/* =====================================================
   style.css —— 全局样式：配色/留白/圆角卡片/阴影/排版/过渡
   依赖 themes.css 提供的 CSS 变量

   本次整理要点（纯视觉，不改任何结构逻辑）：
   1) 合并重复声明：.chat-wrap 两处 → 一处；.bead-pal 的 flex-wrap
      wrap / nowrap 冲突 → 保留滑页式需要的 nowrap 一份；
   2) .input 里写了两次 font-size（16px / 15px），统一保留 16px
      （iOS 聚焦时 <16px 会整页放大且不会缩回）；
   3) 删除重复的注释块；圆角/阴影节奏交给 ui-pro.css 的 token 统一。
   ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
/* iOS 地址栏收起/展开时 100vh 会把内容顶出去，用 dvh 跟随可视区 */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}
body { overflow-x: hidden; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .35s ease, color .35s ease;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; border: none; cursor: pointer; }
input, textarea { font-family: inherit; outline: none; }
.hidden { display: none !important; }

/* ---------- 闪屏页（整屏用户照片背景 + 顶部特效标题） ---------- */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center;
  transition: opacity .9s ease, transform .9s ease;
  overflow: hidden;
}
.splash.fade { opacity: 0; transform: scale(1.08); pointer-events: none; }
/* 整屏背景图：竖屏全屏铺满、居中 cover 裁剪，不拉伸变形 */
.splash-bg {
  position: absolute; inset: 0;
  background-image: url("../img/cover_bg.jpg");
  background-size: cover;            /* 铺满裁剪，不变形 */
  background-position: center;      /* 居中 */
  background-repeat: no-repeat;
  animation: splashZoom 2.4s ease-out forwards;
}
@keyframes splashZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
/* 顶部压一层渐变蒙版，让标题更清晰、画面更高级 */
.splash-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(60,10,35,.35) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0) 70%, rgba(60,10,35,.25) 100%);
}
/* 顶部中间特效标题：发光 + 渐变 + 描边 */
.splash-title {
  position: relative; z-index: 2;
  margin-top: calc(48px + env(safe-area-inset-top));
  font-size: 42px; font-weight: 900; letter-spacing: 8px;
  color: #ffffff;
  /* 多层辉光 + 描边，任何照片上都清晰 */
  text-shadow:
    0 0 12px rgba(255,180,210,.95),
    0 0 28px rgba(255,120,170,.7),
    0 2px 4px rgba(120,40,80,.6);
  -webkit-text-stroke: 1px rgba(255,255,255,.35);
  animation: titleIn 1.1s ease both;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(-18px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.splash-bar { position: relative; z-index: 2; width: 140px; height: 3px; background: rgba(255,255,255,.35); border-radius: 3px; margin-top: auto; margin-bottom: 60px; overflow: hidden; }
.splash-bar-fill { height: 100%; background: #fff; border-radius: 3px; width: 0; }

/* ---------- 登录页 ---------- */
#loginPage { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.login-bg { position: absolute; inset: 0; background: var(--gradient); opacity: .12; }
.login-card {
  position: relative; width: 100%; max-width: 360px;
  background: var(--card); border-radius: 24px; padding: 34px 26px;
  box-shadow: var(--shadow);
}
.login-logo { width: 56px; height: 56px; border-radius: 18px; background: var(--gradient); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.login-logo .mini-heart { color: #fff; font-size: 26px; }
.login-title { font-size: 24px; font-weight: 800; }
.login-sub { color: var(--muted); font-size: 13px; margin: 4px 0 22px; }
/* 统一 16px：小于它 iOS 聚焦时会自动放大整个页面且不会自己缩回去 */
.input {
  width: 100%; padding: 13px 16px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--bg-soft);
  font-size: 16px; color: var(--text); margin-bottom: 12px;
}
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; }
.btn-primary {
  width: 100%; padding: 14px; border-radius: 14px; font-size: 16px; font-weight: 700; margin-top: 6px;
}
.login-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }
.login-switch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--primary); }
.login-switch b { cursor: pointer; }

/* ---------- 主应用骨架 ---------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.tab-page { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 90px; display: none; }
.tab-page.active { display: block; }

/* ---------- 底部四 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
/* 44px 是拇指可稳定点中的下限 */
.tab { flex: 1; min-height: 44px; text-align: center; color: var(--muted); font-size: 11px; position: relative; cursor: pointer; transition: color .2s; }
.tab-icon { font-size: 22px; display: block; margin-bottom: 2px; filter: grayscale(1); opacity: .7; transition: filter .2s, opacity .2s, transform .2s; }
.tab.active { color: var(--accent); font-weight: 700; }
.tab.active .tab-icon { filter: none; opacity: 1; transform: translateY(-2px); }
#chatBadge {
  position: absolute; top: 0; left: 50%; margin-left: 8px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #ff4d6d; color: #fff; font-size: 10px; line-height: 17px; display: none;
}
#chatBadge.show { display: block; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card); border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text); display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); font-size: 12px; }

/* ---------- 首页 ---------- */
.home-hero {
  background: var(--gradient); border-radius: 24px; padding: 26px 20px;
  color: #fff; text-align: center; margin-bottom: 14px; box-shadow: var(--shadow);
}
.couple-avatars { display: flex; align-items: center; justify-content: center; gap: 10px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; background: var(--bg-soft); position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 72px; height: 72px; }
.love-dot { font-size: 20px; animation: beat 1.2s infinite; }
.love-days-num { font-size: 40px; font-weight: 800; margin-top: 12px; line-height: 1; }
.love-days-label { font-size: 12px; opacity: .9; margin-top: 4px; }
.score-bar { height: 10px; background: var(--bg-soft); border-radius: 6px; overflow: hidden; }
/* 不做 width 过渡：分数条宽度由 JS 在渲染时一次性写入，
   过渡既不会触发，也属于被禁的布局属性动画 */
.score-fill { height: 100%; background: var(--gradient); border-radius: 6px; }

.mood-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.mood-item { text-align: center; cursor: pointer; padding: 6px; border-radius: 12px; flex: 1; transition: background .2s; }
.mood-item:active, .mood-item.on { background: var(--bg-soft); }
.mood-item span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.mood-item .emoji { font-size: 26px; }

/* 快捷入口网格 */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-item {
  background: var(--card); border-radius: 16px; padding: 16px 8px; text-align: center;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s;
}
.quick-item:active { transform: scale(.94); }
.quick-item .qi { font-size: 26px; }
.quick-item .qn { font-size: 12px; margin-top: 6px; color: var(--text); }

/* 纪念日倒计时条 */
.anniv-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.anniv-item:last-child { border-bottom: none; }
.anniv-left { margin-left: auto; font-weight: 700; color: var(--accent); font-size: 13px; }

/* ---------- 聊天 ---------- */
/* v7：聊天页固定不整页滚（外层再滚就会"往上翻被拽回顶部"的跳动感） */
#page-chat { padding: 0 0 calc(64px + env(safe-area-inset-bottom)); overflow: hidden; }
#chatBody { overscroll-behavior: contain; }
#subBody { overscroll-behavior: contain; }
/* 顶栏点一下回到最新消息（防误导航残留） */
#chatHead { cursor: default; user-select: none; }
/* 向上翻页时顶部提示 */
.chat-top-hint { text-align: center; font-size: 11.5px; color: var(--muted); padding: 4px 0 10px; }
.chat-top-hint.hidden { display: none; }
/* 对方新消息但我在看历史 → 悬浮跳转按钮 */
.new-msg-jump {
  position: absolute; right: 14px; bottom: 128px; z-index: 6;
  border-radius: 18px; padding: 8px 14px; font-size: 12.5px; font-weight: 700;
  background: var(--gradient); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.new-msg-jump.hidden { display: none; }
/* 引用回复条（输入区上方） */
.quote-bar {
  display: flex; align-items: center; gap: 8px; margin: 0 10px; padding: 7px 10px;
  background: var(--bg-soft); border-radius: 10px; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line);
}
.quote-bar.hidden { display: none; }
.quote-bar .qb-line { width: 3px; align-self: stretch; border-radius: 2px; background: var(--primary, #ff5c8a); }
.quote-bar .qb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-bar .qb-close { color: var(--muted); font-size: 14px; padding: 4px 8px; }
/* 气泡内的引用块 */
.msg .msg-quote {
  margin: 2px 0 6px; padding: 5px 8px; font-size: 12px; line-height: 1.35;
  background: rgba(0,0,0,.055); border-left: 3px solid rgba(0,0,0,.18);
  border-radius: 6px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.msg.me .msg-quote { background: rgba(255,255,255,.28); border-left-color: rgba(255,255,255,.55); }
/* 引用跳转后的原消息高亮闪一下：改由 ui-pro.css 的伪元素描边环实现 */
/* v8：已读回执（挂在我最新一条消息气泡下） */
.read-mark { display: block; font-size: 10.5px; color: rgba(0,0,0,.35); margin-top: 3px; }
.read-mark.ok { color: var(--primary, #ff5c8a); }
.msg.partner .read-mark { display: none; }
/* v7：你画我猜提示条 */
.draw-hintbar { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--bg-soft); font-size: 13px; }

.chat-wrap { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; }
#chatBody { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 0 12px; min-height: 0; }
/* 一条消息 = 头像 + 气泡。头像固定在最左，气泡侧靠 row-reverse 实现 */
.msg-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; max-width: 100%; }
.msg-row.me { flex-direction: row-reverse; }
.msg-avatar {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  overflow: hidden; background: var(--bg-soft); border: 2px solid var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,.10); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-avatar .ph { font-size: 15px; font-weight: 800; color: var(--primary-deep); line-height: 1; }
.msg {
  max-width: min(70%, calc(100% - 52px));
  padding: 10px 14px; border-radius: 16px; position: relative;
  word-break: normal; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55;
}
.msg.partner { background: var(--card); border-bottom-left-radius: 4px; box-shadow: var(--shadow); margin-right: auto; }
.msg.me { background: var(--gradient); color: #fff; border-bottom-right-radius: 4px; margin-left: auto; }
.msg .time { display: block; font-size: 10px; opacity: .6; margin-top: 3px; }
.msg.recalled { display: block; margin: 6px auto; background: none; color: var(--muted); text-align: center; font-size: 12px; box-shadow: none; max-width: 100%; }
.msg .react { position: absolute; bottom: -10px; right: 6px; font-size: 14px; background: var(--card); border-radius: 10px; padding: 0 4px; box-shadow: var(--shadow); }
.chat-inputbar {
  display: flex; gap: 10px; padding: 10px; background: var(--card);
  border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
}
/* 16px：小于它 iOS 聚焦时会自动放大整个页面且不会自己缩回去 */
.chat-input { flex: 1; min-width: 0; padding: 11px 14px; font-size: 16px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--bg-soft); }
.chat-send { padding: 0 20px; border-radius: 20px; background: var(--gradient); color: #fff; font-weight: 700; }

/* 长按操作面板 / 表情面板 */
.sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--card); border-radius: 20px 20px 0 0; padding: 18px; }
.sheet-opt { min-height: 44px; padding: 14px; text-align: center; border-radius: 12px; font-size: 15px; }
.sheet-opt:active { background: var(--bg-soft); }
.emoji-row { display: flex; justify-content: space-around; font-size: 28px; }

/* ---------- 朋友圈 ---------- */
.moment-item { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.moment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.moment-head .avatar { width: 40px; height: 40px; border-width: 2px; }
.moment-name { font-weight: 700; font-size: 14px; }
.moment-time { font-size: 11px; color: var(--muted); }
.moment-content { margin-bottom: 10px; white-space: pre-wrap; }
.moment-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.moment-imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer; }
.moment-imgs.single { grid-template-columns: 1fr; }
.moment-imgs.single img { aspect-ratio: auto; max-height: 320px; }
.moment-video { width: 100%; border-radius: 12px; margin-bottom: 10px; }
.moment-actions { display: flex; gap: 18px; color: var(--muted); font-size: 13px; }
.moment-actions span { cursor: pointer; }
.comment-list { margin-top: 10px; background: var(--bg-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.comment-list .citem { padding: 4px 0; }
.comment-list .cname { font-weight: 700; }
.fab {
  position: fixed; right: 18px; bottom: 90px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; background: var(--gradient);
  color: #fff; font-size: 28px; display: flex; align-items: center; justify-content: center;
}
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .eicon { font-size: 54px; margin-bottom: 10px; }

/* ---------- 个人中心 ---------- */
.profile-head { background: var(--gradient); border-radius: 24px; padding: 26px 20px; color: #fff; text-align: center; margin-bottom: 14px; }
.profile-head .avatar { margin: 0 auto; border-color: #fff; cursor: pointer; }
.profile-nick { font-size: 20px; font-weight: 800; margin-top: 10px; }
.profile-sign { font-size: 13px; opacity: .9; margin-top: 4px; }
.menu-list { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 15px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.menu-row:last-child { border-bottom: none; }
.menu-row:active { background: var(--bg-soft); }
.menu-row .micon { font-size: 20px; }
.menu-row .mtext { flex: 1; font-size: 15px; }
.menu-row .arrow { color: var(--muted); }
.btn-danger { width: 100%; padding: 14px; border-radius: 14px; background: var(--danger); color: #fff; font-weight: 700; margin-top: 14px; }

/* 主题选择 */
.theme-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: var(--bg-soft); cursor: pointer; margin-bottom: 10px; }
.theme-dot { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.theme-row.on { outline: 2px solid var(--primary); }

/* ---------- 子页面 ---------- */
#subPage { position: fixed; inset: 0; background: var(--bg); z-index: 90; transform: translateX(100%); transition: transform .3s ease; display: flex; flex-direction: column; }
#subPage.open { transform: translateX(0); }
.sub-header { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.sub-header button { min-width: 44px; min-height: 44px; background: none; font-size: 22px; color: var(--text); }
.sub-header span { font-size: 17px; font-weight: 700; }
#subBody { flex: 1; overflow-y: auto; padding: 16px; }

/* 列表卡片 */
.list-card { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.list-card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.list-card .t { font-weight: 700; }
.list-card .meta { font-size: 12px; color: var(--muted); }
.del-btn { background: none; color: var(--danger); font-size: 13px; }

/* 相册网格 */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.album-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.album-item img { width: 100%; height: 100%; object-fit: cover; }
.album-item .note { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; padding: 4px 6px; }

/* 进度条 */
.progress { height: 8px; background: var(--bg-soft); border-radius: 5px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--gradient); }

/* 记账 */
.ledger-summary { text-align: center; margin-bottom: 14px; }
.ledger-summary .big { font-size: 30px; font-weight: 800; color: var(--accent); }

/* Toast */
.app-toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.78); color: #fff; padding: 10px 20px; border-radius: 22px;
  font-size: 13px; z-index: 300; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; white-space: nowrap;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 顶部加载 */
.loading { text-align: center; color: var(--muted); padding: 20px; font-size: 13px; }
.row-flex { display: flex; gap: 8px; }
.row-flex .input { margin-bottom: 0; }


/* =====================================================
   v5：聊天顶部、正在输入、一起玩入口、拼豆、徽章
   ===================================================== */

/* ---------- 聊天顶部（对方名称 + 在线状态） ---------- */
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.ch-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  overflow: hidden; background: var(--bg-soft); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ch-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ch-avatar .ph { font-size: 15px; font-weight: 800; color: var(--primary-deep); }
.ch-main { min-width: 0; flex: 1; }
.ch-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-sub { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.ch-sub .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #c4c4c4; }
.ch-sub .dot.online { background: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, .18); }
.ch-sub .dot.offline { background: #c9c2c6; }

/* 对方正在输入 */
.typing-tip {
  align-self: flex-start; margin: 0 0 6px 14px;
  background: var(--card); color: var(--muted);
  border-radius: 14px 14px 14px 4px; padding: 7px 12px; font-size: 12.5px;
  box-shadow: var(--shadow); width: fit-content;
}
.typing-tip i { font-style: normal; letter-spacing: 1px; animation: typingBlink 1.2s infinite; }
@keyframes typingBlink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------- 首页"一起玩"入口 ---------- */
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.play-item {
  background: var(--bg-soft); border-radius: 16px; padding: 14px;
  cursor: pointer; transition: transform .16s ease, box-shadow .2s ease;
}
.play-item:active { transform: scale(.96); }
.pl-top { display: flex; align-items: center; justify-content: space-between; }
.pl-icon { font-size: 26px; }
.pl-live { font-size: 10px; color: var(--primary-deep); background: var(--card); border-radius: 8px; padding: 2px 7px; }
.pl-name { font-weight: 800; font-size: 15px; margin-top: 8px; }
.pl-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 一起刷视频 ---------- */
.watch-tip { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.watch-list { display: flex; flex-direction: column; gap: 10px; }
.watch-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 16px; padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer; min-height: 60px;
}
.watch-item:active { transform: scale(.98); }
.wi-icon { font-size: 26px; flex: 0 0 auto; }
.wi-main { flex: 1; min-width: 0; }
.wi-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-host { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-go { color: var(--primary-deep); font-size: 13px; font-weight: 700; flex: 0 0 auto; }

/* ---------- 拼豆 ---------- */
.bead-size { margin-bottom: 10px; }
.chip {
  background: var(--bg-soft); color: var(--muted); border-radius: 10px;
  padding: 7px 12px; font-size: 13px; min-height: 34px;
}
.chip.on { background: var(--gradient); color: #fff; font-weight: 700; }
.bead-pal .sw {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  box-shadow: 0 0 0 2px var(--card); transition: transform .14s ease;
}
.bead-pal .sw.on { transform: scale(1.18); box-shadow: 0 0 0 2.5px var(--primary-deep); }

/* ===== 拼豆 · 滑页式色板（一次 8 色，共 40 色） =====
   注意：这里必须 flex-wrap: nowrap（滑页依赖单行横向排列），
   上面那份 wrap 的旧声明会造成换行/不换行冲突，已删除 */
.bead-pal { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: nowrap; }
.bead-pal .pal-viewport {
  flex: 1; min-width: 0; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft);
  touch-action: pan-y; cursor: grab; padding: 6px 4px;
}
.bead-pal .pal-track {
  display: flex; align-items: center; width: 100%;
  transition: transform .32s cubic-bezier(.22,.85,.36,1); will-change: transform;
}
.bead-pal .pal-page { flex: 0 0 100%; display: flex; justify-content: space-around; align-items: center; gap: 6px; }
.bead-pal .pal-side { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.bead-pal .pal-arrow {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--primary-deep); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s ease, background .15s;
}
.bead-pal .pal-arrow:active { transform: scale(.92); background: var(--bg-soft); }
.pal-dots { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 2px 0 8px; }
.pal-dots .pd { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: transform .25s ease, background .25s ease; }
.pal-dots .pd.on { background: var(--gradient); transform: scale(1.3); box-shadow: 0 0 6px color-mix(in srgb, var(--primary) 60%, transparent); }
.pal-eraser { display: flex; justify-content: center; margin-bottom: 10px; }
.pal-eraser .chip { min-height: 30px; padding: 4px 16px; }

.bead-grid {
  display: grid; grid-template-columns: repeat(var(--side), var(--cell, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; touch-action: manipulation;
}
/* v7：大图纸外层滚动容器 */
.bead-scroll { overflow: auto; max-height: 64vh; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-radius: 8px; }
.bead-grid .cell {
  aspect-ratio: 1; background: var(--card); cursor: pointer;
}
.bead-mini {
  display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 0;
  width: fit-content; margin: 8px 0; border: 1px solid var(--line);
}
.bead-mini i { display: block; }
/* v15：列表缩略图改单个 canvas（原来每张图纸 n×n 个节点，图纸一多重开就卡） */
.bead-mini-c { display: block; margin: 8px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.bead-more { width: 100%; margin-top: 8px; }
.bead-cnt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bead-cnt .cnt {
  min-width: 22px; height: 22px; border-radius: 6px; color: #fff;
  font-size: 11px; line-height: 22px; text-align: center; padding: 0 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

/* ---------- 成就徽章 ---------- */
.badge-sum { text-align: center; }
.badge-sum .big { font-size: 26px; font-weight: 800; color: var(--accent); }
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge-item {
  background: var(--card); border-radius: 16px; padding: 14px 12px; text-align: center;
  box-shadow: var(--shadow); cursor: pointer; min-height: 44px;
}
.badge-item.locked { opacity: .45; filter: grayscale(1); box-shadow: none; background: var(--bg-soft); }
.badge-item .bi { font-size: 26px; }
.badge-item .bn { font-weight: 800; font-size: 14px; margin-top: 6px; }
.badge-item .bd { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.badge-item .bt { font-size: 10.5px; color: var(--primary-deep); margin-top: 5px; }
