/* 后台管理美化 */
.admin-header {
  width: 100%;
  padding: 36px 0 10px 0;
  text-align: center;
}
.admin-main {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 48px;
}
.admin-card {
  background: var(--bg-card-light, #fff);
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: 28px 28px 18px 28px;
  margin-bottom: 18px;
}
.admin-subcard {
  background: #f7fafd;
  border: 1px solid #e5e7eb;
  margin-bottom: 18px;
  padding: 18px 20px 10px 20px;
  border-radius: 12px;
  box-shadow: none;
}
.admin-login-card {
  max-width: 340px;
  margin: 0 auto 32px auto;
}
.admin-section-title {
  color: #020617;
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 10px;
}
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-label {
  font-weight: bold;
  margin-bottom: 2px;
  color: #222;
}
.admin-input, .admin-textarea {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  color: #222;
  margin-bottom: 6px;
}
.admin-textarea {
  min-height: 60px;
  resize: vertical;
}
.admin-btn {
  padding: 7px 18px;
  border: none;
  border-radius: 6px;
  background: #e5e7eb;
  color: #222;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.admin-btn-primary {
  background: #2d8cf0;
  color: #fff;
  font-weight: bold;
}
.admin-btn-small {
  padding: 4px 12px;
  font-size: 0.95rem;
}
.admin-btn:hover {
  background: #dbeafe;
}
.admin-btn-primary:hover {
  background: #2563eb;
}
.admin-flex-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
  margin-bottom: 8px;
}

/* 第一行：名称（左） + 文件选择（中） + 删除（右） */
.admin-flex-row .admin-input {
  grid-column: 1 / 2;
  min-width: 0;
}

.admin-flex-row input[type="file"] {
  grid-column: 2 / 3;
  max-width: 160px;
}

.admin-flex-row .admin-btn-small {
  grid-column: 3 / 4;
  justify-self: end;
  white-space: nowrap;
}

/* 第二行：预览图单独占左侧一整列 */
.admin-flex-row img {
  grid-column: 1 / 2;
  width: 70px;
  height: 70px;
  border-radius: 6px;
  object-fit: cover;
}
.admin-results {
  margin-bottom: 10px;
  color: #222;
}
.feedback {
  margin-top: 8px;
  font-size: 0.98rem;
  min-height: 1.2em;
}
.feedback.info {
  color: #2563eb;
}
.feedback.success {
  color: #22c55e;
}
.feedback.error {
  color: #ef4444;
}
:root {
  color-scheme: light dark;
  --bg: #0b1026;
  --bg-card: rgba(255, 255, 255, 0.08);
  --bg-card-light: rgba(0, 0, 0, 0.045);
  --accent: #4ade80;
  --accent-strong: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --danger: #f87171;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(160deg, #0f172a, #1e293b 55%, #020617 100%);
  color: var(--text-primary);
}

header {
  width: min(1100px, 90vw);
  padding: 48px 24px 16px;
  text-align: center;
}

header h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: 1px;
}

header p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

main {
  width: min(1100px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 48px;
}

.timer-card,
.qr-card,
.vote-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.45);
}

.timer-card h2,
.qr-card h2,
.vote-card h2 {
  margin: 0 0 16px;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
}

/* 大屏：计时 + 二维码并排布局 */
.timer-qr-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1.1fr);
  gap: 24px;
  align-items: center;
}

.timer-qr-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timer-qr-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.timer-qr-right .qr-wrapper {
  margin: 0;
}

.timer-qr-right .qr-wrapper img {
  width: 300px;
  height: 300px;
}

.timer-qr-note {
  font-size: 1rem;
  color: var(--text-secondary);
}

.countdown {
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
}

.countdown.closed {
  color: var(--danger);
}

.participant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.participant-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(148, 163, 184, 0.05));
  border-radius: 20px;
  padding: 24px;
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.3);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.participant-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 222, 128, 0.5);
  box-shadow: 0 12px 30px rgba(74, 222, 128, 0.25);
}

.participant-card.leader {
  border: 2px solid var(--accent-strong);
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.35);
}

.participant-name {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.participant-votes {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 1px;
}

/* 摇一摇排行榜样式：姓名学号大，次数说明小 */
.shake-main-line {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.shake-sub-line {
  font-size: 1.3rem;
  font-weight: 500;
  /* color: var(--text-secondary); */
}

.participant-progress {
  margin-top: 12px;
  height: 8px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.participant-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #6366f1, #ec4899);
  transition: width 0.4s ease;
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qr-wrapper img {
  width: min(320px, 65vw);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.6);
  background: #fff;
  padding: 16px;
}

.notice {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.vote-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.vote-button {
  padding: 18px;
  border-radius: 18px;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(74, 222, 128, 0.12);
  color: var(--text-primary);
  border: 1px solid rgba(74, 222, 128, 0.35);
  transition: transform 0.25s ease, background 0.25s ease;
  display: inline-block;
  text-align: center;
}

/* 摇一摇开启按钮单独居中 */
.shake-enable-button {
  display: block;
  margin: 8px auto 4px;
  max-width: 260px;
}

.vote-button:hover,
.vote-button:focus {
  transform: translateY(-2px);
  background: rgba(74, 222, 128, 0.24);
  outline: none;
}

.vote-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.feedback {
  margin-top: 16px;
  text-align: center;
  min-height: 24px;
  font-size: 1rem;
}

.feedback.success {
  color: var(--accent);
}

.feedback.error {
  color: var(--danger);
}

@media (max-width: 768px) {
  header {
    padding-top: 32px;
  }

  .participant-card {
    padding: 20px;
  }

  .vote-button {
    font-size: 1rem;
    padding: 16px;
  }
}
