/* ============================================================
   京大口腔广场舞大赛 · 投票 H5
   纸质票根 + 蓝墨印刷（与小程序同一套 token）
   一句话：把首页当一张印出来的赛事票根来排
   ============================================================ */

:root {
  --ink: #0e2b47;
  --ink-2: #5a7793;
  --ink-3: #93a6b9;
  --brand: #1e6be6;
  --brand-deep: #0f3e9e;
  --brand-dark: #0b2a6b;
  --soft: #eaf2ff;
  --paper: #f4f7fb;
  --line: #e2ebf6;
  --line-soft: #f0f5fb;
  --tear: #d6e5f6;
  --gold: #c9922f;
  --gold-lite: #e8be6e;
  --wechat: #07c160;

  --sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "微软雅黑", sans-serif;

  --gutter: 14px;
  --card: 14px;
  --btn: 9px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  /* 锁死缩放：只允许上下滚动，双指放大与双击放大都禁用 */
  touch-action: pan-y;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-y: none;
}

button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 印刷网格：只在纸面留白处若隐若现，给"印出来的东西"一点纸感 */
.floor {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 107, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 107, 230, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, #000 26%, #000 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, #000 26%, #000 100%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 92px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 50px;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 107, 230, 0.14);
}

.ticket-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 4px 10px;
  color: var(--brand);
  background: var(--soft);
  border: 1px solid rgba(30, 107, 230, 0.24);
  border-radius: 7px;
  font-size: 11.5px;
}

.ticket-chip b {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.chip-label { opacity: 0.82; }

/* ---------------- 视图切换 ---------------- */
.view { display: none; }
.view.is-active { display: block; }

/* ---------------- 海报：票根上半联 ---------------- */
.poster {
  position: relative;
  margin: 12px var(--gutter) 0;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(14, 43, 71, 0.04);
  animation: rise 0.6s cubic-bezier(0.22, 0.68, 0.3, 1) both;
}

/* 轮播头图 */
.hero {
  position: relative;
  height: 206px;
  border-radius: 2px;
  overflow: hidden;
  background: linear-gradient(155deg, #dcebfb 0%, #c0dbf7 100%);
}

.hero-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0.1, 0.2, 1);
}

.hero-track img {
  flex: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
  display: block;
}

/* 照片上的内嵌细框：像一张贴上去的相纸 */
.hero::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 1px;
  pointer-events: none;
  z-index: 2;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
}

.hero-dots i {
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.3s ease, background 0.3s ease;
}

.hero-dots i.on {
  width: 14px;
  background: #fff;
}

/* ---------------- 倒计时 ---------------- */
.countdown {
  margin: 9px var(--gutter) 0;
  padding: 11px 16px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  animation: rise 0.6s 0.08s cubic-bezier(0.22, 0.68, 0.3, 1) both;
}

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

.cd-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.cd-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 107, 230, 0.13);
}

.cd-digits {
  display: flex;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}

.cd-digits b {
  min-width: 24px;
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}

.cd-digits i {
  font-style: normal;
  font-size: 10px;
  color: var(--ink-3);
  margin: 0 4px 0 1px;
}

.cd-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.countdown.is-over .cd-label::before {
  background: var(--ink-3);
  box-shadow: none;
}

.countdown.is-over .cd-digits b {
  color: var(--ink-2);
}

/* ---------------- 票根带：整页唯一的饱和色 ---------------- */
.tickets {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 9px var(--gutter) 0;
  padding: 15px 20px;
  background: linear-gradient(100deg, #1e6be6 0%, #1656c8 100%);
  border-radius: 4px;
  overflow: hidden;
  color: #fff;
  animation: rise 0.6s 0.05s cubic-bezier(0.22, 0.68, 0.3, 1) both;
}

/* 撕口虚线 + 两端打孔缺口 */
.tickets::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  border-top: 2px dashed rgba(255, 255, 255, 0.42);
}

/* 两端打孔：孔被带边裁掉一半，像从票本上撕下来 */
.tickets > .notch {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tickets > .notch:nth-child(2) {
  left: auto;
  right: 0;
  transform: translate(50%, -50%);
}

.stamps { display: flex; gap: 8px; flex: none; }

.stamp {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.stamp.is-used {
  color: transparent;
  background: rgba(255, 255, 255, 0.2);
}

.stamp.is-used::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.96);
}

.stamp.is-stamping { animation: stamp 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.35); }

.tickets-copy {
  font-size: 12.5px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.94);
  text-align: right;
}

.tickets-copy b {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}

/* ---------------- 公告 / 分区标题 ---------------- */
.notice {
  margin: 12px var(--gutter) 0;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #24507f;
  background: var(--soft);
  border-left: 3px solid rgba(30, 107, 230, 0.35);
  border-radius: 0 8px 8px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px var(--gutter) 10px;
  padding: 0 2px;
}

.section-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.section-head h2::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand);
}

.section-head--page { margin-top: 14px; }

.head-note {
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 队伍卡 ---------------- */
.team-list {
  display: grid;
  gap: 10px;
  padding: 0 var(--gutter);
}

.team {
  display: flex;
  gap: 11px;
  padding: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card);
  transition: border-color 0.2s ease;
}

.team.is-top { border-color: rgba(30, 107, 230, 0.28); }

.thumb {
  position: relative;
  flex: none;
  width: 82px;
  height: 102px;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(155deg, #dcebfb 0%, #c0dbf7 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

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

.rank-chip {
  position: absolute;
  left: 0;
  bottom: 0;
  min-width: 20px;
  padding: 1px 6px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #fff;
  background: rgba(14, 43, 71, 0.58);
  border-radius: 0 7px 0 0;
  font-variant-numeric: tabular-nums;
}

.voted-mark {
  position: absolute;
  right: 4px;
  top: 4px;
  padding: 1px 5px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #fff;
  background: rgba(30, 107, 230, 0.9);
  border-radius: 3px;
  transform: rotate(-4deg);
}

.team-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }

.team h3 {
  font-size: 17px;
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.team-slogan {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-meta {
  margin-top: 5px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}

.team-foot {
  margin-top: auto;
  padding-top: 9px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.votes {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1;
}

/* 票数用墨色，强调色让给按钮 */
.votes b {
  font-size: 23px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
}

.votes span { font-size: 10px; color: var(--ink-3); }

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

/* ---------------- 按钮 ---------------- */
.btn-primary,
.btn-ghost,
.btn-code,
.btn-wechat {
  border: 0;
  transition: transform 0.12s ease, background 0.16s ease, opacity 0.16s ease;
}

.btn-primary {
  height: 36px;
  min-width: 76px;
  padding: 0 15px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(180deg, #2a7bf0 0%, #1550be 100%);
  border-radius: var(--btn);
  box-shadow: 0 3px 9px rgba(20, 60, 140, 0.24);
}

.btn-primary:active { transform: translateY(1px) scale(0.985); }

.btn-primary:disabled,
.btn-primary.is-done {
  color: #7e93a8;
  background: #edf2f8;
  box-shadow: none;
  letter-spacing: 0.05em;
  font-weight: 500;
  cursor: default;
}

.btn-ghost {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--brand);
  background: #fff;
  border: 1px solid rgba(30, 107, 230, 0.3);
  border-radius: var(--btn);
}

.btn-ghost:active { background: var(--soft); }

.btn-wide { width: 100%; height: 44px; font-size: 15px; }

.list-foot {
  margin: 12px var(--gutter) 0;
  padding: 0 2px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* ---------------- 排行榜 ---------------- */
.champ {
  position: relative;
  margin: 0 var(--gutter);
  padding: 7px;
  background: linear-gradient(150deg, #0b2a6b 0%, #14509f 58%, #1e6be6 100%);
  border-radius: 4px;
  color: #fff;
  overflow: hidden;
  animation: rise 0.5s cubic-bezier(0.22, 0.68, 0.3, 1) both;
}

.champ-frame {
  position: relative;
  padding: 14px 16px 16px;
  border: 1px solid rgba(201, 146, 47, 0.55);
  border-radius: 2px;
}

.champ-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 2px;
  color: var(--gold-lite);
}

.champ-top .where {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.6);
}

.champ h3 {
  margin-top: 9px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding-right: 58px;
}

.champ-votes {
  margin-top: 5px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.champ-votes b {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.champ-votes span {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold-lite);
}

.champ-slogan {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  padding-right: 46px;
}

.seal {
  position: absolute;
  right: 15px;
  bottom: 13px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--gold-lite);
  border: 1px solid rgba(201, 146, 47, 0.5);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.rank-list {
  margin: 12px var(--gutter) 0;
  padding: 2px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card);
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.rank-row .num {
  flex: none;
  width: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.rank-row.is-medal .num { color: var(--gold); }

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

.rank-row .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row .sub-line {
  margin-top: 1px;
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar {
  margin-top: 8px;
  height: 3px;
  background: #e6eefa;
  border-radius: 2px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(30, 107, 230, 0.55), var(--brand));
  border-radius: 2px;
}

.rank-row .score {
  flex: none;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.rank-row .score em {
  font-style: normal;
  margin-left: 2px;
  font-size: 10px;
  font-weight: 400;
  color: var(--ink-3);
}

/* ---------------- 我的 ---------------- */
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 var(--gutter);
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card);
}

.avatar {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(155deg, #2a7bf0, #1550be);
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 3px 9px rgba(20, 60, 140, 0.2);
}

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

.profile-body { min-width: 0; }

.profile-body h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag {
  padding: 0 5px;
  font-size: 10px;
  line-height: 16px;
  border-radius: 3px;
  color: var(--brand);
  background: var(--soft);
}

.stat-grid {
  display: flex;
  margin: 10px var(--gutter) 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card);
  overflow: hidden;
}

.stat {
  flex: 1;
  padding: 13px 14px 15px;
  text-align: left;
}

.stat + .stat { border-left: 1px dashed var(--tear); }

.stat b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}

.login-card {
  margin: 10px var(--gutter) 0;
  padding: 18px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card);
}

.login-card h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.login-card p {
  margin: 6px 0 14px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.login-card .btn-ghost { height: 42px; font-size: 14px; margin-top: 8px; }

.sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px var(--gutter) 8px;
  padding: 0 2px;
}

.sub-head h3 {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sub-head span { font-size: 11.5px; color: var(--ink-3); }

.history {
  margin: 0 var(--gutter);
  padding: 2px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card);
}

.history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--ink);
}

.history li:last-child { border-bottom: 0; }

.history time {
  flex: none;
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.empty {
  margin: 0 var(--gutter);
  padding: 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--card);
}

/* ---------------- 规则 ---------------- */
.rules {
  margin: 12px var(--gutter) 0;
  padding: 15px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card);
}

.rules h3 {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.rules ol { margin-top: 8px; counter-reset: rule; }

.rules li {
  position: relative;
  counter-increment: rule;
  padding-left: 22px;
  margin-bottom: 7px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-2);
}

.rules li::before {
  content: counter(rule) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.privacy {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-3);
}

.site-foot {
  margin: 16px var(--gutter) 0;
  padding-bottom: 6px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.9;
  color: var(--ink-3);
}

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 5px 0;
  background: none;
  border: 0;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.tab svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.is-active { color: var(--brand); font-weight: 600; }

.tab.is-active::after {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--brand);
}

/* ---------------- 弹层 ---------------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 42, 107, 0.38);
  backdrop-filter: blur(3px);
  animation: fade 0.24s ease both;
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 18px 18px 0 0;
  animation: sheet-up 0.3s cubic-bezier(0.22, 0.68, 0.3, 1) both;
}

.sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 0;
  border-radius: 50%;
  color: var(--ink-2);
}

.sheet-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.video-panel { padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-top: 24px;
  background: #0e2b47;
  border-radius: 10px;
  overflow: hidden;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0e2b47;
}

.video-wrap video[data-empty="1"] { display: none; }

.video-empty {
  position: absolute;
  inset: 0;
  background-position: 50% 42%;
  background-size: cover;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  padding: 18px;
  text-align: center;
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(30, 107, 230, 0.22), transparent 70%),
    linear-gradient(160deg, #16395c 0%, #0b2440 100%);
}

.video-empty[hidden] { display: none; }

.video-empty .empty-title { color: #fff; }

.video-empty .empty-sub { color: rgba(255, 255, 255, 0.62); }

.empty-play {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.empty-play svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.empty-play svg path { fill: currentColor; stroke: none; }

.empty-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.empty-sub {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 258px;
}

.video-info { padding-top: 14px; }

.video-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.video-head h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.rank-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.video-slogan {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}

.video-meta {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.video-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-foot .votes b { font-size: 26px; }

.video-foot .btn-wide { flex: 1; }

/* ---------------- 登录 ---------------- */
.login-panel h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding-right: 40px;
}

.login-sub {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.btn-wechat {
  width: 100%;
  height: 46px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #f4fff8;
  background: var(--wechat);
  border-radius: 10px;
}

.btn-wechat svg { width: 21px; height: 21px; fill: currentColor; }
.btn-wechat:active { opacity: 0.9; }

.wechat-hint {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.field {
  display: block;
  margin-bottom: 10px;
  padding: 7px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--btn);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.field:focus-within {
  border-color: rgba(30, 107, 230, 0.5);
  background: #fff;
}

.field-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.field input {
  width: 100%;
  padding: 2px 0;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.field input::placeholder { color: var(--ink-3); opacity: 0.75; letter-spacing: 0; }

.code-row { display: flex; align-items: center; gap: 8px; }

.btn-code {
  flex: none;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--brand);
  background: #fff;
  border: 1px solid rgba(30, 107, 230, 0.3);
  border-radius: 7px;
}

.btn-code[disabled] { color: var(--ink-3); border-color: var(--line); background: var(--paper); }

.form-error {
  margin: 4px 0 0;
  font-size: 12px;
  color: #c9352c;
}

.demo-code {
  margin: 8px 0 0;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--brand);
  background: var(--soft);
  border-radius: 7px;
}

#phoneForm { margin-top: 14px; }

.login-legal {
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--ink-3);
}

#phoneForm .btn-primary { margin-top: 10px; }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 60;
  max-width: 84vw;
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.45;
  color: #fff;
  text-align: center;
  background: rgba(11, 42, 107, 0.95);
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(11, 42, 107, 0.28);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* 弹层打开时，提示改到上方，避免压住表单 */
.toast.is-high {
  top: 15%;
  bottom: auto;
  transform: translate(-50%, -8px);
}

.toast.is-high.is-show { transform: translate(-50%, 0); }

/* ---------------- 动效 ---------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes stamp {
  0% { transform: scale(1.5); opacity: 0.3; }
  60% { transform: scale(0.94); opacity: 1; }
  100% { transform: scale(1); }
}

/* 极窄屏（320–345px）：压缩封面与按钮，避免按钮顶出卡片 */
@media (max-width: 350px) {
  .thumb { width: 72px; height: 92px; }
  .actions { gap: 6px; }
  .btn-primary { min-width: 64px; padding: 0 11px; font-size: 13px; letter-spacing: 0.02em; }
  .btn-ghost { padding: 0 9px; font-size: 12.5px; }
  .votes b { font-size: 21px; }
  .tickets-copy { font-size: 12px; }
  .stamp { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media (min-width: 560px) {
  .app {
    background: var(--paper);
    box-shadow: 0 0 0 1px var(--line);
  }
}

/* ============================================================
   队伍详情页（与设计稿 1:1 对齐）
   ============================================================ */
.app.is-detail .topbar,
.app.is-detail .tabbar { display: none; }
.app.is-detail { padding-bottom: 78px; }

.detail-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.detail-nav-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.detail-back {
  position: absolute;
  left: calc(var(--gutter) - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink);
}

.detail-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 封面：整幅出血 + 内嵌细框 + 压暗渐变 */
.detail-cover {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(155deg, #dcebfb 0%, #c0dbf7 100%);
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  display: block;
}

.detail-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 42, 107, 0.16) 0%, rgba(11, 42, 107, 0) 34%, rgba(11, 42, 107, 0.46) 100%);
  pointer-events: none;
}

.detail-frame {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
}

.detail-no {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(14, 43, 71, 0.58);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.detail-wrap { padding: 14px var(--gutter) 22px; }

/* 队名 + 总票数 */
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.detail-head-l { flex: 1; min-width: 0; }

.detail-name {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.5px;
  color: var(--ink);
}

.detail-sub {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.2px;
}

.detail-total {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding-top: 2px;
}

.detail-total b {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.detail-total i {
  font-style: normal;
  font-size: 10px;
  color: var(--ink-3);
}

/* 口号 */
.slogan-box {
  margin-top: 10px;
  padding: 12px 14px;
  border-left: 3px solid rgba(30, 107, 230, 0.35);
  background: var(--soft);
  border-radius: 0 9px 9px 0;
  font-size: 13px;
  line-height: 1.7;
  color: #24507f;
}

.slogan-box:empty { display: none; }

/* 段落标题：左侧蓝色短竖条 */
.section-title {
  margin: 20px 0 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
}

.section-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--brand);
}

.section-title em {
  font-style: normal;
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.3px;
  color: var(--ink-3);
  margin-left: 2px;
}

.section-title em:empty { display: none; }

/* 参赛作品：有视频放播放器，没有就封面 + 待上传 */
.video-frame {
  position: relative;
  height: 186px;
  border-radius: 13px;
  overflow: hidden;
  background: #0b2a6b;
}

.video-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  display: block;
}

.video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 42, 107, 0) 42%, rgba(11, 42, 107, 0.62) 100%);
  pointer-events: none;
}

.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #06183a;
}

.video-frame.is-playing::after { display: none; }
.video-frame.is-playing img,
.video-frame.is-playing .vf-play { display: none; }
/* 真视频播放时，标题条让位给原生控件 */
.video-frame.is-playing .vf-meta { display: none; }

.vf-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  margin: -32px 0 0 -27px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(9, 32, 70, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.vf-play::before {
  content: "";
  margin-left: 3px;
  width: 0;
  height: 0;
  border-left: 13px solid var(--brand-deep);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.vf-dur {
  position: absolute;
  right: 11px;
  top: 11px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(9, 32, 70, 0.55);
  color: #fff;
  font-size: 9.5px;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.vf-meta {
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 11px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
}

.vf-meta b {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.4;
}

.vf-meta i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.72);
}

.vf-tag {
  flex: none;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  font-size: 9.5px;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

/* 队伍资料 */
.kvcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2px 16px;
}

.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f5fb;
  font-size: 13px;
}

.kv:last-child { border-bottom: 0; }

.kv .k { color: var(--ink-2); letter-spacing: 0.4px; }

.kv .v {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.detail-note {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-3);
  text-align: center;
}

/* 底部：今日剩余 + 通栏投票 */
.detail-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  padding: 9px var(--gutter) calc(9px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.detail-bar-l { flex: none; }

.bk {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-3);
}

.bv {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.bv b {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.bv i {
  font-style: normal;
  font-size: 10px;
  color: var(--ink-3);
}

.detail-vote {
  flex: 1;
  min-width: 0;
  height: 38px;
  font-size: 14px;
}

/* 队伍卡片：整卡可点 */
.team { cursor: pointer; }
.team:active { background: #fbfdff; }

/* 视频弹层里的「查看详情」 */
.video-more {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 10px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--brand);
}

.video-more svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 350px) {
  .detail-cover { height: 210px; }
  .video-frame { height: 164px; }
  .detail-name { font-size: 21px; }
  .detail-total b { font-size: 24px; }
  .detail-vote { font-size: 13px; }
}
