/* 点赞祈福 · 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --gold: #f0a83c;
  --gold-light: #ffe9b0;
  --gold-deep: #c96a1e;
  --bg-deep: #0d0505;
  --bg-mid: #200a08;
  --text: #f5e6c8;
  --text-dim: #c9a06a;
  --red: #fa5151;
  --green: #07c160;
}

html, body {
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}

body {
  font-family: 'Noto Serif SC', 'STSong', 'Songti SC', serif;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 120%, #3d1410 0%, #200a08 45%, #0d0505 100%);
  user-select: none;
  -webkit-user-select: none;
}

#app { position: relative; width: 100%; height: 100%; }

/* 顶部标题 */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  text-align: center; padding: calc(env(safe-area-inset-top) + 12px) 12px 8px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(13,5,5,.9), rgba(13,5,5,0));
}
#topbar h1 {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 400; letter-spacing: .14em;
  background: linear-gradient(180deg, #ffe9b0 20%, #f0a83c 60%, #c96a1e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(255,150,50,.25);
}
#topbar p { margin-top: 4px; font-size: clamp(12px, 1.6vw, 15px); color: var(--text-dim); letter-spacing: .4em; text-indent: .4em; opacity: .85; }

/* HUD */
#hud {
  position: fixed; top: calc(env(safe-area-inset-top) + 90px); left: 12px; right: 12px;
  z-index: 10; display: flex; justify-content: center; gap: 10px; pointer-events: none;
}
.hud-item {
  display: flex; flex-direction: column; align-items: center; min-width: 76px;
  background: rgba(30,10,6,.55); border: 1px solid rgba(240,168,60,.35);
  border-radius: 12px; padding: 6px 12px; backdrop-filter: blur(6px);
}
.hud-item .label { font-size: 11px; color: var(--text-dim); letter-spacing: .2em; }
.hud-item .val { font-size: 17px; color: var(--gold-light); font-weight: 600; margin-top: 2px; }

/* 主画布 */
#scene { position: fixed; inset: 0; display: block; }

/* 底部工具栏 */
#toolbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: linear-gradient(0deg, rgba(13,5,5,.95), rgba(13,5,5,0));
}
.tb-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 70px; height: 62px; border: 1px solid rgba(240,168,60,.4);
  background: rgba(40,14,8,.75); color: var(--gold-light); border-radius: 16px;
  font-family: inherit; font-size: 12px; letter-spacing: .1em; cursor: pointer;
  backdrop-filter: blur(6px); transition: transform .12s, background .2s;
}
.tb-btn:active { transform: scale(.92); background: rgba(90,34,14,.9); }
.tb-btn .ic { font-size: 22px; line-height: 1; }
.tb-btn.primary { border-color: var(--gold); box-shadow: 0 0 16px rgba(240,168,60,.35); }

/* 飘字层 */
#float-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.float-text {
  position: absolute; font-family: 'Ma Shan Zheng', serif; font-weight: 400;
  color: var(--gold-light); text-shadow: 0 0 12px rgba(255,150,50,.6);
  animation: floatUp 1.6s ease-out forwards; white-space: nowrap;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(.7); }
  15% { opacity: 1; transform: translateY(-10px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-120px) scale(1); }
}

/* 遮罩与弹窗 */
#overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
#overlay.hidden { display: none; }
.modal {
  width: 100%; max-width: 360px; max-height: 82vh; overflow-y: auto;
  background: linear-gradient(180deg, #2a0e08, #1a0806);
  border: 1px solid rgba(240,168,60,.4); border-radius: 18px; padding: 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.modal h2 {
  font-family: 'Ma Shan Zheng', serif; font-weight: 400; font-size: 24px;
  color: var(--gold-light); text-align: center; letter-spacing: .15em; margin-bottom: 18px;
}
.modal .close {
  float: right; font-size: 20px; color: var(--text-dim); cursor: pointer; margin-top: -4px;
}
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; letter-spacing: .1em; }
.form-item input {
  width: 100%; padding: 11px 12px; border-radius: 10px; font-size: 15px;
  border: 1px solid rgba(240,168,60,.35); background: rgba(13,5,5,.6); color: var(--text);
  outline: none; font-family: inherit;
}
.form-item input:focus { border-color: var(--gold); }
.form-row { display: flex; gap: 8px; }
.form-row input { flex: 1; }
.btn {
  width: 100%; padding: 12px; border-radius: 12px; border: none; cursor: pointer;
  font-family: inherit; font-size: 16px; letter-spacing: .2em; transition: opacity .2s;
  background: linear-gradient(180deg, #f0a83c, #c96a1e); color: #3a1406; font-weight: 600;
}
.btn:disabled { opacity: .5; }
.btn.ghost { background: transparent; border: 1px solid rgba(240,168,60,.4); color: var(--gold-light); }
.btn.danger { background: transparent; border: 1px solid rgba(250,81,81,.5); color: var(--red); }
.btn.green { background: linear-gradient(180deg, #07c160, #059748); color: #fff; }
.link-row { text-align: center; margin-top: 12px; font-size: 13px; color: var(--text-dim); }
.link-row a { color: var(--gold); cursor: pointer; }
.tip { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 10px; line-height: 1.6; }

/* 列表/卡片 */
.card {
  background: rgba(13,5,5,.5); border: 1px solid rgba(240,168,60,.25);
  border-radius: 12px; padding: 12px; margin-bottom: 10px;
}
.card .row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.card .row .dim { color: var(--text-dim); font-size: 12px; }
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tier-item {
  border: 1px solid rgba(240,168,60,.35); border-radius: 12px; padding: 12px;
  text-align: center; cursor: pointer; background: rgba(30,10,6,.5);
}
.tier-item .amt { font-size: 20px; color: var(--gold-light); font-weight: 600; }
.tier-item .pts { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.tier-item.sel { border-color: var(--gold); box-shadow: 0 0 14px rgba(240,168,60,.3); }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs .tab {
  flex: 1; padding: 8px; text-align: center; font-size: 13px; cursor: pointer;
  border: 1px solid rgba(240,168,60,.3); border-radius: 8px; color: var(--text-dim);
}
.tabs .tab.on { background: rgba(240,168,60,.2); color: var(--gold-light); border-color: var(--gold); }

/* 桌面端居中 */
@media (min-width: 600px) {
  body { display: flex; justify-content: center; background: #050202; }
  #app { width: 420px; height: 100vh; position: relative; box-shadow: 0 0 60px rgba(0,0,0,.8); }
  #toolbar { left: 50%; transform: translateX(-50%); width: 420px; }
}
