/* 共用：抖音竖屏安全区结构 */
:root {
  --display: "ZCOOL XiaoWei", "STKaiti", "KaiTi", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--sans);
}

.stage {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 10vh minmax(0, 1fr) 30vh;
}

.safe-bottom {
  display: grid;
  place-items: end center;
  padding-bottom: 2.2vh;
}

.safe-note {
  font-size: 11px;
  letter-spacing: 0.2em;
  opacity: 0.2;
  user-select: none;
}

.work-zone {
  position: relative;
  min-height: 0;
  width: min(720px, 92vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
  padding: 0 2vw;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 22px;
  flex-shrink: 0;
}

.brand h1 {
  font-family: var(--display);
  font-size: clamp(22px, 4.6vw, 30px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand p {
  margin-top: 4px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
  opacity: 0.65;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 12px;
  flex-shrink: 0;
}

.live-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.plotter {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.rail-bar {
  display: grid;
  grid-template-columns: 18px 1fr 18px;
  align-items: center;
  gap: 6px;
  margin: 2px 4px 8px;
  z-index: 2;
}

.rail-end {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.rail-beam {
  position: relative;
  height: 10px;
}

.carriage {
  position: absolute;
  top: 50%;
  left: 18%;
  width: 46px;
  height: 34px;
  transform: translate(-50%, -70%);
  transition: left 0.9s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.carriage-body {
  width: 100%;
  height: 100%;
}

.pen {
  position: absolute;
  left: 50%;
  top: 86%;
  width: 7px;
  height: 28px;
  transform: translateX(-50%) rotate(12deg);
  transform-origin: top center;
}

.pen.writing { animation: scribble 0.26s ease-in-out 4; }

@keyframes scribble {
  0%, 100% { transform: translateX(-50%) rotate(12deg) translateY(0); }
  50% { transform: translateX(-50%) rotate(6deg) translateY(3px); }
}

.paper-roll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.paper-head {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.28em;
  margin-bottom: 8px;
  opacity: 0.45;
}

.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.rule {
  padding: 10px 8px;
  text-align: center;
}

.rule em {
  display: block;
  font-style: normal;
  font-size: 11px;
  margin-bottom: 4px;
  opacity: 0.55;
}

.rule strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(15px, 3.4vw, 18px);
  font-weight: 400;
  line-height: 1.2;
}

.rule span {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  padding: 2px 7px;
}

.result-stage {
  position: relative;
  margin-top: 12px;
  min-height: 96px;
  display: grid;
  place-items: center;
}

.result-ticker {
  min-height: 18px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0.5;
}

.card {
  width: min(100%, 420px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  animation: card-in 0.4s ease forwards;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 20px;
  flex-shrink: 0;
}

.card .meta { flex: 1; min-width: 0; }
.card .badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  margin-bottom: 3px;
}

.card .nick {
  font-family: var(--display);
  font-size: clamp(18px, 4vw, 24px);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .tip {
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.55;
}

.card .times {
  font-family: var(--display);
  font-size: 22px;
}

.sales-banner {
  position: absolute;
  left: 50%;
  top: 18%;
  width: min(92%, 520px);
  transform: translate(-50%, -8px);
  padding: 14px 16px;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sales-banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sales-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 3px 8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.sales-text {
  font-family: var(--display);
  font-size: clamp(18px, 4.2vw, 26px);
  line-height: 1.35;
}

.queue-hint {
  min-height: 16px;
  text-align: center;
  font-size: 12px;
  opacity: 0.55;
}

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.particles span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  animation: float-up linear infinite;
}

@keyframes float-up {
  0% { transform: translateY(35vh); opacity: 0; }
  25% { opacity: 0.6; }
  100% { transform: translateY(-10vh); opacity: 0; }
}

@media (min-aspect-ratio: 1/1) {
  .stage { grid-template-rows: 8vh minmax(0, 1fr) 28vh; }
  .work-zone { width: min(560px, 46vw); }
}

@media (max-height: 720px) {
  .rule { padding: 8px 6px; }
  .result-stage { min-height: 78px; }
}
