/* ================= 暗夜狼人杀 主题样式 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0d1018;
  --bg2: #151a28;
  --panel: #1c2236;
  --panel2: #232b44;
  --line: #333d5e;
  --gold: #e8c47a;
  --gold2: #f4ddb0;
  --red: #e2604f;
  --red2: #ff8a78;
  --purple: #b48cf2;
  --green: #6fcf97;
  --blue: #7aa7ff;
  --text: #e9ecf5;
  --muted: #9aa3bd;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    linear-gradient(180deg, rgba(11,14,22,.86) 0%, rgba(13,16,24,.94) 100%),
    radial-gradient(1200px 600px at 80% -10%, rgba(32,40,74,.5) 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(42,30,58,.45) 0%, transparent 55%),
    url('../img/bg.jpg') center / 112% 112% fixed no-repeat,
    var(--bg);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100%;
}

/* ---------- 角色立绘通用 ---------- */
.role-art {
  display: block; width: 122%; height: 122%; max-width: none;
  object-fit: cover; object-position: center center;
}
.role-emoji {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}

#app { max-width: 860px; margin: 0 auto; padding-bottom: 60px; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(13,16,24,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo-btn {
  background: none; border: none; color: var(--gold); font-size: 17px;
  font-weight: 700; cursor: pointer; letter-spacing: 1px;
}
.topnav { display: flex; gap: 4px; }
.topnav button {
  background: none; border: none; color: var(--muted);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.topnav button:hover { color: var(--gold); background: var(--panel); }

/* ---------- 通用 ---------- */
#view { padding: 20px 16px; }
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg2) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
h1 { font-size: 26px; letter-spacing: 2px; }
h2 { font-size: 19px; margin-bottom: 12px; color: var(--gold2); }
h3 { font-size: 16px; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 13.5px; }
.center { text-align: center; }
.gold { color: var(--gold); }
.red { color: var(--red2); }
.purple { color: var(--purple); }
.spacer { height: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

.btn {
  display: inline-block;
  background: linear-gradient(180deg, #f0d496, #d9b265);
  color: #2a2110; border: none; border-radius: 12px;
  padding: 12px 20px; font-size: 15px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(217,178,101,.25);
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); box-shadow: none;
}
.btn-danger { background: linear-gradient(180deg, #ef7d6c, #d24f3e); color: #fff; }
.btn-blue { background: linear-gradient(180deg, #8fb4ff, #5f85dd); color: #101733; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; display: block; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.chip.good { color: var(--gold); border-color: #6b5a34; background: rgba(232,196,122,.08); }
.chip.wolf { color: var(--red2); border-color: #6e332c; background: rgba(226,96,79,.1); }
.chip.third { color: var(--purple); border-color: #564080; background: rgba(180,140,242,.1); }

/* ---------- 首页 ---------- */
.hero {
  text-align: center; padding: 48px 12px 30px;
  text-shadow: 0 2px 20px rgba(0,0,0,.6);
}
.hero .moon { font-size: 64px; filter: drop-shadow(0 0 24px rgba(232,196,122,.5)); animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.hero h1 {
  margin: 14px 0 8px;
  background: linear-gradient(90deg, #f6e3b4, #d9a85a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.mode-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 18px; cursor: pointer; text-align: center;
  transition: transform .12s, border-color .15s;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.mode-card .big { font-size: 42px; }
.mode-card h3 { margin: 10px 0 4px; color: var(--gold2); font-size: 18px; }
.mode-card p { font-size: 13px; color: var(--muted); }
.feature-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 10px; }
.feature {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 8px; text-align: center; cursor: pointer;
}
.feature .fi { font-size: 24px; }
.feature span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

/* ---------- 角色图鉴 ---------- */
.lib-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.lib-filter button {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 16px; cursor: pointer; font-size: 13.5px;
}
.lib-filter button.active { background: var(--gold); color: #2a2110; border-color: var(--gold); font-weight: 700; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.role-card {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0; cursor: pointer; text-align: center;
  overflow: hidden;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}
.role-card:hover {
  transform: translateY(-3px); border-color: var(--gold);
  box-shadow: 0 10px 26px rgba(0,0,0,.45), 0 0 0 1px rgba(232,196,122,.25);
}
.role-card .ricon {
  position: relative; height: 118px; overflow: hidden;
  background: linear-gradient(160deg, #232b44, #10141f);
}
.role-card .ricon::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,13,22,.12) 0%, transparent 35%, rgba(10,13,22,.18) 75%, rgba(21,26,40,.92) 100%);
}
.role-card .ricon .role-art { transition: transform .25s ease; }
.role-card:hover .ricon .role-art { transform: scale(1.06); }
.role-card .ricon .role-emoji { font-size: 44px; }
.role-card .rname { font-weight: 700; padding: 9px 10px 0; font-size: 15px; position: relative; }
.role-card .rtag { font-size: 12px; color: var(--muted); padding: 3px 10px 13px; }
.role-card.good { border-top: 3px solid var(--gold); }
.role-card.wolf { border-top: 3px solid var(--red); }
.role-card.third { border-top: 3px solid var(--purple); }

/* 角色详情弹层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(5,7,12,.72);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel2), var(--bg2));
  border: 1px solid var(--line); border-radius: 18px; padding: 24px;
}
.modal .m-icon {
  position: relative;
  width: 184px; height: 184px; margin: 0 auto 6px;
  border-radius: 16px; overflow: hidden;
  border: 1px solid #8a7142;
  background: linear-gradient(160deg, #232b44, #10141f);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 5px rgba(232,196,122,.07);
}
.modal .m-icon::after {
  content: ''; position: absolute; inset: 0;
  box-shadow: inset 0 0 40px rgba(0,0,0,.45);
  border-radius: 16px; pointer-events: none;
}
.modal .m-icon .role-emoji { font-size: 64px; }
.modal h2 { text-align: center; margin: 8px 0 2px; }
.modal .m-chips { text-align: center; margin-bottom: 14px; }
.modal .m-sec { margin-top: 12px; }
.modal .m-sec .lab { color: var(--gold); font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.modal .m-sec p { font-size: 14px; color: #cdd4e8; }

/* ---------- 房间设置 ---------- */
.setup-head { display:flex; justify-content:space-between; align-items:center; margin-bottom: 14px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preset-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  background: var(--panel); cursor: pointer;
}
.preset-item.active { border-color: var(--gold); background: rgba(232,196,122,.08); }
.preset-item .pn { font-weight: 700; font-size: 14.5px; }
.preset-item .pd { font-size: 12px; color: var(--muted); }
.preset-item .pc { font-size: 12px; color: var(--gold); margin-top: 4px; }

.input, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 15px;
  outline: none;
}
.input:focus, select:focus { border-color: var(--gold); }
label.flab { display:block; font-size:13px; color: var(--muted); margin: 12px 0 5px; }

.comp-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.comp-token {
  font-size: 12.5px; padding: 4px 8px; border-radius: 8px;
  background: var(--panel2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 4px;
}
.comp-token .x { color: var(--red2); cursor: pointer; font-weight: 700; }
.stepper { display:flex; align-items:center; gap:12px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.stepper .val { font-size: 22px; font-weight: 700; min-width: 48px; text-align:center; }

.role-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; max-height: 340px; overflow-y: auto; padding: 4px;
}
.rp-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 0 0 8px;
  text-align: center; cursor: pointer; background: var(--panel); position: relative;
  font-size: 12.5px; overflow: hidden;
}
.rp-item .ri {
  position: relative; height: 58px; overflow: hidden; margin-bottom: 5px;
  background: linear-gradient(160deg, #232b44, #10141f);
}
.rp-item .ri::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,13,22,.15), rgba(20,25,40,.55));
}
.rp-item .ri .role-emoji { font-size: 26px; }
.rp-item.selected { border-color: var(--gold); background: rgba(232,196,122,.12); }
.rp-item .cnt {
  position: absolute; top: -6px; right: -4px; background: var(--gold);
  color: #2a2110; border-radius: 999px; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; line-height: 18px;
}

/* ---------- 游戏界面 ---------- */
.game-wrap { max-width: 720px; margin: 0 auto; }
.story-card {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 18px 20px; margin-bottom: 14px;
  animation: cardIn .3s ease;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.scene-title { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 2px; margin-bottom: 4px; }
.scene-sub { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.night-theme { border-color: #4a4480; background: linear-gradient(180deg,#232252,#141428); }
.day-theme { border-color: #6b5a34; background: linear-gradient(180deg,#3a2f1e,#1d1810); }

/* 玩家网格 */
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.p-slot {
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 8px; text-align: center; cursor: default;
  background: rgba(255,255,255,.03); position: relative;
  transition: border-color .12s, transform .1s, background .12s;
}
.p-slot.selectable { cursor: pointer; }
.p-slot.selectable:hover { border-color: var(--gold); transform: translateY(-2px); }
.p-slot.selected { border-color: var(--gold); background: rgba(232,196,122,.14); }
.p-slot.dead { opacity: .42; filter: grayscale(.8); }
.p-slot .seat-no { position: absolute; top: 5px; left: 8px; font-size: 11px; color: var(--muted); }
.p-slot .avatar { font-size: 30px; }
.p-slot .avatar.avatar-num {
  width: 46px; height: 46px; margin: 2px auto 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800; color: var(--gold);
  border-radius: 50%; border: 1.5px solid #6b5a34;
  background: rgba(232,196,122,.08);
}
.p-slot .avatar.avatar-img {
  width: 48px; height: 48px; margin: 2px auto 0;
  border-radius: 50%; overflow: hidden;
  border: 1.5px solid #b89a5e;
  background: linear-gradient(160deg, #232b44, #10141f);
  box-shadow: 0 0 10px rgba(0,0,0,.4);
}
.p-slot .pname { font-size: 13.5px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-slot .prole { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.p-slot .badges { margin-top: 4px; display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.p-slot .bd { font-size: 11px; }
.p-slot.dead .death-x {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: rgba(226,96,79,.55);
}
.p-slot.disabled-look { opacity: .32; pointer-events: none; }
.p-slot .ch { font-size: 10px; }

/* 身份条 */
.me-bar {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, rgba(232,196,122,.12), transparent);
  border: 1px solid #6b5a34; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px;
}
.me-bar .mi {
  width: 48px; height: 48px; flex: none;
  border-radius: 50%; overflow: hidden;
  border: 1.5px solid #b89a5e;
  background: linear-gradient(160deg, #232b44, #10141f);
  box-shadow: 0 0 14px rgba(232,196,122,.18);
}
.me-bar .mi .role-emoji { font-size: 26px; }
.me-bar .mn { font-weight: 700; }
.me-bar .ms { font-size: 12.5px; color: var(--muted); }

/* 日志/发言 */
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-line { font-size: 14px; color: var(--muted); padding-left: 14px; position: relative; }
.log-line::before { content: "•"; position: absolute; left: 2px; color: var(--gold); }
.speech {
  background: var(--panel2); border-radius: 12px; padding: 9px 13px;
  font-size: 14px; max-width: 92%;
}
.speech .who { font-size: 12px; color: var(--gold); font-weight: 700; margin-bottom: 2px; }
.speech .who.wolf-sp { color: var(--red2); }
.speech.align-r { align-self: flex-end; background: #2e3a63; }
.speech.align-r .who { color: #a9c2ff; }

/* 行动提示 */
.action-hint {
  background: rgba(232,196,122,.09); border: 1px dashed #8a7142;
  border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 12px;
}
.action-hint b { color: var(--gold); }

.waiting {
  text-align: center; padding: 30px 10px; color: var(--muted);
}
.waiting .spin { font-size: 34px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* 传递设备遮罩 */
.pass-mask {
  position: fixed; inset: 0; z-index: 200;
  background:
    linear-gradient(160deg, rgba(20,25,46,.94), rgba(8,10,18,.97)),
    url('../img/bg.jpg') center / 112% 112% no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.pass-mask .pm-icon { font-size: 60px; animation: float 4s ease-in-out infinite; }
.pass-mask .pm-art {
  position: relative;
  width: 196px; height: 196px; border-radius: 22px; overflow: hidden;
  border: 2px solid #b89a5e; margin-bottom: 6px;
  background: linear-gradient(160deg, #232b44, #10141f);
  box-shadow: 0 0 60px rgba(232,196,122,.22), 0 20px 50px rgba(0,0,0,.6);
  animation: float 4s ease-in-out infinite;
}
.pass-mask .pm-art::after {
  content: ''; position: absolute; inset: 0;
  box-shadow: inset 0 0 50px rgba(0,0,0,.4);
  border-radius: 22px;
}
.pass-mask .pm-art .role-emoji { font-size: 72px; }
.pass-mask h2 { color: var(--gold2); margin: 14px 0 6px; font-size: 28px; }
.pass-mask p { color: var(--muted); margin-bottom: 26px; max-width: 320px; font-size: 16px; }

/* 传屏模式：当前操作人横幅 */
.mp-operator-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 180;
  background: linear-gradient(90deg, rgba(40,30,15,.95), rgba(20,25,46,.95));
  color: var(--gold2); text-align: center; padding: 8px 16px;
  font-size: 16px; border-bottom: 1px solid rgba(184,154,94,.4);
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.mp-operator-bar b { color: #fff; }

/* 结果浮层 */
.result-mask {
  position: fixed; inset: 0; z-index: 150; background: rgba(5,7,12,.82);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.result-box {
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel2), var(--bg2));
  border: 1px solid var(--line); border-radius: 20px; padding: 26px; text-align: center;
}
.result-box .trophy { font-size: 60px; }
.result-box h1 { margin: 8px 0 4px; }
.full-roles { margin-top: 16px; text-align: left; display: grid; gap: 6px; }
.fr-item {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04); border-radius: 10px; padding: 7px 12px; font-size: 14px;
}
.fr-item .fi {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%; overflow: hidden;
  border: 1px solid #6b5a34;
  background: linear-gradient(160deg, #232b44, #10141f);
}
.fr-item .fi .role-emoji { font-size: 20px; }
.fr-item .fn { flex: 1; }
.fr-item .fc { font-size: 12.5px; color: var(--muted); }
.fr-layers { flex: 1; display: grid; gap: 3px; }
.fr-layer { font-size: 13px; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.04); }
.fr-layer.fr-dead { opacity: .45; text-decoration: line-through; }

/* 一人多身份：状态栏身份层标记 */
.layer-pips { margin-left: 6px; white-space: nowrap; }
.layer-pips .lp {
  display: inline-block; min-width: 17px; text-align: center; margin: 0 1px;
  font-size: 11px; border-radius: 999px; padding: 1px 5px;
  border: 1px solid var(--line); color: var(--muted);
}
.layer-pips .lp-cur { background: rgba(217,178,101,.22); border-color: #c9a15b; color: #f0d496; }
.layer-pips .lp-dead { opacity: .4; text-decoration: line-through; }

/* 死亡公告 */
.death-announce { text-align: center; padding: 8px 0; }

/* ============================================================
   账号 / 段位 / 商店 / 试炼
   ============================================================ */

/* 顶栏用户 */
.top-user {
  display: flex; align-items: center; gap: 6px; margin-left: 8px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 4px 10px 4px 6px; cursor: pointer;
}
.top-user:hover { border-color: var(--gold); }
.tu-ava {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #2c3450, #10141f); font-size: 15px;
}
.tu-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tu-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.tu-meta b { font-size: 12px; }
.tu-meta i { font-size: 10px; color: var(--muted); font-style: normal; white-space: nowrap; }

/* 头像与头像框（三层结构：外层定位上下文 → 头像层 → 装饰框层）
 * 头像框为 SVG，中心透明，装饰仅在环带，不遮挡头像 */
.ava { position: relative; display: inline-grid; place-items: center; border-radius: 50%; flex: none; overflow: visible; }
.ava .ava-in {
  position: absolute; inset: 15%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #2c3450, #0d1018);
}
.ava .ava-in img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava-fr { position: absolute; inset: -9%; z-index: 2; pointer-events: none; }
.ava-fr-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ava-sm { width: 44px; height: 44px; } .ava-sm .ava-in { font-size: 22px; }
.ava-md { width: 58px; height: 58px; } .ava-md .ava-in { font-size: 28px; }
.ava-lg { width: 88px; height: 88px; } .ava-lg .ava-in { font-size: 42px; }
.ava-xl { width: 112px; height: 112px; } .ava-xl .ava-in { font-size: 52px; }
.ava .ava-fr:empty { display: none; }
@keyframes legendGlow { 0%,100% { filter: drop-shadow(0 0 2px rgba(255,216,107,.5)); } 50% { filter: drop-shadow(0 0 7px rgba(255,216,107,.95)); } }
.ava .ava-fr-svg[class*="legend"], .fr-legend-glow { animation: legendGlow 2.6s ease-in-out infinite; }

/* 月相段位视觉 */
.rank-moon { width: 44px; height: 44px; flex: none; filter: drop-shadow(0 0 6px rgba(232,196,122,.25)); }
.moon-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.rank-moon-lg { width: 56px; height: 56px; }

/* 个人主页 */
.prof-head { display: flex; align-items: center; gap: 18px; }
.prof-info { flex: 1; min-width: 0; }
.rank-bar { height: 8px; border-radius: 999px; background: var(--bg); margin: 8px 0 4px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#f6e3b4,#d9a85a); }
.prof-stats { display: grid; grid-template-columns: repeat(6,1fr); gap: 8px; text-align: center; }
.prof-stats b { display: block; font-size: 17px; color: var(--gold2); }
.prof-stats span { font-size: 11px; color: var(--muted); }
.spec-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.spec-row b { margin-left: auto; color: var(--gold); }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(51,61,94,.4); font-size: 14px; }
.hist-row .win { color: var(--green); font-weight: 700; }
.hist-row .lose { color: var(--red2); font-weight: 700; }
.pos { color: var(--green); } .neg { color: var(--red2); }

/* 商店 */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px,1fr)); gap: 10px; }
.shop-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center;
  background: var(--bg2); display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.shop-item.on { border-color: var(--gold); background: rgba(232,196,122,.1); }
.shop-item.lock { opacity: .85; }
.shop-item .si-name { font-size: 13px; font-weight: 600; }
.shop-item .si-state { font-size: 11px; color: var(--muted); }
.vi-ic { font-size: 30px; height: 44px; display: grid; place-items: center; }

/* 试炼 */
.trial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px,1fr)); gap: 8px; }
.trial-cell {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--bg2); cursor: pointer; font-size: 18px; transition: transform .1s, border-color .15s;
}
.trial-cell span { font-size: 12px; color: var(--muted); }
.trial-cell:hover { transform: translateY(-2px); border-color: var(--gold); }
.trial-cell.cleared { border-color: #3f7a55; background: rgba(111,207,151,.08); }
.trial-cell.locked { opacity: .4; cursor: not-allowed; }

/* 结算分页面板 */
.score-panel {
  margin: 14px 0; border: 1px solid #6b5a34; border-radius: 14px;
  background: linear-gradient(180deg, rgba(232,196,122,.08), rgba(21,26,40,.6));
  padding: 14px; text-align: left;
}
.sp-title { font-weight: 700; color: var(--gold2); margin-bottom: 8px; }
.sp-line { font-size: 13.5px; padding: 2px 0; }
.sp-line.win { color: var(--green); font-weight: 700; }
.sp-line.lose { color: var(--red2); font-weight: 700; }
.sp-line.muted { color: var(--muted); font-size: 12px; }
.sp-perf { margin: 4px 0; }
.spi { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 1px 0; }
/* 行为维度得分条 */
.sp-dims { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; padding: 8px; background: rgba(0,0,0,.2); border-radius: 8px; }
.sp-dim { display: grid; grid-template-columns: 36px 1fr 42px; align-items: center; gap: 8px; font-size: 12px; }
.sp-dim .sd-name { color: var(--muted); }
.sp-dim .sd-bar { height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.sp-dim .sd-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.sp-dim .sd-fill.pos { background: linear-gradient(90deg, #4caf50, #8bc34a); }
.sp-dim .sd-fill.neg { background: linear-gradient(90deg, #f44336, #ff9800); }
.sp-dim .sd-pts { text-align: right; font-weight: bold; }
.sp-dim .sd-pts.pos { color: #8bc34a; }
.sp-dim .sd-pts.neg { color: #ff9800; }
.sp-rank { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 4px; font-size: 16px; }
.sp-rank b { color: var(--gold); font-size: 19px; }

/* 轻提示 */
.wn-toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: var(--panel2); border: 1px solid var(--gold); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 200; box-shadow: var(--shadow);
}
.wn-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .prof-stats { grid-template-columns: repeat(3,1fr); }
  .tu-meta i { display: none; }
  .topnav button { padding: 6px 8px; font-size: 13px; }
}
.death-announce .skull { font-size: 40px; }
.death-name { font-weight: 700; font-size: 17px; color: var(--red2); }

/* 投票条 */
.vote-bar { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.vote-fill { height: 100%; background: linear-gradient(90deg, #d9b265, #f0d496); border-radius: 999px; transition: width .5s; }
.vote-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vote-row .vn { width: 90px; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-row .vb { flex: 1; }
.vote-row .vc { width: 44px; text-align: right; font-size: 13px; color: var(--gold); }

/* 快速发言 */
.quick-phrases { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.quick-phrases button {
  font-size: 12.5px; padding: 5px 10px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.quick-phrases button:hover { border-color: var(--gold); }

.day-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

.back-home { margin-bottom: 14px; }

@media (max-width: 560px) {
  .mode-grid, .preset-grid { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .topnav { overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav button { padding: 6px 8px; font-size: 13px; white-space: nowrap; }
  .logo-btn { font-size: 15px; white-space: nowrap; }
  #view { padding: 14px 10px; }
}

/* ============================================================
   联盟 / 聊天（本地模拟社交）
   ============================================================ */

/* 联盟列表与详情 */
.guild-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.guild-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg2); }
.gr-badge, .gh-badge {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800; color: #1a1408;
  background: linear-gradient(135deg, #f6e3b4, #c99b4e); font-size: 14px;
  overflow: hidden; border: 1px solid rgba(232,196,122,.35);
}
.gr-badge img, .gh-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.gr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gr-info span { font-size: 12px; }
.guild-head { display: flex; align-items: center; gap: 14px; }
.gh-info { flex: 1; min-width: 0; }
.gh-badge { width: 56px; height: 56px; font-size: 17px; border-radius: 14px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 8px; }
.member { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); text-align: center; }
.member.me { border-color: var(--gold); background: rgba(232,196,122,.08); }
.member .m-ava {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  overflow: hidden; background: radial-gradient(circle at 35% 30%, #2c3450, #0d1018);
}
.member .m-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.member b { font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member i { font-size: 11px; color: var(--muted); font-style: normal; }

/* 联盟赛积分榜 */
.board { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.board-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid rgba(51,61,94,.4); font-size: 14px; }
.board-row:last-child { border-bottom: none; }
.board-row.mine { background: rgba(232,196,122,.1); }
.br-rank { width: 30px; text-align: center; font-weight: 700; }
.br-name { flex: 1; }
.br-name i { color: var(--muted); font-style: normal; font-size: 11px; margin-left: 6px; }
.season-claim { border-color: #6b5a34; background: linear-gradient(180deg, rgba(232,196,122,.12), rgba(21,26,40,.6)); }
.reward-line { margin: 8px 0 12px; font-size: 16px; }

/* 聊天 FAB + 面板 */
.wn-chat .chat-fab {
  position: fixed; right: 18px; bottom: 20px; z-index: 160;
  width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--gold);
  background: linear-gradient(180deg, #f6e3b4, #c99b4e); font-size: 24px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.45);
}
.wn-chat .chat-fab[hidden] { display: none !important; }
.wn-chat .chat-panel[hidden] { display: none !important; }
.chat-panel {
  position: fixed; right: 18px; bottom: 20px; z-index: 170;
  width: min(360px, calc(100vw - 24px)); height: min(540px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6); overflow: hidden;
}
.cp-head { display: flex; align-items: center; padding: 8px 8px 0; gap: 4px; cursor: grab; }
.cp-head:active { cursor: grabbing; }
.cp-tabs { flex: 1; display: flex; gap: 4px; }
.cp-tabs button {
  flex: 1; background: none; border: none; color: var(--muted);
  padding: 8px 0; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.cp-tabs button.on { color: var(--gold2); background: rgba(232,196,122,.12); font-weight: 700; }
.cp-close { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 8px; }
.cp-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cp-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.cp-input .input { flex: 1; font-size: 14px; padding: 8px 10px; }

/* 消息气泡 */
.cm { display: flex; gap: 8px; align-items: flex-end; }
.cm-ava {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 17px; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #2c3450, #0d1018);
}
.cm-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cm-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-name { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cm-bubble {
  position: relative; max-width: 240px; padding: 8px 12px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line); font-size: 14px; line-height: 1.5;
  word-break: break-word;
}
.cm-bubble time { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; text-align: right; }
.cm.me { flex-direction: row-reverse; }
.cm.me .cm-bubble { background: linear-gradient(180deg, rgba(232,196,122,.2), rgba(201,155,78,.14)); border-color: #6b5a34; }
.cm-system { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }

/* 私信列表 */
.dm-list { display: flex; flex-direction: column; }
.dm-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-radius: 10px; }
.dm-row:hover { background: rgba(232,196,122,.08); }
.dm-row b { font-size: 14px; }
/* 好友/申请分区 */
.dl-section { font-size: 12px; color: var(--gold, #e8c47a); opacity: .85; padding: 14px 6px 4px; letter-spacing: 1px; }
.dl-grow { flex: 1; min-width: 0; }
.dl-grow .muted { font-size: 12px; margin-top: 2px; }
.dm-row .btn-sm { flex: none; }
.dm-head { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dm-back { cursor: pointer; font-size: 22px; color: var(--gold); line-height: 1; padding: 0 4px; }
.dm-title { font-weight: 700; }
.dm-title .muted { font-weight: 400; font-size: 12px; }

/* 连接状态 */
.cp-conn { font-size: 11px; padding: 4px 12px 0; }
.cp-conn.ok { color: var(--green); }
.cp-conn.off { color: var(--muted); }
/* 未读角标 */
.chat-fab { position: relative; }
.chat-fab.has-unread::after {
  content: attr(data-badge); position: absolute; top: -4px; right: -4px;
  background: #e8463c; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center;
  padding: 0 4px; border: 2px solid var(--bg);
}

/* ============================================================
 * 身份解锁进度 / 未拥有身份置灰
 * ============================================================ */
.unlock-bar { height: 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 10px; }
.unlock-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #c99b4e, var(--gold2)); transition: width .3s; }
.rp-item.locked { opacity: .42; filter: grayscale(.85); cursor: not-allowed; }
.rp-item .lock-tag {
  position: absolute; left: 0; right: 0; bottom: 22px; margin: auto;
  font-size: 10.5px; color: var(--muted); text-align: center; pointer-events: none;
}

/* ============================================================
 * 任务中心
 * ============================================================ */
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 10px; }
.task-row.done { opacity: .62; border-color: #4d5a3a; }
.tr-main { flex: 1.2; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tr-main b { font-size: 14px; }
.tr-mid { flex: 1; min-width: 90px; display: flex; align-items: center; gap: 8px; }
.tr-bar { flex: 1; height: 7px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.tr-fill { height: 100%; background: linear-gradient(90deg, #c99b4e, var(--gold2)); border-radius: 4px; }
.tr-prog { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tr-r { flex: 0 0 auto; font-size: 12.5px; color: var(--gold); text-align: right; max-width: 130px; }
.task-row.done .tr-r { color: var(--green); }

/* 活跃度 */
.act-bar { position: relative; margin: 26px 6px 8px; }
.act-track { height: 10px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.act-fill { height: 100%; background: linear-gradient(90deg, #8a6a35, var(--gold), #f4ddb0); border-radius: 5px; transition: width .4s; }
.act-node {
  position: absolute; top: -16px; transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--panel2); color: var(--muted); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; cursor: pointer; line-height: 1.1; text-align: center;
}
.act-node small { display: block; font-size: 9px; font-weight: 400; }
.act-node.can { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(232,196,122,.5); animation: actPulse 1.4s infinite; }
.act-node.claimed { border-color: var(--green); color: var(--green); background: rgba(94,170,94,.12); }
@keyframes actPulse { 0%,100% { transform: translateX(-50%) scale(1);} 50% { transform: translateX(-50%) scale(1.1);} }

/* ============================================================
 * 联盟赛时间线
 * ============================================================ */
.season-line { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.sl-item {
  flex: 1; min-width: 110px; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; background: var(--bg2); text-align: center; opacity: .55;
}
.sl-item b { display: block; font-size: 13.5px; color: var(--gold2); }
.sl-item i { font-style: normal; font-size: 11px; color: var(--muted); }
.sl-item.on { opacity: 1; border-color: var(--gold); background: linear-gradient(180deg, rgba(232,196,122,.14), var(--bg2)); box-shadow: 0 0 14px rgba(232,196,122,.25); }

/* ============================================================
 * 登神之阶
 * ============================================================ */
.ascent-hero {
  border-color: #6b4f8c !important;
  background: radial-gradient(circle at 50% -20%, rgba(180,140,242,.22), var(--panel2) 60%) !important;
}
.phase-list { display: flex; gap: 8px; flex-wrap: wrap; }
.phase-item {
  flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg2); opacity: .6;
}
.phase-item b { color: var(--purple); font-size: 16px; }
.phase-item span { font-size: 12.5px; color: var(--muted); }
.phase-item.on { opacity: 1; border-color: var(--purple); background: rgba(180,140,242,.1); box-shadow: 0 0 14px rgba(180,140,242,.3); }
.phase-item.done { opacity: .75; border-color: var(--green); }
.phase-item.done b { color: var(--green); }
.phase-item.lock { opacity: .4; }
.phase-item.lock b { color: var(--muted); }

/* ============================================================
 * 组队模式
 * ============================================================ */
.team-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.team-slot {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 8px;
  background: var(--bg2); display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
}
.team-slot .ts-ava {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-size: 22px; background: radial-gradient(circle at 35% 30%, #2c3450, #0d1018);
}
.team-slot b { font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-slot i { font-style: normal; font-size: 11px; color: var(--muted); }
.team-slot.ready { border-color: var(--green); background: rgba(94,170,94,.1); }
.team-slot.ready i { color: var(--green); }
.team-slot.host { border-color: var(--gold); }
.team-slot.empty { border-style: dashed; opacity: .55; }
.team-slot.empty .ts-ava { font-size: 20px; color: var(--muted); }

.team-chat {
  height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.tc-line { font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.tc-line b { color: var(--gold2); }
.tc-line.self b { color: var(--gold); }
#teamAudio { display: none; }

@media (max-width: 560px) {
  .tr-r { max-width: 96px; }
  .sl-item { min-width: 46%; }
}
