* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --accent: #6c8cff;
  --accent-hover: #5a7bf0;
  --text: #e8eaf0;
  --muted: #9aa0ad;
  --error: #ff6b6b;
}

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.view {
  min-height: 100vh;
}

/* 登录 */
#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.card h1 {
  font-size: 24px;
  text-align: center;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 6px;
}

.card input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2c303a;
  background: #12141a;
  color: var(--text);
  font-size: 15px;
}

.card input:focus {
  outline: none;
  border-color: var(--accent);
}

.card button {
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.card button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.error {
  color: var(--error);
  font-size: 14px;
  text-align: center;
  min-height: 18px;
}

/* 主界面 */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--card);
  border-bottom: 1px solid #23262f;
}

.spacer {
  flex: 1;
}

.remaining {
  color: var(--accent);
  font-weight: 600;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.link-btn:hover {
  color: var(--text);
}

.draw-area {
  text-align: center;
  padding: 28px 20px 8px;
}

.draw-btn {
  font-size: 20px;
  padding: 14px 40px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

.draw-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.draw-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.draw-btn:disabled {
  background: #3a3f4b;
  cursor: not-allowed;
}

.hint {
  color: var(--muted);
  margin-top: 12px;
  min-height: 20px;
}

/* 倒计时确认条 */
.confirm-bar {
  max-width: 560px;
  margin: 0 auto 8px;
  padding: 16px 24px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid #2c303a;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.confirm-row {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  justify-content: center;
}

.timer-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #23262f;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.confirm-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-weight: 600;
}

.confirm-btn:active {
  transform: scale(0.96);
}

.redraw-btn-style {
  background: #f0922b;
  color: #fff;
}

.redraw-btn-style:hover {
  background: #e07e1e;
}

.redraw-btn-style:disabled {
  background: #3a3f4b;
  cursor: not-allowed;
}

.confirm-btn-style {
  background: #4caf7d;
  color: #fff;
}

.confirm-btn-style:hover {
  background: #3d9e6a;
}

.timer-track {
  width: 100%;
  height: 4px;
  background: #2c303a;
  border-radius: 2px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: var(--accent);
  width: 100%;
  border-radius: 2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  padding: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.grid figure {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
