/* ===========================================================================
 * 三角洲行动 · 口琴模拟器 —— 样式
 * 深色战术风格：深底 + 琥珀金主色（呼应口琴铜簧片）
 * ========================================================================= */

:root {
  --hm-bg: #0a0e13;
  --hm-bg-soft: #111821;
  --hm-panel: #141d27;
  --hm-panel-2: #1a242f;
  --hm-line: #23303e;
  --hm-text: #e9f0f7;
  --hm-text-dim: #7e8d9c;
  --hm-amber: #ffa33d;
  --hm-amber-soft: #ffc879;
  --hm-amber-deep: #b8631a;
  --hm-low: #35c96b;
  --hm-high: #ff5b5b;
  --hm-sharp: #ffd23d;
  --hm-radius: 16px;
  --hm-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(255, 163, 61, .12), transparent 62%),
    radial-gradient(880px 480px at 88% 112%, rgba(53, 201, 107, .07), transparent 60%),
    var(--hm-bg);
  color: var(--hm-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 战术网格底纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

.hm-app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===========================================================================
 * 顶栏
 * ========================================================================= */

.hm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--hm-line);
  background: rgba(10, 14, 19, .72);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.hm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* 站点 Logo：透明底方图，直接叠在深色顶栏上（不再画琥珀色底板，否则会透在人物背后） */
.hm-brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .04);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--hm-line);
  transition: box-shadow .25s ease;
}

.hm-brand-mark:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 163, 61, .45);
}

.hm-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hm-brand-text {
  min-width: 0;
}

.hm-brand-text strong {
  display: block;
  font-size: 16px;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-brand-text span {
  display: block;
  font-size: 11px;
  letter-spacing: 2.4px;
  color: var(--hm-text-dim);
  text-transform: uppercase;
}

.hm-topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hm-btn {
  appearance: none;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
  color: var(--hm-text);
  font: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}

.hm-btn:hover {
  border-color: rgba(255, 163, 61, .55);
  color: var(--hm-amber-soft);
}

.hm-btn:active {
  transform: translateY(1px);
}

.hm-btn.is-open {
  border-color: var(--hm-amber);
  color: var(--hm-amber);
  background: rgba(255, 163, 61, .10);
}

.hm-btn em {
  font-style: normal;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(255, 210, 61, .14);
  color: var(--hm-sharp);
}

/* ===========================================================================
 * 舞台
 * ========================================================================= */

.hm-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 3.6vh, 46px);
  padding: clamp(20px, 4vh, 44px) clamp(16px, 4vw, 44px) clamp(24px, 4vh, 40px);
}

/* ===========================================================================
 * 状态读数
 * 顶部那行读数（待演奏 / 音量）已删除，这组样式现在只服务跟弹区的目标音读数：
 * .hm-readout / .hm-note-symbol / .hm-meta / .hm-pulse
 * ========================================================================= */

.hm-readout {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hm-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2c3742;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .03);
  transition: background .12s, box-shadow .12s;
}

.hm-pulse.is-on {
  background: var(--hm-amber);
  box-shadow: 0 0 0 4px rgba(255, 163, 61, .16), 0 0 22px rgba(255, 163, 61, .75);
  animation: hm-pulse 1.1s ease-in-out infinite;
}

@keyframes hm-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.78); opacity: .62; }
}

.hm-note-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 尺寸固定（而非只有 min-*）：记号变长（升降号、高低音点）时盒子不再跟着伸缩，
     否则每次换音都会推动整行左右移动 */
  width: clamp(110px, 14vw, 190px);
  height: clamp(110px, 14vw, 190px);
  flex: 0 0 auto;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid var(--hm-line);
  background: linear-gradient(165deg, var(--hm-panel-2), #0e151c);
  box-shadow: var(--hm-shadow);
  font-size: clamp(56px, 8vw, 104px);
  line-height: 1;
  font-weight: 600;
  color: var(--hm-amber);
  transition: border-color .16s, box-shadow .16s, color .16s;
}

body.is-playing .hm-note-symbol {
  border-color: rgba(255, 163, 61, .6);
  box-shadow: var(--hm-shadow), 0 0 44px rgba(255, 163, 61, .22);
}

.hm-idle {
  color: #33404e;
  letter-spacing: 6px;
}

/* 简谱记号：高低音点 */
.hm-fig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hm-fig-main {
  display: flex;
  align-items: flex-start;
  line-height: 1;
}

.hm-deg {
  font-variant-numeric: tabular-nums;
}

.hm-acc {
  font-size: .55em;
  line-height: 1;
  color: var(--hm-sharp);
  margin-right: 2px;
  transform: translateY(6%);
}

.hm-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hm-dots:empty {
  display: none;
}

.hm-dots i {
  display: block;
  width: .11em;
  height: .11em;
  min-width: 5px;
  min-height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.hm-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* 宽度固定：跟弹目标音框右侧的操作提示（「按住右键 + 按 Z」等）长短不一，
     若由内容撑宽，同一行里 flex: 1 的进度条就会被挤着左右移动 */
  width: clamp(184px, 22vw, 232px);
  flex: 0 0 auto;
}

.hm-meta-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .4px;
  white-space: nowrap;
}

.hm-meta-hint {
  font-size: 12px;
  color: var(--hm-text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 修饰键 chips：位置与游戏内一致 —— 琴键下方居中 */
.hm-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 修饰键 chip：名称与游戏内一致（左键降调 / 中键半音 / 右键升调）。
   字号与内边距都比早先的 11px 小胶囊更大，一眼能看清；
   左侧内联 SVG 直接画出鼠标并高亮对应按键，因此琴体底栏不再重复一行文字说明。 */
.hm-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 22px;
  border: 1px solid var(--hm-line);
  background: rgba(255, 255, 255, .04);
  color: var(--hm-text);
  transition: all .14s;
  white-space: nowrap;
}

/* 鼠标按键图标：外轮廓描边 + 高亮块，高亮块由路径/矩形决定是左、中还是右键 */
.hm-mouse {
  width: 16px;
  height: 21px;
  flex: 0 0 auto;
}

.hm-mouse-body {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  opacity: .5;
}

.hm-mouse-key {
  fill: var(--hm-amber-soft);
}

/* 点亮时只换底色与字色，不改字重：加粗会让 chip 变宽、把整行状态区顶得左右移动。
   同时鼠标图标反白（高亮块取字色），读作「这个键正被按住」。 */
.hm-chip.is-on {
  color: #0b0f14;
}

.hm-chip.is-on .hm-mouse-body {
  opacity: .75;
}

.hm-chip.is-on .hm-mouse-key {
  fill: currentColor;
}

#hmChipLow.is-on { background: var(--hm-low); border-color: var(--hm-low); }
#hmChipHigh.is-on { background: var(--hm-high); border-color: var(--hm-high); }
#hmChipSharp.is-on { background: var(--hm-sharp); border-color: var(--hm-sharp); }

/* ===========================================================================
 * 口琴本体
 * ========================================================================= */

.hm-instrument {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(16px, 2.4vw, 26px) clamp(18px, 3vw, 34px) clamp(18px, 2.6vw, 30px);
  border-radius: 26px;
  border: 1px solid var(--hm-line);
  background: linear-gradient(180deg, #131c26, #0d141b);
  box-shadow: var(--hm-shadow);
  max-width: 100%;
}

.hm-holes {
  display: flex;
  gap: clamp(6px, .8vw, 11px);
  justify-content: center;
}

.hm-hole {
  --hole-edge: rgba(255, 163, 61, .38);
  --hole-top: #3a2614;
  --hole-bottom: #1a1208;
  --hole-num: var(--hm-amber-soft);

  appearance: none;
  border: 1px solid var(--hole-edge);
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: clamp(42px, 6.4vw, 84px);
  height: clamp(126px, 21vh, 208px);
  padding-block: clamp(12px, 1.8vh, 20px);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--hole-top), var(--hole-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 8px 20px rgba(0, 0, 0, .45);
  transition: transform .1s ease, box-shadow .14s, border-color .14s, background .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

.hm-hole:hover {
  border-color: rgba(255, 163, 61, .8);
}

.hm-hole-num {
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 700;
  line-height: 1;
  color: var(--hole-num);
  font-variant-numeric: tabular-nums;
}

.hm-hole-key {
  font-size: clamp(17px, 2.1vw, 28px);
  line-height: 1;
  letter-spacing: 1px;
  font-weight: 700;
  color: rgba(233, 240, 247, .82);
  padding: 5px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .35);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.hm-hole.is-active {
  transform: translateY(3px);
  border-color: var(--hm-amber);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 0 0 1px rgba(255, 163, 61, .45),
    0 0 34px rgba(255, 163, 61, .55);
}

.hm-hole.is-active .hm-hole-num {
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 163, 61, .95);
}

.hm-hole.is-active .hm-hole-key {
  color: #fff;
  border-color: rgba(255, 255, 255, .32);
  background: rgba(0, 0, 0, .5);
}

/* 音区配色联动 */
body[data-octave="low"] .hm-hole {
  --hole-edge: rgba(53, 201, 107, .42);
  --hole-top: #12301f;
  --hole-bottom: #071810;
  --hole-num: var(--hm-low);
}

body[data-octave="high"] .hm-hole {
  --hole-edge: rgba(255, 91, 91, .42);
  --hole-top: #3a1616;
  --hole-bottom: #1c0808;
  --hole-num: var(--hm-high);
}

body[data-octave="low"] .hm-hole.is-active {
  border-color: var(--hm-low);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 1px rgba(53, 201, 107, .45), 0 0 34px rgba(53, 201, 107, .5);
}

body[data-octave="high"] .hm-hole.is-active {
  border-color: var(--hm-high);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 1px rgba(255, 91, 91, .45), 0 0 34px rgba(255, 91, 91, .5);
}

body[data-sharp="on"] .hm-hole {
  --hole-edge: var(--hm-sharp);
}

/* 触屏兜底控件：仅触屏设备显示 */
.hm-touchbar {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (hover: none) and (pointer: coarse) {
  .hm-touchbar {
    display: flex;
  }
  .hm-holes {
    overflow-x: auto;
    padding-bottom: 6px;
    max-width: 100%;
  }
}

/* ===========================================================================
 * 输入轨迹
 * ========================================================================= */

.hm-trail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 58px;
  /* 撑满舞台内容宽（原先封了 900px，比上方的琴体面板窄一截，右边缘对不齐） */
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--hm-radius);
  border: 1px dashed var(--hm-line);
  background: rgba(19, 28, 38, .5);
}

.hm-trail-item {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 38px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel-2);
  font-size: 19px;
  font-weight: 600;
  color: var(--hm-amber-soft);
}

.hm-trail-item:last-child {
  border-color: var(--hm-amber);
  box-shadow: 0 0 18px rgba(255, 163, 61, .28);
}

.hm-trail-empty {
  font-size: 12px;
  color: #4a5663;
  letter-spacing: .5px;
}

/* ===========================================================================
 * 面板（键位说明 / 曲谱库）
 * ========================================================================= */

.hm-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 11, .74);
  backdrop-filter: blur(6px);
}

.hm-panel[hidden] {
  display: none;
}

/* 面板淡入：避免结果窗瞬间盖住画面显得突兀（已在收尾时序中避开尾音） */
.hm-panel:not([hidden]) {
  animation: hm-panel-in .3s ease-out both;
}

.hm-panel:not([hidden]) .hm-panel-card {
  animation: hm-panel-card-in .36s cubic-bezier(.22, .9, .3, 1.06) both;
}

@keyframes hm-panel-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hm-panel-card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hm-panel-card {
  width: min(720px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
  box-shadow: var(--hm-shadow);
}

.hm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hm-line);
  position: sticky;
  top: 0;
  background: var(--hm-panel);
}

.hm-panel-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .3px;
}

.hm-panel-close {
  appearance: none;
  border: 1px solid var(--hm-line);
  background: transparent;
  color: var(--hm-text-dim);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.hm-panel-close:hover {
  color: var(--hm-text);
  border-color: var(--hm-text-dim);
}

.hm-panel-body {
  padding: 20px 22px 26px;
  font-size: 13.5px;
  line-height: 1.75;
  color: #bcc8d4;
}

.hm-panel-body h3 {
  font-size: 13px;
  color: var(--hm-amber);
  letter-spacing: 1px;
  margin: 22px 0 10px;
  text-transform: uppercase;
}

.hm-panel-body h3:first-child {
  margin-top: 0;
}

.hm-panel-body p {
  margin: 0 0 10px;
}

.hm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hm-table th,
.hm-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--hm-line);
}

.hm-table th {
  color: var(--hm-text-dim);
  font-weight: 500;
  font-size: 12px;
}

.hm-table td code,
.hm-kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #0d1319;
  border: 1px solid var(--hm-line);
  color: var(--hm-text);
  white-space: nowrap;
}

.hm-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #0b0f14;
}

.hm-tag-mid { background: var(--hm-text); }
.hm-tag-high { background: var(--hm-high); }
.hm-tag-low { background: var(--hm-low); }
.hm-tag-sharp { background: var(--hm-sharp); }

.hm-note-amber {
  color: var(--hm-amber-soft);
}

/* ===========================================================================
 * 页脚
 * ========================================================================= */

.hm-foot {
  padding: 14px clamp(16px, 4vw, 44px) 22px;
  text-align: center;
  font-size: 12px;
  color: #4d5a67;
}

.hm-foot-entries {
  margin-bottom: 6px;
}

.hm-foot-entries .footer-entry-sep {
  margin: 0 8px;
  opacity: .6;
}

.hm-foot a {
  color: #6d7c8a;
  text-decoration: none;
}

.hm-foot a:hover {
  color: var(--hm-amber-soft);
}

/* ===========================================================================
 * 响应式
 * ========================================================================= */

@media (max-width: 720px) {
  .hm-brand-text span {
    display: none;
  }

  .hm-note-symbol {
    width: 96px;
    height: 96px;
  }

  .hm-meta {
    width: 170px;
  }

  .hm-instrument {
    width: 100%;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ===========================================================================
 * 内页布局（曲谱库 / 跟弹）
 * ========================================================================= */

a.hm-brand-mark {
  text-decoration: none;
}

.hm-stage-top {
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  gap: 22px;
}

.hm-page-head {
  text-align: center;
  margin-bottom: 4px;
}

.hm-page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: .5px;
}

.hm-page-head p {
  margin: 0;
  color: var(--hm-text-dim);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ===========================================================================
 * 曲谱库
 * ========================================================================= */

.hm-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.hm-filter-btn {
  appearance: none;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
  color: var(--hm-text-dim);
  font: inherit;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s;
}

.hm-filter-btn:hover {
  color: var(--hm-amber-soft);
  border-color: rgba(255, 163, 61, .5);
}

.hm-filter-btn.is-on {
  background: rgba(255, 163, 61, .14);
  border-color: var(--hm-amber);
  color: var(--hm-amber);
  font-weight: 600;
}

.hm-filter-btn em {
  font-style: normal;
  font-size: 11px;
  opacity: .7;
  margin-left: 4px;
}

.hm-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.hm-score-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 20px 22px 22px;
  border-radius: 18px;
  border: 1px solid var(--hm-line);
  background: linear-gradient(165deg, #16202b, #101820);
  color: inherit;
  text-decoration: none;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}

.hm-score-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 163, 61, .55);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

.hm-score-card[hidden] {
  display: none;
}

.hm-score-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.hm-tag-cat-1 { background: var(--hm-amber); }
.hm-tag-cat-2 { background: #7aa2ff; }
.hm-tag-cat-3 { background: #ff8bd0; }
.hm-tag-cat-4 { background: #9aa7b4; }

.hm-diff {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid currentColor;
}

.hm-diff-1 { color: var(--hm-low); }
.hm-diff-2 { color: var(--hm-sharp); }
.hm-diff-3 { color: var(--hm-high); }

.hm-score-title {
  margin: 0;
  font-size: 19px;
  letter-spacing: .3px;
}

.hm-score-sub {
  margin: 0;
  font-size: 12px;
  color: var(--hm-amber-soft);
  letter-spacing: .4px;
}

.hm-score-source {
  margin: 0;
  font-size: 12px;
  color: var(--hm-text-dim);
}

.hm-score-desc {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: #9dabb8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hm-score-foot {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hm-line);
  font-size: 12px;
  color: var(--hm-text-dim);
}

.hm-score-stat b {
  color: var(--hm-amber);
  font-size: 14px;
}

.hm-score-cta {
  position: absolute;
  right: 20px;
  bottom: 18px;
  font-size: 12px;
  color: var(--hm-amber);
  opacity: 0;
  transition: opacity .16s, transform .16s;
  transform: translateX(-4px);
}

.hm-score-card:hover .hm-score-cta {
  opacity: 1;
  transform: translateX(0);
}

.hm-empty {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--hm-line);
  border-radius: 20px;
  color: var(--hm-text-dim);
}

.hm-empty-sub {
  font-size: 12.5px;
  color: #4d5a67;
}

.hm-list-tip {
  text-align: center;
  font-size: 12px;
  color: #4d5a67;
  margin: 6px 0 0;
}

/* ===========================================================================
 * 跟弹页
 * ========================================================================= */

/* ===========================================================================
 * 曲谱选择器与跟弹区（首页与跟弹入口共用）
 * ========================================================================= */

.hm-picker {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
}

.hm-picker-label {
  flex: none;
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--hm-text-dim);
}

.hm-picker-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.hm-picker-item {
  appearance: none;
  font: inherit;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--hm-line);
  background: rgba(255, 255, 255, .03);
  color: var(--hm-text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: all .14s;
}

.hm-picker-item:hover {
  border-color: rgba(255, 163, 61, .55);
  color: var(--hm-amber-soft);
}

.hm-picker-item.is-on {
  background: var(--hm-amber);
  border-color: var(--hm-amber);
  color: #0b0f14;
  font-weight: 700;
}

.hm-picker-item em {
  font-style: normal;
  font-size: 11px;
}

/* 选中态底色为琥珀色，难度色需让位以保证对比度 */
.hm-picker-item.is-on em {
  color: #0b0f14;
  opacity: .72;
}

.hm-picker-more {
  flex: none;
  font-size: 12px;
  color: var(--hm-text-dim);
  text-decoration: none;
  transition: color .14s;
}

.hm-picker-more:hover {
  color: var(--hm-amber);
}

.hm-picker-status {
  flex: none;
  font-size: 12px;
  color: var(--hm-sharp);
}

.hm-picker-status:empty {
  display: none;
}

/* 跟弹区：仅在选中曲谱时显示 */
.hm-follow {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.hm-follow[hidden] {
  display: none;
}

.hm-score-name {
  color: var(--hm-text);
  font-weight: 600;
}

.hm-score-meta-bar {
  display: flex;
  gap: 10px 20px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12.5px;
  color: var(--hm-text-dim);
}

.hm-score-meta-bar b {
  color: var(--hm-amber);
}

.hm-warning {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 210, 61, .35);
  background: rgba(255, 210, 61, .08);
  color: var(--hm-sharp);
  font-size: 12.5px;
}

/* 自动播放：一键试听整曲。播放中按钮转为琥珀实底，提示「再点一次即停止」 */
.hm-autoplay-btn {
  font-size: 13px;
}

.hm-autoplay-btn.is-on {
  border-color: transparent;
  background: linear-gradient(150deg, var(--hm-amber), var(--hm-amber-deep));
  color: #17110a;
  font-weight: 600;
}

/* 播放态悬停要盖过 .hm-btn-strong:hover（两者同为零点二特异度，靠这条零点三压住） */
.hm-autoplay-btn.is-on:hover {
  border-color: transparent;
  background: linear-gradient(150deg, var(--hm-amber), var(--hm-amber-deep));
  color: #17110a;
}

.hm-autoplay-icon {
  font-size: 11px;
  line-height: 1;
}

/* 操作区：试听 + 悬浮两枚按钮排在进度条上方，右侧接状态说明。
   原先它们是各自一整行（按钮 + 长句说明），合并进 HUD 后省掉两行高度 */
.hm-hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hm-hud-actions .hm-btn {
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12.5px;
}

/* 悬浮窗用法提示：独占一整行（flex-basis 100%），排在按钮下方。
   独占全屏会把任何置顶窗口压在下面，所以游戏要用无边框 / 窗口化；
   这行字只做说明，不参与按钮与状态说明的宽度竞争 */
.hm-hud-tip {
  flex: 1 0 100%;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--hm-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-hud-hint {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 12px;
  color: var(--hm-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 开启中：按钮转琥珀实底，读作「点一下即收回」 */
#hmFloatBtn.is-on {
  border-color: transparent;
  background: linear-gradient(150deg, var(--hm-amber), var(--hm-amber-deep));
  color: #17110a;
  font-weight: 600;
}

#hmFloatBtn.is-on:hover {
  border-color: transparent;
  background: linear-gradient(150deg, var(--hm-amber), var(--hm-amber-deep));
  color: #17110a;
}

.hm-play-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 18px clamp(16px, 3vw, 26px);
  border-radius: 20px;
  border: 1px solid var(--hm-line);
  background: linear-gradient(165deg, var(--hm-panel-2), #0e151c);
}

.hm-play-hud .hm-note-symbol {
  width: 96px;
  height: 96px;
  font-size: clamp(40px, 5vw, 62px);
  border-radius: 18px;
}

.hm-progress-box {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hm-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--hm-text-dim);
}

.hm-progress-head b {
  color: var(--hm-text);
  font-variant-numeric: tabular-nums;
}

.hm-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #1e2833;
  overflow: hidden;
}

.hm-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hm-amber-deep), var(--hm-amber));
  transition: width .22s ease;
}

/* 谱面 */

/* 谱面：窗口式显示，只露出当前行与下一行（高度由 app.js 按两行实测高度设定）。
   未启用脚本时以 max-height 兜底，此时看不到整曲但也不会撑破布局。 */

.hm-sheet {
  position: relative;
  padding: 22px clamp(14px, 3vw, 28px);
  border-radius: 20px;
  border: 1px solid var(--hm-line);
  background: rgba(19, 28, 38, .55);
  max-height: 44vh;
  overflow: hidden;
}

/* 谱面轨道：脚本用 translateY 把当前行推到窗口顶部 */
.hm-sheet-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

/* 角标：第几句 / 共几句 */
.hm-sheet-counter {
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--hm-text-dim);
}

.hm-sheet-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

/* 谱面只有音符（已取消歌词）：每格就是一个简谱记号 */
.hm-sheet-note {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 宽度随时值走：半拍（--hm-beats: .5）收窄，多拍加宽 */
  min-width: calc(44px + (var(--hm-beats, 1) - 1) * 16px);
  padding: 7px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .03);
  font-size: 22px;
  font-weight: 600;
  color: var(--hm-text);
  transition: all .14s;
}

.hm-sheet-fig {
  display: flex;
  align-items: center;
  line-height: 1;
}

.hm-sheet-note.is-rest {
  opacity: .35;
}

.hm-sheet-note.is-hold {
  border-color: rgba(255, 163, 61, .32);
}

.hm-sheet-note.is-current {
  border-color: var(--hm-amber);
  background: rgba(255, 163, 61, .16);
  color: var(--hm-amber);
  transform: scale(1.12);
  box-shadow: 0 0 22px rgba(255, 163, 61, .38);
}

.hm-sheet-note.is-done {
  color: #55636f;
  background: rgba(53, 201, 107, .08);
  border-color: rgba(53, 201, 107, .22);
}

.hm-sheet-note.is-wrong {
  border-color: var(--hm-high);
  background: rgba(255, 91, 91, .18);
  color: var(--hm-high);
  animation: hm-shake .3s ease;
}

@keyframes hm-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ===========================================================================
 * 悬浮窗（Document Picture-in-Picture）
 *
 * 小窗是一个独立文档，样式表由脚本把 homepage 的 <link> 搬过去，
 * 因此下面这些规则直接作用在小窗里：目标音 + 操作提示 + 进度 + 后续音符 + 修饰键状态。
 * 尺寸按小窗（约 340×300）来定，不跟着主页面的 clamp() 缩放。
 * ========================================================================= */

.hm-float {
  /* 与主页面 .hm-app 同理：压在 body::before 的网格底纹之上 */
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100vh;
  padding: 10px 12px 12px;
}

/* 窗口可能被缩得比较小，内容超出时允许滚动，不至于够不到「再来一遍」 */
.hm-float-body {
  overflow-y: auto;
}

.hm-float-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--hm-text-dim);
}

.hm-float-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-float-count {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.hm-float-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 目标音是小窗的主角：盒子与字号都比原先放大，一眼能看清 */
.hm-float .hm-note-symbol {
  width: 92px;
  height: 92px;
  padding: 6px;
  border-radius: 18px;
  box-shadow: none;
  font-size: 54px;
}

.hm-float .hm-note-symbol.is-wrong {
  border-color: var(--hm-high);
  color: var(--hm-high);
  box-shadow: 0 0 18px rgba(255, 91, 91, .35);
  animation: hm-shake .3s ease;
}

.hm-float-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.hm-float-hint {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.hm-float-acc {
  font-size: 11.5px;
  color: var(--hm-text-dim);
  font-variant-numeric: tabular-nums;
}

/* 小窗谱面：整句按格子铺开，长句折两行；flex:1 让多余高度落在谱面区，
   底部按钮始终贴底（1 行的短句也不会把按钮顶上来） */
.hm-float-preview {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 24px;
}

/* 一行尽量放得下 12 个音（社区谱面每句 8~16 个），长句才折第二行 */
.hm-float-preview .hm-sheet-note {
  min-width: 22px;
  padding: 3px;
  border-radius: 7px;
  font-size: 15px;
}

/* 小窗里的「当前音」不做放大，否则预览条每换一个音就抖一下 */
.hm-float-preview .hm-sheet-note.is-current {
  transform: none;
  box-shadow: none;
}

/* 底部操作行：常态是「跟练」，弹完整曲后再出现「再来一遍」。
   常驻占位（margin-top:auto 顶到底），因为跟练按钮一直都在 ——
   绝对定位会压到谱面预览条上 */
.hm-float-foot {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
}

.hm-float-guide,
.hm-float-again {
  font-size: 13px;
  padding: 6px 18px;
}

/* .hm-btn 是 inline-flex，会盖掉 [hidden] 的 UA 样式，这里显式收起来 */
.hm-float-again[hidden] {
  display: none;
}

/* 完成结果 */

.hm-result-card {
  width: min(520px, 100%);
}

.hm-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
  margin-bottom: 16px;
}

.hm-result-stats dt {
  font-size: 12px;
  color: var(--hm-text-dim);
  margin-bottom: 6px;
}

.hm-result-stats dd {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--hm-amber);
  font-variant-numeric: tabular-nums;
}

.hm-result-msg {
  text-align: center;
  font-size: 13px;
  color: var(--hm-text-dim);
  min-height: 20px;
  margin: 0 0 18px;
}

.hm-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .hm-play-hud {
    justify-content: center;
  }

  .hm-sheet-note {
    min-width: calc(38px + (var(--hm-beats, 1) - 1) * 12px);
    font-size: 19px;
  }

  .hm-result-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ===========================================================================
 * 用户体系：顶栏用户区、搜索工具栏、收藏点赞、我的、投稿表单
 * ========================================================================= */

/* ---------- 顶栏用户区 ---------- */

.hm-btn-strong {
  border-color: rgba(255, 163, 61, .6);
  background: rgba(255, 163, 61, .14);
  color: var(--hm-amber-soft);
}

.hm-btn-strong:hover {
  background: rgba(255, 163, 61, .22);
  color: var(--hm-amber);
}

.hm-btn-ghost {
  background: transparent;
  color: var(--hm-text-dim);
}

.hm-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
  color: var(--hm-text);
  text-decoration: none;
  font-size: 13px;
  transition: border-color .16s, color .16s;
}

.hm-user-chip:hover,
.hm-user-chip.is-open {
  border-color: var(--hm-amber);
  color: var(--hm-amber);
}

.hm-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 163, 61, .18);
  color: var(--hm-amber-soft);
  font-size: 12px;
  font-weight: 700;
}

.hm-user-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-user-out {
  display: inline-flex;
  margin: 0;
}

/* ---------- 顶部提示条 ---------- */

.hm-flash {
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
}

.hm-flash-ok {
  border-color: rgba(53, 201, 107, .5);
  background: rgba(53, 201, 107, .10);
  color: #a8e9c0;
}

.hm-flash-err {
  border-color: rgba(255, 91, 91, .5);
  background: rgba(255, 91, 91, .10);
  color: #ffb4b4;
}

/* ---------- 曲谱库工具栏：搜索与排序 ---------- */

.hm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.hm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
  max-width: 540px;
}

.hm-search-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
  color: var(--hm-text);
  transition: border-color .16s;
}

.hm-search-input::placeholder {
  color: #5d6b79;
}

.hm-search-input:focus {
  outline: none;
  border-color: rgba(255, 163, 61, .65);
}

.hm-search-clear {
  font-size: 12px;
  color: var(--hm-text-dim);
  text-decoration: none;
}

.hm-search-clear:hover {
  color: var(--hm-amber-soft);
}

.hm-search-hint {
  margin: 0;
  flex: 1 1 320px;
  font-size: 13px;
  color: var(--hm-text-dim);
}

.hm-search-hint a {
  color: var(--hm-amber-soft);
}

.hm-search-result {
  margin: -8px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--hm-text-dim);
}

.hm-search-result b {
  color: var(--hm-amber-soft);
}

.hm-sort {
  display: inline-flex;
  border: 1px solid var(--hm-line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--hm-panel);
}

.hm-sort-btn {
  padding: 8px 18px;
  font-size: 13px;
  color: var(--hm-text-dim);
  text-decoration: none;
  transition: background .16s, color .16s;
}

.hm-sort-btn:hover {
  color: var(--hm-amber-soft);
}

.hm-sort-btn.is-on {
  background: rgba(255, 163, 61, .14);
  color: var(--hm-amber);
  font-weight: 600;
}

/* ---------- 曲谱卡片：标题链接与互动按钮 ---------- */

a.hm-score-title {
  color: inherit;
  text-decoration: none;
  transition: color .16s;
}

a.hm-score-title:hover {
  color: var(--hm-amber-soft);
}

.hm-score-title.is-off {
  color: var(--hm-text-dim);
}

/* 整卡可点：标题链接用伪元素铺满整张卡片。
   底部区的按钮 / 链接抬到上层保持自身可点，其余区域点击都走整卡链接 */
.hm-score-card.is-clickable {
  cursor: pointer;
}

.hm-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 18px;
}

.hm-score-card-actions a,
.hm-score-card-actions button {
  position: relative;
  z-index: 2;
}

.hm-score-publisher {
  display: block;
  margin-top: 2px;
  color: var(--hm-text-dim);
}

.hm-score-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 14px;
}

/* 「进入跟弹」原本是悬浮提示，现在与互动按钮同排，改为常显 */
.hm-score-card-actions .hm-score-cta {
  position: static;
  opacity: 1;
  transform: none;
}

.hm-acts {
  display: inline-flex;
  gap: 8px;
}

.hm-act {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hm-line);
  background: rgba(255, 255, 255, .02);
  color: var(--hm-text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}

.hm-act:hover {
  color: var(--hm-text);
  border-color: rgba(255, 163, 61, .45);
}

.hm-act:disabled {
  opacity: .6;
  cursor: default;
}

.hm-act-icon {
  font-size: 13px;
  line-height: 1;
}

.hm-act-like.is-on {
  color: var(--hm-high);
  border-color: rgba(255, 91, 91, .6);
  background: rgba(255, 91, 91, .12);
}

.hm-act-fav.is-on {
  color: var(--hm-sharp);
  border-color: rgba(255, 210, 61, .6);
  background: rgba(255, 210, 61, .12);
}

/* ---------- 「我的」分栏与审核状态 ---------- */

.hm-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.hm-tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
  color: var(--hm-text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: all .16s;
}

.hm-tab:hover {
  color: var(--hm-amber-soft);
  border-color: rgba(255, 163, 61, .5);
}

.hm-tab.is-on {
  background: rgba(255, 163, 61, .14);
  border-color: var(--hm-amber);
  color: var(--hm-amber);
  font-weight: 600;
}

.hm-tab em {
  font-style: normal;
  font-size: 11px;
  opacity: .75;
  margin-left: 4px;
}

.hm-score-audit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 12px;
  color: var(--hm-text-dim);
}

.hm-audit {
  padding: 1px 9px;
  border-radius: 20px;
  font-size: 11px;
  border: 1px solid currentColor;
}

.hm-audit-0 { color: var(--hm-text-dim); }
.hm-audit-1 { color: var(--hm-low); }
.hm-audit-2 { color: var(--hm-sharp); }
.hm-audit-3 { color: var(--hm-high); }

.hm-audit-remark {
  font-style: normal;
  color: #ffb4b4;
}

/* ---------- 投稿表单 ---------- */

.hm-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 28px);
  border-radius: 20px;
  border: 1px solid var(--hm-line);
  background: rgba(19, 28, 38, .55);
}

.hm-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.hm-form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hm-form-label {
  font-size: 13px;
  color: var(--hm-text-dim);
}

.hm-form-label em {
  font-style: normal;
  color: var(--hm-amber);
}

.hm-form-input,
.hm-form-textarea {
  font: inherit;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--hm-line);
  background: #0d1319;
  color: var(--hm-text);
  transition: border-color .16s;
}

.hm-form-input-sm {
  max-width: 160px;
}

.hm-form-textarea {
  resize: vertical;
  line-height: 1.9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.hm-form-input:focus,
.hm-form-textarea:focus {
  outline: none;
  border-color: rgba(255, 163, 61, .65);
}

.hm-form-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hm-form-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hm-line);
  background: var(--hm-panel);
  font-size: 13px;
  color: var(--hm-text-dim);
  cursor: pointer;
  transition: all .16s;
}

.hm-form-option:has(input:checked) {
  border-color: var(--hm-amber);
  background: rgba(255, 163, 61, .12);
  color: var(--hm-amber);
}

.hm-form-option input {
  accent-color: var(--hm-amber);
}

.hm-form-help {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--hm-line);
  background: rgba(255, 255, 255, .02);
}

.hm-form-help summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--hm-amber-soft);
}

.hm-form-help-body {
  margin-top: 12px;
  font-size: 13px;
  color: var(--hm-text-dim);
}

.hm-form-help-body p {
  margin: 0 0 10px;
}

.hm-form-help-body pre {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--hm-line);
  background: #0d1319;
  font-size: 12.5px;
  color: var(--hm-text);
  overflow-x: auto;
}

.hm-form-help-tip {
  color: var(--hm-amber-soft);
}

/* AI 抄谱提示词：整段摊开、限高滚动，上面按钮一键复制 */
.hm-prompt-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.hm-prompt {
  max-height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.hm-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hm-form-note {
  font-size: 12px;
  color: var(--hm-text-dim);
}

@media (max-width: 720px) {
  .hm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hm-search {
    max-width: none;
  }

  .hm-sort {
    align-self: center;
  }

  .hm-user-name {
    display: none;
  }
}

/* ===========================================================================
 * 认证页（登录 / 注册 / 忘记密码 / 个人中心）
 * 与首页共用同一套顶栏、底栏、按钮与表单语言，这里只补认证特有的容器与卡片
 * ========================================================================= */

.hm-auth-shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hm-auth-shell-wide {
  max-width: 980px;
}

/* 入口页（登录 / 注册 / 找回密码）内容只有一张卡，垂直居中才与首页的舞台感一致；
   个人中心页内容较长，仍从顶部排布（不给这个类即可） */
.hm-stage-auth {
  justify-content: center;
}

/* ---------- 卡片与标题 ---------- */

.hm-auth-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(20px, 3vw, 30px) clamp(18px, 3vw, 28px);
  border-radius: 20px;
  border: 1px solid var(--hm-line);
  background: rgba(19, 28, 38, .6);
  box-shadow: var(--hm-shadow);
}

.hm-auth-head {
  text-align: center;
}

.hm-auth-head h1 {
  margin: 0 0 8px;
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: .5px;
}

.hm-auth-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--hm-text-dim);
}

.hm-auth-head em {
  font-style: normal;
  color: var(--hm-amber);
}

/* ---------- 表单 ---------- */

.hm-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hm-auth-inline {
  display: flex;
  gap: 8px;
}

.hm-auth-inline .hm-form-input {
  flex: 1;
  min-width: 0;
}

.hm-auth-inline .hm-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.hm-btn-block {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
  font-size: 14px;
}

/* 实心主按钮：与品牌图形同色，用于页面里唯一的主操作 */
.hm-btn-primary {
  border-color: transparent;
  background: linear-gradient(150deg, var(--hm-amber), var(--hm-amber-deep));
  color: #17110a;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(255, 163, 61, .2);
}

.hm-btn-primary:hover {
  color: #17110a;
  border-color: transparent;
  filter: brightness(1.07);
}

.hm-btn:disabled {
  opacity: .5;
  cursor: default;
  box-shadow: none;
}

.hm-btn:disabled:hover {
  color: inherit;
  border-color: inherit;
  filter: none;
}

/* 顶栏「注册」在注册页要高亮，需盖过 hm-btn-strong 自身的底色 */
.hm-btn-strong.is-open {
  background: rgba(255, 163, 61, .24);
  border-color: var(--hm-amber);
  color: var(--hm-amber);
}

/* 次要按钮：与主按钮同宽同高，作为退出/返回一类的次级操作 */
.hm-btn-line {
  justify-content: center;
  padding: 10px 16px;
}

/* ---------- 底部链接与说明 ---------- */

.hm-auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--hm-text-dim);
}

.hm-auth-foot a {
  color: var(--hm-amber-soft);
  text-decoration: none;
}

.hm-auth-foot a:hover {
  color: var(--hm-amber);
}

.hm-auth-foot-end {
  justify-content: flex-end;
}

.hm-auth-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--hm-text-dim);
}

.hm-auth-note strong {
  color: var(--hm-amber-soft);
  font-weight: 600;
}

.hm-auth-note a {
  color: var(--hm-amber-soft);
}

.hm-auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- 个人中心：左导航 + 右内容 ---------- */

.hm-auth-layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.hm-auth-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--hm-line);
  background: rgba(19, 28, 38, .6);
}

.hm-auth-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--hm-text-dim);
  text-decoration: none;
  transition: background .16s, color .16s;
}

.hm-auth-nav a:hover {
  background: rgba(255, 255, 255, .03);
  color: var(--hm-text);
}

.hm-auth-nav a.is-on {
  background: rgba(255, 163, 61, .14);
  color: var(--hm-amber);
  font-weight: 600;
}

.hm-auth-nav i {
  flex: 0 0 18px;
  text-align: center;
  font-size: 15px;
}

/* ---------- 只读资料 ---------- */

.hm-auth-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hm-auth-info-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(35, 48, 62, .9);
}

.hm-auth-info-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hm-auth-info-label {
  flex: 0 0 92px;
  font-size: 13px;
  color: var(--hm-text-dim);
}

.hm-auth-info-value {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--hm-text);
  word-break: break-all;
}

.hm-auth-info-value.is-empty {
  color: #4d5a67;
}

/* ---------- 头像 ---------- */

.hm-avatar-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hm-avatar-preview {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hm-line);
  background: #0d1319;
}

.hm-crop-box {
  width: 100%;
  height: 300px;
  border-radius: 14px;
  border: 1px solid var(--hm-line);
  background: #0d1319;
  overflow: hidden;
}

.hm-crop-box[hidden] {
  display: none;
}

.hm-crop-box img {
  display: block;
  max-width: 100%;
}

.hm-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hm-avatar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- toastr 深色适配（认证页内的 AJAX 提示） ---------- */

#toast-container > div {
  background-image: none !important;
  border: 1px solid var(--hm-line);
  border-radius: 12px;
  box-shadow: var(--hm-shadow);
  opacity: 1;
  font-size: 13px;
  padding: 12px 16px;
}

#toast-container > .toast-success {
  background-color: rgba(53, 201, 107, .14);
  border-color: rgba(53, 201, 107, .5);
  color: #a8e9c0;
}

#toast-container > .toast-error {
  background-color: rgba(255, 91, 91, .14);
  border-color: rgba(255, 91, 91, .5);
  color: #ffb4b4;
}

#toast-container > .toast-info {
  background-color: rgba(255, 163, 61, .14);
  border-color: rgba(255, 163, 61, .5);
  color: var(--hm-amber-soft);
}

#toast-container > .toast-warning {
  background-color: rgba(255, 210, 61, .14);
  border-color: rgba(255, 210, 61, .5);
  color: var(--hm-sharp);
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .hm-auth-layout {
    grid-template-columns: 1fr;
  }

  .hm-auth-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hm-auth-nav a {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .hm-auth-inline {
    flex-direction: column;
  }

  .hm-auth-info-row {
    flex-direction: column;
    gap: 6px;
  }

  .hm-auth-info-label {
    flex: none;
  }
}

