:root {
  --paper: #f2ece1;
  --card: #fffdf8;
  --ink: #2b241d;
  --ink-2: #6b6157;
  --ink-3: #9a9086;
  --red: #c0563a;
  --blue: #3d6fb5;
  --gold: #c9a227;
  --line: #e2d8c8;
  --shadow: 0 6px 20px rgba(60, 44, 24, 0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
.app { max-width: 520px; margin: 0 auto; padding: 0 18px 96px; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }

/* 顶栏 */
.top { display: flex; align-items: flex-end; justify-content: space-between; padding: 26px 0 14px; }
.top h1 { font-size: 26px; margin: 0; letter-spacing: 1px; }
.top .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.quota {
  font-size: 12px; color: var(--ink-2); background: #fff6e2; border: 1px solid #efe0bd;
  border-radius: 99px; padding: 6px 12px; white-space: nowrap;
}

/* 卡片/通用 */
.card {
  background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
  border: 1px solid rgba(210, 195, 172, 0.45);
}
.card + .card { margin-top: 12px; }
.card-t { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.card-s { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.sec-t { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.sec-t h2 { font-size: 16px; margin: 0; }
.sec-t .r { font-size: 12px; color: var(--ink-3); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* 按钮 */
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 11px 18px; border-radius: 12px; font-size: 15px; font-family: inherit;
  cursor: pointer; transition: transform .12s ease, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .5; }

/* 大厅九宫格 */
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot {
  position: relative; background: var(--card); border: 1px solid rgba(210, 195, 172, 0.55);
  border-radius: 16px; padding: 14px 14px 12px; text-align: left; cursor: pointer;
  box-shadow: 0 3px 10px rgba(60, 44, 24, 0.05); overflow: hidden;
}
.slot:active { transform: scale(.985); }
.slot .mode { font-size: 12px; color: var(--ink-3); }
.slot .rec { font-size: 17px; font-weight: 600; margin-top: 2px; }
.slot .st { font-size: 12px; margin-top: 10px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.slot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.slot .dot.on { background: var(--red); }
.slot .dot.ok { background: #4a8a5c; }
.slot .mini-track { height: 4px; border-radius: 4px; background: #eee5d6; margin-top: 10px; overflow: hidden; }
.slot .mini-fill { height: 100%; background: var(--red); }
.slot-again { position: absolute; right: 12px; top: 14px; font-size: 11px; color: var(--red); }
.slot.done .rec { color: var(--ink-3); }

/* 房间头 */
.room-top { padding: 18px 0 6px; }
.room-top .back { font-size: 13px; color: var(--ink-3); }
.room-title { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.room-title h1 { font-size: 24px; margin: 0; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 99px; background: #efe5d4; color: var(--ink-2); }
.pill.wait { background: #e9eef7; color: #3c5a8c; }
.pill.vote { background: #f7eee0; color: #8a6a2f; }
.pill.on { background: #f7e6e0; color: var(--red); }
.pill.done { background: #e6efe7; color: #3f7a52; }
.duo { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.duo .who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #e6dccb; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-3); overflow: hidden; }
.avatar.lg { width: 64px; height: 64px; font-size: 15px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.duo .nm { font-size: 13px; color: var(--ink-2); }
.duo .vs { color: var(--ink-3); font-size: 12px; }

/* 血条 */
.hp { position: relative; height: 30px; border-radius: 8px; background: #e8ddca; overflow: hidden; border: 1px solid #dccfb8; }
.hp-fill { position: absolute; top: 0; bottom: 0; transition: width .42s ease; }
.hp-red { left: 0; background: linear-gradient(180deg, #d76a4c, var(--red)); }
.hp-blue { right: 0; background: linear-gradient(180deg, #4f82c8, var(--blue)); }
.hp-fill::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px);
}
.hp-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(255,255,255,.7); }
.hp-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.hp-meta .r { text-align: right; }

/* 心愿卡 */
.wish { display: flex; gap: 12px; align-items: center; }
.wish-photo { width: 78px; height: 78px; border-radius: 12px; object-fit: cover; background: #efe6d6; flex: none; }
.wish-body { flex: 1; min-width: 0; }
.wish-name { font-size: 15px; font-weight: 600; }
.wish-price { font-size: 17px; color: var(--red); font-weight: 600; margin-top: 2px; }
.wish-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.wish-empty { color: var(--ink-3); font-size: 13px; }

/* 明细 */
.entries { margin-top: 10px; }
.entry { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.entry:last-child { border-bottom: none; }
.entry .l { min-width: 0; }
.entry .t { font-size: 14px; }
.entry .m { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.entry .v { color: #4a8a5c; font-weight: 600; white-space: nowrap; }

/* 横幅 */
.banner {
  margin-top: 12px; border-radius: 14px; padding: 14px 16px; background: linear-gradient(120deg, #f6e3a8, #e9c86b);
  color: #4a3a12; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.banner .bt { font-size: 16px; font-weight: 700; }
.banner .bs { font-size: 12px; opacity: .8; margin-top: 2px; }

/* 倒计时条 */
.cd-card { margin-bottom: 12px; }
.cd-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.cd-track { height: 6px; border-radius: 6px; background: #eee5d6; margin-top: 8px; overflow: hidden; }
.cd-fill { height: 100%; background: var(--red); transition: width 1s linear; }

/* 投票卡 */
.vote-card { position: relative; }
.vote-card.picked { outline: 2px solid var(--red); }
.vote-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.vote-note { font-size: 12px; color: var(--ink-3); }

/* 图鉴 */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.poke { position: relative; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 4px 14px rgba(60,44,24,.1); cursor: pointer; }
.poke-photo { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #3b332a; }
.poke-photo.empty { display: flex; align-items: center; justify-content: center; color: #e8dcc6; font-size: 13px; }
.poke-meta { padding: 9px 10px 11px; }
.poke-name { font-size: 13.5px; font-weight: 600; }
.poke-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; display: flex; justify-content: space-between; }
.badge { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 7px; letter-spacing: .5px; }
.foil { position: absolute; inset: 0; pointer-events: none; opacity: .0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.55) 0 8px, rgba(255,255,255,0) 8px 22px, rgba(255,255,255,.28) 22px 30px, rgba(255,255,255,0) 30px 46px);
  animation: foilMove 7s linear infinite; }
@keyframes foilMove { from { background-position: 0 0 } to { background-position: 220px 0 } }
.t-N { background: #8a8f98; } .t-R { background: #3d6fb5; } .t-SR { background: #7b4fb5; }
.t-SSR { background: #c9a227; } .t-UR { background: #c0563a; } .t-NUR { background: #1f1b16; }
.r1 .foil { opacity: .04 } .r2 .foil { opacity: .08 } .r3 .foil { opacity: .13 }
.r4 .foil { opacity: .2 } .r5 .foil { opacity: .28 }

/* 大卡 */
.bigcard { position: relative; border-radius: 20px; padding: 16px; background: linear-gradient(160deg, #2b241d, #4a3b2c); color: #fff; overflow: hidden; }
.bigcard .photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; background: #191512; display: block; }
.bigcard .name { font-size: 20px; font-weight: 700; margin-top: 12px; }
.bigcard .price { color: #f0d27c; font-size: 18px; margin-top: 2px; }
.bigcard .meta { font-size: 12px; opacity: .75; margin-top: 8px; line-height: 1.7; }
.bigcard .foot { font-size: 11px; opacity: .6; margin-top: 14px; letter-spacing: .5px; }

/* 底部导航 */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 60px;
  background: rgba(255, 253, 248, .92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
}
.nav button { background: none; border: 0; font-size: 14px; color: var(--ink-3); font-family: inherit; padding: 4px 10px; }
.nav button.on { color: var(--red); font-weight: 600; }

/* FAB */
.fab {
  position: fixed; right: max(18px, calc(50% - 260px + 18px)); bottom: 84px; width: 56px; height: 56px;
  border-radius: 50%; background: var(--red); color: #fff; font-size: 28px; line-height: 1; border: 0;
  box-shadow: 0 8px 20px rgba(192, 86, 58, .35); z-index: 21; cursor: pointer;
}

/* 弹层 */
.sheet-mask { position: fixed; inset: 0; background: rgba(28, 22, 16, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 520px; background: var(--card); border-radius: 22px 22px 0 0; padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto; animation: up .22s ease;
}
@keyframes up { from { transform: translateY(20px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet h3 { margin: 0 0 14px; font-size: 17px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px 12px;
  font-size: 15px; font-family: inherit; color: var(--ink); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--red); }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.saved-box { background: #f4f8f1; border: 1px dashed #bcd3b4; border-radius: 12px; padding: 12px; text-align: center; }
.saved-box .k { font-size: 12px; color: var(--ink-2); }
.saved-box .v { font-size: 24px; font-weight: 700; color: #4a8a5c; }
.photo-pick { display: flex; gap: 10px; align-items: center; }
.photo-pick img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #efe6d6; }
.bonus-box { margin-top: 12px; background: #fff6e2; border: 1px solid #efe0bd; border-radius: 12px; padding: 12px; }
.bonus-box .t { font-size: 13px; }
.bonus-box .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* 登录 */
.gate { padding-top: 60px; }
.gate .logo { font-size: 34px; font-weight: 700; letter-spacing: 2px; }
.gate .sub { color: var(--ink-3); font-size: 13px; margin: 6px 0 26px; }
.gate-avatar { display: flex; align-items: center; gap: 12px; margin: 6px 0 20px; }
.gate-note { font-size: 11.5px; color: var(--ink-3); margin-top: 16px; line-height: 1.6; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%) translateY(8px);
  background: rgba(30, 24, 18, .9); color: #fff; font-size: 13.5px; padding: 11px 18px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 30px 0; }
.link-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.link-row:last-child { border-bottom: none; }
.link-row .arr { color: var(--ink-3); }
.stat3 { display: flex; text-align: center; }
.stat3 > div { flex: 1; }
.stat3 .k { font-size: 11.5px; color: var(--ink-3); }
.stat3 .v { font-size: 19px; font-weight: 700; }
