/* 《微光手记》阶段2 前端样式 —— 极简/治愈/有仪式感 */
:root {
  --bg: #080B14;
  --bg-card: #111729;
  --bg-card-2: #161E33;
  --line: rgba(232, 244, 255, 0.10);
  --text: #E8F4FF;
  --text-dim: #8B9BB8;
  --gold: #FFC773;
  --glow: #8FD3FF;
  --violet: #C9B8FF;
  --ok: #7BE495;
  --warn: #FF8E8E;
  --r: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.02em;
}
/* 背景微光点阵 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(2px 2px at 12% 22%, rgba(232,244,255,.14) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 16%, rgba(255,199,115,.16) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 68%, rgba(143,211,255,.12) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 85%, rgba(232,244,255,.10) 50%, transparent 51%),
    radial-gradient(circle at 50% -10%, rgba(120,160,255,.10), transparent 60%);
}
#app { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 24px 20px 100px; }
h1, h2, h3, .serif { font-family: Georgia, "Songti SC", "SimSun", serif; font-weight: 500; }
h1 { font-size: 30px; letter-spacing: .12em; }
h2 { font-size: 21px; letter-spacing: .06em; }
h3 { font-size: 16px; }
.dim { color: var(--text-dim); }
.gold { color: var(--gold); }
.small { font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* 顶部栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.brand { font-size: 14px; letter-spacing: .24em; color: var(--gold); }
.topbar .right { display: flex; gap: 14px; font-size: 13px; color: var(--text-dim); }
a, .link { color: var(--glow); text-decoration: none; cursor: pointer; }

/* 卡片 */
.card { background: linear-gradient(160deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card.tap { cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s; }
.card.tap:hover { transform: translateY(-2px); border-color: rgba(255,199,115,.45); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.card.locked { opacity: .45; filter: grayscale(.6); }
.grid { display: grid; gap: 12px; }
.grid.cols2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols4 { grid-template-columns: repeat(4, 1fr); }

/* 按钮 */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid rgba(143,211,255,.35); border-radius: 12px;
  background: rgba(143,211,255,.08); color: var(--text);
  padding: 10px 18px; font-size: 14px; cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
  font-family: inherit;
}
button:hover, .btn:hover { background: rgba(143,211,255,.18); border-color: var(--glow); }
button:active { transform: scale(.97); }
button.primary { background: linear-gradient(135deg, rgba(255,199,115,.22), rgba(255,199,115,.08)); border-color: rgba(255,199,115,.55); color: #FFE8C2; }
button.ghost { border-color: var(--line); background: transparent; color: var(--text-dim); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }

/* 首页今日之光 */
.hero { position: relative; overflow: hidden; min-height: 230px; border-radius: 22px; border: 1px solid rgba(255,199,115,.22);
  background: radial-gradient(circle at 75% 25%, rgba(255,199,115,.16), transparent 45%), radial-gradient(circle at 20% 80%, rgba(120,160,255,.18), transparent 50%), #0D1222;
  padding: 28px; display: flex; flex-direction: column; justify-content: space-between; }
.hero .big { font-size: 26px; font-family: Georgia, "Songti SC", serif; }
.hero .sub { color: var(--text-dim); font-size: 13px; margin-top: 8px; }
.hero .halo { position: absolute; right: -30px; top: -30px; width: 220px; height: 220px; border-radius: 50%;
  border: 1px solid rgba(255,199,115,.2); box-shadow: inset 0 0 60px rgba(255,199,115,.08), 0 0 60px rgba(255,199,115,.06); }

/* 关卡节点 */
.level-node { aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 19px; }
.level-node:hover { border-color: var(--gold); }
.level-node.passed { border-color: rgba(123,228,149,.35); background: rgba(123,228,149,.06); }
.level-node.passed::after { content: "✦"; color: var(--ok); font-size: 11px; }
.level-node.locked { opacity: .35; cursor: not-allowed; }

/* 解谜页 */
#playCanvas { display: block; margin: 16px auto; border-radius: 14px; border: 1px solid var(--line); max-width: 100%; height: auto; box-shadow: 0 0 50px rgba(120,160,255,.06); }
.hud { display: flex; justify-content: space-between; align-items: center; background: rgba(17,23,41,.8); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.hud .num { font-size: 19px; font-family: Georgia, serif; color: var(--gold); }
.timer { color: var(--glow); }
.timer.urgent { color: var(--warn); }

/* 弹层 */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(4,6,12,.82); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; background: linear-gradient(160deg, #141B2E, #0E1424); border: 1px solid rgba(255,199,115,.25); border-radius: 20px; padding: 26px; }
.modal h2 { text-align: center; margin-bottom: 6px; }
.stars { text-align: center; font-size: 38px; color: var(--gold); letter-spacing: .15em; margin: 12px 0 4px; }
.stats { display: flex; justify-content: center; gap: 28px; color: var(--text-dim); font-size: 13px; margin: 14px 0 20px; }
.stats b { color: var(--text); font-size: 17px; font-family: Georgia, serif; }
#posterCanvas { width: 100%; border-radius: 12px; display: block; margin-top: 12px; }

/* 图鉴 */
.specimen { border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px; text-align: center; background: var(--bg-card); }
.specimen .sym { font-size: 28px; filter: drop-shadow(0 0 10px rgba(255,199,115,.3)); }
.specimen .nm { font-size: 12px; margin-top: 6px; }
.specimen .rar { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.specimen.unknown { opacity: .35; filter: grayscale(1); }
.specimen.common { border-color: rgba(200,220,255,.2); }
.specimen.rare { border-color: rgba(143,211,255,.5); }
.specimen.epic { border-color: rgba(201,184,255,.6); }
.specimen.legendary { border-color: rgba(255,199,115,.7); box-shadow: inset 0 0 20px rgba(255,199,115,.08); }

/* 列表 */
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-item:last-child { border-bottom: 0; }

/* Toast */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 99;
  background: rgba(20,27,46,.96); border: 1px solid rgba(255,199,115,.4); color: var(--text); padding: 11px 20px; border-radius: 12px;
  font-size: 13px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: 88vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 底部导航 */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(8,11,20,.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 10px 0 max(10px, env(safe-area-inset-bottom)); }
.bottom-nav a { color: var(--text-dim); font-size: 11px; text-align: center; flex: 1; text-decoration: none; }
.bottom-nav a.active { color: var(--gold); }
.bottom-nav .ico { font-size: 18px; display: block; margin-bottom: 2px; }

@media (max-width: 480px) {
  #app { padding: 16px 14px 100px; }
  h1 { font-size: 25px; }
  .hero { padding: 22px; min-height: 200px; }
  .hero .big { font-size: 22px; }
  .grid.cols4 { grid-template-columns: repeat(3, 1fr); }
}
