/* ---------- 基础 ---------- */
:root {
  --paper: #FAF6EF;
  --card: #FFFFFF;
  --ink: #2B2723;
  --muted: #7A736A;
  --line: #E8E0D4;
  --brand: #2F5D50;
  --brand-dark: #24483E;
  --brand-soft: #EDF3EF;
  --accent: #C0583F;
  --danger: #B03A2E;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 39, 35, .04), 0 8px 24px rgba(43, 39, 35, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 页面整体不缩放：只有看图/批注照片、地图允许双指缩放 */
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* 照片和地图自己处理手势，这里放开 */
.lb-stage, .map-chart, .map-chart canvas { touch-action: none; }
/* 批注图：只有开了"看批注"才接管手势，平时要让页面能正常滚 */
.anno-stage, .anno-scaler { touch-action: auto; }
.anno-stage.drawing, .anno-stage.drawing .anno-scaler { touch-action: none; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.2px; }
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin: 0; }

.muted-text { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.spacer { flex: 1; }
.dot-sep { color: var(--line); margin: 0 2px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  background: transparent;
  color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { border-color: var(--line); background: #fff; }
.btn.ghost:hover { border-color: #D5C9B8; background: #FDFBF7; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.wechat { background: #07C160; color: #fff; }
.btn.wechat:hover { background: #06AD56; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn.danger { color: var(--danger); }
.link-btn.back { margin-bottom: 14px; }

.icon-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}

/* ---------- 输入 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.field > span i { color: var(--accent); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 93, 80, .1);
}
.field textarea { resize: vertical; line-height: 1.7; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-gap { display: flex; gap: 8px; }
.row-gap input { flex: 1; }
.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  outline: none;
}
.search-input:focus { border-color: var(--brand); }

.form-error {
  background: #FCEFEC;
  border: 1px solid #F3CCC4;
  color: #A33A2A;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ---------- 登录 ---------- */
body.auth-mode { background: var(--paper); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-wrap.single { grid-template-columns: 1fr; place-items: center; padding: 32px 18px; }

.auth-side {
  padding: 64px 56px;
  background: linear-gradient(160deg, #2F5D50 0%, #274B41 60%, #1F3C34 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-side::after {
  content: "";
  position: absolute;
  right: -80px; bottom: -120px;
  width: 340px; height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
}
.auth-brand { font-size: 34px; font-weight: 600; letter-spacing: 4px; }
.auth-slogan { margin-top: 18px; font-size: 17px; line-height: 1.9; color: rgba(255, 255, 255, .82); }
.auth-points {
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, .7);
}
.auth-points li { padding-left: 18px; position: relative; }
.auth-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #C9A227;
}

.auth-card {
  width: 100%;
  min-width: 0;
  background: var(--card);
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--line);
}
.auth-card.wide { width: 100%; max-width: 520px; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); border-left: 1px solid var(--line); }
.auth-card h2 { margin-bottom: 6px; }
.auth-card > .muted-text { margin-bottom: 22px; font-size: 14px; }
.or-line { text-align: center; margin: 18px 0 14px; position: relative; }
.or-line::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--line);
}
.or-line span { position: relative; background: #fff; padding: 0 12px; color: var(--muted); font-size: 12px; }
#signout-setup { margin-top: 18px; align-self: center; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 246, 239, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 62px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; letter-spacing: 1px; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.nav a i { font-style: normal; font-size: 13px; opacity: .8; }
.nav a:hover { background: rgba(47, 93, 80, .07); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; }

.me-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
}
.me-btn:hover { background: #fff; }
.me-name { font-size: 13px; }

/* 头像 */
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  flex: none;
  position: relative;
  overflow: hidden;
}
/* 头像现在是真 <img>：加载失败会触发 error，交给全局兜底重取一次 */
.avatar .av-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.avatar.has-img { color: transparent; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; }
.avatar.big { width: 46px; height: 46px; font-size: 18px; }

/* ---------- 页面 ---------- */
.outlet { max-width: 1120px; margin: 0 auto; padding: 30px 22px 80px; }
.page { animation: fade .25s ease; }
.page.narrow { max-width: 760px; margin: 0 auto; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.page-head h1 { margin-bottom: 4px; }
.page-head p { font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 16px 18px; }

/* ---------- 地图 ---------- */
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 18px;
  align-items: stretch;
}
.map-card { padding: 6px; }
.map-chart { width: 100%; height: 500px; }

.prov-panel { display: flex; flex-direction: column; overflow: hidden; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.prov-list { padding: 8px; overflow-y: auto; max-height: 470px; }
.prov-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 11px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
}
.prov-row:hover { background: var(--brand-soft); }
.prov-row.active { background: var(--brand); color: #fff; }
.prov-row.active .prov-count { color: rgba(255, 255, 255, .85); }
.prov-count { font-size: 12px; color: var(--muted); }
.prov-note { padding: 10px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

.prov-detail { margin-top: 18px; padding-bottom: 6px; }
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  padding: 14px 16px 16px;
}
.member-card {
  display: flex;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #FDFBF7;
}
.member-info { min-width: 0; }
.member-info strong { display: block; font-size: 14px; }

/* ---------- 相册 ---------- */
.filter-bar { padding: 14px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.tag-chip em { font-style: normal; font-size: 11px; color: #B4A995; }
.tag-chip:hover { border-color: var(--brand); color: var(--brand); }
.tag-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tag-chip.active em { color: rgba(255, 255, 255, .8); }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 16px;
}
.photo-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(43, 39, 35, .1); }
.photo-media { position: relative; aspect-ratio: 4 / 3; background: #EFE9DE; overflow: hidden; }
.photo-media img, .photo-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.play-badge {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  pointer-events: none;
}
.media-missing {
  display: grid; place-items: center; height: 100%;
  color: var(--muted); font-size: 13px;
}
.photo-card figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; }
.photo-caption { font-size: 13.5px; line-height: 1.55; }
.photo-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.photo-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-tag {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}
.mini-tag.clickable { border: none; cursor: pointer; font-family: inherit; }
.mini-tag.clickable:hover { background: var(--brand); color: #fff; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.viewer-media { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 10px; background: #111; display: block; }
.viewer-meta { margin-top: 14px; }

/* ---------- 随笔 ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button {
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.tabs button.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-card {
  display: flex;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .18s, transform .18s;
}
.post-card:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(43, 39, 35, .09); }
.post-cover { width: 190px; flex: none; background: #EFE9DE; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-body { padding: 16px 18px; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.post-body h3 { font-size: 17px; }
.excerpt { font-size: 13.5px; color: var(--muted); line-height: 1.65; }
.post-foot { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 4px; }
.stat { font-size: 12px; color: var(--muted); margin-left: 10px; }

.article { padding: 30px 34px; }
.article h1 { font-size: 25px; line-height: 1.45; margin-bottom: 14px; }
.article-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.article-cover { margin: 0 0 22px; border-radius: 12px; overflow: hidden; background: #EFE9DE; }
.article-cover img { width: 100%; display: block; }
.article-content { font-size: 15.5px; line-height: 1.95; color: #35302B; }
.article-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
}
.act-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}
.act-btn em { font-style: normal; font-size: 12px; }
.act-btn:hover { border-color: var(--brand); color: var(--brand); }
.act-btn.on { background: #FBF0EC; border-color: #EFCbC0; color: var(--accent); }

.comments { margin-top: 18px; padding: 22px 26px; }
.comments h3 { margin-bottom: 16px; }
.comment-thread { border-bottom: 1px dashed var(--line); }
.comment-thread:last-child { border-bottom: none; }
.comment { display: flex; gap: 10px; padding: 11px 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.comment-head strong { font-size: 13.5px; }
.comment p { font-size: 14px; line-height: 1.7; color: #3A342E; }

/* 楼中楼 */
.comment-replies {
  margin: 0 0 10px 34px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
.comment.reply { padding: 7px 0; }
.comment.reply:last-child { padding-bottom: 2px; }
.comment.reply p { font-size: 13.5px; }
.reply-to { color: var(--brand); font-weight: 500; }
.comment-tools { display: flex; gap: 14px; margin-top: 2px; }
.comment-tools .link-btn { font-size: 12px; color: var(--muted); padding: 0; }
.comment-tools .link-btn:hover { color: var(--brand); }
.comment-tools .link-btn.danger:hover { color: var(--danger); }

.comment-editor { flex: 1; min-width: 0; }
.reply-bar {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--brand);
  background: var(--brand-soft); border-radius: 8px;
  padding: 5px 10px; margin-bottom: 6px;
}
.reply-bar[hidden] { display: none; }
.reply-bar strong { font-weight: 600; }
.reply-bar .link-btn { margin-left: auto; font-size: 12px; color: var(--muted); }

.comment-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; }
.comment-form textarea {
  width: 100%;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.comment-form textarea:focus { border-color: var(--brand); }

/* ---------- 活动 ---------- */
.event-list { display: flex; flex-direction: column; gap: 16px; }
.event-card { display: flex; overflow: hidden; }
.event-card.past { opacity: .72; }
.event-cover { width: 220px; flex: none; background: #EFE9DE; }
.event-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-main { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.event-top { display: flex; align-items: center; gap: 10px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.event-desc { font-size: 14px; line-height: 1.7; color: #4A443D; }
.event-signs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sign-avatars { display: flex; gap: -6px; align-items: center; }
.sign-avatars .avatar { margin-right: -6px; border: 2px solid #fff; }
.event-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }

.badge {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 500;
}
.badge.live { background: var(--brand-soft); color: var(--brand); }
.badge.muted { background: #F0EBE2; color: var(--muted); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(35, 31, 27, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade .18s ease;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
}
.me-card { display: flex; align-items: center; gap: 14px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 38px;
  transform: translate(-50%, 16px);
  background: #2B2723;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 200;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-mark { font-size: 34px; line-height: 1; color: var(--line); margin-bottom: 12px; }
.empty h4 { font-size: 15px; color: var(--ink); margin-bottom: 6px; font-weight: 500; }
.empty p { font-size: 13.5px; }

.loading { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 50px; color: var(--muted); }
.loading .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand); opacity: .4;
  animation: bounce 1s infinite;
}
.loading .dot:nth-child(2) { animation-delay: .15s; }
.loading .dot:nth-child(3) { animation-delay: .3s; }
.loading em { font-style: normal; font-size: 13px; margin-left: 6px; }
@keyframes bounce { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.boot-error { max-width: 520px; margin: 120px auto; text-align: center; }

/* ---------- 消息通知 ---------- */
.bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.bell-btn:hover { background: #F1EBE0; color: var(--ink); }
.bell-badge {
  position: absolute;
  top: 1px; right: 0;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--paper);
}
.bell-badge.hidden { display: none; }

.notif-panel {
  position: fixed;
  top: 60px; right: 18px;
  width: 330px;
  max-height: 68vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(43, 39, 35, .14);
  z-index: 70;
  overflow: hidden;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.notif-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.notif-item {
  display: flex; gap: 9px;
  width: 100%;
  padding: 11px 15px;
  border: none;
  border-bottom: 1px solid #F5F0E7;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #FBF7F0; }
.notif-dot {
  flex: none;
  width: 7px; height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}
.notif-item.unread .notif-dot { background: var(--accent); }
.notif-body { font-size: 13px; line-height: 1.6; color: #4A443D; }
.notif-body b { font-weight: 600; color: var(--ink); }
.notif-body em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.notif-empty { padding: 34px 18px; text-align: center; font-size: 13.5px; color: var(--muted); line-height: 1.9; }

/* ---------- 首页更新说明 ---------- */
.notice-slot { margin-bottom: 14px; }
.notice-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 13px 16px;
  box-shadow: var(--shadow);
}
.notice-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.notice-head strong { font-size: 14.5px; min-width: 0; word-break: break-word; }
.notice-tag {
  flex: none;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #FBF0EC;
  color: var(--accent);
  letter-spacing: .5px;
}
.notice-body {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.85;
  color: #4A443D;
}
.notice-add { color: var(--muted); padding: 2px 0; }

/* ---------- 置顶 ---------- */
.pin-badge {
  display: inline-block;
  margin-right: 7px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .5px;
  vertical-align: 2px;
}
.post-card.pinned { border-left: 3px solid var(--brand); }
.pinned-flag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 1px 9px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
}
.flash { animation: flashBg 1.8s ease; border-radius: 10px; }
@keyframes flashBg {
  0% { background: #FBF0EC; }
  60% { background: #FBF0EC; }
  100% { background: transparent; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 940px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-chart { height: 380px; }
  .prov-list { max-height: 240px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 40px 28px; }
  .auth-points { display: none; }
  .auth-card { border-left: none; border-top: 1px solid var(--line); padding: 32px 26px 44px; }
  .auth-card.wide { border-top: 1px solid var(--line); }
}

@media (max-width: 700px) {
  .outlet { padding: 20px 14px 70px; }
  .topbar-inner { padding: 0 14px; gap: 10px; height: 56px; }
  .brand span:not(.brand-mark) { display: none; }
  .nav {
    gap: 0;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    flex: none;
    padding: 6px 8px;
    font-size: 12.5px;
    white-space: nowrap;
    letter-spacing: 0;
  }
  .nav a i { display: none; }
  .me-name { display: none; }
  .me-btn { padding: 3px; }
  h1 { font-size: 22px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .post-card { flex-direction: column; }
  .post-cover { width: 100%; height: 170px; }
  .event-card { flex-direction: column; }
  .event-cover { width: 100%; height: 160px; }
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .article { padding: 22px 18px; }
  .comments { padding: 18px 16px; }
  .comment-replies { margin-left: 22px; padding-left: 10px; }
  .comment-form { gap: 8px; }
  .notif-panel { width: calc(100vw - 24px); right: 12px; top: 58px; max-height: 72vh; }
  .grid-2 { grid-template-columns: 1fr; }
  .modal { max-height: 92vh; }
}

/* ---------- 添加到桌面引导 ---------- */
.pwa-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(28, 24, 20, .42);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
  animation: pwaFade .18s ease;
}
@keyframes pwaFade { from { opacity: 0; } to { opacity: 1; } }
.pwa-sheet {
  width: 100%; max-width: 440px;
  background: var(--card); border-radius: 18px;
  padding: 20px 20px 16px;
  box-shadow: 0 18px 48px rgba(28, 24, 20, .22);
  animation: pwaRise .22s ease;
}
@keyframes pwaRise { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }
.pwa-icon {
  width: 56px; height: 56px; border-radius: 13px; display: block;
  margin-bottom: 12px; box-shadow: 0 2px 8px rgba(43, 39, 35, .16);
}
.pwa-copy strong { font-size: 16px; display: block; margin-bottom: 6px; }
.pwa-copy p { font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.pwa-actions { display: flex; gap: 10px; margin-top: 16px; }
.pwa-actions .btn { flex: 1; }
.pwa-never {
  display: block; width: 100%; margin-top: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--muted); padding: 6px;
}
.pwa-never:hover { color: var(--ink); }

@media (min-width: 700px) {
  .pwa-mask { align-items: center; }
  .pwa-sheet { max-width: 400px; }
}

.pwa-alt {
  display: block; text-align: center; margin-top: 12px;
  font-size: 13px; color: var(--brand);
  text-decoration: underline; text-underline-offset: 3px;
}
.pwa-alt:active { opacity: .7; }

/* ---------- 安装说明页 ---------- */
.guide-page { max-width: 720px; }
.guide-card { padding: 20px 18px; margin-bottom: 14px; }
.guide-card.tight { padding: 6px 18px; }
.gsec { font-size: 16px; margin: 26px 0 12px; color: var(--ink); }
.gbanner {
  background: #FDF4E8; border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 13px 14px; margin-bottom: 16px;
}
.gbanner strong { font-size: 14.5px; display: block; margin-bottom: 5px; color: #8A4327; }
.gbanner p { font-size: 13.5px; line-height: 1.75; color: #6E5B4C; }
.gtip { margin-top: 9px; }

.gstep { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.gstep:last-child { border-bottom: none; padding-bottom: 2px; }
.gstep:first-child { padding-top: 2px; }
.gnum {
  flex: 0 0 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.gbody { flex: 1; min-width: 0; }
.gbody strong { font-size: 14.5px; display: block; margin-bottom: 3px; }
.gtext { font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.gtext b { color: var(--ink); font-weight: 600; }
.gtext code {
  background: var(--brand-soft); color: var(--brand-dark);
  padding: 1px 5px; border-radius: 5px; font-size: 12.5px;
  font-family: ui-monospace, Menlo, monospace; word-break: break-all;
}

.gqa { border-bottom: 1px solid var(--line); }
.gqa:last-child { border-bottom: none; }
.gqa summary {
  cursor: pointer; list-style: none; padding: 13px 22px 13px 0;
  font-size: 14px; color: var(--ink); position: relative;
}
.gqa summary::-webkit-details-marker { display: none; }
.gqa summary::after {
  content: '+'; position: absolute; right: 2px; top: 11px;
  font-size: 17px; color: var(--muted); font-weight: 400;
}
.gqa[open] summary::after { content: '−'; }
.gqa[open] summary { color: var(--brand); font-weight: 500; }
.ga { font-size: 13.5px; line-height: 1.78; color: var(--muted); padding: 0 0 14px; }

.glink {
  background: #F6F8FB; border: 1px dashed #D7DFEA; border-radius: 10px;
  padding: 10px 12px; margin: 7px 0 12px;
  font-size: 12.5px; line-height: 1.6; color: #4A5A78;
  word-break: break-all; font-family: ui-monospace, Menlo, monospace;
}

@media (max-width: 560px) {
  .guide-card { padding: 17px 14px; }
  .guide-card.tight { padding: 4px 14px; }
  .gtext { font-size: 13px; }
}

.pwa-guide {
  display: block; width: 100%; margin-top: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 12.5px; color: var(--muted); padding: 6px;
}
.pwa-guide:active { opacity: .6; }

.gbanner.info {
  background: var(--brand-soft); border-left-color: var(--brand);
}
.gbanner.info strong { color: var(--brand-dark); }
.gbanner.info p { color: #4A5A55; }

/* ---------- 地图：中国 / 世界 切换 ---------- */
.map-card { position: relative; }

.map-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.map-tabs button {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.map-tabs button.on {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.abroad-tag {
  font-style: normal;
  font-size: 10px;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(192, 88, 63, .1);
  color: var(--accent);
  vertical-align: 1px;
}
.abroad-tag.home { background: var(--brand-soft); color: var(--brand); }
.prov-row.active .abroad-tag { background: rgba(255, 255, 255, .22); color: #fff; }
.prov-detail-sub { margin: 0 0 10px; }

/* ---------- 实名提示 ---------- */
.auth-hint {
  margin-top: 14px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  background: var(--brand-soft);
  border-radius: 10px;
}
.auth-hint b { color: var(--brand); font-weight: 600; }
.auth-card > .auth-hint { margin-bottom: 16px; }

@media (max-width: 560px) {
  .map-tabs { display: flex; width: 100%; }
  .map-tabs button { flex: 1; }
}

/* ---------- 照片下的留言互动 ---------- */
.photo-comments {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pc-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.pc-list { display: flex; flex-direction: column; gap: 10px; }
.pc-item { display: flex; gap: 8px; align-items: flex-start; }
.pc-body { flex: 1; min-width: 0; }
.pc-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.pc-line b { color: var(--ink); font-weight: 600; }
.pc-text {
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  word-break: break-word;
}
.pc-del { margin-left: auto; color: var(--danger, #B03A2E); }
.pc-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.pc-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.pc-input:focus { outline: none; border-color: var(--brand); }
.pc-form .btn { height: 36px; padding: 0 16px; flex: none; }
.pc-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- 留言里发图片 ---------- */
.cmt-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.cmt-img-btn {
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  padding: 0;
  cursor: pointer;
}
.cmt-img-btn:disabled { opacity: .5; }
.cmt-attach { margin-top: 9px; }
.cmt-attach-item { position: relative; display: inline-block; }
.cmt-attach-item img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.cmt-attach-x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.cmt-img { display: block; margin: 8px 0 2px; }
.cmt-img img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  cursor: zoom-in;
}

/* ---------- 图片批注 ---------- */
.anno-block { margin: 0 0 22px; }
.anno-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #EFE9DE;
  line-height: 0;
}
.anno-stage img { width: 100%; display: block; }
.anno-layer {
  position: absolute;
  inset: 0;
  touch-action: none;
}
.anno-stage.drawing .anno-layer { cursor: crosshair; }
.anno-box {
  position: absolute;
  border: 2px solid var(--anno, var(--brand));
  border-radius: 6px;
  background: rgba(47, 93, 80, .09);
  background: color-mix(in srgb, var(--anno, #2F5D50) 12%, transparent);
}
.anno-box.mine {
  border-color: var(--accent);
  background: rgba(192, 88, 63, .09);
}
.anno-box > b {
  position: absolute;
  top: -9px;
  left: -9px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--anno, var(--brand));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 19px;
  text-align: center;
}
.anno-box.mine > b { background: var(--accent); }
.anno-tip {
  display: none;
  position: absolute;
  left: -2px;
  top: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.55;
  border-radius: 9px;
  width: max-content;
  max-width: 220px;
  white-space: normal;
  z-index: 4;
  box-shadow: 0 6px 18px rgba(43, 39, 35, .22);
}
.anno-tip em {
  display: block;
  font-style: normal;
  color: #BFD6CB;
  font-size: 11px;
  margin-bottom: 2px;
}
.anno-box.show-tip .anno-tip { display: block; }
.anno-marquee {
  position: absolute;
  border: 1.5px dashed var(--accent);
  background: rgba(192, 88, 63, .12);
  pointer-events: none;
}

/* 缩放层：图片、批注框、选框都在这层里，缩放平移不会各走各的 */
.anno-scaler {
  position: relative;
  transform-origin: 0 0;
  will-change: transform;
}
/* 放大后要能看清细节，图层直接跟着缩放；超出的部分由 .anno-stage 裁掉 */
.anno-zoombar {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  border-radius: 999px;
  background: rgba(28, 26, 24, .62);
  backdrop-filter: blur(6px);
  opacity: .92;
  z-index: 3;
}
.azbtn {
  flex: 0 0 auto;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.azbtn.wide { font-size: 12px; padding: 0 9px; letter-spacing: .5px; }
.azbtn:active { background: rgba(255, 255, 255, .34); }
.azval { color: #fff; font-size: 11px; min-width: 34px; text-align: center; }

/* 批注文字颜色选择 */
.anno-colors { display: inline-flex; align-items: center; gap: 5px; }
.acolor {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}
.acolor.on {
  box-shadow: 0 0 0 2px var(--ink);
  transform: scale(1.14);
}
.anno-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.chip-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
}
.chip-btn.on {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.chip-btn em { font-style: normal; margin-left: 3px; }

/* 批注在留言列表里的样子 */
.anno-cmt .avatar.sm { font-size: 10px; }
.anno-quote {
  margin: 0;
  padding: 8px 11px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}

/* ---------- 全屏看图 ---------- */
body.lb-open { overflow: hidden; }
.lb-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(16, 14, 12, .96);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: fade .16s ease;
  touch-action: none;
}
.lb-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-top, 0px));
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: linear-gradient(rgba(0, 0, 0, .5), transparent);
}
.lb-count {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  letter-spacing: .4px;
}
.lb-close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.lb-close:hover { background: rgba(255, 255, 255, .24); }
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(40, 36, 32, .55);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  padding-bottom: 4px;
  cursor: pointer;
  backdrop-filter: blur(3px);
}
.lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 12px 56px;
}
.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}
.lb-img.zoomed { cursor: grab; }
.lb-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: rgba(255, 255, 255, .72);
  font-size: 12.5px;
  line-height: 1.6;
  background: linear-gradient(transparent, rgba(0, 0, 0, .5));
  pointer-events: none;
}

/* 可放大的图：给个手型 + 角标 */
.photo-card .photo-media { cursor: zoom-in; }
.viewer-media { cursor: zoom-in; }
.zoom-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(20, 18, 16, .55);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
}
.post-cover, .event-cover { position: relative; cursor: zoom-in; }
.anno-stage { cursor: zoom-in; }
.anno-stage.drawing { cursor: crosshair; }

@media (max-width: 560px) {
  .lb-stage { padding: 46px 4px 50px; }
  /* 手机主要靠左右滑动，箭头藏起来免得挡图 */
  .lb-nav { display: none; }
}

/* 相册卡片上的放大按钮 */
.zoom-wrap { position: relative; }
.zoom-btn {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: rgba(20, 18, 16, .55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: .82;
  transition: opacity .16s ease, transform .1s ease;
}
.photo-card:hover .zoom-btn { opacity: 1; }
.photo-card .zoom-btn:active { transform: scale(.94); }

/* ---------- 照片集 ---------- */
.set-badge {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 18, 16, .62);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .3px;
}
.set-card .photo-media::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .32);
  pointer-events: none;
}
.set-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 2px;
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.set-ops { display: flex; align-items: center; gap: 12px; }
.set-bar .link-btn { color: var(--brand-dark); }

/* 全屏看图顶部的保存按钮 */
.lb-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lb-tools .lb-close { margin-left: 0; }
.lb-dl {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.lb-dl:hover { background: rgba(255, 255, 255, .26); }

/* ---------- 消息面板里的通知开关 ---------- */
.push-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 4px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(47, 93, 80, .16);
}
.push-bar.muted {
  background: #F6F1E8;
  color: var(--muted);
  border-color: var(--line);
}
.push-bar.on { background: var(--brand-soft); }
.push-bar > span:nth-child(2) { flex: 1; min-width: 0; }
.push-ico { font-size: 14px; line-height: 1; flex: none; }
.push-go {
  flex: none;
  height: 28px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.push-go:active { transform: scale(.97); }

/* ==================== 游戏（五子棋 / 斗地主） ==================== */
.gsec {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin: 22px 0 10px;
  letter-spacing: .3px;
}

.game-cards { display: flex; flex-direction: column; gap: 12px; }

.game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: transform .12s, box-shadow .16s;
}
.game-card:active { transform: scale(.985); }
.gc-ico {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 18px;
  letter-spacing: -2px;
  flex: none;
}
.gc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gc-body b { font-size: 16px; }
.gc-body em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.gc-go { margin-left: auto; font-size: 13px; color: var(--brand); flex: none; }

.join-row { display: flex; gap: 10px; }
.join-row input {
  flex: 1;
  letter-spacing: 6px;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
}
.join-row .btn { flex: none; }

.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.ri-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 8px;
}
.ri-body { display: flex; flex-direction: column; }
.ri-body em { font-style: normal; font-size: 12px; color: var(--muted); }

/* ---- 房间 ---- */
.groom { display: flex; flex-direction: column; gap: 12px; }
.groom-head {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 0 4px;
}
.groom-code { font-size: 13px; color: var(--muted); }
.groom-code b {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--brand);
  letter-spacing: 1.5px;
  font-size: 14px;
}
.groom-head .link-btn:first-child { flex: none; }
.groom-head .link-btn:last-child { margin-left: auto; }
.groom-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.gseat-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.gseat { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.gseat b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gseat.turn { color: var(--brand); }
.gseat.turn b { font-weight: 700; }
.gseat-vs { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.stone {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  display: inline-block;
}
.stone.black { background: radial-gradient(circle at 34% 30%, #6d6d6d, #111); }
.stone.white { background: radial-gradient(circle at 34% 30%, #fff, #cfcfcf); border: 1px solid #d8d8d8; }

/* ---- 观战席 ---- */
.gwatch {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 12px;
  min-height: 40px;
}
.gwatch.empty { background: transparent; border-style: dashed; }
.gw-label { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.gw-label i { font-style: normal; color: var(--brand); font-weight: 700; }
.gw-none { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-list {
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  padding: 1px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gw-list::-webkit-scrollbar { display: none; }
.gw-chip {
  display: inline-flex; align-items: center; gap: 5px;
  flex: none; max-width: 132px;
  background: var(--brand-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 9px 2px 2px;
  font-size: 12px;
}
.gw-chip b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-chip.me { border-color: var(--brand); color: var(--brand); }
.gw-chip .avatar { width: 20px; height: 20px; font-size: 10px; }

/* 落点预览的提示行：固定高度，出现/消失时棋盘不会上下跳 */
.gaim {
  min-height: 17px;
  margin-top: -4px;
  font-size: 12px;
  text-align: center;
  color: var(--brand);
  opacity: 0;
  transition: opacity .12s ease;
}
.gaim.on { opacity: 1; }

.gstatus { text-align: center; font-size: 13.5px; color: var(--muted); }
.gstatus .win { color: var(--accent); font-size: 15px; }
.gboard-wrap { display: flex; justify-content: center; }
#go-board {
  width: 100%;
  max-width: 520px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(90, 70, 40, .18);
  touch-action: manipulation;
  cursor: pointer;
}

/* ---- 语音条 ---- */
.gvoice {
  display: flex; flex-direction: column; align-items: stretch; gap: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
}
.gv-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gvoice.on { background: var(--brand-soft); border-color: #D3E2DA; }
.gvoice.muted { color: var(--muted); }
.gv-text { color: var(--muted); font-size: 12.5px; }
.gvoice.on .gv-text { color: var(--brand-dark); }
.gv-text.dim { opacity: .75; }
.gv-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34A853;
  box-shadow: 0 0 0 0 rgba(52, 168, 83, .6);
  animation: gvpulse 1.8s infinite;
  flex: none;
}
@keyframes gvpulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 168, 83, .55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 168, 83, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 168, 83, 0); }
}
.vbtn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.vbtn.ghost { background: transparent; color: var(--brand); }
.vbtn.muted-btn { background: var(--accent); border-color: var(--accent); }
.gvoice .gv-text { flex: 1 1 auto; min-width: 0; }
/* 开麦失败：把原因直接写在栏里，别只弹一个转瞬即逝的提示 */
.gvoice.err { border-color: #E7C1BC; background: #FDF3F1; }
.gvoice.err .gv-text { color: var(--accent); line-height: 1.45; }

/* ---- 斗地主 ---- */
.ddz-wait {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ddz-others { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ddz-seat {
  display: flex; align-items: center; gap: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  min-width: 0;
}
.ddz-seat.turn { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.ddz-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex: none;
}
.ddz-seat-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ddz-seat-info b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddz-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ddz-name .ll-badge, .ddz-name .fm-badge { flex: none; margin-right: 0; }
.ddz-seat-info em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.ll-badge {
  display: inline-block;
  font-size: 10.5px;
  background: var(--accent);
  color: #fff;
  border-radius: 5px;
  padding: 0 5px;
  margin-right: 4px;
  vertical-align: 1px;
}
.fm-badge {
  display: inline-block;
  font-size: 10.5px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 5px;
  padding: 0 5px;
  margin-right: 4px;
  vertical-align: 1px;
}

.ddz-table {
  min-height: 74px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #F3EEE4;
  border-radius: 12px;
  padding: 10px;
}
.ddz-last-who { font-size: 12px; color: var(--muted); }
.ddz-last-cards { display: flex; }
.ddz-last-cards .pcard { margin-left: -16px; }
.ddz-last-cards .pcard:first-child { margin-left: 0; }

.ddz-result {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
}
.ddz-result b { color: var(--brand); font-size: 15px; }
.ddz-result span { color: var(--muted); font-size: 12px; }
.ddz-result .win { color: var(--accent); margin-left: auto; font-style: normal; font-weight: 600; }
.ddz-result .lose { color: var(--muted); margin-left: auto; font-style: normal; }

.ddz-mine { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; }
.ddz-mine-head { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.ddz-hand {
  display: flex;
  overflow-x: auto;
  padding: 14px 2px 6px;
  scrollbar-width: none;
}
.ddz-hand::-webkit-scrollbar { display: none; }
.ddz-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.ddz-actions .btn { padding: 8px 16px; font-size: 14px; }

.pcard {
  flex: none;
  width: 40px;
  height: 56px;
  margin-left: 0;
  background: #fff;
  border: 1px solid #D9D0C2;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #2B2723;
  box-shadow: -2px 0 3px rgba(0, 0, 0, .10), 1px 1px 2px rgba(0, 0, 0, .08);
  transition: transform .12s, border-color .12s;
  cursor: pointer;
  user-select: none;
  padding: 2px 0 0 5px;
  line-height: 1;
}
.pcard:first-child { margin-left: 0; }
.pcard i { font-style: normal; font-size: 13px; line-height: 1; margin-top: -2px; }
.pcard.red { color: #C0392B; }
.pcard.joker b { font-size: 11px; writing-mode: vertical-rl; letter-spacing: 1px; }
.pcard.small { width: 32px; height: 46px; font-size: 13px; cursor: default; padding-left: 4px; }
.pcard.small i { font-size: 11px; }
.pcard.small:first-child { margin-left: 0; }
.pcard.sel {
  transform: translateY(-12px);
  border-color: var(--accent);
  box-shadow: 0 4px 10px rgba(192, 88, 63, .25);
}

@media (max-width: 380px) {
  .pcard { width: 36px; height: 52px; margin-left: -17px; font-size: 14px; }
  .gc-body em { font-size: 12px; }
}

/* ---------- 头像图片 ---------- */
.avatar {
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  overflow: hidden;
}
.me-avatar-ops { display: flex; gap: 12px; margin-top: 4px; }

/* ---------- 棋类棋子标记（座位行的小图标） ---------- */
.stone.red { background: radial-gradient(circle at 34% 30%, #ff8574, #c0392b); }
.stone.yellow { background: radial-gradient(circle at 34% 30%, #ffe08a, #e0a51f); }
.stone.x, .stone.o {
  background: transparent;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.stone.x { color: #2C5F8A; }
.stone.x::after { content: '✕'; }
.stone.o { color: #C0392B; }
.stone.o::after { content: '○'; }
.stone.xq-red, .stone.xq-black {
  background: #F6E3BE;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.stone.xq-red { color: #A93226; border: 1px solid #A93226; }
.stone.xq-red::after { content: '帅'; }
.stone.xq-black { color: #1C2833; border: 1px solid #1C2833; }
.stone.xq-black::after { content: '将'; }

/* 六个游戏卡片：宽屏两列，窄屏一列 */
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ---------- 首页：现在在线 ---------- */
.online-slot { margin-bottom: 14px; }
.online-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.online-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.online-head b { font-size: 14px; color: var(--brand); }
.online-sub { font-size: 12px; color: var(--muted); }
.online-list { display: flex; flex-wrap: wrap; gap: 9px 16px; align-items: center; }
.online-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
/* 「游戏中」的同学是链接：点一下直接进他的房间 */
a.online-item {
  text-decoration: none; color: var(--ink);
  padding: 3px 8px 3px 3px; margin: -3px -8px -3px -3px;
  border-radius: 999px; cursor: pointer;
  transition: background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
a.online-item:hover, a.online-item:active { background: rgba(192, 88, 63, .1); }
.online-item em { font-style: normal; max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-item.playing em { color: #B4552A; }
.online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3FA76A; box-shadow: 0 0 0 3px rgba(63, 167, 106, .15);
}
.online-tag {
  font-style: normal; font-size: 11px; line-height: 1.5;
  padding: 0 6px; border-radius: 999px;
  background: rgba(192, 88, 63, .12); color: #B4552A;
}
.online-more { font-size: 12px; color: var(--muted); }

/* ---------- 棋盘：上一手 ---------- */
.glast {
  text-align: center; font-size: 13px; color: #6B6152;
  margin: -4px 0 10px;
}
.glast b { color: #B4761E; font-weight: 600; letter-spacing: .5px; }
.online-tip {
  margin-top: 9px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--muted); line-height: 1.6;
}

/* ---------- 邀请：房间里选人 / 被邀请时的提示条 ---------- */
.inv-list { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow-y: auto; }
.inv-loading { font-size: 13px; color: var(--muted); padding: 10px 2px; }
.inv-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 2px; border-radius: 10px;
}
.inv-row:hover { background: rgba(47, 93, 80, .05); }
.inv-name { font-size: 14px; color: var(--ink); max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-sub { font-size: 12px; color: var(--muted); margin-left: auto; margin-right: 6px; }
.inv-btn { padding: 5px 12px; font-size: 13px; border-radius: 9px; }

.invite-bar {
  position: fixed; z-index: 1200;
  /* 放底部：顶部是导航栏，压在上面会挡住别人点菜单 */
  left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: min(94vw, 470px);
  padding: 9px 12px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(20, 28, 36, .18);
  animation: invIn .24s ease;
}
@keyframes invIn { from { opacity: 0; transform: translate(-50%, 14px); } }
.invite-bar .ib-ico { font-size: 18px; line-height: 1; }
.invite-bar .ib-text { font-size: 13px; line-height: 1.45; min-width: 0; }
.invite-bar .ib-text b { font-weight: 600; }
.invite-bar .ib-text em {
  display: inline-block; margin-left: 6px; font-style: normal;
  font-size: 12px; color: var(--muted);
}
.invite-bar .ib-go { padding: 6px 14px; font-size: 13px; white-space: nowrap; }
.invite-bar .ib-x { font-size: 18px; line-height: 1; color: var(--muted); }

/* ---- 战绩榜 ---- */
.rank-entry { display: flex; justify-content: flex-end; margin: -6px 0 12px; }

.rank-tabs {
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rank-tabs::-webkit-scrollbar { display: none; }
.rank-tab {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.rank-tab i {
  font-style: normal; font-size: 11px;
  background: var(--brand-soft); color: var(--brand);
  border-radius: 999px; padding: 0 6px;
}
.rank-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rank-tab.on i { background: rgba(255,255,255,.22); color: #fff; }

/* 领奖台 */
.podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 10px;
  padding: 26px 4px 0;
  margin-bottom: 6px;
}
.pd {
  flex: 1 1 0; min-width: 0; max-width: 168px;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
}
.pd-crown { height: 18px; font-size: 15px; line-height: 18px; }
.pd-ava { margin-bottom: 2px; }
.pd-name {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 13.5px; font-weight: 600;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pd-rate { font-size: 17px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.pd-sub { font-size: 11px; color: var(--muted); }
.pd-stand {
  width: 100%;
  margin-top: 7px;
  border-radius: 10px 10px 4px 4px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #C9B48A, #B49C6E);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.pd-stand b { font-size: 17px; font-weight: 700; }
.pd-1 .pd-stand { height: 68px; background: linear-gradient(180deg, #F3C24C, #D9A32C); }
.pd-2 .pd-stand { height: 52px; background: linear-gradient(180deg, #C9C9CE, #A9A9B2); }
.pd-3 .pd-stand { height: 42px; background: linear-gradient(180deg, #D8A47C, #BE8558); }
.pd-1 .pd-name { font-size: 14.5px; }
.pd-empty { visibility: hidden; }

.dragon {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  color: #7A4B12;
  background: linear-gradient(180deg, #FFE9A8, #FFD166);
  border: 1px solid #E9BE45;
  border-radius: 999px;
  padding: 0 7px;
  line-height: 16px;
  white-space: nowrap;
}

/* 第四名往后 */
.rank-list {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.rk-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  font-size: 13px;
}
.rk-row + .rk-row { border-top: 1px solid var(--line); }
.rk-no { flex: none; width: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.rk-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-num { flex: none; font-size: 11.5px; color: var(--muted); }
.rk-bar {
  flex: 0 0 46px; height: 5px;
  background: var(--brand-soft);
  border-radius: 999px;
  overflow: hidden;
}
.rk-bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.rk-rate { flex: none; width: 38px; text-align: right; font-size: 12px; color: var(--brand); font-weight: 600; }

/* ---- 谁在语音里 ---- */
.gv-who {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.gvw-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.gvw-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--brand-dark);
  max-width: 46%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gvw-chip.me { border-color: var(--brand); }
.gvw-chip.mute { color: var(--muted); }
.gvw-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #34A853; flex: none;
}
.gvw-chip.mute .gvw-dot { background: #B9B3AA; }

/* 座位/观战席上的小话筒 */
.micb {
  font-style: normal; font-size: 11px; line-height: 1;
  margin-left: 2px;
  opacity: .85;
}

/* ---- 聊天条 ---- */
.gchat {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.gchat[hidden] { display: none; }
.gc-log {
  display: flex; flex-direction: column; gap: 3px;
  max-height: 84px; overflow-y: auto;
  scrollbar-width: none;
}
.gc-log::-webkit-scrollbar { display: none; }
.gc-log:empty::after {
  content: '还没人说话。观战的可以发弹幕，棋盘上能看到。';
  font-size: 11.5px; color: var(--muted);
}
.gc-line {
  font-size: 12.5px; line-height: 1.5;
  display: flex; gap: 5px; align-items: baseline;
  overflow: hidden;
}
.gc-line b { flex: none; font-weight: 600; color: var(--brand-dark); max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-line span { color: var(--ink); word-break: break-word; }
.gc-line.gc-dan b { color: #9A6B21; }
.gc-line.gc-dan i { font-style: normal; font-size: 10px; opacity: .8; }
.gc-line.me { opacity: .92; }
.gc-row { display: flex; gap: 8px; align-items: center; }
.gc-input {
  flex: 1 1 auto; min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  padding: 0 10px;
  font-size: 16px;      /* 小于 16px 时 iOS 一聚焦就会把整页放大 */
  color: var(--ink);
  outline: none;
}
.gc-input:focus { border-color: var(--brand); background: #fff; }
.gc-btn { flex: none; padding: 0 14px; height: 34px; font-size: 13px; border-radius: 9px; }

/* ---- 弹幕层 ---- */
.groom { position: relative; }
.gdan {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 30;
}
.gdan .dan {
  position: absolute; left: 100%;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.4;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(43, 39, 35, .78);
  color: #fff;
  animation-name: danFly;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform;
  max-width: 78vw;
  overflow: hidden; text-overflow: ellipsis;
}
.gdan .dan.by-watch { background: rgba(154, 107, 33, .82); }
.gdan .dan.by-player { background: rgba(47, 93, 80, .84); }
@keyframes danFly {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100vw - 100%)); }
}

/* ============================================================
   对局特效：将军 / 获胜
   ============================================================ */
.gfx {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  overflow: hidden;
}

/* ---------- 赢棋 ---------- */
.fx-victory {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: radial-gradient(circle at 50% 46%, rgba(255, 246, 214, .55), rgba(255, 246, 214, 0) 62%);
  animation: fxFadeIn .28s ease both;
}
.fx-rays {
  position: absolute;
  width: 190vmax;
  height: 190vmax;
  left: 50%;
  top: 50%;
  margin: -95vmax 0 0 -95vmax;
  background: conic-gradient(from 0deg,
    rgba(240, 180, 41, .30) 0 3deg, transparent 3deg 16deg,
    rgba(240, 180, 41, .22) 16deg 19deg, transparent 19deg 32deg,
    rgba(240, 180, 41, .30) 32deg 35deg, transparent 35deg 48deg,
    rgba(240, 180, 41, .22) 48deg 51deg, transparent 51deg 64deg,
    rgba(240, 180, 41, .30) 64deg 67deg, transparent 67deg 80deg,
    rgba(240, 180, 41, .22) 80deg 83deg, transparent 83deg 96deg,
    rgba(240, 180, 41, .30) 96deg 99deg, transparent 99deg 112deg,
    rgba(240, 180, 41, .22) 112deg 115deg, transparent 115deg 128deg,
    rgba(240, 180, 41, .30) 128deg 131deg, transparent 131deg 144deg,
    rgba(240, 180, 41, .22) 144deg 147deg, transparent 147deg 160deg,
    rgba(240, 180, 41, .30) 160deg 163deg, transparent 163deg 180deg,
    rgba(240, 180, 41, .30) 180deg 183deg, transparent 183deg 196deg,
    rgba(240, 180, 41, .22) 196deg 199deg, transparent 199deg 212deg,
    rgba(240, 180, 41, .30) 212deg 215deg, transparent 215deg 228deg,
    rgba(240, 180, 41, .22) 228deg 231deg, transparent 231deg 244deg,
    rgba(240, 180, 41, .30) 244deg 247deg, transparent 247deg 260deg,
    rgba(240, 180, 41, .22) 260deg 263deg, transparent 263deg 276deg,
    rgba(240, 180, 41, .30) 276deg 279deg, transparent 279deg 292deg,
    rgba(240, 180, 41, .22) 292deg 295deg, transparent 295deg 308deg,
    rgba(240, 180, 41, .30) 308deg 311deg, transparent 311deg 324deg,
    rgba(240, 180, 41, .22) 324deg 327deg, transparent 327deg 340deg,
    rgba(240, 180, 41, .30) 340deg 343deg, transparent 343deg 360deg);
  animation: fxSpin 9s linear infinite;
  opacity: .85;
}
.fx-badge {
  position: relative;
  font-size: 54px;
  line-height: 1;
  animation: fxBadge .9s cubic-bezier(.2, 1.5, .4, 1) both;
  filter: drop-shadow(0 6px 14px rgba(140, 96, 8, .3));
}
.fx-title {
  position: relative;
  font-size: clamp(30px, 9vw, 52px);
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #FFE9A8 8%, #F0B429 46%, #B4720B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(120, 74, 4, .55);
  text-shadow: 0 10px 26px rgba(150, 100, 10, .28);
  animation: fxTitle .62s cubic-bezier(.18, 1.4, .35, 1) both;
}
.fx-sub {
  position: relative;
  font-size: 13.5px;
  letter-spacing: 3px;
  color: #7A5312;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  animation: fxTitle .62s .1s cubic-bezier(.18, 1.4, .35, 1) both;
}
.fx-sparks { position: absolute; inset: 0; }
.fx-sparks i {
  position: absolute;
  bottom: -16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFF3C4 0%, #F0B429 65%, rgba(240, 180, 41, 0) 72%);
  box-shadow: 0 0 10px rgba(240, 180, 41, .8);
  animation-name: fxSpark;
  animation-timing-function: ease-out;
  animation-iteration-count: 1;
  animation-fill-mode: both;
}

/* ---------- 将军 ---------- */
.fx-check {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(176, 42, 30, .18), rgba(176, 42, 30, 0) 55%);
  animation: fxFadeIn .12s ease both;
}
.fx-check-word {
  position: relative;
  font-size: clamp(96px, 30vw, 190px);
  font-weight: 900;
  line-height: 1;
  color: #FFF6E5;
  -webkit-text-stroke: 3px #8E1C10;
  text-shadow:
    0 0 26px rgba(214, 62, 40, .8),
    0 0 60px rgba(214, 62, 40, .5),
    0 14px 30px rgba(0, 0, 0, .28);
  animation: fxCheckBoom .62s cubic-bezier(.16, 1.5, .32, 1) both;
}
.fx-check-sub {
  position: relative;
  margin-top: 2px;
  font-size: 14px;
  letter-spacing: 4px;
  color: #FFF1DC;
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(142, 28, 16, .8);
  animation: fxTitle .5s .16s ease both;
}
.fx-shock {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid rgba(240, 180, 41, .85);
  animation: fxShock 1.05s .02s cubic-bezier(.1, .7, .3, 1) both;
}
.fx-shock.d2 { animation-delay: .18s; border-color: rgba(214, 62, 40, .8); }

@keyframes fxFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fxSpin { to { transform: rotate(360deg); } }
@keyframes fxBadge {
  0% { transform: scale(.2) rotate(-24deg); opacity: 0; }
  60% { transform: scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes fxTitle {
  0% { transform: scale(.72) translateY(14px); opacity: 0; letter-spacing: 10px; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes fxSpark {
  0% { transform: translate3d(0, 0, 0) scale(.5); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate3d(var(--dx, 0), -92vh, 0) scale(1.05); opacity: 0; }
}
@keyframes fxCheckBoom {
  0% { transform: scale(3.4); opacity: 0; filter: blur(10px); }
  45% { transform: scale(.92); opacity: 1; filter: blur(0); }
  62% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: .96; }
}
@keyframes fxShock {
  0% { transform: scale(.2); opacity: .95; }
  100% { transform: scale(9); opacity: 0; }
}

/* 棋盘跟着震一下 */
.gboard-wrap.shake { animation: boardShake .62s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes boardShake {
  10%, 90% { transform: translate3d(-3px, 0, 0) rotate(-.35deg); }
  20%, 80% { transform: translate3d(5px, 0, 0) rotate(.4deg); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0) rotate(-.5deg); }
  40%, 60% { transform: translate3d(7px, 0, 0) rotate(.5deg); }
}

/* 状态行里的「将军」标记 */
.gstatus .check { color: var(--danger); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .fx-rays, .fx-sparks i, .fx-shock { animation: none; }
  .gboard-wrap.shake { animation: none; }
}

/* ============================================================
   狼人杀
   ============================================================ */
.ww { display: flex; flex-direction: column; gap: 12px; }

.ww-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(120deg, #22312C, #2F443C);
  color: #F3EFE4;
}
.ww-day {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
}
.ww-phase { font-size: 14px; font-weight: 600; }
.ww-phase.p-night { color: #A9C4E8; }
.ww-phase.p-day { color: #F2D9A0; }
.ww-phase.p-vote { color: #F0B429; }
.ww-phase.p-over { color: #9ED3B4; }
.ww-timer {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
  min-width: 26px;
  text-align: right;
}
.ww-timer.urgent { color: #FF8A6B; font-weight: 700; }
.ww-spk {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.ww-spk.off { opacity: .45; }

.ww-start, .ww-win {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.ww-start { background: var(--brand-soft); color: var(--brand-dark); }
.ww-start b { font-size: 13.5px; }
.ww-start span { color: var(--muted); font-size: 12.5px; }
.ww-win {
  background: linear-gradient(120deg, #FFF3D6, #FBE6BC);
  border: 1px solid #EFD49A;
  color: #7A5312;
}
.ww-win b { font-size: 15px; }
.ww-win span { font-size: 12.5px; opacity: .85; }

/* 六个座位 */
.ww-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.ww-seat {
  position: relative;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  font-family: inherit;
}
.ww-seat:active { transform: scale(.975); }
.ww-seat .avatar { width: 40px; height: 40px; font-size: 16px; margin-bottom: 2px; }
.ww-seat b { font-size: 12.5px; font-weight: 600; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.ww-no {
  position: absolute;
  left: 7px; top: 6px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.ww-role {
  font-style: normal;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #F1EDE5;
  color: var(--muted);
  white-space: nowrap;
}
.ww-role.r-wolf { background: rgba(192, 88, 63, .13); color: #A33A22; }
.ww-role.r-good { background: var(--brand-soft); color: var(--brand); }
.ww-role.unknown { opacity: .65; }
.ww-seat.me {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(47, 93, 80, .12);
}
.ww-seat.speaking {
  border-color: #F0B429;
  box-shadow: 0 0 0 3px rgba(240, 180, 41, .22);
  animation: wwTalk 1.6s ease-in-out infinite;
}
@keyframes wwTalk {
  0%, 100% { box-shadow: 0 0 0 3px rgba(240, 180, 41, .18); }
  50% { box-shadow: 0 0 0 7px rgba(240, 180, 41, .1); }
}
.ww-seat.dead { opacity: .48; filter: grayscale(.7); }
.ww-seat.camp-wolf { background: #FFF6F3; }
.ww-seat.camp-good { background: #F7FAF8; }
.ww-badge {
  position: absolute;
  right: 6px; top: 6px;
  font-style: normal;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #fff;
}
.ww-badge.out { background: #9A938A; }
.ww-badge.talk { background: #D9962A; }
.ww-badge.vote { background: var(--accent); }
.ww-me-tag {
  position: absolute;
  right: 6px; bottom: 6px;
  font-style: normal;
  font-size: 10px;
  color: var(--brand);
  font-weight: 600;
}

/* 我的身份 + 操作 */
.ww-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}
.ww-me-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #F6F3EC;
}
.ww-me-card.r-wolf { background: #FBEEE9; }
.ww-me-card.r-good { background: var(--brand-soft); }
.ww-me-ico { font-size: 26px; line-height: 1; }
.ww-me-txt b { font-size: 14px; display: block; }
.ww-me-txt p { font-size: 12px; color: var(--muted); margin-top: 1px; }

.ww-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ww-tip {
  font-size: 13px;
  color: var(--ink);
  padding: 8px 11px;
  border-radius: 10px;
  background: #FAF7F1;
  line-height: 1.55;
}
.ww-tip.talk { background: #FFF6E2; color: #7A5312; font-weight: 500; }
.ww-seer-log {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.ww-seer-log b { color: var(--muted); font-weight: 600; margin-right: 2px; }
.ww-seer-log span {
  padding: 2px 8px;
  border-radius: 999px;
  background: #F1EDE5;
}
.ww-seer-log .wolf { background: rgba(192, 88, 63, .14); color: #A33A22; font-weight: 600; }
.ww-seer-log .good { background: var(--brand-soft); color: var(--brand); }

/* 上帝播报 */
.ww-log {
  max-height: 168px;
  overflow-y: auto;
  padding: 11px 13px;
  border-radius: 12px;
  background: #1F2A26;
  color: #E7E2D6;
  font-size: 12.5px;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ww-log-line { display: flex; gap: 7px; align-items: flex-start; }
.ww-log-dot {
  flex: none;
  width: 5px; height: 5px;
  margin-top: 8px;
  border-radius: 50%;
  background: #C9A227;
}
.ww-log-line.muted { color: #9AA39D; }

@media (max-width: 560px) {
  .ww-grid { grid-template-columns: repeat(2, 1fr); }
  .ww-seat .avatar { width: 36px; height: 36px; }
}

/* ---------- 奶蛙表情 ---------- */
/* 留言/聊天里显示成图，尺寸按上下文缩放；透明底，浅色深色都不违和 */
.stk {
  width: 2.1em; height: 2.1em;
  vertical-align: -0.55em;
  margin: 0 .12em;
  object-fit: contain;
  -webkit-user-drag: none;
}
.comment-body p .stk { width: 84px; height: 84px; vertical-align: middle; margin: 2px 3px 2px 0; }
.gc-line .stk { width: 40px; height: 40px; vertical-align: middle; margin: 0 1px; }
.gc-line { align-items: center; }

/* 触发按钮 */
.stk-box { position: relative; display: inline-block; }
.stk-btn, .gc-stkbtn { white-space: nowrap; }
.gc-stkbtn {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 9px;
  font-size: 17px; line-height: 1;
  padding: 0;
  cursor: pointer;
}
.gc-stkbtn:hover { background: #fff; border-color: var(--brand); }

/* 选择面板 */
.stk-panel {
  position: absolute;
  left: 0; bottom: calc(100% + 8px);
  z-index: 60;
  width: 286px;
  max-width: calc(100vw - 32px);
  max-height: 236px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(43, 39, 35, .16);
  -webkit-overflow-scrolling: touch;
}
.stk-panel[hidden] { display: none; }
.stk-item {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 2px;
  background: none; border: 0; border-radius: 10px;
  cursor: pointer;
}
.stk-item:hover, .stk-item:active { background: var(--brand-soft); }
.stk-item img { width: 42px; height: 42px; object-fit: contain; }
.stk-item em {
  font-style: normal; font-size: 10px; color: var(--muted);
  white-space: nowrap; transform: scale(.94);
}
/* 聊天条上的面板贴着左边展开（按钮在行首，往右翻才不会顶出屏幕） */
.gc-stkbox .stk-panel { bottom: calc(100% + 6px); }

@media (max-width: 380px) {
  .stk-panel { width: 252px; grid-template-columns: repeat(4, 1fr); }
  .stk-item img { width: 40px; height: 40px; }
}
