/* ===========================================================
   点歌台 · 视觉样式（移动端优先，深色霓虹）
   =========================================================== */

:root {
  --bg: #0a0816;
  --bg-2: #150c28;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f2ff;
  --muted: rgba(245, 242, 255, 0.56);
  --faint: rgba(245, 242, 255, 0.34);
  --brand: #a855f7;
  --brand-2: #ec4899;
  --cyan: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 18px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(168, 85, 247, 0.34), transparent 62%),
    radial-gradient(760px 480px at 92% 2%, rgba(236, 72, 153, 0.24), transparent 58%),
    radial-gradient(800px 600px at 50% 108%, rgba(34, 211, 238, 0.14), transparent 60%),
    linear-gradient(170deg, var(--bg) 0%, var(--bg-2) 55%, #0b0715 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px 108px;
  min-height: 100vh;
}

/* ---------------- 头部 ---------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 -16px;
  padding: 16px 16px 12px;
  background: linear-gradient(180deg, rgba(10, 8, 22, 0.94), rgba(10, 8, 22, 0.72) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand .sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  flex: none;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  flex: none;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}

.badge.super {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, #f59e0b, #ec4899);
  box-shadow: 0 4px 16px -6px rgba(236, 72, 153, 0.9);
}

.badge.admin {
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.16);
}

/* ---------------- 标签栏 ---------------- */

.tabs {
  display: flex;
  gap: 6px;
  margin: 14px -16px 0;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: 0.2s;
}

.tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-strong);
}

.tab .count {
  margin-left: 5px;
  font-size: 11px;
  color: var(--faint);
}

/* ---------------- 卡组 ---------------- */

.section {
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--faint);
}

.section-head .hint {
  font-size: 12px;
  color: var(--faint);
}

.card {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* 正在唱 */
.now {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(236, 72, 153, 0.2)),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px -24px rgba(236, 72, 153, 0.85);
}

.now::after {
  content: '';
  position: absolute;
  inset: -60% -20% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 65%);
  pointer-events: none;
}

.now-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.eq i {
  width: 2.5px;
  background: var(--cyan);
  border-radius: 2px;
  animation: eq 0.9s ease-in-out infinite;
}

.eq i:nth-child(1) {
  height: 5px;
  animation-delay: 0s;
}
.eq i:nth-child(2) {
  height: 10px;
  animation-delay: 0.18s;
}
.eq i:nth-child(3) {
  height: 7px;
  animation-delay: 0.36s;
}

@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.45);
  }
  50% {
    transform: scaleY(1);
  }
}

.now-title {
  margin: 12px 0 4px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.25;
}

.now-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

/* 轮次 */
.round {
  margin-top: 16px;
}

.round-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 8px;
}

.round-head .name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(245, 242, 255, 0.75);
}

.round-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.round-head .num {
  font-size: 11px;
  color: var(--faint);
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.row.mine {
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(34, 211, 238, 0.09);
}

.row.dragging {
  z-index: 10;
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.9);
}

.idx {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.row:nth-child(1) .idx {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub .tag {
  color: var(--cyan);
}

/* 演唱者标签：参与X次 / 首唱 / 插队 / 手动 */
.ptag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
  vertical-align: 1px;
  color: rgba(245, 242, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.ptag.first {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.14);
}

.ptag.jump {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.now-meta .ptag {
  vertical-align: 2px;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: 0.16s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn.primary {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(236, 72, 153, 0.95);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.1);
}

.btn.sm {
  padding: 7px 11px;
  font-size: 12.5px;
  border-radius: 10px;
}

.btn.block {
  width: 100%;
}

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  transition: 0.16s;
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.14);
}

.icon-btn.on {
  color: #fff;
  background: rgba(168, 85, 247, 0.35);
  border-color: rgba(168, 85, 247, 0.6);
}

.actions {
  display: flex;
  gap: 6px;
  flex: none;
}

/* 拖拽把手 */
.handle {
  width: 24px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--faint);
  cursor: grab;
  touch-action: none;
  font-size: 13px;
  letter-spacing: -1px;
}

.handle:active {
  cursor: grabbing;
  color: var(--text);
}

/* ---------------- 空状态 ---------------- */

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--faint);
}

.empty .big {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.8;
}

.empty p {
  margin: 6px 0 0;
  font-size: 13px;
}

/* ---------------- 提示条 ---------------- */

.tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 13px 15px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.tip b {
  color: var(--text);
  font-weight: 650;
}

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

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}

.field .desc {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.55;
}

.input,
select.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  color: var(--text);
  outline: none;
  transition: 0.16s;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus {
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(255, 255, 255, 0.09);
}

select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-row .label {
  font-size: 14px;
  font-weight: 600;
}

.switch-row .desc {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.5;
}

.switch {
  width: 46px;
  height: 27px;
  flex: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: 0.2s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.switch.on {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  border-color: transparent;
}

.switch.on::after {
  transform: translateX(19px);
}

/* ---------------- 徽标行 ---------------- */

.info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.info .grow {
  flex: 1;
  min-width: 0;
}

.info .name {
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info .meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- toast ---------------- */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(20, 14, 36, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: 0 16px 34px -14px #000;
  animation: toast-in 0.24s ease;
  max-width: 86vw;
  text-align: center;
}

.toast.ok {
  border-color: rgba(52, 211, 153, 0.5);
}
.toast.err {
  border-color: rgba(251, 113, 133, 0.55);
  color: #ffd9df;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

/* ---------------- 底部悬浮 ---------------- */

.fab {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  box-shadow: 0 20px 40px -14px rgba(236, 72, 153, 0.85);
  width: calc(100% - 48px);
  max-width: 420px;
  justify-content: center;
}

.fab:active {
  transform: translateX(-50%) scale(0.98);
}

/* ---------------- 底部弹层 ---------------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 3, 10, 0.66);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.2s;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.sheet {
  width: 100%;
  max-width: 600px;
  max-height: 82vh;
  overflow: auto;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #150e27;
  border-top: 1px solid var(--line-strong);
  animation: sheet-up 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
}

.sheet h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.sheet .sheet-sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--faint);
}

.grabber {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  margin: -8px auto 14px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 单曲操作菜单：短标签 4 列，7 个动作压成两行 */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.menu-grid .btn {
  padding: 9px 4px;
  font-size: 13px;
  border-radius: 11px;
  min-height: 38px;
}

/* 消息日志 */
.log {
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.log .t {
  font-size: 13.5px;
  font-weight: 600;
  word-break: break-all;
}

.log .m {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--faint);
}

.log .pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.log .pill.into {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.4);
}

.log .pill.skip {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.35);
}

.skeleton {
  height: 58px;
  border-radius: 15px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  margin-bottom: 8px;
}

@keyframes sk {
  to {
    background-position: -200% 0;
  }
}

.link {
  color: var(--cyan);
  text-decoration: none;
}

@media (min-width: 620px) {
  .app {
    padding-bottom: 120px;
  }
  .fab {
    max-width: 420px;
  }
}

/* ===========================================================
   活动 / 上管 / 全部信息 / 历史（v2）
   =========================================================== */

/* ---------------- 上管徽标 ---------------- */

.duty-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 132px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: 0.18s;
}

.duty-chip:active {
  transform: scale(0.96);
}

.duty-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.duty-chip.on {
  color: #d1fae5;
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.5);
}

.duty-chip.on .duty-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
  animation: dutyPulse 1.8s infinite;
}

.duty-chip.other {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
}

.duty-chip.other .duty-dot {
  background: var(--warn);
}

@keyframes dutyPulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.05);
  }
}

/* ---------------- 活动卡片 ---------------- */

.act-card {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: 0.2s;
}

.act-card[data-status='active'] {
  background: linear-gradient(100deg, rgba(52, 211, 153, 0.14), rgba(34, 211, 238, 0.08));
  border-color: rgba(52, 211, 153, 0.32);
}

.act-card[data-status='active']:has(.act-dot.warn) {
  background: linear-gradient(100deg, rgba(251, 191, 36, 0.16), rgba(236, 72, 153, 0.08));
  border-color: rgba(251, 191, 36, 0.38);
}

.act-card[data-status='ended'] {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

.act-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.act-info {
  min-width: 0;
}

.act-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.act-dot.on {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
  animation: dutyPulse 1.8s infinite;
}

.act-dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.18);
  animation: dutyPulse 1.2s infinite;
}

.act-dot.ended {
  background: rgba(245, 242, 255, 0.28);
}

.act-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.act-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.act-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

/* ---------------- 快捷入口 ---------------- */

.quick-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.quick {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border-radius: 13px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  transition: 0.18s;
  overflow: hidden;
}

.quick:active {
  transform: scale(0.98);
}

.quick.on {
  color: #fff;
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.16);
}

.quick .q-ico {
  font-size: 14px;
}

.quick .q-num {
  font-size: 11px;
  color: var(--faint);
}

.quick.has-new {
  color: #fff;
  border-color: rgba(236, 72, 153, 0.6);
  animation: quickFlash 1.3s ease-in-out infinite;
}

@keyframes quickFlash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.45);
    background: rgba(236, 72, 153, 0.14);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(236, 72, 153, 0);
    background: rgba(236, 72, 153, 0.28);
  }
}

.new-dot {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2), #f43f5e);
  box-shadow: 0 4px 12px -4px rgba(244, 63, 94, 0.9);
}

.bottom-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.bottom-actions .btn {
  flex: 1;
}

/* ---------------- 轮次标记 / 已唱 ---------------- */

.round.current .round-head .name {
  color: #fff;
}

.round.current .rows {
  position: relative;
  padding-left: 8px;
  border-left: 2px solid rgba(168, 85, 247, 0.45);
  margin-left: 0;
}

.badge.current {
  color: #f5d0fe;
  background: rgba(168, 85, 247, 0.24);
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.badge.next {
  color: var(--faint);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.row.done {
  opacity: 0.62;
}

.row.done .row-title {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

/* ---------------- 全部信息 ---------------- */

#panel-messages .section-head {
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

#panel-messages .section-head h2 {
  flex: 1;
}

.icon-btn.back {
  font-size: 20px;
  line-height: 1;
  padding-bottom: 3px;
}

#messages-body {
  margin-top: 12px;
}

.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  transition: 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.msg.valid {
  background: linear-gradient(100deg, rgba(168, 85, 247, 0.24), rgba(236, 72, 153, 0.14));
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 12px 26px -20px rgba(168, 85, 247, 0.95);
}

.msg.invalid {
  opacity: 0.5;
}

.msg.invalid .msg-text {
  color: var(--muted);
  font-weight: 500;
}

.msg-time {
  flex: none;
  width: 46px;
  padding-top: 2px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.msg-main {
  flex: 1;
  min-width: 0;
}

.msg-text {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--faint);
}

.msg-flag {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.msg.valid .msg-flag {
  color: #f5d0fe;
  background: rgba(168, 85, 247, 0.28);
  border-color: rgba(168, 85, 247, 0.55);
}

/* 已唱：和无效一样走暗色，但不能在这里操作 */
.msg.done {
  opacity: 0.55;
}

.msg.done .msg-text {
  color: var(--muted);
  font-weight: 500;
}

.msg.done .msg-flag {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.3);
}

/* 右侧：状态标签 + 一个动作按钮 */
.msg-ops {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.msg-act {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.42);
}

.msg-act.danger {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.4);
}

.msg-act:active {
  transform: scale(0.95);
}

/* ---------------- 历史 ---------------- */

.hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hist-title {
  font-size: 13.5px;
  font-weight: 700;
}

.hist-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--faint);
}

.hist-rows {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.hist-row {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--muted);
}

.hist-row .t {
  width: 42px;
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.hist-row .s {
  width: 66px;
  flex: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hist-row .n {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hist-more {
  margin-top: 6px;
  font-size: 11px;
  color: var(--faint);
}

/* ---------------- 居中弹窗 ---------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(6, 4, 14, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.16s ease;
}

.modal {
  width: 100%;
  max-width: 330px;
  padding: 20px 20px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #1b1230, #150e26);
  border: 1px solid var(--line-strong);
  box-shadow: 0 26px 60px -22px rgba(0, 0, 0, 0.95);
  animation: modalIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.modal-text {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .btn {
  flex: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes modalIn {
  from {
    transform: translateY(14px) scale(0.97);
    opacity: 0;
  }
}

/* hidden 属性优先级兜底（display:grid 会盖过 UA 的 [hidden]） */
.new-dot[hidden],
#msg-dot[hidden] {
  display: none;
}

/* ===========================================================
   手机端体验优化（v3.3）
   =========================================================== */

/* 触控基础：去双击缩放延迟、按压缩放 */
button,
.tab,
.quick,
.icon-btn,
.row,
.msg {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* 触摸反馈：按下有轻微缩放/提亮 */
@media (hover: none) {
  .btn:active,
  .icon-btn:active,
  .tab:active,
  .quick:active {
    transform: scale(0.96);
    filter: brightness(1.25);
  }
  .row:active {
    background: rgba(255, 255, 255, 0.085);
  }
}

/* 输入框 ≥16px，避免 iOS 聚焦自动放大 */
.input,
.sheet input,
.modal input {
  font-size: 16px;
}

/* 底部主操作：吸底 + 安全区，唱完不用滚到页尾 */
.bottom-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  margin: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(10, 8, 22, 0) 0%, rgba(10, 8, 22, 0.92) 34%, #0a0816 100%);
  backdrop-filter: blur(8px);
}
.bottom-actions .btn {
  min-height: 46px;
  font-size: 15px;
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.8);
}

/* 触控目标加大：行内按钮 38px、小按钮 34px 高 */
.icon-btn {
  width: 38px;
  height: 38px;
  font-size: 16px;
}
.btn.sm {
  min-height: 34px;
  padding: 7px 13px;
}

/* 窄屏：压缩留白，行内两行描述不顶破卡片 */
@media (max-width: 380px) {
  .app {
    padding: 0 12px 118px;
  }
  .header {
    margin: 0 -12px;
  }
  .row {
    gap: 9px;
    padding: 11px 12px;
  }
  .idx {
    width: 24px;
    height: 24px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 麦序行描述最多两行，长原话省略 */
.row-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 歌名允许换行：长英文歌名不再截断成一行 */
.row-title {
  white-space: normal;
  word-break: break-word;
}

/* 快捷入口按钮加高，好点 */
.quick {
  min-height: 52px;
}

/* 底部弹层在小屏更高一些，内容滚动顺滑 */
@media (max-width: 620px) {
  .sheet {
    max-height: 88vh;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .toast-wrap {
    bottom: 128px;
  }
}

/* 标签栏横向滚动跟手 */
.tabs {
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.tab {
  scroll-snap-align: start;
}
