/* 声音实验室 / 非模板感：噪点、斜切、等宽、少渐变毛玻璃 */
:root {
  --ink: #060605;
  --paper: #0d0c0a;
  --line: #2a2620;
  --lime: #c8f23c;
  --hot: #ff2d6a;
  --ice: #6ee0ff;
  --mist: #c4bdb2;
  --dim: #7a7368;
  --text: #ebe6dc;
  /* 主列最大宽度，配合 margin:auto 在宽屏上水平居中 */
  --layout-max: 1240px;
  --gutter: clamp(12px, 3vw, 32px);
  --font: "Noto Sans SC", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", "Noto Sans SC", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--ice);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--lime);
}

/* 全屏底：噪点 + 扫光 + 色晕 */
.texture-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.sweep-line {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  opacity: 0.15;
  animation: sweepy 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sweepy {
  0%,
  100% {
    transform: translateY(0) scaleX(0.3);
    opacity: 0.1;
  }
  50% {
    transform: translateY(42vh) scaleX(1);
    opacity: 0.22;
  }
}

.glow-orb {
  position: fixed;
  top: -20%;
  right: -10%;
  z-index: 0;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(200, 242, 60, 0.07), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(255, 45, 106, 0.06), transparent 50%);
  filter: blur(40px);
  pointer-events: none;
}

/* 页壳 */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 顶栏：与主列同宽居中 */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--layout-max);
  width: 100%;
  margin: 0 auto;
  padding: 18px var(--gutter);
  box-sizing: border-box;
  border-bottom: 2px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
}

.head-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
}

.head-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  background: var(--ink);
  flex-shrink: 0;
}

.head-words {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.head-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  font-variation-settings: "opsz" 20;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.head-slogan {
  font-size: 0.72rem;
  color: var(--dim);
  line-height: 1.4;
  max-width: 36ch;
}

.head-r {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  padding: 5px 10px;
  border: 1px solid var(--lime);
  transform: skewX(-3deg);
}

.badge--infer {
  text-transform: none;
  letter-spacing: 0.02em;
  max-width: min(100%, 22rem);
  line-height: 1.3;
  white-space: normal;
  font-size: 0.6rem;
}

.head-nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.head-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mist);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.head-nav a span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--dim);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.head-nav a:hover {
  color: var(--hot);
}

.head-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--lime);
  border: 1px solid color-mix(in srgb, var(--lime) 55%, var(--line));
  background: color-mix(in srgb, var(--lime) 8%, var(--paper));
  transform: skewX(-3deg);
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.head-download:hover {
  color: var(--text);
  border-color: var(--hot);
  box-shadow: 3px 3px 0 0 color-mix(in srgb, var(--hot) 70%, transparent);
  transform: skewX(-3deg) translate(-1px, -1px);
}

.head-download__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.9;
}

.head-download__icon svg {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
}

/* 主区：主列整体水平居中，侧轨+正文共用一整块宽度，不再 920px 卡死在左侧 */
.main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0 var(--gutter);
  box-sizing: border-box;
}

.main-grid {
  display: flex;
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  min-height: 0;
  align-items: stretch;
  box-sizing: border-box;
}

.rail {
  width: 40px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.rail-vert {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--dim);
  opacity: 0.75;
  user-select: none;
}

.content {
  flex: 1;
  min-width: 0;
  padding: clamp(24px, 3vw, 40px) 0 48px;
  /* 取消 max-width，让正文与侧轨一起铺满 main-grid 内的剩余宽度 */
}

.engine-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

#tab-uvr .engine-tab__sub,
#tab-uvr.is-active .engine-tab__sub {
  color: var(--hot);
  font-weight: 600;
}

#tab-score .engine-tab__sub,
#tab-score.is-active .engine-tab__sub {
  color: var(--hot);
  font-weight: 600;
}

.engine-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--mist);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.engine-tab:hover:not(:disabled) {
  border-color: var(--dim);
  color: var(--text);
}

.engine-tab.is-active {
  border-color: var(--lime);
  background: rgba(200, 242, 60, 0.06);
  color: var(--text);
}

.engine-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.engine-tab__tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  padding: 2px 6px;
}

.engine-tab__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.engine-tab__sub {
  font-size: 0.78rem;
  color: var(--dim);
  line-height: 1.4;
}

.engine-tab.is-active .engine-tab__sub {
  color: var(--mist);
}

@media (max-width: 900px) {
  .engine-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .engine-tabs {
    grid-template-columns: 1fr;
  }
}

.score-notation-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(200, 242, 60, 0.04);
}

.score-upload-alert {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 2px solid var(--hot);
  background: rgba(255, 45, 106, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 45, 106, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.score-upload-alert p {
  margin: 0;
  line-height: 1.55;
}

.score-upload-alert p + p {
  margin-top: 8px;
}

.score-upload-alert__title {
  margin-bottom: 10px !important;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hot);
}

.score-upload-alert__main {
  font-size: 0.92rem;
  color: var(--text);
}

.score-upload-alert__warn {
  font-size: 0.92rem;
  color: #ffb0c0;
}

.score-upload-alert__warn strong {
  color: #ffd0dc;
}

.score-upload-alert__tip {
  font-size: 0.82rem;
  color: var(--mist);
}

.score-upload-alert strong {
  color: var(--lime);
}

.score-notation-label {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.score-notation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.score-notation-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.88rem;
  cursor: pointer;
}

.score-notation-opt:has(input:checked) {
  border-color: var(--lime);
  color: var(--text);
}

.score-notation-opt input {
  accent-color: var(--lime);
}

.hero-lead--warning {
  max-width: none;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--hot) 70%, var(--line));
  background: rgba(255, 45, 106, 0.08);
  color: #ffd0dc;
}

.hero-lead--warning strong {
  color: var(--lime);
}

.score-notation-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--dim);
  line-height: 1.45;
}

.score-preview-head {
  margin-top: 10px;
}

.score-preview-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.score-pages-deck {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.score-page {
  width: min(100%, 900px);
  margin: 0 auto;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(18, 18, 18, 0.06);
}

.score-page[hidden] {
  display: none !important;
}

/* Verovio 的续页自动页码由网页分页器统一显示，避免重复页码和字体编码差异。 */
.score-page:not(:first-child) .pgHead.autogenerated {
  display: none;
}

.score-page.is-auto-turned {
  animation: score-page-turn 220ms ease-out;
}

@keyframes score-page-turn {
  from {
    opacity: 0.72;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.score-page__label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: var(--dim);
  text-align: right;
}

.score-page__img,
.score-page__svg-inner {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.score-player {
  margin-top: 8px;
}

.score-player__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.score-player__btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.score-player__btn:hover:not(:disabled) {
  border-color: var(--lime);
  color: var(--lime);
}

.score-player__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.score-player__hint {
  flex: 1 1 180px;
  font-size: 0.78rem;
  color: var(--dim);
  line-height: 1.4;
}

.score-player__status {
  font-size: 0.78rem;
  color: var(--lime);
}

.score-player__deck {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.score-player__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(100%, 900px);
  margin: 0 auto 10px;
}

.score-player__page-btn {
  min-width: 88px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
}

.score-player__page-btn:hover:not(:disabled) {
  border-color: var(--lime);
  color: var(--lime);
}

.score-player__page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.score-player__page-status {
  min-width: 92px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--dim);
}

.score-note {
  cursor: pointer;
  outline: none;
}

.score-note use,
.score-note path,
.score-note polygon,
.score-note .score-note-text,
.score-note .score-note-head,
.score-note .score-note-dot,
.score-note .score-note-line {
  transition: fill 80ms linear, stroke 80ms linear, color 80ms linear;
}

.score-note:focus-visible .score-note-hit {
  stroke: var(--lime);
  stroke-width: 2;
}

.score-note.is-playing .score-note-text,
.score-note.is-playing .score-note-accidental,
.score-note.is-playing .score-note-head,
.score-note.is-playing .score-note-dot {
  fill: #1a6dff !important;
}

.score-note.is-playing .score-note-line {
  stroke: #1a6dff !important;
}

.score-note.is-playing .score-note-hit {
  fill: rgba(26, 109, 255, 0.12);
}

.score-player--pages g.score-note.is-playing,
.score-player--pages g.score-note.is-playing use,
.score-player--pages g.score-note.is-playing path,
.score-player--pages g.score-note.is-playing polygon {
  color: #1a6dff !important;
  fill: #1a6dff !important;
  stroke: #1a6dff !important;
}

.score-note:hover:not(.is-playing) .score-note-text,
.score-note:hover:not(.is-playing) .score-note-head {
  fill: #333;
}

.score-download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.score-download-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--dim);
}

.score-format-select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  font-size: 0.85rem;
}

.score-download-btn {
  flex-shrink: 0;
}

.score-player__osmd {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 4px 12px;
  min-height: 160px;
}

.score-player__osmd svg {
  display: block;
  max-width: 100%;
  height: auto !important;
  margin: 0 auto;
}

/* OSMD 当前播放音符 */
.score-player--osmd .vf-notehead.is-playing path,
.score-player--osmd .is-playing path,
.score-player--osmd g.is-playing path,
.score-player--osmd g.score-note.is-playing path {
  fill: #1a6dff !important;
  stroke: #1a6dff !important;
}

.score-player--osmd g.score-note {
  cursor: pointer;
}

.score-preview-jianpu {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #faf9f6;
}

.gallery-track--score .score-preview-osmd,
.gallery-track--score .score-preview-jianpu {
  margin-top: 8px;
}

.midi-embed-panel {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 12px 12px 10px;
}

.content.is-midi-mode .midi-embed-panel {
  margin-bottom: 16px;
  padding: 8px 8px 6px;
}

.content.is-score-mode #hero-lead {
  display: none;
}

.midi-embed-foot {
  margin: 8px 2px 0;
  font-size: 0.75rem;
  color: var(--mist);
  line-height: 1.5;
  text-align: center;
}

.midi-embed-foot a {
  color: var(--lime);
}

.midi-embed-frame {
  display: block;
  width: 100%;
  min-height: 640px;
  height: clamp(480px, 72vh, 920px);
  border: 1px solid var(--line);
  background: #111;
}

.content.is-midi-mode .midi-embed-frame {
  min-height: 520px;
  height: clamp(560px, calc(100vh - 220px), 1080px);
}

@media (max-width: 640px) {
  .midi-embed-frame {
    min-height: 420px;
    height: 56vh;
  }
  .content.is-midi-mode .midi-embed-frame {
    min-height: 400px;
    height: calc(100vh - 200px);
  }
}

/* Hero 斜切 */
.hero {
  position: relative;
  margin-bottom: 28px;
  padding-top: 8px;
}

.hero-cut {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 12px;
  background: var(--ink);
  clip-path: polygon(0 100%, 4% 0, 12% 100%, 22% 0, 32% 100%, 100% 100%);
  opacity: 0.6;
  pointer-events: none;
}

.hero-inner {
  margin-bottom: 22px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hot);
  margin: 0 0 6px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.2vw, 2.4rem);
  font-weight: 800;
  font-variation-settings: "opsz" 36;
  line-height: 1.1;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-title em {
  font-style: normal;
  color: var(--lime);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.hero-lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--mist);
  max-width: 44ch;
}

/* 上传区 */
.dropzone {
  position: relative;
  border: 2px dashed color-mix(in srgb, var(--lime) 40%, var(--line));
  background: linear-gradient(145deg, rgba(20, 18, 14, 0.95), rgba(8, 8, 6, 0.98));
  padding: 28px 22px 32px;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.dropzone::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  pointer-events: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag-over {
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime), 6px 6px 0 0 var(--ink);
  transform: translate(-2px, -2px);
}

.dropzone:focus-visible {
  box-shadow: 0 0 0 2px var(--ice);
}

.dropzone-inner {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.drop-art {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 4px;
}

.fake-vu {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  padding: 4px 8px;
  background: var(--ink);
  border: 1px solid var(--line);
}

.fake-vu i {
  display: block;
  width: 3px;
  min-height: 4px;
  background: var(--lime);
  border-radius: 1px;
  animation: vu 0.5s ease-in-out infinite;
}

.fake-vu i:nth-child(1) { animation-delay: 0s; }
.fake-vu i:nth-child(2) { animation-delay: 0.05s; }
.fake-vu i:nth-child(3) { animation-delay: 0.1s; }
.fake-vu i:nth-child(4) { animation-delay: 0.15s; }
.fake-vu i:nth-child(5) { animation-delay: 0.2s; }
.fake-vu i:nth-child(6) { animation-delay: 0.25s; }
.fake-vu i:nth-child(7) { animation-delay: 0.3s; }
.fake-vu i:nth-child(8) { animation-delay: 0.35s; }
.fake-vu i:nth-child(9) { animation-delay: 0.4s; }
.fake-vu i:nth-child(10) { animation-delay: 0.45s; }

@keyframes vu {
  0%,
  100% { height: 4px; opacity: 0.5; }
  50% { height: 28px; opacity: 1; }
}

.drop-hint-line {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--dim);
  margin: 0;
}

.drop-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.hint {
  font-size: 0.8rem;
  color: var(--dim);
  margin: 0;
}

.btn-go {
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border: 2px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  cursor: pointer;
  transform: skewX(-2deg);
  box-shadow: 4px 4px 0 0 var(--hot);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-go:hover {
  transform: skewX(-2deg) translate(-1px, -1px);
  box-shadow: 5px 5px 0 0 var(--hot);
  color: var(--ink);
}

.btn-go:active {
  transform: skewX(-2deg) translate(1px, 1px);
  box-shadow: 2px 2px 0 0 var(--hot);
}

.btn-go:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.notice {
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--dim);
  max-width: 40em;
  margin: 0;
}

.dropzone-pending .pending-filename {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ice);
  margin: 0;
  word-break: break-all;
}

.pending-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

/* 排队 · 自动口令 */
.passphrase-wait {
  margin-top: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--ink) 88%, var(--paper));
  border: 1px dashed color-mix(in srgb, var(--hot) 30%, var(--line));
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--mist);
}

.passphrase-wait__text {
  margin: 0;
}

.passphrase-wait__text strong {
  color: var(--ice);
  font-weight: 600;
}

.passphrase-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--ink) 88%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--ice) 35%, var(--line));
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--mist);
}

.passphrase-box__label {
  margin: 0 0 8px;
  color: var(--ice);
  font-size: 0.74rem;
  font-weight: 600;
}

.passphrase-box__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}

.passphrase-code {
  flex: 1 1 200px;
  min-width: 0;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 2px;
  word-break: break-all;
}

.passphrase-box__foot {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--mist);
  opacity: 0.9;
}

.passphrase-box__foot strong {
  color: var(--lime);
  font-weight: 600;
}

.passphrase-input {
  flex: 1 1 160px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
}

.passphrase-input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime);
}

/* 听听其他小伙伴的声音 */
.gallery h2,
.gallery-page-title {
  margin: 0;
}

.gallery-page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
}

.gallery--entry .gallery-entry-btn {
  display: inline-flex;
  margin-top: 8px;
  text-decoration: none;
}

.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 8px;
}

.gallery-counts {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--dim);
}

.gallery-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.gallery-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.gallery-row:hover {
  background: color-mix(in srgb, var(--lime) 12%, transparent);
}

.gallery-row__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.gallery-row__name {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  border-bottom: 1px solid transparent;
}

.gallery-row:hover .gallery-row__name {
  border-bottom-color: var(--lime);
}

.gallery-row__sub {
  font-size: 0.78rem;
  color: var(--mist);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 52ch;
}

.gallery-row__side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--dim);
}

.gallery-row__engine {
  opacity: 0.85;
}

.gallery-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.gallery-page-info {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--dim);
}

.gallery-page-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.gallery-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--dim);
}

.gallery-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gallery-badge--done {
  color: var(--ink);
  background: var(--lime);
  border-color: transparent;
}

.gallery-badge--processing {
  color: var(--hot);
  border-color: color-mix(in srgb, var(--hot) 55%, var(--line));
}

.gallery-badge--queued {
  color: var(--ice);
  border-color: color-mix(in srgb, var(--ice) 55%, var(--line));
}

.gallery-item__bar {
  height: 4px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
  margin: 8px 0 6px;
  overflow: hidden;
}

.gallery-item__bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ice), var(--lime));
  transition: width 0.35s ease;
}

.gallery-item__msg {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--mist);
}

.gallery-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.gallery-detail-foot {
  margin: 20px 0 0;
  font-size: 0.85rem;
}

.gallery-detail-foot a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--lime);
}

.gallery-tracks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.gallery-track {
  border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  padding-top: 8px;
}

.gallery-track--original {
  border-top: none;
  padding-top: 0;
  margin-bottom: 2px;
}

.gallery-track--original .gallery-track__label {
  color: var(--hot);
}

.gallery-track__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.gallery-track__label {
  font-size: 0.82rem;
  font-weight: 600;
}

.gallery-track a.download {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--lime);
  border: 1px solid var(--lime);
  padding: 5px 10px;
  flex-shrink: 0;
}

.gallery-track a.download:hover {
  background: var(--ice);
  border-color: var(--ice);
  color: var(--ink);
}

.gallery-track .result-preview {
  width: 100%;
  height: 32px;
}

.gallery-empty {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--dim);
}

/* 口令取回 */
.pickup h2 {
  margin-top: 0;
}

.pickup-lead {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--mist);
  margin: 0 0 14px;
}

.pickup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pickup-go {
  flex-shrink: 0;
  margin-top: 0;
}

.pickup-msg {
  font-size: 0.78rem;
  color: var(--dim);
  margin: 12px 0 0;
  min-height: 1.3em;
}

.pickup-msg--active {
  color: var(--text);
}

.pickup-results {
  margin-top: 14px;
}

.pickup-results .result-item {
  margin-bottom: 8px;
}

/* 任务卡 */
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 22px 24px;
}

.card--slant {
  transform: rotate(0.2deg);
}

.card--slant::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(
    180deg,
    var(--line) 0 4px,
    transparent 4px 8px
  );
  pointer-events: none;
}

.card.hidden,
.hidden {
  display: none !important;
}

.task-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.task-actions .btn-ghost[disabled],
.task-actions .btn-ghost.is-muted {
  opacity: 0.55;
}

.task-actions .btn-ghost.is-muted {
  /* 完成后弱化「取消」，但仍可点（避免 disabled 吞掉点击） */
  cursor: pointer;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hot);
  margin: 0 0 4px;
}

.task-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 6px;
  word-break: break-all;
  color: var(--text);
}

.status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--line);
}

.status.pending { color: var(--ice); }
.status.processing { color: var(--lime); }
.status.done { color: var(--lime); border-color: var(--lime); }
.status.failed { color: var(--hot); border-color: var(--hot); }
.status.cancelled { color: var(--dim); border-color: var(--line); }

.btn-ghost {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mist);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--ice);
  border-color: var(--ice);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
}

.bar-box {
  flex: 1;
  min-width: 0;
  height: 8px;
  background: var(--ink);
  border: 1px solid var(--line);
  overflow: hidden;
  border-radius: 2px;
}

.bar-fill {
  height: 100%;
  width: 0;
  min-width: 0;
  background: linear-gradient(90deg, var(--hot), var(--lime));
  transition: width 0.45s ease;
  border-radius: 1px;
}

.bar-fill.indeterminate {
  width: 28%;
  background: var(--lime);
  animation: ind 1.2s steps(2) infinite;
}

.bar-fill.bar-fill--pulse {
  background: linear-gradient(90deg, var(--hot) 0%, var(--lime) 50%, var(--hot) 100%);
  background-size: 200% 100%;
  animation: fillshimmer 2.2s ease-in-out infinite;
}

@keyframes ind {
  0% { margin-left: -30%; }
  100% { margin-left: 100%; }
}

@keyframes fillshimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.task-pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lime);
  min-width: 2.5rem;
  text-align: right;
  flex-shrink: 0;
}

.task-message {
  font-size: 0.8rem;
  color: var(--dim);
  margin: 4px 0 0;
}

.results {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.empty-out {
  font-size: 0.8rem;
  color: var(--dim);
  margin: 0;
  padding: 8px 0;
}

.results .result-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--ink);
}

.result-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.result-preview {
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
}

.midi-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted, #8a8f9a);
}

.result-item .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.result-item .label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lime);
}

.result-item .fname {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--dim);
  word-break: break-all;
  max-width: 240px;
}

.result-item a.download {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--lime);
  border: 1px solid var(--lime);
  padding: 7px 14px;
  flex-shrink: 0;
}

.result-item a.download:hover {
  background: var(--ice);
  border-color: var(--ice);
  color: var(--ink);
}

.error {
  margin-top: 12px;
  font-size: 0.8rem;
  padding: 10px 12px;
  border: 1px solid var(--hot);
  color: #ffb0c0;
  background: rgba(255, 45, 106, 0.08);
}

/* 文区块 */
.section-bar {
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-bar h2,
.howto h2,
.faq h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  font-variation-settings: "opsz" 24;
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.deku {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--mist);
  max-width: 52ch;
}

.feature-deck {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 20px;
  margin-bottom: 28px;
}

@media (min-width: 800px) {
  .feature-deck {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature {
  border-left: 3px solid var(--lime);
  padding-left: 18px;
  transform: none;
}

.feature:nth-child(2) {
  border-left-color: var(--ice);
}

.feature:nth-child(3) {
  border-left-color: var(--hot);
}

.num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--dim);
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.1em;
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.feature p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--mist);
}

.howto {
  margin-bottom: 24px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--mist);
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.steps li:last-child {
  border-bottom: none;
}

.st-n {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--lime);
  min-width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.faq details:last-of-type {
  border-bottom: none;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.faq summary::marker,
.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: " +";
  font-family: var(--font-mono);
  color: var(--hot);
  font-weight: 400;
}

.faq details[open] summary::after {
  content: " -";
}

.faq details p {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--dim);
}

.foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  max-width: var(--layout-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 18px var(--gutter) 24px;
  box-sizing: border-box;
  border-top: 1px solid var(--line);
  text-align: center;
  background: var(--paper);
}

.foot p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--dim);
}

.foot-mono {
  font-family: var(--font-mono);
}

.foot-dot {
  margin: 0 0.2em;
  opacity: 0.5;
}

.open-source {
  margin-top: 20px;
  padding: 22px 0 8px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.open-source h2 {
  margin: 0 0 6px;
  color: var(--mist);
  font-size: 0.88rem;
  font-weight: 600;
}

.open-source .open-source__intro {
  margin: 0 0 20px;
  color: var(--dim);
  font-size: 0.72rem;
  line-height: 1.8;
}

.open-source__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
}

.open-source__group h3 {
  margin: 0 0 7px;
  color: var(--dim);
  font-size: 0.7rem;
  font-weight: 500;
}

.open-source__group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.open-source__group li {
  min-width: 0;
  max-width: 100%;
}

.open-source .open-source__group a {
  color: #a2b8ba;
  font-size: 0.74rem;
  line-height: 1.9;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.open-source .open-source__group a:hover {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.open-source a:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .open-source__groups {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* 通用弹窗（离线版公告等） */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: rgba(6, 6, 5, 0.78);
  backdrop-filter: blur(4px);
  animation: modal-fade 0.18s ease-out;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  max-height: min(86vh, 560px);
  overflow-y: auto;
  background: linear-gradient(180deg, #14110e 0%, var(--paper) 72%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 22px 20px;
  box-shadow:
    0 0 0 1px rgba(200, 242, 60, 0.08),
    0 24px 70px rgba(0, 0, 0, 0.65);
  animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--dim);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: var(--hot);
  border-color: var(--line);
  background: rgba(255, 45, 106, 0.08);
}

.modal-close:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.modal-card .mono-label {
  margin: 0 0 5px;
  color: var(--lime);
}

.modal-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.modal-lead {
  margin: 0 0 18px;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--dim);
}

.modal-note {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 0.72rem;
  color: var(--dim);
}

.modal-card--offline {
  width: min(560px, 100%);
  max-height: min(90vh, 680px);
}

.modal-card--offline .modal-lead {
  margin-bottom: 14px;
}

.modal-card--offline .modal-lead strong {
  color: var(--mist);
  font-weight: 600;
}

.offline-announce__highlights {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.offline-announce__highlights li {
  position: relative;
  padding-left: 14px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--mist);
}

.offline-announce__highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--lime) 25%, transparent);
}

.offline-announce__specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.offline-spec {
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
}

.offline-spec--rec {
  border-color: color-mix(in srgb, var(--lime) 35%, var(--line));
  background: color-mix(in srgb, var(--lime) 5%, var(--ink));
}

.offline-spec__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.offline-spec__hint {
  margin: 2px 0 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.offline-spec--rec .offline-spec__hint {
  color: color-mix(in srgb, var(--lime) 70%, var(--dim));
}

.offline-spec__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}

.offline-spec__list li {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  gap: 6px;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--dim);
}

.offline-spec__list li span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--mist);
  white-space: nowrap;
}

.offline-announce__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.offline-announce__actions .btn-go {
  margin-top: 0;
  padding: 10px 22px;
  font-size: 0.88rem;
}

.offline-announce__actions .btn-ghost {
  padding: 10px 16px;
  font-size: 0.75rem;
}

@media (max-width: 520px) {
  .offline-announce__specs {
    grid-template-columns: 1fr;
  }

  .offline-announce__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .offline-announce__actions .btn-go,
  .offline-announce__actions .btn-ghost {
    width: 100%;
    text-align: center;
  }
}

.foot a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 小屏 */
@media (max-width: 720px) {
  .rail {
    display: none;
  }

  .head {
    gap: 10px;
    padding: 12px var(--gutter);
  }

  .head-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .head-logo {
    width: 42px;
    height: 42px;
  }

  .head-name {
    font-size: clamp(0.82rem, 3.8vw, 0.98rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .head-r {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .head-slogan {
    display: none;
  }

  .head-nav a span {
    display: none;
  }

  .head-nav a {
    font-size: 0.8rem;
  }

  .head-download {
    display: none;
  }

  .head-download__text {
    font-size: 0;
  }

  .head-download__text::before {
    content: "安装离线版";
    font-size: 0.68rem;
  }
}

@media (max-width: 500px) {
  .hero-title {
    font-size: 1.5rem;
  }
}

/* ---------- Windows 离线版下载页 ---------- */

.download-body {
  height: 100dvh;
  overflow: hidden;
  background: var(--ink);
}

.download-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.download-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 0 var(--gutter);
  box-sizing: border-box;
  pointer-events: none;
}

.download-overlay a,
.download-overlay button {
  pointer-events: auto;
}

.download-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(14px, 2.5vh, 22px) 0;
  flex-shrink: 0;
}

.download-head .head-logo {
  width: 44px;
  height: 44px;
}

.download-head .head-name {
  font-size: 1rem;
}

.download-head .head-slogan {
  font-size: 0.68rem;
  max-width: 28ch;
}

.download-back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.download-back:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
}

.download-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-bottom: clamp(12px, 3vh, 28px);
}

.download-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 70% at 50% 50%,
    rgba(0, 0, 0, 0.5) 0%,
    transparent 72%
  );
}

.download-content {
  position: relative;
  z-index: 1;
  width: min(100%, 48rem);
  padding: clamp(8px, 2vh, 16px) clamp(12px, 3vw, 24px);
  text-align: center;
  pointer-events: auto;
}

.download-hero {
  max-width: 38rem;
  margin: 0 auto clamp(8px, 1.5vh, 14px);
  animation: downloadFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.download-showcase {
  position: relative;
  width: 100%;
  min-height: clamp(168px, 26vh, 220px);
  margin: 0 0 clamp(22px, 4vh, 36px);
  overflow: hidden;
}

.download-slides {
  position: relative;
  min-height: inherit;
}

.download-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}

.download-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.download-slide__viz {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 44px;
  margin-bottom: 4px;
}

.dl-bar {
  display: block;
  width: 4px;
  height: calc(var(--h, 0.5) * 44px);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 2px;
  transform-origin: bottom center;
  animation: dlBarPulse 1.6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.dl-bar--wide {
  width: 14px;
}

.download-slide__viz--dual {
  gap: 18px;
}

.download-slide__viz--api {
  align-items: center;
  gap: 0;
  height: 36px;
}

.dl-node {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.dl-node--mid {
  animation: dlNodePulse 2s ease-in-out infinite;
}

.dl-link {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.1));
  position: relative;
  overflow: hidden;
}

.dl-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  animation: dlLinkFlow 1.8s ease-in-out infinite;
}

.download-slide__viz--chip {
  position: relative;
  width: 88px;
  height: 40px;
}

.dl-chip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.45);
  transition: opacity 0.6s ease, color 0.6s ease, border-color 0.6s ease;
}

.dl-chip--cpu {
  animation: dlChipAlt 4s ease-in-out infinite;
}

.dl-chip--gpu {
  animation: dlChipAlt 4s ease-in-out infinite reverse;
}

.download-slide__tag {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.38);
}

.download-slide__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}

.download-slide__sub {
  margin: 0;
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.52);
  max-width: 28ch;
}

@keyframes dlBarPulse {
  0%,
  100% {
    transform: scaleY(0.55);
    opacity: 0.45;
  }
  50% {
    transform: scaleY(1);
    opacity: 0.9;
  }
}

@keyframes dlLinkFlow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes dlNodePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    transform: scale(1.35);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
  }
}

@keyframes dlChipAlt {
  0%,
  45% {
    opacity: 1;
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.35);
  }
  55%,
  100% {
    opacity: 0.2;
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

.download-kicker {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.22em;
}

.download-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  line-height: 1.15;
}

.download-title__brand {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4.2vw, 2.35rem);
  font-weight: 800;
  font-variation-settings: "opsz" 36;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.65);
  position: relative;
  padding-bottom: 12px;
}

.download-title__brand::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100%, 12rem);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.45) 20%,
    rgba(255, 255, 255, 0.45) 80%,
    transparent
  );
}

.download-title__edition {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.8vw, 0.88rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.download-title__version {
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 1.5vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.38);
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

@keyframes downloadFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.download-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
  animation: downloadFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
}

.download-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(20px, 3vh, 28px) clamp(12px, 2vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  min-height: clamp(100px, 13vh, 124px);
}

.download-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.download-card.is-placeholder {
  opacity: 0.55;
  cursor: not-allowed;
}

.download-card.is-placeholder:hover {
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
}

.download-card__tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.download-card__name {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 700;
}

.download-card__action {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.download-card:hover .download-card__action {
  color: rgba(255, 255, 255, 0.85);
}

.download-card__status {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.download-footnote {
  margin: clamp(24px, 4vh, 36px) 0 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 640px) {
  .download-cards {
    grid-template-columns: 1fr;
  }

  .download-head .head-slogan {
    display: none;
  }

  .download-showcase {
    min-height: clamp(150px, 22vh, 190px);
  }
}

@media (max-height: 700px) {
  .download-hero {
    margin-bottom: 6px;
  }

  .download-showcase {
    min-height: clamp(130px, 20vh, 160px);
    margin-bottom: 16px;
  }

  .download-card {
    min-height: 76px;
    padding: 12px 14px;
  }
}

@media (max-height: 600px) {
  .download-hero {
    margin-bottom: 4px;
  }

  .download-title__brand {
    font-size: clamp(1.25rem, 3.8vw, 1.85rem);
    padding-bottom: 8px;
  }

  .download-title__edition {
    font-size: 0.68rem;
    letter-spacing: 0.22em;
  }

  .download-showcase {
    min-height: clamp(120px, 18vh, 140px);
  }

  .download-slide__viz {
    height: 32px;
    margin-bottom: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .download-slide,
  .dl-bar,
  .dl-link::after,
  .dl-node--mid,
  .dl-chip {
    animation: none !important;
    transition: none !important;
  }

  .download-slide.is-active {
    opacity: 1;
  }
}
