/* ============================================================
   像素宠物 · PixelPet 全局样式
   复古治愈像素风 / 双端自适应 / 昼夜色调切换
   ============================================================ */
:root {
  --bg-day: #fdf3d9;
  --bg-night: #1c2438;
  --panel-day: #fff8e7;
  --panel-night: #262f4a;
  --ink-day: #4a3b2a;
  --ink-night: #e8e3d2;
  --accent: #ff9f43;
  --accent-dark: #e07b24;
  --green: #6ab04c;
  --red: #eb4d4b;
  --blue: #4a90d9;
  --gold: #f6b93b;
  --shadow: 0 4px 0 rgba(0,0,0,.18);
  --btn-h: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  font-family: "Courier New", "SimSun", monospace;
  background: var(--bg-day);
  color: var(--ink-day);
  overflow: hidden;
  user-select: none;
  transition: background .6s ease, color .6s ease;
}
body.night {
  background: var(--bg-night);
  color: var(--ink-night);
}
body.night .panel, body.night .modal-box {
  background: var(--panel-night);
  color: var(--ink-night);
  box-shadow: 0 4px 0 rgba(0,0,0,.45);
}
body.night .bar-wrap { background: rgba(255,255,255,.12); }

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 12px calc(8px + env(safe-area-inset-bottom));
}

/* ---------- 顶部信息栏 ---------- */
#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--panel-day);
  border: 3px solid var(--ink-day);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: background .6s ease;
}
body.night #topbar { background: var(--panel-night); }
.pet-id { display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: 16px; }
#pet-name { cursor: pointer; border-bottom: 1px dashed transparent; }
#pet-name:hover { border-bottom: 1px dashed var(--ink-day); }
.name-input { width: 100%; padding: 10px 12px; font-size: 16px; border: 2px solid #c9a96a; border-radius: 8px; background: #fff9ea; color: #4a3b2a; box-sizing: border-box; margin: 10px 0 4px; }
.name-box .cf-actions { margin-top: 10px; }
#account-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 0; background: transparent; border: 0; color: inherit; font-size: 11px; cursor: pointer; padding: 0 2px; }
#account-btn span { font-size: 9px; opacity: .8; }
.account-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.account-tabs .tab { flex: 1; }
.account-state { font-size: 15px; margin: 6px 0 10px; }
.account-note { font-size: 12px; color: #8a7a5f; margin: 8px 0 4px; line-height: 1.6; }
.acc-msg { font-size: 13px; min-height: 18px; margin: 6px 0 2px; color: #b4533a; }
.account-body .name-input { margin: 4px 0 8px; }
.ai-badge { display: inline-block; margin-left: 5px; padding: 1px 5px; font-size: 10px; font-style: normal; color: #fff; background: #c9854f; border-radius: 8px; vertical-align: 1px; }
.chat-menu { position: fixed; z-index: 999; min-width: 130px; background: #fffdf6; border: 2px solid #e5cfa6; border-radius: 10px; padding: 6px; box-shadow: 0 6px 18px rgba(120, 90, 40, .22); }
.chat-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; background: transparent; border: 0; border-radius: 7px; font-size: 14px; cursor: pointer; }
.chat-menu button:hover { background: #f6ecd8; }
.badge {
  font-size: 11px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--accent-dark);
}
.hud { display: flex; gap: 10px; font-size: 15px; align-items: baseline; }
.hud-item { display: flex; align-items: baseline; gap: 2px; }
.hud-item b { color: var(--accent-dark); font-weight: bold; }
.hud-item em { font-style: normal; font-size: 10px; opacity: .65; font-weight: bold; }
#hud-clock { color: inherit; opacity: .8; }

/* ---------- 宠物展示区 ---------- */
#pet-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin-top: 10px;
}
#pet-box {
  position: relative;
  width: min(280px, 52vw);
  height: min(280px, 52vw);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.15));
}
#pet-box canvas { width: 100%; height: 100%; image-rendering: pixelated; }
#day-night-tag {
  position: absolute;
  top: 4px; right: 6px;
  font-size: 12px;
  background: rgba(0,0,0,.25);
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
}

/* 互动特效粒子 */
.fx {
  position: absolute;
  z-index: 12;
  pointer-events: none;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0,0,0,.12);
  animation-duration: 1.1s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}
.fx-feed { animation-name: fxFeed; }
.fx-clean { animation-name: fxClean; }
.fx-pet { animation-name: fxPet; }
.fx-play { animation-name: fxPlay; }
@keyframes fxFeed {
  0% { opacity: 0; transform: translate(calc(var(--dx) * .3), -26px) scale(.4); }
  35% { opacity: 1; transform: translate(0, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(calc(var(--dx) * -.4), 10px) scale(.3); }
}
@keyframes fxClean {
  0% { opacity: 0; transform: translate(0, 12px) scale(.5); }
  25% { opacity: .95; }
  100% { opacity: 0; transform: translate(var(--dx), -44px) scale(1.35); }
}
@keyframes fxPet {
  0% { opacity: 0; transform: translate(0, 10px) scale(.6); }
  30% { opacity: 1; transform: translate(calc(var(--dx) * .3), 0); }
  100% { opacity: 0; transform: translate(var(--dx), -52px) scale(1); }
}
@keyframes fxPlay {
  0% { opacity: 0; transform: translate(0, 8px) rotate(0) scale(.5); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), -44px) rotate(220deg) scale(1.15); }
}

/* 宠物台词气泡 */
.bubble {
  position: absolute;
  top: 8%; left: 50%;
  transform: translateX(-50%);
  max-width: 78%;
  background: #fff;
  color: #4a3b2a;
  border: 3px solid #4a3b2a;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 3px 0 rgba(0,0,0,.2);
  z-index: 5;
  animation: pop .25s ease;
  white-space: normal;
  word-break: break-word;
}
body.night .bubble { background: #3a4568; color: #e8e3d2; border-color: #121a2e; }
.bubble::after {
  content: "";
  position: absolute;
  bottom: -10px; left: 30px;
  border: 6px solid transparent;
  border-top-color: #fff;
}
body.night .bubble::after { border-top-color: #3a4568; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

/* ---------- 属性条 ---------- */
#stats {
  display: grid;
  gap: 6px;
  padding: 10px 4px;
  margin-top: 4px;
}
.stat { display: flex; align-items: center; gap: 6px; }
.stat-ico { width: 46px; display: flex; align-items: center; gap: 3px; font-size: 15px; }
.stat-ico em { font-style: normal; font-size: 11px; font-weight: bold; opacity: .85; }
.bar-wrap {
  flex: 1;
  height: 14px;
  background: rgba(0,0,0,.12);
  border: 2px solid var(--ink-day);
  border-radius: 8px;
  overflow: hidden;
}
.bar {
  height: 100%;
  width: 100%;
  background: var(--green);
  transition: width .4s ease, background .4s ease;
}
.stat:nth-child(2) .bar { background: var(--blue); }
.stat:nth-child(3) .bar { background: #f368e0; }
.stat:nth-child(4) .bar { background: var(--gold); }
.bar.low { background: var(--red) !important; }
.stat-num { width: 34px; text-align: right; font-size: 13px; }

/* ---------- 操作栏 ---------- */
#actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 6px;
}
.act {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 48px;
  background: var(--panel-day);
  border: 3px solid var(--ink-day);
  border-radius: 10px;
  font-family: inherit;
  font-size: 17px;
  color: var(--ink-day);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .05s ease, box-shadow .05s ease;
  touch-action: manipulation;
}
body.night .act { background: var(--panel-night); color: var(--ink-night); }
.act span { font-size: 12px; font-weight: bold; }
.act:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.act:disabled { opacity: .4; pointer-events: none; }
.act.warn { background: #ffe1e1; border-color: var(--red); color: var(--red); }
body.night .act.warn { background: #4a2b2b; color: #ffb3b3; border-color: var(--red); }

/* 邮件未读徽标 */
.badge-dot {
  position: absolute;
  top: 0; right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--panel-day);
  pointer-events: none;
}
body.night .badge-dot { border-color: var(--panel-night); }

/* ---------- 弹窗通用 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadein .2s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.hidden { display: none !important; }
.modal-box {
  width: min(92vw, 400px);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel-day);
  border: 4px solid var(--ink-day);
  border-radius: 14px;
  box-shadow: 0 8px 0 rgba(0,0,0,.3);
  padding: 14px;
  animation: slideup .22s ease;
}
@keyframes slideup { from { transform: translateY(20px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-head h3 { font-size: 18px; }
.close {
  width: 32px; height: 32px;
  font-size: 20px;
  border: 2px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.modal-sub { font-size: 13px; margin-bottom: 10px; opacity: .8; }

/* ---------- 商店 ---------- */
.shop-list { list-style: none; display: grid; gap: 8px; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink-day);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.5);
}
body.night .shop-item { background: rgba(255,255,255,.06); }
.shop-item .ico { font-size: 26px; width: 38px; text-align: center; }
.shop-item .info { flex: 1; }
.shop-item .name { font-weight: bold; font-size: 14px; }
.shop-item .desc { font-size: 11px; opacity: .75; }
.shop-item .price { font-size: 13px; color: var(--accent-dark); font-weight: bold; }
.shop-item button {
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  border: 2px solid var(--ink-day);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.2);
}
.shop-item button:active { transform: translateY(2px); box-shadow: none; }
.shop-item button.owned { background: #888; pointer-events: none; }

/* ---------- 雷达 ---------- */
.radar-box { text-align: center; }
#radar-canvas {
  width: min(78vw, 300px);
  height: min(78vw, 300px);
  margin: 0 auto;
  display: block;
  background: #07140f;
  border: 3px solid var(--ink-day);
  border-radius: 50%;
  image-rendering: pixelated;
}
.radar-info { margin: 8px 0; font-size: 13px; min-height: 18px; }
.primary-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  border: 3px solid var(--ink-day);
  border-radius: 10px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  width: 100%;
}
.primary-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.primary-btn:disabled { opacity: .5; pointer-events: none; }
.radar-note { margin-top: 8px; font-size: 11px; opacity: .65; line-height: 1.6; }

/* ---------- 玩家名片 ---------- */
.pcard-body { display: flex; align-items: center; gap: 12px; padding: 6px 2px 12px; }
.pcard-ava {
  width: 64px; height: 64px;
  image-rendering: pixelated;
  border: 3px solid var(--ink-day);
  border-radius: 10px;
  background: #fff;
}
body.night .pcard-ava { background: #3a4568; }
.pcard-meta { font-size: 13px; line-height: 1.8; }
.pcard-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pcard-actions .act { height: 46px; }

/* ---------- 比武 ---------- */
.battle-box { width: min(94vw, 420px); }
#battle-stage {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 8px;
  min-height: 150px;
  margin-bottom: 8px;
}
.b-fighter { text-align: center; }
.b-fighter canvas {
  width: 96px; height: 96px;
  image-rendering: pixelated;
}
.b-fighter .nm { font-size: 13px; font-weight: bold; margin: 2px 0; }
.b-hp { width: 96px; height: 12px; background: rgba(0,0,0,.2); border: 2px solid currentColor; border-radius: 6px; overflow: hidden; margin: 0 auto; }
.b-hp i { display: block; height: 100%; background: var(--green); transition: width .35s ease; }
.b-vs { font-size: 22px; font-weight: bold; align-self: center; }
.battle-log {
  height: 96px;
  overflow-y: auto;
  border: 2px solid var(--ink-day);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 8px;
  background: rgba(0,0,0,.06);
}
body.night .battle-log { background: rgba(0,0,0,.25); }
.battle-log .log-line { animation: pop .2s ease; }
.invite-box { max-width: 340px; text-align: center; }
.invite-body { padding: 10px 0; }
.invite-tip { font-size: 15px; margin-bottom: 10px; }
.invite-meta { font-size: 13px; color: #8a7a5a; margin: 4px 0; }
.invite-btns { display: flex; gap: 10px; margin-top: 12px; justify-content: center; }
.battle-actions button:disabled { opacity: .55; cursor: not-allowed; }
.battle-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.battle-actions .act { height: 46px; }
.ai-offer {
  border: 2px dashed var(--red);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(255, 214, 165, .18);
  animation: pop .25s ease;
}
.ai-offer-tip { font-size: 13px; font-weight: bold; margin-bottom: 6px; }
.ai-offer-btns { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; }
.ai-offer-btns .act { height: 40px; font-size: 13px; }

/* ---------- 确认弹窗 ---------- */
.cf-text { font-size: 14px; line-height: 1.7; margin-bottom: 14px; }
.cf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cf-actions .act { height: 46px; }
.act.good { background: var(--green); color: #fff; }
.act.bad { background: var(--red); color: #fff; }

/* ---------- 宠物栏 ---------- */
.pets-tip { font-size: 12px; opacity: .7; margin-bottom: 10px; }
.pets-list { list-style: none; display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; }
.pet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink-day);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.5);
}
body.night .pet-item { background: rgba(255,255,255,.06); }
.pet-item canvas { width: 48px; height: 48px; image-rendering: pixelated; border: 2px solid var(--ink-day); border-radius: 8px; background: #fff; }
body.night .pet-item canvas { background: #3a4568; }
.pet-item .info { flex: 1; }
.pet-item .name { font-weight: bold; font-size: 14px; }
.pet-item .meta { font-size: 11px; opacity: .75; }
.pet-item .tag-cur { background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; }
.pet-item .tag-max { background: var(--gold); color: #4a3b2a; font-size: 10px; padding: 1px 6px; border-radius: 999px; }
.pet-item button {
  font-family: inherit; font-size: 12px; font-weight: bold;
  border: 2px solid var(--ink-day); border-radius: 8px;
  padding: 6px 10px; background: var(--green); color: #fff; cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.2);
}
.pet-item button.using { background: #888; pointer-events: none; }
.pet-item button:active { transform: translateY(2px); box-shadow: none; }

/* ---------- 好友系统 ---------- */
.friends-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.friends-tabs .tab {
  font-family: inherit; font-size: 13px; font-weight: bold;
  border: 2px solid var(--ink-day); border-radius: 8px;
  padding: 8px; background: rgba(255,255,255,.4); color: var(--ink-day); cursor: pointer;
}
body.night .friends-tabs .tab { background: rgba(255,255,255,.06); color: var(--ink-night); }
.friends-tabs .tab.active { background: var(--accent); color: #fff; }
.friends-list { list-style: none; display: grid; gap: 8px; min-height: 120px; max-height: 44vh; overflow-y: auto; }
.pick-list { list-style: none; display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; }
.friend-item {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--ink-day); border-radius: 10px;
  padding: 8px 10px; background: rgba(255,255,255,.5); cursor: pointer;
}
body.night .friend-item { background: rgba(255,255,255,.06); }
.friend-item:active { background: rgba(0,0,0,.08); }
.friend-item .ico { font-size: 22px; width: 30px; text-align: center; }
.friend-item .info { flex: 1; }
.friend-item .nm { font-weight: bold; font-size: 13px; }
.friend-item .sub { font-size: 11px; opacity: .75; }
.friend-item .st { font-size: 11px; color: var(--green); }
.friend-item .st.off { color: #999; }
.friends-empty { text-align: center; color: #999; font-size: 13px; padding: 24px 0; }
.friends-page { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 10px; }
.page-btn {
  font-family: inherit; font-size: 12px; font-weight: bold;
  border: 2px solid var(--ink-day); border-radius: 8px;
  padding: 6px 12px; background: var(--panel-day); color: inherit; cursor: pointer;
}
body.night .page-btn { background: var(--panel-night); }
.page-btn:disabled { opacity: .35; pointer-events: none; }
#page-info { font-size: 13px; }

/* ---------- 组队任务 ---------- */
.task-stage { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 120px; margin-bottom: 8px; }
.task-stage .t-ava { width: 72px; height: 72px; image-rendering: pixelated; border: 3px solid var(--ink-day); border-radius: 12px; background: #fff; }
body.night .task-stage .t-ava { background: #3a4568; }
.task-stage .t-ava canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.task-stage .t-plus { font-size: 22px; font-weight: bold; }
.task-stage .t-name { font-size: 12px; text-align: center; margin-top: 2px; }
.task-hint { text-align: center; font-size: 13px; margin: 6px 0; }
.task-list { list-style: none; display: grid; gap: 8px; max-height: 30vh; overflow-y: auto; margin-top: 8px; }
.task-item { display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink-day); border-radius: 10px; padding: 8px 10px; }
.task-item .nm { flex: 1; font-weight: bold; font-size: 13px; }
.task-item button { font-family: inherit; font-size: 12px; font-weight: bold; border: 2px solid var(--ink-day); border-radius: 8px; padding: 6px 10px; background: var(--blue); color: #fff; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.task-item button:disabled { opacity: .4; pointer-events: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,30,30,.92);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  animation: pop .25s ease;
  pointer-events: none;
  max-width: 84vw;
  text-align: center;
}

/* ---------- 聊天系统 ---------- */
.chat-box { width: min(94vw, 400px); }
.chat-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.chat-tabs .tab {
  font-family: inherit; font-size: 13px; font-weight: bold;
  border: 2px solid var(--ink-day); border-radius: 8px;
  padding: 8px; background: rgba(255,255,255,.4); color: var(--ink-day); cursor: pointer;
}
body.night .chat-tabs .tab { background: rgba(255,255,255,.06); color: var(--ink-night); }
.chat-tabs .tab.active { background: var(--accent); color: #fff; }
.chat-window { display: flex; flex-direction: column; gap: 8px; }
.chat-msgs {
  height: 38vh;
  min-height: 190px;
  overflow-y: auto;
  border: 2px solid var(--ink-day);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.night .chat-msgs { background: rgba(255,255,255,.06); }
.msg { display: flex; gap: 6px; font-size: 13px; line-height: 1.5; }
.msg .who { color: var(--blue); font-weight: bold; flex-shrink: 0; }
.msg .txt { word-break: break-word; }
.msg.mine .who { color: var(--accent-dark); }
.chat-input { display: flex; gap: 8px; }
.chat-input input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  border: 2px solid var(--ink-day);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink-day);
  outline: none;
}
body.night .chat-input input { background: #1c2438; color: var(--ink-night); }
.chat-input button {
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  border: 2px solid var(--ink-day);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.2);
}
.chat-private { display: flex; gap: 10px; min-height: 42vh; }
.conv-list {
  width: 38%;
  border: 2px solid var(--ink-day);
  border-radius: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: rgba(255,255,255,.4);
  flex-shrink: 0;
}
body.night .conv-list { background: rgba(255,255,255,.06); }
.conv-item { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.conv-item.active { background: rgba(255,159,67,.25); border-color: var(--accent); }
.conv-item .ico { font-size: 14px; }
.conv-item .info { flex: 1; min-width: 0; }
.conv-item .nm { font-size: 12px; font-weight: bold; }
.conv-item .sub { font-size: 10px; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-private .chat-window { flex: 1; min-width: 0; }
.conv-title { font-size: 12px; font-weight: bold; opacity: .8; text-align: center; }

/* ---------- 邮件 ---------- */
.mail-list { list-style: none; display: grid; gap: 8px; max-height: 58vh; overflow-y: auto; }
.mail-item {
  border: 2px solid var(--ink-day);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.5);
  cursor: pointer;
}
body.night .mail-item { background: rgba(255,255,255,.06); }
.mail-item.read { opacity: .6; }
.mail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mail-title { font-weight: bold; font-size: 13px; }
.mail-title .dot { color: var(--red); font-style: normal; }
.mail-time { font-size: 10px; opacity: .6; }
.mail-body { font-size: 12px; line-height: 1.6; margin-top: 4px; opacity: .85; }

/* ---------- 桌面端布局微调 ---------- */
@media (min-width: 640px) {
  #app { max-width: 480px; }
  #pet-box { width: 300px; height: 300px; }
  .act { height: 52px; font-size: 18px; }
  .act span { font-size: 12px; }
}
