:root {
  --blue: #4a6cf7;
  --blue-2: #5b7cfa;
  --ink: #2b3350;
  --muted: #7b86a3;
  --line: rgba(122, 146, 215, 0.28);
  --card: rgba(255, 255, 255, 0.92);
  --radius: 16px;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: #eef1fb;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* 手机舞台：页面上居中一列，蓝框图铺在里面 */
#stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #f7f8ff;
  box-shadow: 0 18px 60px rgba(43, 51, 80, 0.16);
}

#bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

#veil {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.62);
  pointer-events: none;
}

#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 600;
  font-size: 16px;
  z-index: 20;
  background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  backdrop-filter: blur(6px);
}

#topbar .back {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  cursor: pointer;
  flex: none;
}

#topbar .title {
  flex: 1;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#topbar .spacer {
  width: 30px;
  flex: none;
}

#view {
  position: absolute;
  top: 46px;
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 24px;
  z-index: 10;
}

#view.with-tab {
  bottom: 62px;
}

#tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58px;
  display: flex;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

#tabbar button {
  flex: 1;
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

#tabbar button.on {
  color: var(--blue);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(74, 108, 247, 0.08);
  padding: 16px;
}

.muted {
  color: var(--muted);
  font-size: 12.5px;
}

.accent {
  color: var(--blue);
}

/* ---------- 登录 ---------- */
.login {
  padding-top: 22px;
  text-align: center;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #4a6cf7, #7f9bff);
  box-shadow: 0 10px 26px rgba(74, 108, 247, 0.35);
}

h1.brand {
  margin: 0;
  font-size: 26px;
  letter-spacing: 1px;
}

.login .sub {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.tabs button {
  flex: 1;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tabs button.on {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(74, 108, 247, 0.3);
}

.code-input,
input.code-input {
  width: 100%;
  height: 62px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 7px;
  color: var(--blue);
  outline: none;
  padding-left: 7px;
  text-transform: uppercase;
}

.code-input:focus {
  border-color: rgba(74, 108, 247, 0.55);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12);
}

button.primary {
  width: 100%;
  height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(74, 108, 247, 0.3);
}

button.primary:disabled {
  opacity: 0.6;
}

button.primary.ghost {
  background: rgba(255, 255, 255, 0.94);
  color: var(--blue);
  border: 1px solid var(--line);
  box-shadow: none;
}

.steps {
  margin: 20px 2px 0;
  text-align: left;
  display: grid;
  gap: 9px;
}

.step {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.step .num {
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(74, 108, 247, 0.5);
  color: var(--blue);
  font-size: 10.5px;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

/* ---------- 首页 ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 4px 8px;
  font-weight: 700;
  font-size: 14px;
}

.group-card .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.label-pill {
  font-size: 11px;
  color: var(--blue);
  background: rgba(74, 108, 247, 0.1);
  border-radius: 8px;
  padding: 3px 8px;
  font-weight: 600;
}

.group-card .name {
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 4px;
}

.stats {
  display: flex;
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.stat {
  flex: 1;
  text-align: center;
}

.stat b {
  display: block;
  font-size: 20px;
  color: var(--ink);
  font-weight: 700;
}

.stat.blue b {
  color: var(--blue);
}

.stat span {
  font-size: 11.5px;
  color: var(--muted);
}

.hall-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-top: 10px;
  cursor: pointer;
}

.hall-item .hn {
  font-size: 17px;
  font-weight: 700;
}

.hall-item .tag {
  font-size: 10.5px;
  color: #fff;
  background: var(--blue-2);
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: 2px;
}

.hall-item .right {
  margin-left: auto;
  text-align: right;
}

.hall-item .cnt {
  font-size: 17px;
  font-weight: 700;
  color: var(--blue);
}

.mini-link {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  margin-top: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.mini-link .arrow {
  margin-left: auto;
  color: var(--muted);
}

/* ---------- 机厅详情 ---------- */
.hero .title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
}

.hero .big {
  font-size: 26px;
  font-weight: 800;
  color: var(--blue);
}

.actions {
  display: flex;
  gap: 7px;
  margin: 10px 0 4px;
}

.actions .btn {
  flex: 1;
}

.btn {
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: #3d4a72;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(122, 146, 215, 0.3);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
}

.btn.on {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.btn.ghost {
  flex: 0 0 96px;
  color: var(--blue);
}

.btn.clock {
  width: 100%;
  height: 46px;
  line-height: 46px;
  font-size: 15px;
  border-radius: 14px;
}

.btn.clock.in {
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7, #7b96ff);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(74, 108, 247, 0.3);
}

.btn.clock.out {
  color: #e4572e;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(228, 87, 46, 0.4);
}

.clock-row {
  margin: 8px 0 2px;
}

.clock-tip {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 4px 0;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 8px 90px;
}

.blk {
  position: relative;
}

.blk.is-pair {
  margin-top: 9px;
}

.blk.is-pair .mcard + .mcard {
  margin-top: 8px;
}

.blk .pair-img {
  position: absolute;
  left: -8px;
  right: -8px;
  top: -4px;
  bottom: -4px;
  width: calc(100% + 16px);
  height: calc(100% + 8px);
  z-index: 0;
  pointer-events: none;
}

.pair-tag {
  position: absolute;
  left: 22px;
  top: -9px;
  z-index: 3;
  font-size: 11px;
  color: #fff;
  border-radius: 8px;
  padding: 2px 10px;
  font-weight: 700;
}

.mcard {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(74, 108, 247, 0.07);
  overflow: hidden;
  user-select: none;
  cursor: pointer;
}

.mcard.selected {
  box-shadow: 0 0 0 2px var(--blue) inset, 0 6px 16px rgba(74, 108, 247, 0.16);
}

.cbar {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7f9bff, #4a6cf7);
  font-size: 16px;
}

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

.who-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.who .since {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
}

.dur {
  flex: none;
  align-self: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}

.tag {
  font-size: 10px;
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: 1.5px;
  background: rgba(122, 146, 215, 0.18);
  color: #5a678d;
  font-weight: 600;
}

.tag.me {
  background: var(--blue);
  color: #fff;
}

.rm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #d0623f;
  background: rgba(228, 87, 46, 0.1);
  font-size: 13px;
  font-weight: 700;
  margin-left: 4px;
  flex: none;
}

.pick {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  margin-left: 4px;
  flex: none;
  transition: background .15s, border-color .15s;
}
.pick.on {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 2px 6px rgba(74, 108, 247, .35);
}

.mcard.selected .pick {
  background: var(--blue);
  border-color: var(--blue);
}

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 26px 0;
}

.pairbar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(43, 51, 80, 0.18);
}

.pairbar .btn {
  flex: 0 0 auto;
  padding: 0 16px;
  height: 36px;
  line-height: 36px;
  font-size: 13px;
}

/* ---------- 排行 ---------- */
.rank-card {
  padding: 14px 16px;
  margin-top: 10px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  margin-top: 8px;
}

.rank-no {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: #c7d0e8;
  flex: none;
}

.rank-no.top1 {
  background: #f6c344;
}

.rank-no.top2 {
  background: #b9c4dc;
}

.rank-no.top3 {
  background: #e0a273;
}

.rank-name {
  font-weight: 700;
  font-size: 15px;
}

.rank-hours {
  margin-left: auto;
  text-align: right;
}

.rank-hours b {
  color: var(--blue);
  font-size: 16px;
}

/* ---------- 管理 ---------- */
.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-top: 8px;
}

.admin-row .nm {
  font-weight: 700;
}

.btn.danger {
  flex: 0 0 auto;
  padding: 0 14px;
  height: 34px;
  line-height: 34px;
  font-size: 12.5px;
  color: #d9534f;
  border-color: rgba(217, 83, 79, 0.35);
  background: #fff;
}

.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip {
  padding: 6px 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: #55618a;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  cursor: pointer;
}

.chip.on {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.inline-form input {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  outline: none;
}

.inline-form .btn {
  flex: 0 0 auto;
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* ---------- 弹窗 / 提示 ---------- */
#toast {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  background: rgba(30, 36, 56, 0.9);
  color: #fff;
  font-size: 13.5px;
  padding: 12px 18px;
  border-radius: 12px;
  max-width: 78%;
  text-align: center;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

#toast.show {
  opacity: 1;
}

#modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(30, 36, 56, 0.35);
  padding: 24px;
}

#modal.show {
  display: flex;
}

.modal-box {
  width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(30, 36, 56, 0.25);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-tip {
  margin: 8px 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-box input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font-size: 15px;
  outline: none;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

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

.modal-actions .btn.primary-solid {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

@media (min-width: 520px) {
  body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0;
  }
  #stage {
    border-radius: 0;
  }
}

/* 拖动中的卡片 */
.mcard.dragging {
  position: relative;
  z-index: 9;
  transition: none !important;
  box-shadow: 0 16px 36px rgba(43, 51, 80, .24);
  border-color: rgba(74, 108, 247, .55);
  background: #fff;
}
/* 登录码输入框：占位提示不要跟着拉宽字距 */
.code-input::placeholder {
  letter-spacing: normal;
  font-size: 15px;
  font-weight: 500;
  color: #9aa4bd;
}
/* ---------- 拼机合并卡 ---------- */
.mcard.pair {
  display: block;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.9);
}

.mcard.pair .cbar {
  top: 8px;
  bottom: 8px;
}

.prow {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px 12px 18px;
  min-height: 62px;
}

.prow + .prow {
  border-top: 1px dashed rgba(122, 146, 215, 0.3);
}

.prow .since {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- 队首光效 ---------- */
@keyframes glowWhite {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 6px 1px rgba(150, 175, 255, 0.55); }
  50% { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.98), 0 0 16px 6px rgba(150, 175, 255, 0.85); }
}

@keyframes glowGreen {
  0%, 100% { box-shadow: 0 0 0 2px rgba(46, 196, 122, 0.85), 0 0 6px 2px rgba(46, 196, 122, 0.45); }
  50% { box-shadow: 0 0 0 3px rgba(46, 196, 122, 0.95), 0 0 18px 7px rgba(46, 196, 122, 0.75); }
}

/* 白光：轮到队首、还没上机；绿光：这个人正在上机（拼机里只亮上机的那一个） */
.avatar.is-next {
  animation: glowWhite 1.5s ease-in-out infinite;
}

.avatar.is-playing {
  animation: glowGreen 1.5s ease-in-out infinite;
}

.blk.pending .mcard,
.blk.playing .mcard {
  border-color: rgba(150, 175, 255, 0.55);
}

/* ---------- 队首左右下角圆按钮 ---------- */
.corners {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 18;
  pointer-events: none;
}

.cbtn {
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #5b7cfa, #4a6cf7);
  box-shadow: 0 10px 24px rgba(74, 108, 247, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.cbtn.stop {
  background: linear-gradient(135deg, #ff6b6b, #e33b3b);
  box-shadow: 0 10px 24px rgba(227, 59, 59, 0.38);
}

.cbtn.ghost {
  background: rgba(255, 255, 255, 0.97);
  color: var(--muted);
  border: 1.5px solid var(--line);
  box-shadow: 0 8px 20px rgba(43, 51, 80, 0.14);
}

.cbtn:active {
  transform: scale(0.93);
}

#view.has-corners {
  padding-bottom: 118px;
}

/* ---------- 退出拼机 ---------- */
.unpair-row {
  margin-top: 8px;
}

.unpair-row .btn {
  width: 100%;
}

/* QQ 头像：图片盖在首字母上，加载失败自动露出首字母 */
.avatar.img {
  position: relative;
  overflow: hidden;
}
.avatar.img .av-letter {
  position: relative;
  z-index: 0;
}
.avatar.img img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* 排卡成员标题右侧：提示 + 刷新按钮 */
.head-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.refresh {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(74, 108, 247, 0.09);
  border: 1px solid rgba(74, 108, 247, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1.2;
}
.refresh:active {
  transform: scale(0.96);
}

/* ---------------- 个人页 ---------------- */
.pf-card { padding: 16px; }
.pf-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pf-avatar {
  position: relative; width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #4a6cf7, #7fa0ff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; overflow: hidden; flex: none;
}
.pf-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-letter { position: relative; z-index: 0; }
.pf-meta { min-width: 0; }
.pf-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.pf-meta .muted { font-size: 12px; word-break: break-all; }
.code-input.small { height: 44px; font-size: 15px; letter-spacing: 0; margin-bottom: 10px; }
.row.gap { display: flex; gap: 8px; }
.small-tip { margin-top: 10px; font-size: 12px; line-height: 1.6; }
.link-row { text-align: center; margin: 4px 0 12px; }
.link { color: var(--blue); font-size: 13px; text-decoration: underline; cursor: pointer; }
.refresh b, .refresh span { font-variant-numeric: tabular-nums; }

/* 个人页按钮：与 .btn 视觉一致 */
.pf-card button.ghost,
.card button.ghost {
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(122, 146, 215, 0.34);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pf-card button.primary,
.card button.primary {
  height: 44px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #4a6cf7, #5b7cfa);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(74, 108, 247, 0.28);
}
.pf-card button:active { transform: scale(0.98); }
input.code-input.small { text-align: left; padding-left: 14px; letter-spacing: 0; text-transform: none; }

/* 个人页：管理员区块 */
.pf-sec-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}
.admin-ok {
  font-size: 13px;
  color: #17b169;
  background: rgba(23, 177, 105, .1);
  border: 1px solid rgba(23, 177, 105, .25);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.5;
}
.pf-card input.code-input { width: 100%; margin-bottom: 10px; }

/* 个人页：两个按钮严格同一水平线 */
.pf-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 2px;
}
.pf-row > button {
  flex: 1 1 0;
  height: 44px;
  margin: 0 !important;
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
  vertical-align: middle;
}
.pf-wide { width: 100%; margin-top: 2px; }

/* 拼机中：一起拼机按钮锁定 */
.btn.locked {
  opacity: 0.45;
  filter: grayscale(0.65);
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.7) !important;
  color: var(--muted, #7b86a3) !important;
  border-color: rgba(122, 146, 215, 0.25) !important;
  box-shadow: none !important;
}

/* ---------------------------------------------------------------- 角色名字动效 */
.who-name.role-creator,
.who-name.role-owner,
.who-name.role-mod {
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 800;
}

/* Creater：红 ↔ 淡红 缓慢循环 */
.who-name.role-creator {
  background-image: linear-gradient(90deg, #e63b3b, #ffb3b3, #e63b3b);
  animation: roleCycle 7s linear infinite;
}

/* Mod：深绿 ↔ 淡绿 过渡 */
.who-name.role-mod {
  background-image: linear-gradient(90deg, #0b6b43, #6ee7a8, #0b6b43);
  animation: roleCycle 7s linear infinite;
}

/* Owner：金色缓慢闪烁 */
.who-name.role-owner {
  background-image: linear-gradient(90deg, #b8860b, #ffe07a, #b8860b);
  animation: roleCycle 9s linear infinite, roleGlow 3.4s ease-in-out infinite;
}

@keyframes roleCycle {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes roleGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 215, 110, 0)); }
  50% { filter: drop-shadow(0 0 7px rgba(255, 215, 110, 0.9)); }
}

@media (prefers-reduced-motion: reduce) {
  .who-name.role-creator,
  .who-name.role-owner,
  .who-name.role-mod { animation: none; }
}

/* 身份缩写标签 */
.pf-idline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role-chip {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 1px 5px;
  border-radius: 6px;
  line-height: 1.5;
}
.role-chip.role-creator { color: #e63b3b; background: rgba(230, 59, 59, .12); }
.role-chip.role-owner { color: #a97a00; background: rgba(184, 134, 11, .16); }
.role-chip.role-mod { color: #0b6b43; background: rgba(11, 107, 67, .13); }

/* 名字 + 身份标签一行 */
.who-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.who-line .who-name { min-width: 0; }
.who-line .role-chip { flex: none; }

/* 机台：前 N 个机位固定 */
.mach-tag {
  position: absolute;
  right: 10px;
  top: -9px;
  z-index: 4;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4a6cf7, #5b7cfa);
  border-radius: 9px;
  padding: 2px 8px;
  letter-spacing: .3px;
  box-shadow: 0 3px 8px rgba(74, 108, 247, .3);
}
.blk.pinned { position: relative; }

/* 机台位（第 1 台、第 2 台……）统一用蓝色细线边框标出来 */
.blk.pinned .mcard {
  border-color: rgba(74, 108, 247, 0.55);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.1), 0 6px 16px rgba(74, 108, 247, 0.1);
}
.blk.pinned .mcard,
.blk.pinned .prow { cursor: not-allowed; }
.mach-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.mach-label { font-size: 12px; color: #7b86a3; }
.mach-input {
  width: 62px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(122, 146, 215, .34);
  background: #fff;
  text-align: center;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.mach-save { height: 34px; padding: 0 14px; font-size: 13px; }

/* 选中游客：提示条 + 卡片高亮 */
.pick-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 10px 0 4px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(74, 108, 247, .09);
  border: 1px solid rgba(74, 108, 247, .28);
}
.pick-bar .pk { font-size: 13px; font-weight: 700; color: #3556d8; }
.pick-bar .pk-tip { font-size: 11px; color: #7381a6; line-height: 1.4; }
.mcard.picked,
.prow.picked {
  outline: 2px solid rgba(74, 108, 247, .75);
  outline-offset: -2px;
  background: rgba(74, 108, 247, .08) !important;
}


/* 正在上机的小标签 */
.tag.playing {
  background: linear-gradient(135deg, #2fd07a, #17b169);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(23, 177, 105, .35);
}

/* 机厅设置（单机厅）页 */
.hs-card { margin-bottom: 10px; }
.hs-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.hs-row { display: flex; align-items: center; gap: 8px; }
.hs-row .hs-in { flex: 1 1 auto; margin: 0; }
.hs-row .muted { white-space: nowrap; font-size: 12px; }
.hs-alias { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hs-alias.off { opacity: .38; }
.hs-k { flex: 0 0 58px; font-size: 13px; color: var(--ink); }
.hs-alias .hs-in { flex: 1 1 auto; margin: 0; color: var(--ink); font-size: 14px; }
.hs-pair { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px dashed rgba(122,146,215,.25); }
.hs-pair:first-of-type { border-top: 0; }
.hs-pair button { height: 34px; padding: 0 14px; }
.hs-save { padding: 4px 2px 40px; }
.hs-save button { width: 100%; height: 46px; }

/* 排行榜头像 */
.rank-row .avatar.sm { width: 34px; height: 34px; font-size: 15px; flex: none; margin-right: 2px; }
.avatar.sm.img { position: relative; overflow: hidden; }
.avatar.sm.img .av-letter { position: relative; z-index: 0; }
.avatar.sm.img img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.rank-row { align-items: center; }

/* 称号 */
.title-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.title-chip {
  height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px;
  border: 1px solid rgba(122,146,215,.34); background: #fff; color: var(--ink); cursor: pointer;
}
.title-chip.on { background: linear-gradient(135deg,#4a6cf7,#5b7cfa); color: #fff; border-color: transparent; }
.tag.title { background: rgba(74,108,247,.12); color: #4a6cf7; margin-left: 6px; }
/* 机台自动后移倒计时 */
.auto-cd {
  display: inline-block;
  height: 19px;
  padding: 0 8px;
  border-radius: 9px;
  background: rgba(122, 146, 215, 0.14);
  color: #56628a;
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  white-space: nowrap;
}
.auto-cd.soon {
  background: rgba(227, 59, 59, 0.14);
  color: #e33b3b;
}

/* 排卡里的称号标签 */
.tag.title {
  background: rgba(74, 108, 247, 0.1);
  color: #4a6cf7;
  border: 1px solid rgba(74, 108, 247, 0.22);
}
.who-line .tag,
.who-line .role-chip {
  white-space: nowrap;
}
.who-line .who-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.prow .avatar {
  flex: none;
  margin-top: 2px;
}
/* 个人背景板裁剪弹窗 */
.bgc-frame {
  position: relative;
  overflow: hidden;
  margin: 10px auto 8px;
  border-radius: 12px;
  background: rgba(122, 146, 215, 0.12);
  cursor: grab;
  touch-action: none;
}
.bgc-frame:active { cursor: grabbing; }
.bgc-frame img {
  position: absolute;
  max-width: none;
  user-select: none;
  pointer-events: none;
}
#bgcZoom { width: 100%; margin: 4px 0 10px; accent-color: #4a6cf7; }

/* 有背景板的卡片 */
.mcard.has-bg,
.prow.has-bg,
.rank-row.has-bg {
  border: 1px solid rgba(74, 108, 247, 0.28);
}
/* 背景板：原图直出（不压白纱），亮度 / 模糊由用户自己调 */
.has-bg { position: relative; overflow: hidden; }
.has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bgimg);
  background-size: cover;
  background-position: center;
  z-index: 0;
  pointer-events: none;
}
.has-bg > * { position: relative; z-index: 1; }

/* 个人页：背景板亮度 / 模糊滑块 */
.bg-opt { margin-top: 12px; }
.bg-opt .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.bg-opt .row label { font-size: 12px; color: var(--muted); width: 46px; }
.bg-opt .row input[type=range] { flex: 1; }
.bg-opt .row span { font-size: 12px; color: var(--ink); width: 52px; text-align: right; }
.bg-preview {
  margin-top: 10px;
  height: 62px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(122, 146, 215, 0.28);
}

/* 背景板文字描边：图是原图直出，靠一点点白色描边保证文字可读（不改图片本身） */


/* 排行榜管理 */
.tag.ban {
  background: rgba(227, 59, 59, 0.12);
  color: #e33b3b;
  border: 1px solid rgba(227, 59, 59, 0.28);
}
.rk-acts {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex: none;
  align-items: center;
}
.rk-acts .btn {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  flex: none;
}
.admin-row { display: flex; align-items: center; gap: 10px; }
.admin-row > div:first-child { min-width: 0; flex: 1 1 auto; }
.admin-row .nm { word-break: break-word; }
.admin-row .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 名片信息：白色磨砂小标签（黑背景板下也能看清） */
.who-name,
.dur,
.tag {
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 4px rgba(23, 32, 64, 0.12);
}
.who-name {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  line-height: 1.35;
}
.dur {
  padding: 3px 9px;
  border-radius: 9px;
  color: #1f2a4d;
  font-weight: 800;
}
.since-t {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 7px;
  color: #2b3350;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

/* 封禁提示横幅 */
.ban-banner {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(227, 59, 59, 0.14), rgba(255, 107, 107, 0.18));
  border: 1px solid rgba(227, 59, 59, 0.32);
  color: #a01f1f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

/* 机厅设置里的折叠名单 */
details.fold {
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid rgba(122, 146, 215, 0.25);
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
}
details.fold > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #2b3350;
  list-style: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s;
}
details.fold[open] > summary::before { transform: rotate(90deg); }

/* 身份标签（CTR / OWN / MOD）也加磨砂底板 */
.role-chip {
  background: rgba(255, 255, 255, 0.72) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 4px rgba(23, 32, 64, 0.12);
}

/* 排行榜卡片：标签样式与排卡卡片一致 */
.rank-main { min-width: 0; flex: 1 1 auto; }
.rank-line { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.rank-line .rank-name { min-width: 0; }
.rank-row .since {
  margin-top: 3px;
  font-size: 12px;
}
.rank-row .rank-hours { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.rank-row .rank-hours .dur { font-size: 15px; }

/* 闭店期间排卡功能停用 */
.closed-note {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(227, 59, 59, 0.1);
  border: 1px solid rgba(227, 59, 59, 0.28);
  color: #c22f2f;
  font-size: 13px;
  font-weight: 700;
}
.hall-closed .actions .btn,
.hall-closed .clock-row .btn,
.hall-closed .unpair-row,
.hall-closed #corners {
  opacity: 0.45;
  pointer-events: none;
}
.hall-closed .rm { display: none; }

/* 群里手动加的人：在网页里当游客展示 */
.manual-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px dashed rgba(122, 146, 215, 0.45);
  margin-top: 8px;
}
.manual-row .avatar.man {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b9c4e6, #8e9dc9);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.manual-row .who { flex: 1 1 auto; min-width: 0; }
.manual-row .dur { flex: none; color: #8a94b3; font-weight: 700; }
.manual-row .tag { background: rgba(122, 146, 215, 0.16); color: #5b6789; }

/* 机厅码展示（OWn / CTR 可见） */
.hall-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(74, 108, 247, 0.08);
  border: 1px solid rgba(74, 108, 247, 0.18);
}
.hall-code-row .hall-code {
  font-size: 17px;
  letter-spacing: 2px;
  color: #3a56c9;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.hall-code-row .small-btn {
  margin-left: auto;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 9px;
  border: 1px solid rgba(122, 146, 215, 0.34);
  background: #fff;
  color: #2b3350;
  cursor: pointer;
}

/* 我的机厅列表（绑定过的机厅一键切换） */
.group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(122, 146, 215, 0.22);
  margin-bottom: 8px;
}
.group-row.on {
  background: rgba(74, 108, 247, 0.1);
  border-color: rgba(74, 108, 247, 0.3);
}
.group-row .gr-main { min-width: 0; flex: 1 1 auto; }
.group-row .gr-name { font-size: 14px; font-weight: 700; color: #2b3350; }
.group-row .gr-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 1px;
  font-size: 12px;
}
.group-row .small-btn {
  flex: none;
  height: 30px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 9px;
  border: 1px solid rgba(122, 146, 215, 0.34);
  background: #fff;
  color: #2b3350;
  cursor: pointer;
}

/* 人多模式横幅（>6 人才开启自动后移 / 上机提醒） */
.wide-note {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 176, 66, .18), rgba(255, 120, 60, .14));
  border: 1px solid rgba(255, 140, 60, .35);
  color: #a8500f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

/* 拖动手柄（手机端按住它就能拖，不必长按整张卡） */
.blk { position: relative; }
.grip {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: rgba(90, 105, 150, 0.75);
  font-size: 15px;
  line-height: 1;
  letter-spacing: -1px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  touch-action: none;
  cursor: grab;
  z-index: 6;
}
.grip:active { cursor: grabbing; background: rgba(255, 255, 255, 0.85); }
.blk .mcard { padding-right: 34px; }

/* 微信 / QQ 内置浏览器引导页 */
.bg-guide {
  padding: 26px 18px 40px;
  text-align: center;
}
.bg-arrow {
  font-size: 64px;
  line-height: 1;
  color: #4a6cf7;
  transform: rotate(-8deg);
  margin: 6px auto 10px;
  animation: bgBob 1.6s ease-in-out infinite;
}
@keyframes bgBob {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(-8deg) translateY(-8px); }
}
.bg-title {
  font-size: 24px;
  font-weight: 800;
  color: #22305a;
  letter-spacing: 1px;
}
.bg-body {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: #55618c;
}
.bg-body b { color: #e33b3b; }
.bg-url {
  margin: 16px auto 0;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(74, 108, 247, 0.08);
  border: 1px dashed rgba(74, 108, 247, 0.35);
  color: #4a6cf7;
  font-size: 13px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  word-break: break-all;
}
.bg-copy {
  display: inline-block;
  margin-top: 14px;
  width: 100%;
  max-width: 320px;
  height: 46px;
  line-height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5b7cfa, #4a6cf7);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(74, 108, 247, 0.28);
  border: 0;
}
.bg-skip {
  margin-top: 18px;
  font-size: 13px;
  color: #8a93b5;
  text-decoration: underline;
}
