:root {
  --text: #0d3557;
  --muted: #64809c;
  --brand: #0068e5;
  --brand2: #10b981;
  --sky: #00a4ff;
  --teal: #00c4b3;
  --danger: #e11d48;
  --line: rgba(0, 82, 217, .14);
  --card: rgba(255, 255, 255, .82);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 12% -10%, #d3e9ff 0%, transparent 55%),
    radial-gradient(900px 600px at 95% 8%, #d5f7e8 0%, transparent 50%),
    linear-gradient(160deg, #f2f8ff 0%, #ffffff 45%, #ecfbf3 100%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

button, input, textarea { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 82, 217, .07);
}

/* ================= 大屏 ================= */
.screen-wrap {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 20px;
  padding: 22px 26px;
  height: 100vh;
}

.screen-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.screen-head h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #0052d9, #00a4ff 55%, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.screen-head .sub { color: var(--muted); font-size: 15px; }
.screen-head .spacer { flex: 1; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  background: rgba(0, 104, 229, .08);
  border: 1px solid rgba(0, 104, 229, .22);
  color: #0a5bb5;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; }
.dot.off { background: #e11d48; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px 10px;
  font-size: 19px;
  font-weight: 600;
}

.panel-title .tag {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.cloud-panel, .race-panel { display: flex; flex-direction: column; overflow: hidden; }
.cloud-panel { position: relative; }
.cloud-panel .empty { position: absolute; left: 0; right: 0; top: 52px; bottom: 152px; pointer-events: none; }
#cloudCanvas { flex: 1; width: 100%; min-height: 0; display: block; }

.empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 15px;
}

/* 开放题滚动区 */
.barrage {
  height: 150px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  position: relative;
  padding: 0 20px;
}

.barrage-inner { transition: transform .5s ease; }
.barrage-item {
  padding: 7px 0;
  font-size: 16px;
  color: #2c5f8a;
  border-bottom: 1px dashed rgba(0, 82, 217, .12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= 主持人 ================= */
.host-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 22px 60px; }
.host-wrap h1 {
  font-size: 26px;
  margin: 0 0 4px;
  background: linear-gradient(90deg, #0052d9, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.host-wrap .desc { color: var(--muted); margin-bottom: 22px; font-size: 14px; }

.host-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.card { padding: 20px; }
.card h3 { margin: 0 0 14px; font-size: 17px; }

.btn {
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: .15s;
}

.btn:hover { background: #f2f8ff; }
.btn.primary { background: linear-gradient(90deg, #0068e5, #00a4ff); border: none; color: #ffffff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: rgba(225, 29, 72, .07); border-color: rgba(225, 29, 72, .35); color: #d61f4c; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.qr-box { display: flex; gap: 18px; align-items: center; }
.qr-box .qr {
  width: 168px; height: 168px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  flex: none;
}
.qr-box .qr img, .qr-box .qr svg { width: 100%; height: 100%; display: block; }
.qr-meta { font-size: 13px; color: var(--muted); line-height: 1.9; word-break: break-all; }
.qr-meta b { color: var(--text); font-weight: 600; }

.stat-row { display: flex; gap: 22px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.stat-row b { color: var(--text); font-size: 20px; }

select, .input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 12px;
}

/* ================= 手机端 ================= */
.m-wrap { max-width: 560px; margin: 0 auto; padding: 22px 18px 60px; }
.m-head { text-align: center; margin-bottom: 20px; }
.m-head h1 {
  font-size: 23px;
  margin: 0 0 6px;
  background: linear-gradient(90deg, #0052d9, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.m-head p { margin: 0; color: var(--muted); font-size: 14px; }

.q-card { padding: 18px; margin-bottom: 14px; }
.q-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.q-hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.opt {
  display: block;
  padding: 13px 16px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 16px;
  cursor: pointer;
  transition: .15s;
}

.opt:last-child { margin-bottom: 0; }
.opt.on {
  background: linear-gradient(90deg, rgba(0, 104, 229, .1), rgba(16, 185, 129, .1));
  border-color: #00a4ff;
}

.submit {
  width: 100%;
  padding: 15px;
  margin-top: 18px;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(90deg, #0068e5, #00a4ff 55%, #10b981);
  cursor: pointer;
}

.submit:disabled { opacity: .5; }

.done { text-align: center; padding: 50px 20px; }
.done .ico { font-size: 52px; margin-bottom: 14px; color: #10b981; }
.done h2 { margin: 0 0 8px; font-size: 21px; }
.done p { color: var(--muted); font-size: 15px; }

.mini-cloud { margin-top: 22px; padding: 16px; }
.mini-cloud canvas { width: 100%; height: 220px; display: block; }

.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  padding: 11px 20px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 82, 217, .15);
  font-size: 15px;
  z-index: 999;
  animation: pop .25s ease;
}

@media (max-width: 900px) {
  .screen-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
}
