/* 流明之路 · 样式
 * 配色沿用主站：底色 #05070a，橙色强调 #f0873e，其余靠留白与细线分层。
 */

:root {
  --bg: #05070a;
  --ink: #f4f5f7;
  --ink-soft: rgba(244, 245, 247, 0.74);
  --ink-muted: rgba(244, 245, 247, 0.48);
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.07);
  --orange: #f0873e;
  --orange-hot: #ffb06a;
  --panel: rgba(13, 18, 25, 0.92);
  --label: "Archivo", "Noto Sans SC", "PingFang SC", sans-serif;
  --body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 58% 42% at 78% 4%, rgba(240, 135, 62, 0.10), transparent 62%),
    radial-gradient(ellipse 46% 40% at 12% 96%, rgba(107, 124, 255, 0.09), transparent 58%);
  color: var(--ink);
  font-family: var(--body);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

.app {
  height: 100%;
  /* dvh：手机上地址栏收起/弹出时视口高度会变，用它才不会留白或被裁 */
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(14px, 3vw, 30px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  border: 1px solid rgba(240, 135, 62, 0.42);
  background: radial-gradient(circle at 32% 32%, rgba(255, 190, 130, 0.5), transparent 62%);
}

.mark::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 220, 180, 0.9), rgba(255, 220, 180, 0));
  box-shadow: 0 0 6px rgba(255, 186, 116, 0.6);
}

.brand-text h1 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-text p {
  margin: 1px 0 0;
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hud {
  margin-left: auto;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.hud-item {
  min-width: 62px;
  padding: 6px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  text-align: right;
}

.hud-item .k {
  display: block;
  font-family: var(--label);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hud-item .v {
  display: block;
  margin-top: 2px;
  font-family: var(--label);
  font-size: 0.98rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- 棋盘区 ---------- */

.stage {
  position: relative;
  min-height: 0;
  padding: 0 clamp(10px, 2.4vw, 26px);
}

#board {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
  cursor: pointer;
  /* 长按是反向旋转的手势，不能让系统弹出选中菜单或放大镜 */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* 焦点指示：画布内有橙色光标，外框只要一线就够 */
#board:focus { outline: none; }

#board:focus-visible {
  outline: 1px solid rgba(240, 135, 62, 0.5);
  outline-offset: -2px;
}

.level-badge {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 11, 16, 0.7);
  backdrop-filter: blur(6px);
  pointer-events: none;
  white-space: nowrap;
}

.level-badge .name {
  font-size: 0.84rem;
  font-weight: 500;
}

.level-badge .goal {
  font-family: var(--label);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--orange-hot);
  padding-left: 10px;
  border-left: 1px solid var(--line-soft);
}

.level-badge .hint {
  font-size: 0.74rem;
  color: var(--ink-muted);
}

/* ---------- 底部工具条 ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 12px clamp(12px, 3vw, 30px) 16px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 0.84rem;
  padding: 9px 20px;
  min-height: 40px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.12s ease;
}

.btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.btn:active:not(:disabled) { transform: translateY(1px); }

.btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.btn:focus-visible {
  outline: 2px solid var(--orange-hot);
  outline-offset: 3px;
}

.btn.primary {
  border-color: rgba(240, 135, 62, 0.6);
  background: rgba(240, 135, 62, 0.16);
  color: var(--orange-hot);
}

.btn.primary:hover:not(:disabled) {
  background: rgba(240, 135, 62, 0.26);
  border-color: rgba(240, 135, 62, 0.85);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
}

/* ---------- 通关卡片 ---------- */

.win {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 5, 8, 0.55);
  backdrop-filter: blur(3px);
  animation: fade 0.24s ease;
}

.win[hidden] { display: none; }

.win-card {
  width: min(340px, 82vw);
  padding: 26px 26px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
  animation: rise 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.win-stars {
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  color: var(--orange-hot);
  text-shadow: 0 0 16px rgba(240, 135, 62, 0.55);
  min-height: 2rem;
}

.win-card h2 {
  margin: 6px 0 4px;
  font-size: 1.16rem;
  font-weight: 600;
}

.win-detail {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.win-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 榜单前三 */
.win-rank {
  list-style: none;
  margin: 0 0 16px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}

.win-rank li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.win-rank .rk {
  flex: none;
  width: 18px;
  font-family: var(--label);
  font-size: 0.68rem;
  color: var(--orange-hot);
  font-variant-numeric: tabular-nums;
}

.win-rank .nm {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-rank .sc {
  flex: none;
  font-family: var(--label);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.win-actions .btn { padding: 8px 16px; min-height: 38px; font-size: 0.8rem; }

/* ---------- 轻提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 18, 25, 0.95);
  color: var(--ink-soft);
  font-size: 0.8rem;
  pointer-events: none;          /* 只做提示，不拦点击 */
  animation: fade 0.2s ease;
}

.toast[hidden] { display: none; }

/* ---------- 玩法说明 ---------- */

.panel.wide {
  width: min(560px, 94vw);
}

.help-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.help-lead {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.legend-item svg {
  flex: none;
  width: 34px;
  height: 34px;
}

.legend-item img.art {
  flex: none;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(60, 42, 25, 0.35));
}

.legend-item span {
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.legend-item b {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.8rem;
}

.help-rules {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.help-rules p {
  margin: 0 0 7px;
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.help-rules p:last-child { margin-bottom: 0; }

.help-rules b { color: var(--orange-hot); font-weight: 600; }

.help-rules .keys {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  margin-right: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--label);
  font-size: 0.68rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- 通关结局 ---------- */

.panel.finale {
  width: min(420px, 92vw);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.finale-glow {
  position: absolute;
  left: 50%;
  top: -60%;
  width: 320px;
  height: 320px;
  margin-left: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 135, 62, 0.32), transparent 68%);
  pointer-events: none;
  animation: breathe 4.5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.14); opacity: 1; }
}

.panel.finale h2 {
  position: relative;
  margin: 0 0 6px;
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.finale-lead {
  position: relative;
  margin: 0 0 20px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.finale-stats {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.finale-stats .stat {
  flex: 1;
  padding: 10px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.finale-stats .k {
  display: block;
  font-family: var(--label);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.finale-stats .v {
  display: block;
  margin-top: 3px;
  font-family: var(--label);
  font-size: 1.02rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--orange-hot);
}

.finale-note {
  position: relative;
  margin: 0 0 18px;
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

@media (prefers-reduced-motion: reduce) {
  .finale-glow { animation: none; }
}

/* ---------- 关卡选择 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 8, 0.68);
  backdrop-filter: blur(4px);
  animation: fade 0.2s ease;
}

.overlay[hidden] { display: none; }

.panel {
  width: min(460px, 94vw);
  max-height: 86vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  animation: rise 0.26s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

/* 每日挑战卡片 */
.daily-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(240, 135, 62, 0.35);
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(240, 135, 62, 0.14), rgba(240, 135, 62, 0.04));
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.12s ease;
}

.daily-card:hover {
  border-color: rgba(240, 135, 62, 0.7);
  background: linear-gradient(100deg, rgba(240, 135, 62, 0.22), rgba(240, 135, 62, 0.07));
}

.daily-card:active { transform: translateY(1px); }

.daily-card.current {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px rgba(240, 135, 62, 0.35);
}

.daily-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
}

.daily-meta {
  font-size: 0.74rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.daily-top {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(240, 135, 62, 0.2);
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.save-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn.tiny {
  padding: 5px 14px;
  min-height: 32px;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.btn.tiny:hover { color: var(--ink-soft); }

/* 排行榜面板 */
.rank-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.rank-tab {
  appearance: none;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--body);
  font-size: 0.74rem;
  padding: 4px 14px;
  cursor: pointer;
}

.rank-tab:hover { color: var(--ink-soft); }

.rank-tab.on {
  border-color: rgba(240, 135, 62, 0.6);
  background: rgba(240, 135, 62, 0.14);
  color: var(--orange-hot);
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 120px;
}

.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.rank-list li:last-child { border-bottom: none; }

.rank-list .rk {
  flex: none;
  width: 22px;
  font-family: var(--label);
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.rank-list li.top1 .rk { color: #ffd08a; }
.rank-list li.top2 .rk { color: #e8e8ee; }
.rank-list li.top3 .rk { color: #e0a878; }

.rank-list .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-list .mv {
  flex: none;
  font-family: var(--label);
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.rank-list .sc {
  flex: none;
  width: 54px;
  text-align: right;
  font-family: var(--label);
  font-size: 0.78rem;
  color: var(--orange-hot);
  font-variant-numeric: tabular-nums;
}

.rank-list .mine {
  color: var(--ink);
  font-weight: 500;
}

.rank-empty {
  padding: 26px 8px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* 无尽模式入口 */
.endless-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(107, 124, 255, 0.14), rgba(255, 255, 255, 0.02));
  text-align: left;
  cursor: pointer;
  font-family: var(--body);
  transition: border-color 0.2s ease, transform 0.12s ease;
}

.endless-btn:hover { border-color: rgba(160, 175, 255, 0.5); }
.endless-btn:active { transform: translateY(1px); }

.endless-btn .et {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.endless-btn .ed {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.endless-btn .eb {
  display: block;
  margin-top: 4px;
  font-family: var(--label);
  font-size: 0.68rem;
  color: #a8b4ff;
}

/* 成就 */
.ach-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.ach-title {
  font-size: 0.8rem;
  font-weight: 600;
}

.ach-count {
  font-family: var(--label);
  font-size: 0.72rem;
  color: var(--orange-hot);
  font-variant-numeric: tabular-nums;
}

.ach-toggle {
  margin-left: auto;
  appearance: none;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--body);
  font-size: 0.7rem;
  padding: 3px 12px;
  cursor: pointer;
}

.ach-toggle:hover { color: var(--ink-soft); border-color: var(--line); }

.ach-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ach-list[hidden] { display: none; }

.ach {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  opacity: 0.45;
}

.ach.on {
  opacity: 1;
  border-color: rgba(240, 135, 62, 0.42);
  background: rgba(240, 135, 62, 0.1);
}

.ach .icon {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.ach.on .icon {
  background: rgba(240, 135, 62, 0.2);
  color: var(--orange-hot);
}

.ach .txt {
  min-width: 0;
}

.ach .nm {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.ach.on .nm { color: var(--ink); }

.ach .ds {
  display: block;
  font-size: 0.64rem;
  line-height: 1.4;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 榜上名字 */
.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.name-row label {
  flex: none;
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.name-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.82rem;
}

.name-row input:focus {
  outline: none;
  border-color: rgba(240, 135, 62, 0.6);
}

/* 章节分组 */
.level-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.chapter-head h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.chapter-head .chap-stars {
  font-family: var(--label);
  font-size: 0.68rem;
  color: var(--orange-hot);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chapter-head .chap-progress {
  font-family: var(--label);
  font-size: 0.68rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chapter-head span {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.chapter-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.rank-day {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}

.rank-day:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.05);
}

.rank-day .dt {
  flex: none;
  font-family: var(--label);
  font-size: 0.72rem;
  color: var(--orange-hot);
  font-variant-numeric: tabular-nums;
}

.rank-day .dn {
  flex: 1;
  font-size: 0.74rem;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-day .dc {
  flex: none;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

/* 每日挑战日历：最近 28 天 */
.daily-cal {
  margin: 8px 0 4px;
  padding: 8px 10px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.daily-cal .cal-label {
  display: block;
  font-size: 0.68rem;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.daily-cal .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.daily-cal .cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
}

.daily-cal .cal-day b {
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.daily-cal .cal-day i {
  font-style: normal;
  font-size: 0.5rem;
  letter-spacing: 0;
  color: var(--orange-hot);
  min-height: 8px;
}

.daily-cal .cal-day.on {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.28);
}

.daily-cal .cal-day.on b {
  color: var(--ink);
}

.daily-cal .cal-day.today {
  border-color: rgba(235, 122, 56, 0.7);
}

.level-cell {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 8px 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.12s ease;
}

.level-cell:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

/* 关卡缩略图：格子布局一眼可见 */
.level-cell canvas.thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 4px auto 6px;
  border-radius: 6px;
  opacity: 0.9;
}

/* 锁住的关卡也留着颜色：玩家要靠预览判断后面的关卡有多绕 */
.level-cell:disabled canvas.thumb {
  opacity: 0.55;
}

.level-cell:active:not(:disabled) { transform: translateY(1px); }

.level-cell:disabled {
  opacity: 0.32;
  cursor: default;
}

.level-cell.current {
  border-color: rgba(240, 135, 62, 0.7);
  background: rgba(240, 135, 62, 0.12);
}

.level-cell .num {
  font-family: var(--label);
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.level-cell .nm {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-cell .stars {
  display: block;
  margin-top: 5px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--orange-hot);
  min-height: 1em;
}

.level-cell .par {
  display: block;
  margin-top: 2px;
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.level-cell .best {
  display: block;
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: var(--orange-hot);
  font-variant-numeric: tabular-nums;
  min-height: 1em;
}

.panel-note {
  margin: 4px 0 16px;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.panel-foot {
  margin: 16px 0 0;
  font-size: 0.76rem;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- 动画 ---------- */

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

@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .level-cell { transition: none; }
  .win, .overlay, .win-card, .panel { animation: none; }
}

/* ---------- 窄屏 ---------- */

/* 窄屏提示：默认不显示，窄屏媒体查询里再打开 */
.mobile-tip {
  display: none;
  flex-basis: 100%;
  margin: 0 0 2px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

@media (max-width: 680px) {
  .topbar {
    padding: 8px 12px 4px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand-text h1 { font-size: 0.92rem; }
  .brand-text p { display: none; }
  .mark { width: 26px; height: 26px; }
  .hud {
    margin-left: 0;
    width: 100%;
    gap: 5px;
  }
  .hud-item {
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    text-align: center;
  }
  .hud-item .k { font-size: 0.5rem; letter-spacing: 0.06em; }
  .hud-item .v { font-size: 0.82rem; }
  .level-badge { top: 4px; padding: 4px 11px; }
  .level-badge .hint { display: none; }
  .toolbar { padding: 8px 12px 12px; gap: 7px; }
  .btn { padding: 8px 15px; font-size: 0.8rem; min-height: 38px; }
  .mobile-tip { display: block; }
}

/* ---------- 每日挑战推广（通关第一关后插播） ---------- */

/* 底部弹出，不整屏盖住——玩家还得看得见刚拿到的星星和分数 */
#promoPanel {
  align-items: end;
  padding: 0 16px 28px;
  background: rgba(5, 3, 2, 0.5);
  backdrop-filter: none;
}

.promo {
  text-align: center;
  max-width: 420px;
}

.promo-flag {
  display: inline-block;
  padding: 3px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(143, 43, 33, 0.5);
  border-radius: 999px;
  font-family: var(--label);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: #8f2b21;
}

.promo h2 {
  margin: 0 0 10px;
  font-size: 1.32rem;
  font-weight: 600;
  color: #3a2a1a;
}

.promo-lead {
  margin: 0 0 10px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #3a2a1a;
}

.promo-note {
  margin: 0 0 20px;
  font-size: 0.78rem;
  line-height: 1.7;
  color: rgba(60, 40, 22, 0.62);
}

.promo-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.promo-actions .btn {
  min-height: 44px;
  padding: 9px 20px;
}

.promo > .btn.ghost {
  color: rgba(60, 40, 22, 0.55);
}

/* 真正的移动端适配在 mobile.css：它必须在主题样式之后加载，才能盖住水墨主题的尺寸 */
