/* ==========================================================
   怀旧找茬 · 那些年的眼力
   配色：纸黄 / 藏蓝 / 暖橙 / 砖红 / 军绿（老照片影调）
   ========================================================== */
:root {
  --paper:   #f2e8d5;
  --paper-2: #ece0c8;
  --ink:     #2b3a55;
  --ink-2:   #5a5a52;
  --orange:  #c05621;
  --red:     #b33939;
  --green:   #5c6b4a;
  --gold:    #b58a2e;
  --line:    #d8cdb4;
  --shadow:  0 4px 18px rgba(64, 50, 24, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255,251,240,.7), transparent 60%),
    radial-gradient(ellipse at 85% 90%, rgba(196,175,131,.25), transparent 55%);
  color: var(--ink);
  line-height: 1.6;
  overflow: hidden;
}

/* ---------- 屏幕切换 ---------- */
.screen {
  display: none; position: absolute; inset: 0;
  flex-direction: column; align-items: center;
  overflow-y: auto; padding: 24px 5% 40px;
}
.screen.active { display: flex; }
#game { overflow: hidden; }

/* ---------- 通用：信纸卡片 ---------- */
.paper-card {
  background: #fbf6ea;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 36px 44px;
  max-width: 640px; width: 100%;
  position: relative;
}
.paper-card::before {           /* 顶部老式打孔条 */
  content: ""; position: absolute; left: 50%; top: -7px;
  width: 56px; height: 14px; transform: translateX(-50%);
  background: var(--paper);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer;
  font-size: 17px; letter-spacing: 2px;
  padding: 13px 46px; border-radius: 999px;
  transition: transform .12s ease, box-shadow .12s ease;
  font-family: inherit;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--orange); color: #fff8ef;
  box-shadow: 0 4px 0 #8f3f16;
}
.btn-primary:hover { box-shadow: 0 4px 0 #8f3f16, 0 6px 16px rgba(192,86,33,.4); }
.btn-ghost-lg {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink); font-size: 15px; padding: 11px 30px;
}
.btn-ghost {
  background: transparent; color: var(--ink-2); border: none;
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { color: var(--orange); }

/* ==========================================================
   封面
   ========================================================== */
#home { justify-content: center; }
.home-card { text-align: center; padding-top: 48px; }
#homeCanvas {
  width: 100%; height: auto; border-radius: 8px;
  border: 1px solid var(--line);
  background: #efe6d0;
  margin-bottom: 28px;
}
.game-title {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 52px; letter-spacing: 10px; text-indent: 10px;
  color: var(--ink); font-weight: 900;
  text-shadow: 3px 3px 0 rgba(192,86,33,.18);
  margin-bottom: 6px;
}
.game-sub {
  color: var(--orange); letter-spacing: 6px; text-indent: 6px;
  font-size: 15px; margin-bottom: 22px;
}
.game-desc {
  color: var(--ink-2); font-size: 14.5px;
  margin-bottom: 30px; line-height: 2;
}
.home-foot {
  margin-top: 26px; display: flex; justify-content: space-between;
  align-items: center; color: #b0a88f; font-size: 12.5px;
}

/* ==========================================================
   选关
   ========================================================== */
.topbar {
  width: 100%; max-width: 980px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.topbar h2 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 24px; letter-spacing: 4px;
}
.star-total { color: var(--gold); font-size: 15px; letter-spacing: 1px; }

/* ---------- 每日挑战卡 ---------- */
.daily-card {
  width: 100%; max-width: 980px;
  background: linear-gradient(135deg, #b33939 0%, #c05621 60%, #c9752e 100%);
  border-radius: 14px; box-shadow: 0 6px 22px rgba(179,57,57,.35);
  color: #fdf8ec; padding: 22px 28px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.daily-card::after {               /* 角落装饰日历页 */
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.dc-left { display: flex; flex-direction: column; gap: 3px; }
.dc-tag {
  display: inline-block; align-self: flex-start;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  font-size: 12px; letter-spacing: 3px; padding: 2px 12px; border-radius: 999px;
}
.dc-date { font-size: 12.5px; opacity: .85; letter-spacing: 2px; }
.dc-title {
  font-family: "Noto Serif SC","Songti SC",serif;
  font-size: 26px; letter-spacing: 2px; margin-top: 4px;
  text-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.dc-streak { font-size: 13.5px; opacity: .95; letter-spacing: 1px; }
.dc-streak b { color: #ffd34d; font-size: 16px; margin: 0 2px; }
.btn-daily { box-shadow: 0 4px 0 #8f3f16; position: relative; z-index: 1; }
.daily-card.done { background: linear-gradient(135deg, #5c6b4a 0%, #2f7d4f 70%); }
.daily-card.done .btn-daily { background: #7a8f5e; box-shadow: 0 4px 0 #42503a; cursor: default; }

.level-grid {
  display: grid; gap: 20px; width: 100%; max-width: 980px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.level-card {
  background: #fbf6ea; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.level-card:not(.locked):hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(64,50,24,.18);
}
.level-card canvas {
  width: 100%; aspect-ratio: 4/3; display: block;
  background: #efe6d0; border-bottom: 1px solid var(--line);
}
.level-card .lc-body { padding: 14px 18px 16px; }
.level-card .lc-no { font-size: 12px; color: var(--orange); letter-spacing: 3px; }
.level-card .lc-title {
  font-size: 18px; font-weight: 700; margin: 2px 0 4px;
  font-family: "Noto Serif SC", "Songti SC", serif; letter-spacing: 2px;
}
.level-card .lc-cap { font-size: 12.5px; color: var(--ink-2); }
.level-card .lc-stars { margin-top: 8px; font-size: 15px; letter-spacing: 4px; }
.level-card .lc-stars .on { color: var(--gold); }
.level-card .lc-stars .off { color: #d5cbaf; }
.level-card.locked { cursor: not-allowed; opacity: .55; filter: grayscale(.9); }
.level-card.locked .lc-body { position: relative; }
.level-card.locked::after {
  content: "🔒 通关上一关解锁"; position: absolute; right: 12px; bottom: 12px;
  font-size: 11.5px; color: var(--red); background: rgba(251,246,234,.9);
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line);
}

/* ==========================================================
   游戏
   ========================================================== */
.hud {
  width: 100%; max-width: 1020px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 2px 0 10px;
}
.hud-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px; letter-spacing: 4px;
}
.dot-row { display: flex; gap: 7px; }
.dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--red); background: transparent;
  transition: all .25s ease;
}
.dot.found { background: var(--red); box-shadow: 0 0 0 3px rgba(179,57,57,.18); }
.btn-hint {
  border: 1.5px solid var(--orange); color: var(--orange);
  background: rgba(192,86,33,.07); border-radius: 999px;
  padding: 6px 16px; font-size: 13.5px; cursor: pointer; font-family: inherit;
  transition: all .15s ease;
}
.btn-hint:disabled { opacity: .4; cursor: not-allowed; }
.btn-hint:not(:disabled):active { transform: scale(.94); }

/* 计时条 */
.timer-wrap {
  width: 100%; max-width: 1020px; position: relative; height: 22px;
  margin-bottom: 12px;
}
.timer-bar {
  position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #7a8f5e);
  transform-origin: left;
  transition: background .4s ease;
}
.timer-bar.danger { background: linear-gradient(90deg, var(--red), #d95840); }
.timer-text {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12.5px; color: #fff; font-weight: 700; letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,.3); z-index: 1;
}

/* 两张图 */
.pics {
  width: 100%; max-width: 1020px;
  display: grid; gap: 16px; justify-content: center;
  grid-template-columns: 1fr 1fr;
  align-content: start; flex: 1; min-height: 0;
}
.pic-box {
  display: flex; flex-direction: column; min-height: 0;
  position: relative; justify-self: center; width: 100%;
}
@media (min-width: 861px) and (orientation: landscape) {
  .pic { max-width: min(100%, calc(58vh * 4 / 3)); }
}
.pic {
  width: 100%; aspect-ratio: 4/3; display: block;
  background: #efe6d0; border-radius: 10px;
  border: 6px solid #fffdf6;
  outline: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: crosshair;
}
.pic-box figcaption {
  text-align: center; margin-top: 7px;
  font-size: 12px; color: var(--ink-2); letter-spacing: 4px;
}
.pic-box.shake { animation: shake .35s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* toast */
.toast {
  position: fixed; top: 14%; left: 50%;
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  background: rgba(43,58,85,.92); color: #fdf8ec;
  font-size: 14.5px; letter-spacing: 1px;
  padding: 10px 26px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(43,58,85,.35);
  transition: all .25s ease; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(179,57,57,.92); }

/* ==========================================================
   结算
   ========================================================== */
#result { justify-content: center; }
.result-card { text-align: center; padding-top: 44px; }
.result-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 32px; letter-spacing: 6px; margin-bottom: 10px;
}
.result-stars { font-size: 40px; letter-spacing: 12px; color: #d5cbaf; }
.result-stars .on { color: var(--gold); text-shadow: 0 2px 8px rgba(181,138,46,.4); }
.result-sub { color: var(--ink-2); font-size: 14px; margin: 10px 0 20px; }
.result-list {
  list-style: none; text-align: left; margin-bottom: 26px;
  max-height: 180px; overflow-y: auto; padding: 0 6px;
}
.result-list li {
  font-size: 13.5px; color: var(--ink-2); padding: 6px 4px 6px 26px;
  position: relative; border-bottom: 1px dashed #e3d9c0;
  opacity: 0; animation: fadeUp .5s ease forwards;
}
.result-list li:nth-child(1) { animation-delay: .1s; }
.result-list li:nth-child(2) { animation-delay: .25s; }
.result-list li:nth-child(3) { animation-delay: .4s; }
.result-list li:nth-child(4) { animation-delay: .55s; }
.result-list li:nth-child(5) { animation-delay: .7s; }
.result-list li::before {
  content: "✓"; position: absolute; left: 2px;
  color: var(--green); font-weight: 700;
}
.result-list li.miss { color: #b0a690; }
.result-list li.miss::before {
  content: "✗"; color: var(--red);
}
@keyframes fadeUp { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
.result-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-share {
  background: #fbf6ea; color: var(--orange);
  border: 2px solid var(--orange); font-size: 15px; padding: 11px 26px;
}
.btn-share:active { transform: scale(.96); }

/* ---------- 分享卡弹层 ---------- */
.share-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(43,42,35,.82);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; padding: 20px;
}
.share-mask.show { display: flex; }
.share-sheet {
  background: #fbf6ea; border-radius: 14px; padding: 18px;
  max-width: min(88vw, 420px); max-height: 88vh;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  animation: popIn .28s ease;
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.share-sheet img {
  width: 100%; max-height: 64vh; object-fit: contain;
  border-radius: 8px; border: 1px solid var(--line);
}
.share-tip { font-size: 13px; color: var(--ink-2); letter-spacing: 1px; }

/* ==========================================================
   响应式：竖屏 / 窄屏（小程序 web-view 目标形态）
   ========================================================== */
@media (max-width: 860px), (orientation: portrait) {
  .screen { padding: 14px 4% 20px; }
  .pics { grid-template-columns: 1fr; gap: 10px; }
  .pic { border-width: 4px; }
  .pic-box figcaption { margin-top: 4px; letter-spacing: 2px; }
  .pic-box:first-child .pic { max-height: 34vh; }
  .pic-box:last-child  .pic { max-height: 34vh; }
  .hud-title { font-size: 17px; letter-spacing: 2px; }
  .btn-hint { padding: 5px 12px; font-size: 12.5px; }
  .timer-wrap { height: 18px; margin-bottom: 8px; }
  .game-title { font-size: 40px; letter-spacing: 6px; }
  .paper-card { padding: 28px 26px 24px; }
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .daily-card { padding: 16px 20px; }
  .dc-title { font-size: 21px; }
  .btn-daily { font-size: 15px; padding: 10px 28px; }
  .result-btns { gap: 10px; }
  .result-btns .btn { padding: 10px 20px; font-size: 14px; }
  .btn-share { order: -1; width: 100%; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar h2 { order: -1; }
  .topbar-right { width: 100%; justify-content: flex-end; }
  .task-row { padding: 10px 14px; }
  .look-grid { grid-template-columns: repeat(2, 1fr); }
  .home-foot { flex-wrap: wrap; gap: 6px; justify-content: center; }
}

/* ==========================================================
   P1 · 金币 / 任务卡 / 弹层
   ========================================================== */

/* ---------- 金币与顶部小件 ---------- */
.coin-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; color: var(--ink-2); letter-spacing: 1px;
}
.coin-chip b { color: var(--gold); font-size: 15px; }
.coin-chip.sm { font-size: 12.5px; }
.coin-chip.sm b { font-size: 13.5px; }
.home-coins { color: var(--gold); font-size: 13px; letter-spacing: 1px; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.chip-btn {
  background: #fbf6ea; border: 1.5px solid var(--line);
  border-radius: 999px; width: 38px; height: 38px;
  font-size: 17px; cursor: pointer; transition: all .15s ease;
  box-shadow: 0 2px 8px rgba(64,50,24,.08);
}
.chip-btn:hover { border-color: var(--orange); transform: translateY(-1px); }
.chip-btn:active { transform: scale(.92); }

.hud-right { display: flex; align-items: center; gap: 10px; }

/* ---------- 每日任务卡 ---------- */
.task-card {
  width: 100%; max-width: 980px;
  background: #fbf6ea; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 18px 24px 20px; margin-bottom: 24px;
}
.tc-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  font-size: 16px; font-weight: 700; letter-spacing: 2px;
}
.tc-sub { font-size: 12px; color: #b0a88f; font-weight: 400; letter-spacing: 1px; }
.task-rows { display: flex; flex-direction: column; gap: 4px; }
.task-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 10px;
  transition: background .15s ease;
}
.task-row:not(.claimed):hover { background: rgba(192,86,33,.05); }
.task-row.claimed { opacity: .55; }
.tr-info { display: flex; align-items: baseline; gap: 12px; }
.tr-name { font-size: 14.5px; letter-spacing: 1px; }
.tr-prog { font-size: 12.5px; color: var(--orange); letter-spacing: 1px; }
.btn-claim {
  border: 1.5px solid var(--gold); color: var(--gold);
  background: rgba(181,138,46,.08); border-radius: 999px;
  font-size: 13px; padding: 5px 16px; cursor: pointer;
  font-family: inherit; letter-spacing: 1px;
  transition: all .15s ease; white-space: nowrap;
}
.btn-claim:not(:disabled):hover { background: var(--gold); color: #fff8ef; }
.btn-claim:not(:disabled):active { transform: scale(.94); }
.btn-claim:disabled { opacity: .45; cursor: not-allowed; border-color: var(--line); color: var(--ink-2); background: none; }

/* ---------- 结算 · 上榜状态行 ---------- */
.rank-line {
  min-height: 22px; margin: -6px 0 14px;
  font-size: 13.5px; color: var(--orange); letter-spacing: 1px;
}

/* ---------- 通用弹层（排行榜 / 我的） ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(43,42,35,.82);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal-sheet {
  background: #fbf6ea; border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  width: min(92vw, 460px); max-height: 86vh;
  display: flex; flex-direction: column; align-items: stretch;
  padding: 22px 24px 20px; gap: 14px;
  animation: popIn .28s ease;
}

/* 排行榜 */
.bm-tabs {
  display: flex; gap: 8px; background: var(--paper-2);
  border-radius: 999px; padding: 4px;
}
.bm-tab {
  flex: 1; border: none; background: transparent;
  border-radius: 999px; padding: 8px 0;
  font-size: 14.5px; letter-spacing: 3px; cursor: pointer;
  color: var(--ink-2); font-family: inherit;
  transition: all .18s ease;
}
.bm-tab.active {
  background: var(--orange); color: #fff8ef;
  box-shadow: 0 3px 10px rgba(192,86,33,.35);
}
.bm-date {
  text-align: center; font-size: 12px; color: #b0a88f; letter-spacing: 2px;
}
.bm-list {
  flex: 1; overflow-y: auto; min-height: 160px; max-height: 46vh;
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px 2px;
}
.bm-loading, .bm-empty {
  text-align: center; padding: 42px 10px;
  color: var(--ink-2); font-size: 13.5px; letter-spacing: 1px;
}
.bm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  border-bottom: 1px dashed #e3d9c0;
  font-size: 14.5px;
}
.bm-row.top1 { background: rgba(181,138,46,.12); border-bottom-color: transparent; }
.bm-row.top2 { background: rgba(138,138,130,.10); border-bottom-color: transparent; }
.bm-row.top3 { background: rgba(192,86,33,.08); border-bottom-color: transparent; }
.bm-rank { width: 46px; color: var(--ink-2); font-weight: 700; }
.bm-row.top1 .bm-rank, .bm-row.top1 .bm-nick { color: var(--gold); }
.bm-nick { flex: 1; letter-spacing: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-score { font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.bm-streak {
  font-size: 11.5px; color: var(--red); letter-spacing: 1px;
  background: rgba(179,57,57,.08); padding: 2px 8px; border-radius: 999px;
}
.bm-mine {
  text-align: center; padding: 12px 0 2px;
  border-top: 1px dashed var(--line);
  color: var(--orange); font-size: 14px; letter-spacing: 2px;
}

/* 我的 */
.me-title {
  text-align: center; font-family: "Noto Serif SC","Songti SC",serif;
  font-size: 22px; letter-spacing: 6px;
}
.me-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 14px 4px; background: var(--paper-2); border-radius: 10px;
}
.me-stats .st { text-align: center; }
.me-stats .st b { display: block; font-size: 20px; color: var(--gold); }
.me-stats .st span { font-size: 11px; color: var(--ink-2); letter-spacing: 1px; }
.me-block { display: flex; flex-direction: column; gap: 8px; }
.me-label { font-size: 14.5px; font-weight: 700; letter-spacing: 2px; }
.me-tip { font-size: 11.5px; color: #b0a88f; font-weight: 400; letter-spacing: 1px; }
.nick-row { display: flex; gap: 10px; }
.nick-row input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 999px;
  background: #fffdf6; padding: 10px 18px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  letter-spacing: 1px; outline: none;
}
.nick-row input:focus { border-color: var(--orange); }
.btn-sm { font-size: 14px; padding: 9px 22px; }
.look-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.look-card {
  border: 1.5px solid var(--line); border-radius: 10px;
  background: #fffdf6; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 9px; transition: all .15s ease;
}
.look-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.look-card.sel { border-color: var(--orange); background: rgba(192,86,33,.06); }
.lk-prev {
  width: 100%; height: 44px; border-radius: 6px;
  background:
    radial-gradient(circle at 30% 35%, #d98e4a 0 18%, transparent 40%),
    linear-gradient(150deg, #7ec8e3 15%, #cfe8d5 45%, #e8d5a8 78%);
  border: 1px solid var(--line);
}
.lk-name { font-size: 13px; letter-spacing: 2px; }
.lk-state { font-size: 11px; color: var(--ink-2); letter-spacing: 1px; }
.look-card.sel .lk-state { color: var(--orange); }

/* ==========================================================
   P2 · UGC 面板 / 投稿编辑器 / 结算点赞
   ========================================================== */
.home-compliance {
  margin-top: 14px; font-size: 11px; color: #b0a88f;
  letter-spacing: 1px; text-align: center;
}

/* ---------- 经典/玩家自制 双 Tab ---------- */
.ugc-bar {
  width: 100%; max-width: 980px;
  display: flex; gap: 8px; margin-bottom: 18px;
  background: var(--paper-2); border-radius: 999px; padding: 4px;
}
.ugc-tab {
  flex: 1; border: none; background: transparent;
  border-radius: 999px; padding: 10px 0; cursor: pointer;
  font-size: 15px; letter-spacing: 3px; color: var(--ink-2);
  font-family: inherit; transition: all .18s ease;
}
.ugc-tab.active {
  background: var(--ink); color: #fdf8ec;
  box-shadow: 0 3px 10px rgba(43,58,85,.35);
}

/* 强制 hidden 属性覆盖任意 display 样式 */
#levelGrid[hidden], #ugcPanel[hidden] { display: none !important; }

/* ---------- UGC 面板 ---------- */
.ugc-panel { width: 100%; max-width: 980px; }
.ugc-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 4px 2px 16px; flex-wrap: wrap;
}
.ugc-head-txt b { font-size: 17px; letter-spacing: 2px; }
.ugc-head-txt span {
  display: block; margin-top: 3px;
  font-size: 12px; color: #b0a88f; letter-spacing: 1px;
}
.ugc-list {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.ugc-loading, .ugc-empty {
  grid-column: 1 / -1; text-align: center; padding: 40px 10px;
  color: var(--ink-2); font-size: 13.5px; letter-spacing: 1px;
}
.ugc-card {
  background: #fbf6ea; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.ugc-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(64,50,24,.18); }
.ugc-thumb-wrap { position: relative; }
.ugc-thumb-wrap img {
  width: 100%; aspect-ratio: 4/3; display: block;
  background: #efe6d0; border-bottom: 1px solid var(--line);
  object-fit: cover;
}
.ugc-featured {
  position: absolute; left: 10px; top: 10px;
  background: linear-gradient(135deg, #b58a2e, #d9a83a);
  color: #fff8ec; font-size: 11.5px; letter-spacing: 2px;
  padding: 3px 12px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(181,138,46,.5);
}
.ugc-play-count {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(43,42,35,.66); color: #fdf8ec;
  font-size: 11.5px; padding: 2px 10px; border-radius: 999px;
}
.ugc-card .uc-body { padding: 13px 16px 15px; }
.uc-title {
  font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
  font-family: "Noto Serif SC","Songti SC",serif;
}
.uc-cap { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.uc-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.uc-nick { font-size: 12px; color: #b0a88f; letter-spacing: 1px; }
.btn-heart {
  border: 1.5px solid var(--red); color: var(--red);
  background: rgba(179,57,57,.06); border-radius: 999px;
  font-size: 13px; padding: 5px 14px; cursor: pointer;
  font-family: inherit; letter-spacing: 1px;
  transition: all .15s ease;
}
.btn-heart:hover { background: rgba(179,57,57,.14); }
.btn-heart:active { transform: scale(.92); }
.btn-heart.voted {
  background: var(--red); color: #fdf8ec;
}

/* ---------- 投稿编辑器 ---------- */
#submit { align-items: center; }
.ed-card { max-width: 720px; padding: 26px 30px 24px; }
.ed-steps {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.ed-step {
  font-size: 12.5px; letter-spacing: 2px; color: #b0a88f;
  padding: 4px 14px; border-radius: 999px;
  border: 1px dashed var(--line);
}
.ed-step.on {
  color: #fdf8ec; background: var(--orange); border-color: var(--orange);
  border-style: solid;
}
.ed-upload {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px dashed var(--line); border-radius: 12px;
  padding: 22px 16px; cursor: pointer;
  transition: all .15s ease; margin-bottom: 16px;
}
.ed-upload:hover { border-color: var(--orange); background: rgba(192,86,33,.04); }
.ed-up-ico { font-size: 30px; }
.ed-up-txt { font-size: 14px; letter-spacing: 2px; text-align: center; }
.ed-up-txt i { font-size: 11.5px; color: #b0a88f; font-style: normal; letter-spacing: 1px; }
.ed-canvas-wrap { position: relative; }
.ed-canvas {
  width: 100%; aspect-ratio: 4/3; display: block;
  background: #efe6d0; border-radius: 10px;
  border: 6px solid #fffdf6; outline: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: crosshair;
}
.btn-ed-toggle {
  position: absolute; right: 14px; bottom: 14px;
  padding: 8px 18px; font-size: 13.5px;
  background: rgba(251,246,234,.92);
}
.ed-tip {
  font-size: 12.5px; color: var(--orange);
  letter-spacing: 1px; margin: 10px 2px 12px;
}
.ed-marks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ed-mark {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper-2); border-radius: 10px; padding: 8px 12px;
}
.ed-no {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--red); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ed-mark input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px;
  background: #fffdf6; padding: 8px 12px;
  font-size: 14px; font-family: inherit; color: var(--ink);
  outline: none; letter-spacing: 1px;
}
.ed-mark input:focus { border-color: var(--orange); }
.ed-del {
  border: none; background: none; color: #b0a88f;
  font-size: 15px; cursor: pointer; padding: 4px 8px;
}
.ed-del:hover { color: var(--red); }
.ed-meta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ed-meta input {
  border: 1.5px solid var(--line); border-radius: 999px;
  background: #fffdf6; padding: 11px 18px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  outline: none; letter-spacing: 1px;
}
.ed-meta input:focus { border-color: var(--orange); }
.btn-block { width: 100%; }
.ed-note {
  margin-top: 12px; font-size: 11.5px; color: #b0a88f;
  letter-spacing: 1px; line-height: 1.8; text-align: center;
}

/* ---------- 结算 · UGC 点赞行 ---------- */
.ugc-vote-row {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin: 0 0 16px; flex-wrap: wrap;
}
.ugc-vote-row .btn-ghost-lg { color: var(--red); border-color: var(--red); }
.ugc-author { font-size: 12.5px; color: #b0a88f; letter-spacing: 1px; }

@media (max-width: 860px), (orientation: portrait) {
  .ugc-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .ed-card { padding: 20px 18px 18px; }
  .ugc-vote-row .btn-ghost-lg { padding: 9px 20px; font-size: 14px; }
}
