/* ============================================================
   星核 · 页面栈 / 首页 / 消息 / 我的 / 对话 / 底部导航
   ============================================================ */

/* 100dvh 在部分手机浏览器 / in-app webview 里会解析成"比可视区更高"的值，
 * 结果页面被撑出屏幕、底部（比如「退出登录」）既看不到又滚不动。
 * 所以优先用 JS 量出来的 --vh100（visualViewport.height），拿不到才退回 100dvh。 */
#app { position: relative; height: var(--vh100, 100dvh); overflow: hidden; background: var(--bg-page); }

.page {
  position: absolute; inset: 0; display: none; flex-direction: column;
  background: var(--bg); overflow: hidden;
}
.page.active { display: flex; }

.page-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 16px 10px;
}
.page-title { font-size: 22px; font-weight: 800; letter-spacing: .2px; }

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-dot {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #ff8ab8, var(--pink));
  box-shadow: var(--shadow-pink);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.brand-name { font-size: 17px; font-weight: 800; }
.brand-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.search-wrap { flex: none; padding: 0 16px 10px; }
.search-wrap .input { height: 44px; border-radius: var(--radius-full); }

/* ===== 首页顶部：搜索胶囊 + 两行分类 ===== */
.home-top {
  flex: none; display: flex; flex-direction: column; gap: 10px;
  padding: 12px 0 10px; background: var(--bg);
}
.search-pill {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px; height: 44px; padding: 0 16px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-full); color: var(--text-3);
}
.search-pill:focus-within { border-color: var(--pink-line); }
.search-pill input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--text);
}
.search-pill input::placeholder { color: var(--text-3); }
.search-pill input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* 分类行：横向可滚，不换行 */
.cat-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 0 12px 2px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; height: 40px; padding: 0 22px; cursor: pointer; font-family: inherit;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text-2);
  border-radius: var(--radius-full); font-size: 15px; font-weight: 700;
  transition: all .16s var(--ease);
}
.cat-chip:hover { border-color: var(--pink-line); color: var(--pink); }
.cat-chip.active { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: var(--shadow-pink); }
/* 小分类那排：小一号、浅灰底、选中是粉底粉字 */
.cat-row.sub .cat-chip {
  height: 32px; padding: 0 16px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); border-color: transparent;
}
.cat-row.sub .cat-chip.active { background: var(--pink-soft); border-color: var(--pink); color: var(--pink-strong); box-shadow: none; }
.cat-row.sub { padding-bottom: 4px; }

/* ===== 首页四方格 ===== */
.role-grid {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(2, 1fr);
  /* 关键：行高按内容来，绝不为了"塞进容器"而压缩行 —— 否则卡片多了就集体变矮，
     而且 content 高度被压到等于容器高度，overflow-y:auto 也就永远不触发滚动。 */
  grid-auto-rows: max-content;
  gap: 10px; padding: 4px 10px calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  align-content: start;
}
@media (min-width: 620px)  { .role-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .role-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; padding-left: 22px; padding-right: 22px; } }
@media (min-width: 1300px) { .role-grid { grid-template-columns: repeat(5, 1fr); } }

.role-tile {
  position: relative; display: flex; flex-direction: column;
  /* 不要写 min-height:0：那会让卡片被压扁。卡片高度必须由图片的比例决定。 */
  border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform .14s var(--ease), border-color .16s var(--ease), box-shadow .18s var(--ease);
}
.role-tile:hover { transform: translateY(-2px); border-color: var(--pink-line); box-shadow: var(--shadow-2); }
.role-tile:active { transform: scale(.985); }
/* 高度只由 aspect-ratio 决定，不要给 height:100%（那会跟 grid 行高互相循环依赖） */
.role-tile-img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; display: block; background: var(--surface-3); }
.role-tile-img.placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--pink-line);
  background: linear-gradient(150deg, var(--pink-softer), var(--surface-3));
}
/* 海报式卡片：文字全压在图上，底部一层渐变压暗保证可读 */
.role-tile-scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 74%;
  background: linear-gradient(180deg, rgba(12,8,14,0) 0%, rgba(12,8,14,.45) 44%, rgba(12,8,14,.88) 100%);
  pointer-events: none;
}
.role-tile-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 24px 11px 10px; display: flex; flex-direction: column; gap: 4px;
}
.role-tile-name {
  font-size: 15px; font-weight: 800; line-height: 1.3; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.65); word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.role-tile-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.rt-chip {
  background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(4px);
  padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600;
}
.role-tile-desc {
  font-size: 11.5px; color: rgba(255,255,255,.84); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.role-tile-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 2px; font-size: 11.5px; color: rgba(255,255,255,.86);
}
/* 浏览量：眼睛用 SVG，不用 emoji（emoji 在手机上会渲染成彩色表情，跟桌面端不一致） */
.rt-views { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.rt-eye { width: 14px; height: 14px; flex: none; }
.rt-author { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片右上角的点赞小按钮 */
.like-btn {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px;
  border: none; border-radius: var(--radius-full); cursor: pointer;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(6px);
  color: var(--text-3); display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-1); transition: transform .14s var(--ease), color .16s var(--ease);
}
.like-btn:hover { transform: scale(1.08); color: var(--pink); }
.like-btn.on { color: var(--pink); }
.like-btn.on svg { fill: var(--pink); }

/* ===== 消息页：两个大图标 ===== */
.msg-tiles { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 2px 16px 14px; }
.msg-tile {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: var(--radius-lg); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); text-align: left;
  transition: transform .14s var(--ease), border-color .16s var(--ease), box-shadow .18s var(--ease);
}
.msg-tile:hover { transform: translateY(-2px); border-color: var(--pink-line); box-shadow: var(--shadow-2); }
.msg-tile:active { transform: scale(.98); }
.msg-tile-ico {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.msg-tile-ico.pink { background: var(--pink-soft); color: var(--pink); }
.msg-tile-ico.blue { background: var(--blue-soft); color: var(--blue); }
.msg-tile-text { min-width: 0; }
.msg-tile-name { font-size: 15px; font-weight: 700; }
.msg-tile-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.msg-tile .badge {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: var(--radius-full);
  background: var(--pink); color: #fff; font-size: 11px; font-weight: 700;
}

.section-label { flex: none; padding: 0 18px 8px; font-size: 13px; font-weight: 700; color: var(--text-2); }

/* ===== 充值：贴底确认弹窗 + 暂未开通弹窗 ===== */
.sheet-mask {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(24, 16, 22, .42);
  animation: annFade .18s var(--ease);
}
.sheet-mask.hidden { display: none; }
.sheet-card {
  width: 100%; max-width: 480px;
  /* 手机浏览器地址栏会吃掉可视高度，内容一高卡片就顶出屏幕上方（关闭按钮直接看不见）。
     限高按 --vh100（真实可视高度）算，超出部分卡片自己滚。 */
  max-height: calc(var(--vh100, 100vh) - 44px);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(60, 20, 40, .22);
  animation: sheetUp .26s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(100%) } to { transform: none } }
.sheet-grip {
  width: 38px; height: 4px; border-radius: 999px; margin: 0 auto 8px;
  background: var(--line-strong, #ddd8e2);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-title { font-size: 17px; font-weight: 800; color: var(--text); }
#pay-sheet .sheet-head { padding: 4px 0 2px; }
#pay-sheet .icon-btn.plain {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-2, #f1f1f4); color: var(--text-2);
}

/* 金额区：浅灰圆角卡（照参考图） */
.pay-sum {
  margin: 14px 0 16px; padding: 22px 16px;
  border-radius: 20px; background: var(--surface-3); text-align: center;
}
.pay-sum-coins { font-size: 31px; font-weight: 800; color: var(--text); line-height: 1.15; }
.pay-sum-coins span { font-size: 14px; font-weight: 700; margin-left: 5px; color: var(--text-2); }
.pay-sum-price { margin-top: 8px; font-size: 20px; font-weight: 800; color: var(--text); }

/* 支付方式：两列并排 + 单选圈 */
.pay-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-pick {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 11px 10px; border-radius: 15px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); text-align: left;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.pay-pick.active { border-color: var(--pink); background: var(--pink-softer); }
.pay-pick.off { opacity: .6; }
.pay-pick-ico {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pay-pick-ico svg { width: 27px; height: 27px; }
.pay-pick-ico img { width: 100%; height: 100%; object-fit: contain; }
.pay-pick-ico.ali { color: #1677ff; }
.pay-pick-ico.wx { color: #07c160; }
.pay-pick-ico.brand { border-radius: 0; }
.pay-letter {
  width: 100%; height: 100%; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; font-weight: 800; line-height: 1;
}
.pay-letter.ali { background: #1677ff; }
.pay-letter.wx { background: #07c160; }
.pay-pick-name { flex: 1 1 0; min-width: 0; font-size: 13px; font-weight: 700; color: var(--text); }
.pay-radio {
  width: 19px; height: 19px; flex: none; border-radius: 50%;
  border: 1.7px solid var(--line-strong); background: var(--surface);
  transition: border-color .14s, box-shadow .14s;
}
.pay-pick.active .pay-radio {
  border-color: var(--pink);
  box-shadow: inset 0 0 0 4.5px var(--pink);
}
.pay-note { margin-top: 11px; text-align: center; color: var(--text-3); line-height: 1.65; font-size: 12px; }
#pay-sheet .btn.filled.block { height: 50px; font-size: 16.5px; border-radius: var(--radius-full); }

/* 暂未开通弹窗 */
#off-sheet { text-align: center; padding-top: 14px; }
.off-ico { display: flex; justify-content: center; margin: 6px 0 14px; }
.off-ico-inner {
  width: 62px; height: 62px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
}
.off-ico-inner svg { width: 36px; height: 36px; }
.off-ico-inner.wx { background: rgba(7, 193, 96, .15); color: #07c160; }
.off-ico-inner.ali { background: rgba(22, 119, 255, .15); color: #1677ff; }
.off-ico-inner.brand { background: transparent; }
.off-ico-inner img { width: 46px; height: 46px; object-fit: contain; }
.off-title { font-size: 19px; font-weight: 800; color: var(--text); }
.off-desc { margin-top: 10px; font-size: 13.5px; color: var(--text-3); line-height: 1.7; }
.off-qq {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 4px; padding: 14px 18px; border-radius: 16px;
  background: rgba(7, 193, 96, .08); border: 1px solid rgba(7, 193, 96, .28);
}
.off-qq-label { font-size: 13.5px; color: var(--text-3); flex: none; }
.off-qq-num { flex: 1 1 0; text-align: left; font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: .3px; }
.off-copy {
  display: flex; align-items: center; gap: 5px; flex: none; cursor: pointer;
  border: 0; background: transparent; color: var(--green); font-size: 13.5px; font-weight: 700;
}
.off-copy:active { opacity: .65; }

/* ===== 进站公告 ===== */
.ann-mask {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(24, 16, 22, .5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: annFade .2s var(--ease);
}
.ann-mask.hidden { display: none; }
@keyframes annFade { from { opacity: 0 } to { opacity: 1 } }
.ann-card {
  width: 100%; max-width: 360px; max-height: 82vh;
  display: flex; flex-direction: column;
  border-radius: 22px; background: var(--surface);
  box-shadow: 0 18px 48px rgba(60, 20, 40, .3);
  overflow: hidden; animation: annPop .24s var(--ease);
}
@keyframes annPop { from { opacity: 0; transform: translateY(14px) scale(.97) } to { opacity: 1; transform: none } }

/* 渐变标题板：左上小标题 + 右上发布日期 + 大标题 */
.ann-head {
  flex: none; padding: 15px 18px 20px;
  background: linear-gradient(118deg, #ff5c9d 0%, #ff7bb0 46%, #ff9a5c 100%);
  color: #fff;
}
.ann-head-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ann-tag {
  font-size: 11.5px; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .26); color: #fff; letter-spacing: .3px;
}
.ann-date { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .92); white-space: nowrap; }
.ann-title {
  margin-top: 15px; font-size: 19px; font-weight: 800;
  line-height: 1.45; color: #fff; letter-spacing: .2px;
}

/* 正文：深色大字、行距放松 */
.ann-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 20px 18px 18px;
  font-size: 14.5px; line-height: 2; font-weight: 500; color: var(--text);
}
.ann-line { word-break: break-word; }
.ann-gap { height: 14px; }
.ann-link {
  color: var(--pink); font-weight: 800;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  word-break: break-all;
}
.ann-link:active { opacity: .7; }
.ann-foot {
  flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 4px 18px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface);
}
.ann-foot .btn { height: 50px; font-size: 16.5px; border-radius: var(--radius-full); }
.ann-never {
  border: 0; background: transparent; cursor: pointer;
  color: var(--text-3); font-size: 12.5px; padding: 6px 0;
}
.ann-never:active { opacity: .6; }
/* ===== 消息页：三个格子（活动通知 / 新的关注 / 新的点赞）===== */
.nt-tiles {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 0 16px 16px;
}
.nt-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.nt-box {
  position: relative; width: 100%; max-width: 78px; aspect-ratio: 1.13 / 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 19px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1);
  color: var(--text);
  transition: transform .15s var(--ease), border-color .16s var(--ease), box-shadow .18s var(--ease);
}
.nt-tile:hover .nt-box { transform: translateY(-2px); border-color: var(--pink-line); box-shadow: var(--shadow-2); }
.nt-tile:active .nt-box { transform: scale(.96); }
.nt-box svg { width: 24px; height: 24px; }
.nt-box svg .nt-accent { stroke: var(--pink); }
.nt-label { font-size: 11.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.nt-badge {
  position: absolute; top: -5px; right: -5px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--radius-full);
  background: #ff3b4e; color: #fff; font-size: 10px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 59, 78, .35);
}
.nt-badge.hidden { display: none; }

/* ===== 通知列表页：搜索 + 多选 ===== */
.head-actions { display: flex; gap: 6px; align-items: center; }
.head-actions .icon-btn.on { color: var(--pink); background: var(--pink-soft); }

.msg-search {
  flex: none; display: flex; align-items: center; gap: 8px;
  margin: 0 16px 12px; padding: 0 12px; height: 40px;
  border-radius: var(--radius-full); background: var(--surface);
  border: 1px solid var(--line); color: var(--text-3);
}
.msg-search.hidden { display: none; }
.msg-search input {
  flex: 1 1 0; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 14px;
}
.msg-search-clear {
  flex: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--bg-2, #f1f1f5); color: var(--text-3);
  font-size: 15px; line-height: 1;
}

.msg-panel { display: flex; flex-direction: column; gap: 10px; }
.msg-panel:empty { display: none; }
.list-flat { display: flex; flex-direction: column; gap: 10px; }
.list-flat.hidden, .section-label.hidden { display: none; }

.notif-row { position: relative; align-items: flex-start; }
.notif-ico {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--pink-soft); font-size: 16px; line-height: 1; color: var(--pink);
}
.notif-kind { margin-top: 5px; font-size: 11.5px; color: var(--text-3); }
.notif-row.checked { border-color: var(--pink); background: var(--pink-soft); }
.pick {
  width: 21px; height: 21px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 1.6px solid var(--line-2, #d8d8e0); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
}
.pick.on { background: var(--pink); border-color: var(--pink); }

#msg-scroll.managing { padding-bottom: 14px; }
/* 通知列表是二级页，底部没有导航栏，不需要给它留位置 */
#page-notifs #msg-scroll { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
#page-notifs .manage-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

/* 消息页上的对话多选 */
.conv-row.checked { border-color: var(--pink); background: var(--pink-soft); }
#page-chat #conv-list { padding-bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); }
#page-chat:has(#conv-manage-bar:not(.hidden)) #conv-list { padding-bottom: 14px; }

.manage-bar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px calc(10px + var(--tabbar-h) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.manage-bar.hidden { display: none; }
.manage-count { flex: 1 1 0; text-align: center; font-size: 12.5px; color: var(--text-3); }
.mini-btn {
  height: 34px; padding: 0 14px; border-radius: var(--radius-full); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 700;
}
.mini-btn:disabled { opacity: .45; }
.mini-btn.danger { border-color: var(--pink-line); color: var(--pink); background: var(--pink-soft); }

/* ===== 列表（会话 / 赞过 / 通知） ===== */
.list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 0 14px calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.list-item {
  display: flex; gap: 12px; padding: 12px 14px; cursor: pointer;
  border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line);
  transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.list-item:hover { background: var(--pink-softer); border-color: var(--pink-line); box-shadow: var(--shadow-1); }
.list-item.unread { border-color: var(--pink-line); background: var(--pink-softer); }
.list-thumb {
  width: 50px; height: 50px; border-radius: 14px; object-fit: cover; flex: none;
  background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.list-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub {
  font-size: 12.5px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.list-sub.two { -webkit-line-clamp: 2; }
.list-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.list-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); flex: none; }
.level-warning { border-left: 3px solid var(--amber); }
.level-success { border-left: 3px solid var(--green); }
.level-info { border-left: 3px solid var(--pink); }

/* ===== 我的 ===== */
/* #me-body 是 .me-wrap 的父容器：必须自己占满剩余高度并允许收缩，
 * 否则它按内容撑高（min-height:auto 不收缩），里面的 .me-wrap 就永远不会滚动
 * —— 表现就是「退出登录按钮看不见、页面也滑不动」。 */
#me-body { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.me-wrap {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 14px calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
  max-width: 560px; width: 100%; margin: 0 auto;
}
.me-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-1); }
/* .me-wrap 是 overflow 的 flex 列：子项默认 flex-shrink:1，内容一超高就被压扁，
   卡片又 overflow:hidden，表现就是最后几行（每日签到 / 编辑资料）整块消失。 */
.me-wrap > * { flex: none; }
.me-card.pad-0 { padding: 0; overflow: hidden; }

.me-profile { display: flex; gap: 14px; align-items: center; }
.me-avatar-wrap { position: relative; flex: none; }
.me-avatar {
  width: 68px; height: 68px; border-radius: var(--radius-full); overflow: hidden;
  background: linear-gradient(135deg, #ff8ab8, var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff;
}
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-avatar-edit {
  position: absolute; right: -3px; bottom: -3px; width: 26px; height: 26px;
  border-radius: var(--radius-full); background: var(--text); color: var(--surface);
  border: 2px solid #fff; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.me-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.me-account { font-size: 19px; font-weight: 800; word-break: break-all; }
.me-idchip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2); cursor: pointer; max-width: 100%;
}
.me-idchip:hover { border-color: var(--pink-line); color: var(--pink-strong); }
.me-mail { font-size: 13px; color: var(--text-3); word-break: break-all; }

.me-token { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.me-token-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.me-token-value { font-size: 27px; font-weight: 800; letter-spacing: -.4px; margin-top: 2px; }
.me-token-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.me-token-actions .btn { height: 38px; padding: 0 16px; font-size: 13.5px; }

.me-rows { display: flex; flex-direction: column; }
.me-row-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer; background: transparent;
  border-left: none; border-right: none; border-top: none; text-align: left; width: 100%;
}
.me-row-item:last-child { border-bottom: none; }
.me-row-item:hover { background: var(--pink-softer); }
.me-row-ico {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-2);
}
.me-row-ico.pink { background: var(--pink-soft); color: var(--pink); }
.me-row-label { flex: 1; font-weight: 600; font-size: 14.5px; }
.me-row-label.pink { color: var(--pink); }
.me-row-value { font-size: 12.5px; color: var(--text-3); }
.chev { color: var(--text-3); flex: none; display: inline-flex; }
/* ===== 我的：快捷三格 + 常用功能宫格（布局由后台 /admin 配置） =====
 * 视觉照参考图：浅底「连续圆角」(squircle，不是正圆) + 深灰线性图标 + 文字。 */
.me-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.mq-btn {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 10px 4px 8px; border-radius: var(--radius-md); cursor: pointer;
  background: transparent; border: none; color: inherit; font: inherit;
  transition: background .16s var(--ease);
}
.mq-btn:hover, .mq-btn:active { background: var(--pink-softer); }
.mq-ico, .mm-ico {
  position: relative; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--icon-fg);
  border-radius: 30%;              /* 兜底：不支持 mask 的老浏览器退化成圆角方形 */
}
.mq-ico { width: 52px; height: 52px; }
.mm-ico { width: 48px; height: 48px; }
/* 底色单独放在伪元素上，用超椭圆路径裁出来（连续圆角，比正圆顺） */
.mq-ico::before, .mm-ico::before {
  content: ''; position: absolute; inset: 0; border-radius: 30%;
  background: var(--icon-bg);
  -webkit-mask: var(--squircle) center / 100% 100% no-repeat;
  mask: var(--squircle) center / 100% 100% no-repeat;
  transition: background .16s var(--ease);
}
.mq-ico > svg, .mm-ico > svg { position: relative; z-index: 1; }
.mq-btn:hover .mq-ico::before, .mm-btn:hover .mm-ico::before { background: var(--icon-bg-hover); }
.mq-ico svg { width: 24px; height: 24px; }
.mm-ico svg { width: 22px; height: 22px; }
.mq-label { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.mq-badge {
  position: absolute; top: -2px; right: -7px; height: 18px; padding: 0 7px; z-index: 2;
  border-radius: var(--radius-full); background: var(--pink); color: #fff;
  font-size: 11px; font-weight: 700; font-style: normal; line-height: 18px;
  white-space: nowrap; box-shadow: var(--shadow-pink);
}
.mq-badge.plain { background: var(--surface-3); color: var(--text-3); box-shadow: none; font-weight: 600; }
.mq-badge.plain:empty { display: none; }

.me-menu-head { font-size: 15px; font-weight: 800; color: var(--text); margin: 2px 4px 12px; letter-spacing: .3px; }
.me-menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 0; }
.mm-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 5px 2px; border-radius: var(--radius-md); cursor: pointer;
  background: transparent; border: none; color: inherit; font: inherit; min-width: 0;
  transition: background .16s var(--ease);
}
.mm-btn:hover, .mm-btn:active { background: var(--pink-softer); }
.mm-label {
  font-size: 12.5px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.3;
  letter-spacing: .2px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.me-wrap > .btn.block { height: 48px; font-size: 15px; }
/* 常用功能卡片留白更大一点，跟参考图一致 */
.me-card.menu-card { padding: 16px 10px 12px; }

/* ===== 我的卡包 ===== */
.wk-input { display: flex; gap: 8px; }
.wk-input .input { flex: 1 1 0; min-width: 0; letter-spacing: 1px; text-transform: uppercase; }
.wk-input .btn { flex: none; height: 44px; padding: 0 22px; font-size: 14px; }
#wk-tabs { margin: 14px 0 12px; }
.wk-card {
  display: flex; align-items: stretch; gap: 12px; padding: 12px 14px;
  border-radius: var(--radius-md); margin-bottom: 9px;
  background: linear-gradient(135deg, var(--pink-soft), var(--surface));
  border: 1px solid var(--pink-line);
}
.wk-left {
  flex: none; width: 76px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  border-right: 1px dashed var(--pink-line); padding-right: 10px;
}
.wk-num { font-size: 24px; font-weight: 800; color: var(--pink); letter-spacing: -.5px; line-height: 1.1; }
.wk-unit { font-size: 11px; color: var(--pink-strong); opacity: .85; }
.wk-right { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wk-title { font-size: 14.5px; font-weight: 700; }
.wk-exp { font-size: 12px; color: var(--text-3); }
.wk-state { font-size: 12px; font-weight: 700; color: var(--text-3); margin-top: auto; align-self: flex-end; }
.wk-card.dead { background: var(--surface-2); border-color: var(--line); }
.wk-card.usable { box-shadow: var(--shadow-1); }
.wk-sub {
  font-size: 11.5px; color: var(--text-3); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-use {
  flex: none; align-self: center; height: 34px; padding: 0 16px;
  border: none; border-radius: var(--radius-full); cursor: pointer;
  background: linear-gradient(135deg, #ff6aa6, var(--pink)); color: #fff;
  font-size: 13px; font-weight: 700; font-family: inherit;
  box-shadow: var(--shadow-pink); transition: transform .12s var(--ease), opacity .16s;
}
.wk-use:active { transform: scale(.96); opacity: .9; }
.wk-card.dead .wk-left { border-right-color: var(--line); }
.wk-card.dead .wk-num { color: var(--text-3); }
.wk-card.dead .wk-unit { color: var(--text-3); }
.wk-empty {
  padding: 34px 10px; text-align: center; font-size: 13px; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 11px;
}
.wk-empty-ico {
  width: 58px; height: 58px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-3);
}
.wk-empty-ico svg { width: 27px; height: 27px; }

/* ===== 充值页 ===== */
.pay-wrap {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 12px calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  max-width: 520px; width: 100%; margin: 0 auto;
}
.pay-balance {
  border-radius: var(--radius-lg); padding: 15px 18px;
  background: linear-gradient(135deg, #ff6aa6, #ff2f86);
  color: #fff; box-shadow: var(--shadow-pink); margin-bottom: 12px;
}
.pay-balance-label { font-size: 12.5px; opacity: .92; }
.pay-balance-value { margin-top: 5px; display: flex; align-items: baseline; gap: 6px; }
.pay-balance-value b { font-size: 30px; font-weight: 800; letter-spacing: -.6px; }
.pay-balance-value span { font-size: 13px; opacity: .92; }
.pay-balance-hint { display: none; }

/* 套餐卡：紧凑两列，短文案不撑高 */
.pay-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-plan {
  position: relative; overflow: hidden; cursor: pointer; text-align: center;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 6px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .12s var(--ease);
}
.pay-plan:hover { border-color: var(--pink-line); }
.pay-plan:active { transform: scale(.985); }
.pay-plan.active { border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink-soft); }
.pay-plan-coins { font-size: 17px; font-weight: 800; letter-spacing: -.3px; display: flex; align-items: baseline; gap: 3px; line-height: 1.2; }
.pay-plan-coins small { font-size: 10.5px; font-weight: 600; color: var(--text-3); }
.pay-plan-bonus {
  display: inline-flex; align-items: center; height: 17px; padding: 0 9px;
  border-radius: var(--radius-full); color: #fff; font-size: 11px; font-weight: 700;
  background: linear-gradient(100deg, #ff7bb0, #ff5b6e); line-height: 1;
}
.pay-plan-price { font-size: 14.5px; font-weight: 800; line-height: 1.2; }
.pay-plan-note { font-size: 10px; color: var(--text-3); line-height: 1.3; }
.pay-plan-tag {
  position: absolute; top: 0; right: 0; height: 17px; padding: 0 8px;
  display: inline-flex; align-items: center;
  background: linear-gradient(100deg, #ff6aa6, #ff2f86); color: #fff;
  font-size: 10.5px; font-weight: 700; border-bottom-left-radius: 8px;
}
.pay-plan.active::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pink);
}
/* 新用户特惠：描边 + 淡黄底，跟普通档区分开 */
.pay-plan-special { border-color: #ffb020; background: linear-gradient(180deg, rgba(255, 176, 32, .14), var(--surface)); }
.pay-plan-special .pay-plan-tag { background: linear-gradient(100deg, #ffb020, #ff7a00); }
.pay-plan-special .pay-plan-note { color: #b26a00; font-weight: 600; }

.pay-methods { display: flex; gap: 8px; }
.pay-method {
  display: flex; align-items: center; gap: 8px; flex: 1;
  padding: 9px 10px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.pay-method:hover { border-color: var(--pink-line); }
.pay-method.active { border-color: var(--pink); background: var(--pink-softer); }
.pay-method-ico { width: 28px; height: 28px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; }
.pay-method-ico.wx { background: #22b573; }
/* 支付宝用官方图标（白底蓝「支」），所以底衬改成白色 + 一圈细边 */
.pay-method-ico.ali { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pay-method-ico svg { width: 17px; height: 17px; }
.pay-method-ico img { width: 100%; height: 100%; display: block; object-fit: contain; }
.pay-method-name { flex: 1; font-weight: 600; font-size: 13.5px; }
.pay-check {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-strong); color: transparent;
  display: flex; align-items: center; justify-content: center;
}
.pay-method.active .pay-check { background: var(--pink); border-color: var(--pink); color: #fff; }
.pay-tip { text-align: center; margin-top: 8px; line-height: 1.6; font-size: 11.5px; }
.pay-tip.err { color: var(--red); }
#page-pay .section-label { padding: 0 2px 6px; font-size: 12px; margin-top: 10px; }
#page-pay .page-head { padding: 12px 16px 6px; }
#page-pay .page-title { font-size: 19px; }

/* ===== 账单记录（充值 / 积分 两个分栏） ===== */
.seg2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface-3); border-radius: var(--radius-md); padding: 4px; margin-bottom: 12px;
}
.seg2-btn {
  height: 38px; border: none; border-radius: 12px; background: transparent;
  color: var(--text-2); font-weight: 700; font-size: 14.5px; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.seg2-btn.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-1); }

.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 2px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-btn {
  flex: none; height: 30px; padding: 0 14px; border-radius: var(--radius-full);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all .16s var(--ease);
}
.chip-btn.active { background: var(--pink); border-color: var(--pink); color: #fff; }
.chip-btn:hover { border-color: var(--pink-line); }

.bill-summary {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 10px 12px; margin: 6px 0 12px;
  background: var(--pink-softer); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-2);
}
.bill-summary b { color: var(--pink-strong); font-size: 14px; }

.bill-list { display: flex; flex-direction: column; gap: 10px; }
.bill-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-2); border-radius: var(--radius-md); padding: 12px 14px;
}
.bill-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bill-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bill-sub { font-size: 12.5px; color: var(--text-3); word-break: break-word; }
.bill-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bill-amount { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bill-amount b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bill-amount b.plus { color: var(--pink); }
.bill-amount b.minus { color: var(--text); }
.bill-amount span { font-size: 11.5px; color: var(--text-3); }
.bill-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: var(--radius-full); }
.bill-tag.ok { background: var(--pink-soft); color: var(--pink-strong); }
.bill-tag.wait { background: var(--surface-3); color: var(--text-2); }

/* ===== 底部导航（只有图标） ===== */
#tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  /* 用 flex 平分，别写死列数 —— 写死 4 列时第 5 个（创建角色卡）会被挤到第二行 */
  display: flex; align-items: stretch;
  background: var(--tabbar-bg);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
/* 详情页 / 用户主页这些「二级页」把底部导航藏掉，否则会盖住「开始聊天」那条 */
#app.subpage #tabbar { display: none; }
#tabbar .tab {
  flex: 1 1 0; min-width: 0;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); display: flex; align-items: center; justify-content: center;
  position: relative; transition: color .16s var(--ease);
}
#tabbar .tab.active { color: var(--pink); }
#tabbar .tab:active { transform: scale(.94); }
#tabbar .tab svg { display: block; }
#tabbar .badge {
  position: absolute; top: 8px; left: 50%; margin-left: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--radius-full);
  background: var(--pink); color: #fff; font-size: 10px; font-weight: 700;
}

/* ===== 对话页 ===== */
.page.room { z-index: 20; }
/* 聊天背景：角色的图，模糊 + 压淡，保证气泡里的字清楚 */
.room-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center 28%; background-repeat: no-repeat;
  opacity: 0; transition: opacity .35s var(--ease);
}
.room-bg.on { opacity: .3; }
.room-bg::after {
  content: ''; position: absolute; inset: 0;
  backdrop-filter: blur(1.5px);
}
.page.room > #chat-head,
.page.room > #messages,
.page.room > #composer,
.page.room > #choice-bar { position: relative; z-index: 1; }

/* 给选项：贴在输入框上方的一排 */
.choice-bar {
  flex: none; display: flex; flex-direction: column; gap: 7px;
  padding: 10px 12px 2px; background: transparent;
}
.choice-bar.hidden { display: none; }
.choice-hint { font-size: 11.5px; color: var(--text-3); padding-left: 2px; }
.choice-btn {
  text-align: left; font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--pink-strong); background: var(--surface);
  border: 1px solid var(--pink-line); border-radius: var(--radius-md);
  padding: 10px 13px; cursor: pointer; line-height: 1.45;
  box-shadow: var(--shadow-1);
}
.choice-btn:hover { background: var(--pink-soft); }

/* 输入框左边那颗「选项」 */
.ghost-btn {
  flex: none; height: 38px; padding: 0 12px; border-radius: var(--radius-full);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; align-self: flex-end;
}
.ghost-btn:hover { border-color: var(--pink-line); color: var(--pink); }
.ghost-btn:disabled { opacity: .55; }

/* 弹窗里的小节 */
.sheet-section { margin-bottom: 20px; }
.sheet-section:last-child { margin-bottom: 4px; }
.sheet-section-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.sheet-section input[type="range"] { accent-color: var(--pink); height: 28px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-btn { height: 40px; }
#chat-head {
  flex: none; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.chat-avatar {
  width: 40px; height: 40px; border-radius: 13px; object-fit: cover;
  background: var(--surface-3); flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--pink-line);
}
.chat-title-wrap { flex: 1; min-width: 0; }
.chat-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-actions { display: flex; gap: 4px; }
.chat-head-actions .icon-btn.on { color: var(--pink); background: var(--pink-soft); }
.chat-head-actions .icon-btn.on svg { fill: var(--pink); }

.messages {
  flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth;
  padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 11px;
  background: transparent;
}
/* 一行消息：头像 + 内容列 + 气泡壳
 * 结构：.msg > .msg-avatar + .msg-col > .bubble-wrap > .bubble
 * 气泡必须包在 fit-content 的壳里，否则在 flex 列里会被拉伸/挤压导致短句换行 */
.msg { display: flex; gap: 8px; max-width: 860px; width: 100%; margin: 0 auto; align-items: flex-start; }
.msg-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.msg.user .msg-col { align-items: flex-end; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; flex: none;
  background: var(--surface-3); display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-3); overflow: hidden;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble-wrap { max-width: 78%; width: fit-content; display: flex; flex-direction: column; }
.msg.user .bubble-wrap { align-items: flex-end; }
.bubble {
  max-width: 100%;
  padding: 8px 12px; border-radius: 14px; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line);
  line-height: 1.6; word-break: normal; overflow-wrap: break-word; white-space: normal;
  animation: bubble-in .22s var(--ease); box-shadow: var(--shadow-1);
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user .bubble {
  background: var(--pink); color: #fff; border-color: var(--pink);
  border-bottom-right-radius: 5px;
}
.msg.user .bubble a { color: #fff; text-decoration: underline; }
.msg.assistant .bubble { border-bottom-left-radius: 5px; }
.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble em { color: var(--pink-strong); font-style: italic; }
.bubble code { background: var(--surface-3); padding: 2px 6px; border-radius: var(--radius-xs); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.bubble pre { background: var(--surface-2); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; margin: 10px 0; }
.bubble pre code { background: none; padding: 0; }
.bubble blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--pink-line); color: var(--text-2); background: var(--pink-softer); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.bubble ul, .bubble ol { margin: 8px 0; padding-left: 22px; }
.bubble li { margin: 4px 0; }
.bubble h1, .bubble h2, .bubble h3 { margin: 14px 0 8px; font-size: 15px; }
.bubble hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.bubble table { border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 6px 10px; }

.typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes blink { 0%,80%,100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.wb-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3);
  background: var(--surface-3); border-radius: var(--radius-full); padding: 2px 8px; margin-top: 7px;
}

/* ===== 输入区 ===== */
#composer { flex: none; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.composer-inner {
  max-width: 860px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px;
  background: var(--surface-2); border: 1.5px solid var(--line);
  border-radius: var(--radius-xl); padding: 6px 6px 6px 16px;
  transition: border-color .16s var(--ease);
}
.composer-inner:focus-within { border-color: var(--pink); background: var(--bg); }
.composer-input {
  flex: 1; background: transparent; border: none; outline: none;
  resize: none; max-height: 160px; line-height: 1.6; padding: 9px 0;
}
.composer-input::placeholder { color: var(--text-3); }
.send-btn {
  width: 42px; height: 42px; flex: none; border: none; border-radius: var(--radius-full);
  background: var(--pink); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s var(--ease), background .16s var(--ease), opacity .16s var(--ease);
}
.send-btn:hover { background: var(--pink-strong); box-shadow: var(--shadow-pink); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   登录页 / 注册页（全屏）
   ============================================================ */
#auth-gate {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg); overflow-y: auto;
  padding: 34px 22px calc(30px + env(safe-area-inset-bottom));
}
.auth-card { max-width: 430px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 0 4px; }
.auth-logo {
  width: 66px; height: 66px; border-radius: 22px;
  background: linear-gradient(135deg, #ff8ab8, var(--pink));
  box-shadow: var(--shadow-pink);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.auth-title { font-size: 23px; font-weight: 800; letter-spacing: .5px; text-align: center; }
.auth-sub { font-size: 13px; color: var(--text-3); text-align: center; margin-top: -6px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn.block { height: 50px; font-size: 16px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--text-2); padding-top: 2px; }
.auth-panel { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { text-align: center; padding-top: 6px; }
.field-hint { font-size: 12px; color: var(--text-3); }
.field-hint.err { color: var(--red); }
.field-hint.ok { color: var(--green); }

/* ============================================================
   角色卡详情页
   ============================================================ */

.role-page { background: var(--bg); }
.role-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

/* ---- 背景大图 ---- */
.role-hero { position: relative; min-height: 168px; display: flex; flex-direction: column; justify-content: flex-end; }
.role-hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%; background: var(--surface-3);
}
.role-hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,10,16,.42) 0%, rgba(20,10,16,.12) 34%, rgba(20,10,16,.72) 74%, rgba(20,10,16,.92) 100%);
}
.role-hero-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 0;
}
.role-hero-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn.glass {
  background: rgba(0,0,0,.34); color: #fff; backdrop-filter: blur(8px);
}
.icon-btn.glass:hover { background: rgba(0,0,0,.5); color: #fff; }
/* 背景条上的点赞：图标 + 数字 */
.icon-btn.glass.role-heart { width: auto; padding: 0 11px; gap: 5px; border-radius: var(--radius-full); }
.icon-btn.glass.role-heart span { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.icon-btn.glass.role-heart.on { color: #ff8ab8; }
.icon-btn.glass.role-heart.on svg { fill: #ff5c9d; }

.role-head {
  position: relative; z-index: 1; display: flex; gap: 12px; align-items: flex-end;
  padding: 0 16px 14px;
}
.role-head-avatar {
  width: 68px; height: 68px; border-radius: 18px; object-fit: cover; flex: none;
  border: 2px solid rgba(255,255,255,.7); background: var(--surface-3);
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}
.role-head-main { min-width: 0; padding-bottom: 2px; }
.role-head-name {
  font-size: 19px; font-weight: 800; color: #fff; line-height: 1.28;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.role-head-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 12px; color: rgba(255,255,255,.86);
}
.role-head-meta .dot { opacity: .6; }
.role-head-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.role-head-tags .chip {
  background: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(6px);
  padding: 2px 9px; border-radius: 999px; font-size: 11px;
}

/* ---- 数据行 ---- */
.role-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 14px 6px; gap: 2px;
  border-bottom: 1px solid var(--line);
}
.role-stat { text-align: center; min-width: 0; }
.role-stat b {
  display: block; font-size: 15px; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.role-stat span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

/* ---- tab ---- */
.role-tabs {
  display: flex; gap: 4px; padding: 10px 12px 6px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--bg); z-index: 3;
}
.role-tab {
  flex: 1; height: 36px; border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-full); font-size: 13.5px; font-weight: 600;
  color: var(--text-3); font-family: inherit;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.role-tab.active { background: var(--pink-soft); color: var(--pink-strong); }
.role-tab span { font-size: 11px; opacity: .75; }

.role-panes { padding: 12px 14px 4px; }
.role-pane { display: none; }
.role-pane.active { display: block; }

.role-block { margin-bottom: 14px; }
.role-block-title {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  letter-spacing: .4px; margin-bottom: 6px;
}
.role-block-body {
  font-size: 13.5px; line-height: 1.75; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 12px 14px;
  white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow-y: auto;
}
.role-block-body.pre { font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; }
.role-block-body.clamped { max-height: 96px; overflow: hidden; position: relative; }
.role-block-body.clamped::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 42px;
  background: linear-gradient(180deg, transparent, var(--surface));
}
.role-block-more {
  display: block; width: 100%; margin-top: 6px; border: none; background: transparent;
  color: var(--pink); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
}

/* ---- 关于 ta：标签 / 最近更新 / 来源 ---- */
.role-meta {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 4px 14px; margin-bottom: 14px;
}
.role-meta-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.role-meta-row:last-child { border-bottom: none; }
.role-meta-label { flex: none; width: 62px; font-size: 12.5px; color: var(--text-3); line-height: 22px; }
.role-meta-value {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); line-height: 22px;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center; word-break: break-word;
}
.role-meta-value .muted { color: var(--text-3); }
.role-meta-value .chip { height: 22px; padding: 0 9px; font-size: 11px; }

/* ---- 打分 ---- */
.rate-row { display: flex; gap: 5px; flex-wrap: wrap; }
.rate-star {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-3); font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: all .14s var(--ease);
}
.rate-star:hover { border-color: var(--pink-line); color: var(--pink); }
.rate-star.on { background: var(--pink); border-color: var(--pink); color: #fff; }

/* ---- 评论 ---- */
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment {
  display: flex; gap: 10px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.comment-avatar {
  width: 36px; height: 36px; border-radius: 999px; flex: none;
  background: var(--surface-3); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--text-3);
  line-height: 1;
}
/* 头像是 <img> 时：撑满圆形、居中裁切，避免出现缝/线 */
img.comment-avatar { object-fit: cover; object-position: center; display: block; }
.comment-body { flex: 1; min-width: 0; }
.comment-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.comment-name { font-size: 13px; font-weight: 700; color: var(--text); }
.comment-coins {
  font-size: 10.5px; color: var(--pink-strong); background: var(--pink-soft);
  padding: 1px 7px; border-radius: 999px; font-weight: 600;
}
.comment-time { font-size: 11px; color: var(--text-3); margin-left: auto; }
.comment-text { font-size: 13.5px; line-height: 1.65; color: var(--text-2); margin-top: 5px; word-break: break-word; }
.comment-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.comment-act {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px;
}
.comment-act:hover { color: var(--pink); }
.comment-act.on { color: var(--pink); font-weight: 600; }
.comment-more {
  text-align: center; font-size: 13px; color: var(--pink); font-weight: 600;
  padding: 14px; cursor: pointer;
}
.comment-empty, .rank-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 28px 0; }

/* ---- 榜单 ---- */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  cursor: pointer;
}
.rank-item.me { border-color: var(--pink); background: var(--pink-softer); }
.rank-no {
  width: 22px; flex: none; text-align: center; font-size: 13px; font-weight: 800;
  color: var(--text-3); font-variant-numeric: tabular-nums;
}
.rank-item:nth-child(1) .rank-no { color: #f0a020; }
.rank-item:nth-child(2) .rank-no { color: #9aa4b2; }
.rank-item:nth-child(3) .rank-no { color: #c98b4b; }
.rank-avatar { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-3); }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.rank-heat { font-size: 12px; font-weight: 700; color: var(--pink); flex: none; font-variant-numeric: tabular-nums; }

/* ---- 底部操作条 ---- */
.role-bottom {
  flex: none; border-top: 1px solid var(--line); background: var(--surface);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 9px;
}
.comment-bar { display: flex; gap: 8px; }
.comment-bar .input { flex: 1; height: 38px; font-size: 13.5px; }
.comment-bar .btn { height: 38px; flex: none; padding: 0 16px; }
.comment-bar.hidden { display: none; }
.role-actions { display: flex; gap: 9px; }
.role-rate-btn {
  flex: none; width: 104px; height: 46px; gap: 6px; font-size: 13.5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.role-rate-btn.on { color: var(--pink); border-color: var(--pink); }
.role-rate-btn.on svg { fill: var(--pink); }
.role-start { flex: 1; height: 46px; font-size: 16px; }

/* 打分弹窗里的星 */
#rate-modal .rate-row { justify-content: center; margin: 4px 0 18px; }
#rate-modal .modal-text { text-align: center; margin-bottom: 12px; }

@media (max-width: 380px) {
  .role-stat b { font-size: 14px; }
  .role-stat span { font-size: 10px; }
}

/* ============================================================
   用户主页（看别人 / 看自己）
   ============================================================ */

.user-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.user-hero {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 20px 18px; border-bottom: 1px solid var(--line);
}
.user-avatar {
  width: 76px; height: 76px; border-radius: 999px; overflow: hidden; flex: none;
  background: var(--surface-3); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; line-height: 1;
  border: 2px solid var(--surface); box-shadow: var(--shadow-1);
}
img.user-avatar { object-fit: cover; object-position: center; display: block; }
.user-name { font-size: 18px; font-weight: 800; text-align: center; word-break: break-word; }
.user-meta { font-size: 12px; color: var(--text-3); text-align: center; }
.user-nums { display: flex; gap: 26px; margin-top: 4px; }
.user-num { text-align: center; }
.user-num b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.user-num span { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; }
.user-follow { min-width: 116px; height: 38px; margin-top: 6px; border-radius: var(--radius-full); }
.user-follow.on { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.user-follow.self { visibility: hidden; }

.user-tabs {
  display: flex; gap: 4px; padding: 10px 12px 6px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--bg); z-index: 3;
}
.user-panes { padding: 12px 0 24px; }
.user-pane { display: none; }
.user-pane.active { display: block; }

/* 主页里的小卡片（复用首页卡片，缩小一点） */
.role-grid.mini {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 0 14px; overflow: visible; flex: none; min-height: 0;
}
@media (min-width: 620px) { .role-grid.mini { grid-template-columns: repeat(3, 1fr); } }

/* 关注 / 粉丝 列表 */
.people-list { display: flex; flex-direction: column; gap: 8px; padding: 0 14px; }
.person {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); cursor: pointer;
}
.person-avatar {
  width: 42px; height: 42px; border-radius: 999px; overflow: hidden; flex: none;
  background: var(--surface-3); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; line-height: 1;
}
img.person-avatar { object-fit: cover; object-position: center; display: block; }
.person-main { flex: 1; min-width: 0; }
.person-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.person-follow { flex: none; height: 32px; padding: 0 14px; font-size: 12.5px; border-radius: var(--radius-full); }
.person-follow.on { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.users-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 30px 20px; }

/* 评论区的头像 / 昵称可点，进他主页 */
.comment-name { cursor: pointer; }
.comment-name:hover { color: var(--pink); }
img.comment-avatar { cursor: pointer; }

/* ============ 我的页右上角：三档主题切换 ============ */
.theme-switch {
  display: flex; align-items: center; gap: 0; flex: none;
  padding: 3px; border-radius: var(--radius-full);
  background: var(--surface); border: 1.5px solid var(--pink-line);
}
.theme-seg {
  width: 38px; height: 30px; border-radius: var(--radius-full); cursor: pointer;
  border: 0; background: transparent; color: var(--pink);
  display: flex; align-items: center; justify-content: center;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.theme-seg svg { width: 17px; height: 17px; }
.theme-seg.active { background: var(--pink); color: #fff; box-shadow: var(--shadow-pink); }

/* ============ 每日签到弹窗 ============ */
.ck-sheet { padding: 0; max-width: 440px; }
.ck-head {
  position: sticky; top: 0; z-index: 2;
  border-radius: 24px 24px 0 0;
  padding: 14px 16px 20px;
  background: linear-gradient(120deg, #ff5c9d 0%, #ff7bb0 42%, #ff9a5c 100%);
  color: #fff;
}
.ck-head-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ck-pill {
  font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .24); color: #fff;
}
.ck-max { flex: 1 1 0; text-align: right; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .92); }
.ck-x {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 0; flex: none;
  background: rgba(255, 255, 255, .2); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.ck-title { margin-top: 14px; font-size: 25px; font-weight: 800; letter-spacing: .5px; }
.ck-sub { margin-top: 6px; font-size: 13px; color: rgba(255, 255, 255, .9); }

.ck-body { padding: 15px 16px calc(16px + env(safe-area-inset-bottom)); }
.ck-tip {
  padding: 10px 13px; border-radius: 12px; background: var(--surface-3);
  font-size: 13px; color: var(--text-2); font-weight: 600;
}
.ck-tip b { color: var(--text); font-weight: 800; }

.ck-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.ck-day {
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  padding: 11px 4px 9px; text-align: center;
}
.ck-day.done { border-color: var(--pink); background: var(--pink-soft); }
.ck-day.today { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-softer); }
.ck-mark {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-3);
}
.ck-day.done .ck-mark { background: var(--pink-strong); color: #fff; }
.ck-mark svg { width: 15px; height: 15px; }
.ck-amt { font-size: 15px; font-weight: 800; color: var(--text-3); }
.ck-day.done .ck-amt { color: var(--pink-strong); }
.ck-day-label { margin-top: 3px; font-size: 11px; color: var(--text-3); }
.ck-day.done .ck-day-label { color: var(--pink); font-weight: 700; }

.ck-full {
  margin-top: 14px; padding: 12px 14px; border-radius: 14px;
  display: flex; align-items: center; gap: 11px;
  background: rgba(255, 176, 32, .1); border: 1px solid rgba(255, 176, 32, .35);
}
.ck-full-ico {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 176, 32, .22); color: #c98b4b;
}
.ck-full-ico svg { width: 19px; height: 19px; }
.ck-full-t { font-size: 14px; font-weight: 800; color: #b26a00; }
.ck-full-s { margin-top: 2px; font-size: 11.5px; color: #c98b4b; }

.ck-btn {
  margin-top: 16px; width: 100%; height: 50px; border: 0; cursor: pointer;
  border-radius: var(--radius-full); background: var(--pink); color: #fff;
  font-size: 16px; font-weight: 800;
}
.ck-btn:disabled { background: var(--surface-3); color: var(--text-3); cursor: default; }

.ck-rules { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.ck-rules-t { font-size: 13.5px; font-weight: 800; color: var(--text); margin-bottom: 9px; }
.ck-rule { display: flex; gap: 9px; margin-top: 7px; font-size: 12.5px; line-height: 1.65; color: var(--text-2); }
.ck-rule b { flex: none; color: var(--text); font-weight: 800; }

html[data-theme="dark"] .ck-full-t { color: var(--amber); }
html[data-theme="dark"] .ck-full-s { color: rgba(245, 181, 68, .8); }
html[data-theme="dark"] .ck-full-ico { color: var(--amber); background: rgba(255, 176, 32, .2); }
/* 我的页：退出登录做成大号胶囊按钮（之前被内联 height:44px 压小了） */
#btn-logout {
  height: 52px; font-size: 16px; font-weight: 800;
  border-radius: var(--radius-full);
  color: var(--red); background: var(--red-soft); border: 0;
}
#btn-logout:hover { background: var(--red); color: #fff; }
/* 我的页整体别被底部导航压住：给足滚动余量 */
#page-me .me-wrap { padding-bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom)); }
/* ===== 创建角色卡页（正常玩家端 + 定制1端共用） ===== */
/* 定制1端专属样式：底部 + 号、创建角色卡页、全屏编辑、草稿箱 */

/* ---------- 底部导航中间那个 + ---------- */
.tab-plus { position: relative; }
.tab-plus .plus-circle {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ff8ab8, var(--pink));
  color: #fff; box-shadow: 0 5px 14px rgba(255, 77, 148, .38);
  transition: transform .14s var(--ease);
}
.tab-plus:active .plus-circle { transform: scale(.92); }
#tabbar .tab.tab-plus { opacity: 1; }

/* ---------- 创建角色卡 ---------- */
#page-create { background: var(--bg); }
#page-create .page-head { padding: 12px 14px 8px; }
#page-create .page-title { font-size: 17px; }
#page-create .head-actions .icon-btn { width: 34px; height: 34px; }
#cr-full .page-title { font-size: 17px; }

.cr-scroll {
  flex: 1 1 0; min-height: 0; overflow-y: auto;
  padding: 2px 13px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.cr-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 13px; box-shadow: var(--shadow-1);
}
/* 字段下方的批注：说明这段文字到底会出现在哪里 */
.cr-card-title { display: flex; align-items: center; gap: 7px; }
.cr-ico { flex: none; width: 18px; height: 18px; display: inline-flex; color: var(--pink); }
.cr-ico svg { width: 18px; height: 18px; }
.cr-note {
  margin-top: 9px; padding: 8px 11px; border-radius: 10px;
  background: var(--pink-softer); border: 1px solid var(--pink-line);
  color: var(--pink-strong); font-size: 12px; line-height: 1.65;
}
html[data-theme="dark"] .cr-card-title { display: flex; align-items: center; gap: 7px; }
.cr-ico { flex: none; width: 18px; height: 18px; display: inline-flex; color: var(--pink); }
.cr-ico svg { width: 18px; height: 18px; }
.cr-note { color: var(--text-2); }
.cr-full-note { margin: 0 16px 14px; }
.cr-full-note.hidden { display: none; }
.cr-card-title { font-size: 13.5px; font-weight: 800; color: var(--text); }
.cr-req {
  font-size: 10px; font-weight: 700; color: var(--pink);
  background: var(--pink-soft); border-radius: 999px; padding: 1px 6px; margin-left: 5px;
  vertical-align: 1px;
}
.cr-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.cr-field-head .tiny { font-size: 11.5px; }
.cr-expand {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.cr-expand svg { width: 14px; height: 14px; }
.cr-expand:hover { border-color: var(--pink-line); color: var(--pink); }
.tiny.over { color: var(--pink); font-weight: 700; }

.cr-text {
  width: 100%; box-sizing: border-box; min-height: 76px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  padding: 9px 11px; font-size: 13px; line-height: 1.7; color: var(--text);
  font-family: inherit; resize: vertical; outline: none;
}
.cr-text:focus { border-color: var(--pink-line); background: var(--surface); }
.cr-text::placeholder { color: var(--text-3); }

.cr-avatar-row { display: flex; gap: 12px; align-items: center; }
.cr-avatar {
  width: 82px; height: 109px; flex: none; border-radius: 12px; cursor: pointer;
  border: 1.5px dashed var(--line-strong, #d8d3dc); background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-3); overflow: hidden; padding: 0;
}
.cr-avatar.has { border-style: solid; border-color: var(--line); }
.cr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cr-avatar-plus { font-size: 19px; line-height: 1; }
.cr-avatar-hint { font-size: 10.5px; }
.cr-avatar-note { line-height: 1.65; font-size: 11.5px; }

.chip-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-pick {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-size: 12px; font-weight: 700;
  transition: border-color .14s, background .14s, color .14s;
}
.chip-pick.on { border-color: var(--pink); background: var(--pink-soft); color: var(--pink); }
.chip-x { font-style: normal; font-size: 13px; line-height: 1; opacity: .7; padding: 0 1px; }
.chip-add-row { display: flex; gap: 8px; margin-top: 9px; }
.chip-add-row .input { flex: 1 1 0; height: 34px; font-size: 13px; }
.chip-add-row .btn { height: 34px; font-size: 12.5px; padding: 0 12px; }

.cr-actions { display: flex; gap: 9px; align-items: stretch; margin-top: 2px; }
.cr-actions .btn { height: 42px; font-size: 13.5px; }
.cr-actions .cr-save { flex: 1.6 1 0; font-weight: 800; font-size: 14.5px; }
.cr-actions .btn.ghost, .cr-actions .btn.tonal { flex: 1 1 0; }
#page-create #cr-msg { font-size: 12px; }

/* ---------- 全屏编辑 ---------- */
.cr-full {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; background: var(--bg);
  animation: annFade .16s var(--ease);
}
.cr-full.hidden { display: none; }
.cr-full .page-head { padding: 12px 14px 8px; }
.cr-full-text {
  flex: 1 1 0; min-height: 0; width: 100%; box-sizing: border-box;
  border: 0; outline: none; resize: none; background: var(--bg);
  padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
  font-size: 14px; line-height: 1.8; color: var(--text); font-family: inherit;
}
.cr-full-text::placeholder { color: var(--text-3); }

/* ---------- 草稿箱 ---------- */
.cr-draft-list { max-height: 62vh; overflow-y: auto; padding: 4px 0 2px; }
.cr-draft-sec { font-size: 12px; font-weight: 800; color: var(--text-2); padding: 4px 2px 7px; }
.cr-draft {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 13px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); margin-bottom: 8px;
}
.cr-draft:active { background: var(--pink-softer); }
.cr-draft img, .cr-draft-ph {
  width: 36px; height: 48px; border-radius: 9px; flex: none; object-fit: cover;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 16px;
}
.cr-draft-main { flex: 1 1 0; min-width: 0; }
.cr-draft-name { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-draft-del {
  flex: none; border: 0; background: transparent; cursor: pointer;
  color: var(--pink); font-size: 12px; font-weight: 700; padding: 6px;
}

/* 自己建的卡：右上角标状态（私有 / 待审核 / 已退回） */
.rt-flag {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700; line-height: 1.5; color: #fff;
  backdrop-filter: blur(6px);
}
.rt-flag.private { background: rgba(24, 20, 28, .62); }
.rt-flag.pending { background: rgba(245, 158, 11, .92); }
.rt-flag.rejected { background: rgba(229, 72, 77, .92); }
.notif-ico svg { width: 19px; height: 19px; }