/* ==========================================================
   神圣奶蛙合成器 · 奶蛙图鉴 / 金币工坊 / 奶娃博物馆 / 排行榜
   —— 覆盖在 Cocos 画布之上的一层 HTML UI
   设计取向：纸感底色 + 细描边 + 单一琥珀色点缀，不用高光渐变
   ========================================================== */

#nlm-root {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #4A3519;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  --paper: #FFFCF6;
  --paper2: #FFF6E7;
  --line: #EADCC2;
  --line2: #F3E8D3;
  --ink: #4A3519;
  --ink2: #8B7355;
  --ink3: #B39C7C;
  --amber: #E9A13B;
  --amber-d: #C9821F;
  --red: #D9532F;
  --green: #5E9E62;
}

#nlm-root * { box-sizing: border-box; }

/* ---------------- 顶部金币条 ---------------- */
.nlm-chip {
  position: absolute;
  left: 12px;
  top: 92px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px 0 8px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  pointer-events: auto;
  cursor: pointer;
}
.nlm-chip:active { background: var(--paper2); }
.nlm-chip .ico {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--amber);
  border: 1px solid var(--amber-d);
  position: relative;
  flex: 0 0 auto;
}
.nlm-chip .ico::after {
  content: "";
  position: absolute; inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
}
.nlm-chip .num {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 底部入口栏 ---------------- */
.nlm-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  height: 58px;
  display: flex;
  align-items: stretch;
  padding: 0 4px;
  border-radius: 16px;
  background: rgba(255, 252, 246, .96);
  border: 1px solid var(--line);
  box-shadow: 0 3px 14px rgba(90, 60, 20, .13);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.nlm-dock-btn {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .12s;
}
.nlm-dock-btn:active { background: rgba(233, 161, 59, .14); }
.nlm-dock-btn .ic {
  width: 21px; height: 21px;
  display: block;
  color: #7E6547;
}
.nlm-dock-btn .ic svg { width: 100%; height: 100%; display: block; }
.nlm-dock-btn .lb {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ink2);
  letter-spacing: .2px;
  line-height: 1;
}
.nlm-dock-btn .badge {
  position: absolute;
  top: 6px; left: 50%;
  margin-left: 4px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  border: 1.5px solid #FFFCF6;
}
.nlm-dock-btn.ready .ic { color: var(--amber-d); }
.nlm-dock-btn.ready .lb { color: var(--amber-d); }

/* ---------------- 开局标题 ---------------- */
.nlm-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
}
.nlm-title .inner {
  text-align: center;
  animation: nlm-title-in .6s ease-out both;
  transition: opacity .45s ease, transform .45s ease;
}
.nlm-title.off .inner { opacity: 0; transform: translateY(-10px); }
.nlm-title .t {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #4A3418;
  text-shadow: 0 2px 0 rgba(255, 247, 234, .95), 0 4px 10px rgba(120, 90, 40, .14);
}
.nlm-title .rule {
  width: 46px; height: 2px;
  margin: 9px auto 8px;
  border-radius: 2px;
  background: var(--amber);
  opacity: .85;
}
.nlm-title .s {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 4px;
  color: #9A7A48;
}
@keyframes nlm-title-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------- 警戒线标签 ---------------- */
.nlm-line-tip {
  position: absolute;
  right: 12px;
  top: calc(21% - 19px);
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(255, 252, 246, .92);
  border: 1px solid #EFC9BB;
  color: #C05A3A;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .5px;
  line-height: 1.6;
  pointer-events: none;
}

/* ---------------- 面板 ---------------- */
.nlm-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(58, 40, 16, .34);
  pointer-events: auto;
}
.nlm-panel.on { display: flex; animation: nlm-fade .16s ease; }
@keyframes nlm-fade { from { opacity: 0; } to { opacity: 1; } }

.nlm-sheet {
  width: 100%;
  max-width: 430px;
  max-height: 92%;
  display: flex;
  flex-direction: column;
  border-radius: 20px 20px 0 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow: 0 -6px 26px rgba(80, 52, 16, .16);
  animation: nlm-up .22s cubic-bezier(.2, .9, .3, 1);
  overflow: hidden;
}
@keyframes nlm-up { from { transform: translateY(40px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }

.nlm-head {
  position: relative;
  padding: 15px 16px 11px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line2);
}
.nlm-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .3px;
}
.nlm-head .sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink3);
  font-weight: 500;
  line-height: 1.55;
  padding-right: 30px;
}
.nlm-x {
  position: absolute;
  top: 12px; right: 12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
.nlm-x:active { background: var(--paper2); }

.nlm-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 20px;
}

/* ---------------- 卡片 / 按钮 ---------------- */
.nlm-card {
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 10px;
}
.nlm-card .row1 {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.nlm-card .ttl { font-size: 13px; font-weight: 700; color: var(--ink); }
.nlm-card .desc { font-size: 11px; color: var(--ink3); line-height: 1.6; margin-top: 5px; font-weight: 500; }
.nlm-card .desc b { color: var(--amber-d); }

.nlm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--amber);
  color: #3E2708;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .13);
  cursor: pointer;
  font-family: inherit;
}
.nlm-btn:active { box-shadow: none; transform: translateY(1px); }
.nlm-btn.ghost {
  background: #fff;
  color: var(--ink2);
  border: 1px solid var(--line);
  box-shadow: none;
}
.nlm-btn[disabled] {
  background: #F0E7D8;
  color: #B6A48C;
  box-shadow: none;
  pointer-events: none;
}
.nlm-btn.wide { width: 100%; }
.nlm-btn.red {
  background: var(--red);
  color: #fff;
}

/* ---------------- 工坊：工位 ---------------- */
.nlm-slots {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 1px 4px;
  scrollbar-width: none;
}
.nlm-slots::-webkit-scrollbar { display: none; }
.nlm-slot { flex: 0 0 auto; width: 56px; text-align: center; }
.nlm-slot .av {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--paper2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin: 0 auto;
}
.nlm-slot .av img { width: 88%; height: 88%; object-fit: contain; }
.nlm-slot .av .ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--amber) var(--p, 0%), rgba(0, 0, 0, 0) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  pointer-events: none;
}
.nlm-slot .nm { font-size: 9px; font-weight: 600; color: var(--ink2); margin-top: 4px; white-space: nowrap; }
.nlm-slot.empty .av {
  border-style: dashed;
  border-color: #DCCDB4;
  background: #FBF6EC;
  color: #C6B49A;
  font-size: 18px;
}

/* ---------------- 工坊：金币盘 ---------------- */
.nlm-tray-wrap { position: relative; margin: 2px 0 4px; }
.nlm-tray {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 14px;
  background:
    repeating-linear-gradient(0deg, rgba(214, 190, 155, .34) 0 1px, transparent 1px 25%),
    repeating-linear-gradient(90deg, rgba(214, 190, 155, .34) 0 1px, transparent 1px 20%),
    var(--paper2);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: none;
}
.nlm-coin {
  position: absolute;
  width: 17%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 36% 30%, #FFE7A8 0%, #F3BB55 42%, #DE9B2B 78%, #C9821F 100%);
  border: 1.5px solid #C9821F;
  box-shadow: inset 0 -2px 3px rgba(140, 85, 10, .22);
  display: flex; align-items: center; justify-content: center;
  transition: left .16s cubic-bezier(.3, .9, .4, 1.1), top .16s cubic-bezier(.3, .9, .4, 1.1), transform .1s;
  will-change: left, top;
  cursor: grab;
}
.nlm-coin::before {
  content: "";
  position: absolute; inset: 10%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .45);
  pointer-events: none;
}
.nlm-coin img {
  width: 60%; height: 60%;
  object-fit: contain;
  opacity: .9;
  pointer-events: none;
}
.nlm-coin .v {
  position: absolute;
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 700;
  color: #6B4205;
  pointer-events: none;
  line-height: 1;
}
.nlm-coin[data-lv="3"] { background: radial-gradient(circle at 36% 30%, #FFEBD2 0%, #F5B36B 42%, #E08A2C 78%, #C46A08 100%); }
.nlm-coin[data-lv="4"] { background: radial-gradient(circle at 36% 30%, #FFE3D8 0%, #F09A76 42%, #D9603A 78%, #B8421F 100%); border-color: #C4562F; }
.nlm-coin[data-lv="5"] { background: radial-gradient(circle at 36% 30%, #EDE4FF 0%, #B79BEA 42%, #8266C9 78%, #6244A8 100%); border-color: #7255B8; }
.nlm-coin[data-lv="5"] .v { color: #fff; }
.nlm-coin[data-lv="6"] { background: radial-gradient(circle at 36% 30%, #DEF3F8 0%, #86C8DF 42%, #3E90B4 78%, #2A6E8E 100%); border-color: #3E86A6; }
.nlm-coin[data-lv="6"] .v { color: #fff; }
.nlm-coin[data-lv="7"] {
  background: conic-gradient(from 210deg, #F2C14E, #E888A0, #9B7BD4, #62B7D6, #7FC58C, #F2C14E);
  border-color: #fff;
}
.nlm-coin[data-lv="7"] .v { color: #fff; }
.nlm-coin.dragging {
  transition: none;
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 30;
  cursor: grabbing;
}
.nlm-coin.pop { animation: nlm-pop .3s ease-out; }
.nlm-coin.drop { animation: nlm-drop .34s cubic-bezier(.34, 1.42, .56, 1); }
@keyframes nlm-drop {
  0% { transform: translate(-50%, -230%) scale(.9); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes nlm-pop {
  0% { transform: translate(-50%, -50%) scale(1); }
  45% { transform: translate(-50%, -50%) scale(1.26); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.nlm-tray-hint {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  color: #C0AB8C;
  line-height: 1.7;
  pointer-events: none;
  width: 80%;
}
.nlm-tray-hint b { display: block; font-size: 20px; margin-bottom: 6px; font-weight: 600; }

.nlm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}
.nlm-bar .tip { font-size: 10.5px; color: var(--ink3); font-weight: 500; line-height: 1.55; }
.nlm-bar .tip b { color: var(--amber-d); font-size: 12px; }

/* ---------------- 博物馆 ---------------- */
.nlm-room {
  position: relative;
  border-radius: 14px;
  padding: 14px 10px 8px;
  background: var(--paper2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.nlm-room::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 22px;
  background: #F0E2C9;
  border-top: 1px solid #E6D5B6;
}
.nlm-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  padding-bottom: 8px;
  margin-bottom: 11px;
  border-bottom: 3px solid #E6D5B6;
  position: relative;
  z-index: 2;
}
.nlm-shelf:last-child { margin-bottom: 20px; }
.nlm-frame {
  width: 72px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #E4D2B0;
  padding: 5px 4px 4px;
  text-align: center;
}
.nlm-frame img {
  width: 100%; height: 56px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  background: var(--paper2);
}
.nlm-frame .nm {
  font-size: 8.5px; font-weight: 600; color: var(--ink2);
  margin-top: 2px; white-space: nowrap; overflow: hidden;
}
.nlm-frame.locked { background: #FBF5EA; border-style: dashed; border-color: #DCCDB4; }
.nlm-frame.locked .q {
  height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #C6B49A; font-weight: 600;
}
.nlm-frame.legend { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(233, 161, 59, .18); }
.nlm-frame-wrap { position: relative; }
.nlm-frame-wrap .badge {
  position: absolute;
  right: -4px; top: -4px;
  min-width: 15px; height: 15px;
  border-radius: 8px;
  background: var(--green);
  color: #fff; font-size: 9px; font-weight: 700;
  line-height: 13px; text-align: center;
  border: 1px solid #fff;
}

.nlm-prog {
  height: 7px;
  border-radius: 4px;
  background: #F0E5D2;
  overflow: hidden;
  margin-top: 8px;
}
.nlm-prog > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--amber);
  transition: width .3s ease;
}
.nlm-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.nlm-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink2);
  background: var(--paper2);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 2px 7px;
}
.nlm-tag b { color: var(--amber-d); font-weight: 700; }

/* ---------------- 图鉴 ---------------- */
.nlm-codex {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.nlm-cx {
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line2);
  padding: 7px 6px 6px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.nlm-cx img {
  width: 100%; height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--paper2);
}
.nlm-cx .nm { font-size: 10.5px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.nlm-cx .lv { font-size: 9px; font-weight: 500; color: var(--ink3); }
.nlm-cx.locked { background: #FBF6EC; border-style: dashed; border-color: #E0D2B9; }
.nlm-cx.locked img { filter: grayscale(1) opacity(.14); }
.nlm-cx.locked .nm { color: #B6A48C; }
.nlm-cx .rk {
  position: absolute; left: 5px; top: 5px;
  font-size: 8px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
  color: #fff;
}
.nlm-cx .rk.r0 { background: #A9B5A2; }
.nlm-cx .rk.r1 { background: #6BA56F; }
.nlm-cx .rk.r2 { background: #7681C4; }
.nlm-cx .rk.r3 { background: #D9743A; }

/* ---------------- 提示 ---------------- */
.nlm-toasts {
  position: absolute;
  left: 50%;
  top: 148px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  pointer-events: none;
  width: 100%;
}
.nlm-toast {
  max-width: 86%;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(50, 34, 12, .88);
  color: #FBF3E4;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  animation: nlm-toast-in .24s ease-out;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.nlm-toast.gold { background: rgba(198, 118, 16, .93); color: #fff; }
.nlm-toast.out { animation: nlm-toast-out .26s ease forwards; }
@keyframes nlm-toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes nlm-toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------------- 包裹弹窗 ---------------- */
.nlm-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(52, 34, 12, .42);
  pointer-events: auto;
}
.nlm-modal.on { display: flex; animation: nlm-fade .18s ease; }
.nlm-modal-card {
  width: 288px;
  padding: 20px 18px 18px;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(60, 38, 8, .3);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.nlm-modal-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.nlm-modal-card .m-sub { font-size: 11px; color: var(--ink3); font-weight: 500; line-height: 1.65; }

/* 礼物盒：手绘感 SVG，Q 版小方盒，会自己轻轻晃 */
.nlm-box {
  width: 138px;
  height: 148px;
  margin: 10px auto 4px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nlm-box svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  animation: nlm-bob 2.6s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes nlm-bob {
  0%, 100% { transform: translateY(0) rotate(-1.6deg); }
  50% { transform: translateY(-6px) rotate(1.6deg); }
}
.nlm-box:active svg { animation-play-state: paused; transform: scale(.96); }
.nlm-box.shake svg { animation: nlm-shake .42s ease-in-out; }
@keyframes nlm-shake {
  0%, 100% { transform: rotate(0) scale(1); }
  18% { transform: rotate(-8deg) scale(1.04); }
  42% { transform: rotate(7deg) scale(1.06); }
  68% { transform: rotate(-5deg) scale(1.02); }
  88% { transform: rotate(3deg) scale(1.01); }
}

.nlm-reveal { margin: 8px 0 2px; animation: nlm-pop-in .4s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes nlm-pop-in { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }
.nlm-reveal .art {
  width: 104px; height: 104px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--paper2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.nlm-reveal .art img { width: 86%; height: 86%; object-fit: contain; }
.nlm-reveal .nm { font-size: 16px; font-weight: 700; margin-top: 10px; color: var(--ink); }
.nlm-reveal .rk {
  display: inline-block;
  margin-top: 5px;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 5px;
  color: #fff;
}
.nlm-modal-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

/* ---------------- 广告位 ---------------- */
.nlm-ad {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 16, 6, .8);
  pointer-events: auto;
  animation: nlm-fade .16s ease;
}
.nlm-ad-card {
  width: 290px;
  border-radius: 14px;
  overflow: hidden;
  background: #191309;
  border: 1px solid #3a2d1c;
}
.nlm-ad-stage {
  position: relative;
  height: 272px;
  background: #241b0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
}
.nlm-ad-stage .big {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 235, 200, .45);
  letter-spacing: 4px;
  position: relative;
  z-index: 2;
}
.nlm-ad-stage .t1 {
  position: relative; z-index: 2;
  color: #E7C57C; font-size: 14px; font-weight: 600;
}
.nlm-ad-stage .t2 {
  position: relative; z-index: 2;
  color: rgba(240, 225, 200, .45); font-size: 10.5px; font-weight: 400;
  line-height: 1.7; padding: 0 26px; text-align: center;
}
.nlm-ad-stage .frame {
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(231, 197, 124, .25);
  border-radius: 6px;
}
.nlm-ad-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: rgba(255, 255, 255, .1);
  z-index: 3;
}
.nlm-ad-bar > i {
  display: block; height: 100%; width: 0%;
  background: #E7C57C;
  transition: width .2s linear;
}
.nlm-ad-foot {
  padding: 11px 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.nlm-ad-foot .cd { color: rgba(240, 225, 200, .6); font-size: 11.5px; font-weight: 500; }
.nlm-ad-foot .cd b { color: #E7C57C; font-size: 14px; font-weight: 700; }
.nlm-ad-foot .nlm-btn { height: 34px; font-size: 12px; padding: 0 13px; }

/* ---------------- 失败复活 ---------------- */
.nlm-fail-title { font-size: 17px; font-weight: 700; color: var(--red); }
.nlm-fail-note { margin-top: 10px; font-size: 10.5px; font-weight: 500; color: var(--ink3); line-height: 1.6; }
.nlm-fail-note b { color: var(--red); }

/* ---------------- 排行榜 ---------------- */
.nlm-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.nlm-tab {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  background: var(--paper2);
  border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--ink3);
  cursor: pointer;
}
.nlm-tab.on {
  background: var(--amber);
  border-color: var(--amber-d);
  color: #3E2708;
}
.nlm-rank { display: flex; flex-direction: column; gap: 6px; }
.nlm-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line2);
}
.nlm-rank-row .no {
  width: 20px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--ink3);
  font-variant-numeric: tabular-nums;
}
.nlm-rank-row .no.m1 { color: #D99A28; }
.nlm-rank-row .no.m2 { color: #98A3AC; }
.nlm-rank-row .no.m3 { color: #BE8355; }
.nlm-rank-row .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--paper2);
  border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: 0 0 auto;
}
.nlm-rank-row .av img { width: 88%; height: 88%; object-fit: contain; }
.nlm-rank-row .nm {
  flex: 1 1 auto;
  font-size: 12px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nlm-rank-row .sc {
  font-size: 12px; font-weight: 700; color: var(--amber-d);
  font-variant-numeric: tabular-nums;
}
.nlm-rank-row.me { background: #FFF8EA; border-color: #EBCF9A; }
.nlm-rank-row.me .nm { color: #A9681A; }
.nlm-rank-foot {
  margin-top: 10px;
  font-size: 10px;
  color: var(--ink3);
  font-weight: 500;
  line-height: 1.7;
  text-align: center;
}

/* 广告按钮 */
.nlm-adbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 42px;
  margin-top: 9px;
  border-radius: 10px;
  border: 1px dashed #D9BE8E;
  background: #FFFBF2;
  color: #A9681A;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 0 10px;
  text-align: center;
  line-height: 1.4;
}
.nlm-adbtn:active { background: var(--paper2); }
.nlm-adbtn .tag {
  font-size: 9px;
  background: var(--amber);
  color: #3E2708;
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 700;
  flex: 0 0 auto;
}
.nlm-adbtn[disabled] { border-color: #E4D8C4; color: #B6A48C; background: #FAF5EA; pointer-events: none; }
.nlm-adbtn[disabled] .tag { background: #D6C8B2; color: #fff; }

/* ---------------- 设置 ---------------- */
.nlm-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.nlm-set-row .k { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.nlm-set-row .v { font-size: 12px; font-weight: 700; color: var(--amber-d); font-variant-numeric: tabular-nums; }

.nlm-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #EDE2CE;
  outline: none;
  margin: 0 0 16px;
  accent-color: #E9A13B;
}
.nlm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(90, 60, 20, .28);
  cursor: pointer;
}
.nlm-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid #fff;
  cursor: pointer;
}
.nlm-range:last-of-type { margin-bottom: 4px; }

.nlm-steps { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.nlm-step {
  display: flex;
  gap: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink2);
  font-weight: 500;
}
.nlm-step i {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--paper2);
  border: 1px solid var(--line);
  color: var(--amber-d);
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  text-align: center;
  line-height: 14px;
  margin-top: 1px;
}

/* ---------------- 小屏微调 ---------------- */
@media (max-height: 700px) {
  .nlm-chip { top: 82px; height: 26px; }
  .nlm-dock { height: 52px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .nlm-dock-btn .ic { width: 19px; height: 19px; }
  .nlm-ad-stage { height: 230px; }
}
