/* 任务卡 · 样式：深色手机优先 */

:root {
  --bg: #0a0e16;
  --panel: #141a27;
  --panel-2: #1a2231;
  --panel-3: #212b3d;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e9edf6;
  --muted: #8b96ab;
  --accent: #6b8bff;
  --accent-2: #a06bff;
  --gold: #f5b942;
  --ok: #3ecf8e;
  --danger: #ff6b6b;
  --radius: 18px;
  --common: #8b93a7;
  --rare: #4f8ff7;
  --epic: #a768ff;
  --legend: #f5a524;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background:
    radial-gradient(900px 460px at 50% -12%, rgba(107, 139, 255, 0.20), transparent 70%),
    radial-gradient(700px 420px at 88% 108%, rgba(160, 107, 255, 0.14), transparent 72%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
  font: inherit;
  color: var(--text);
}

/* ---------- 手机壳 ---------- */
.phone {
  height: 100%;
  display: flex;
  justify-content: center;
}

.app {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 520px) {
  body { padding: 18px 0; }
  .phone { height: 100%; }
  .app {
    height: 100%;
    max-height: 900px;
    border-radius: 30px;
    border: 1px solid var(--line);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    background: rgba(10, 14, 22, 0.72);
    backdrop-filter: blur(2px);
  }
}

/* ---------- 顶栏 ---------- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 26, 39, 0.9), rgba(20, 26, 39, 0.35));
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-size: 18px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(107, 139, 255, 0.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 15px; letter-spacing: 0.5px; }
.brand-text small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.bell {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 15px;
  display: grid; place-items: center;
}
.bell:active { transform: scale(0.94); }
.bell .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--panel-2);
}

.who {
  display: flex; align-items: center; gap: 6px;
  height: 36px;
  padding: 0 12px 0 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
  max-width: 132px;
}
.who #whoEmoji { font-size: 15px; }
.who #whoName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .caret { color: var(--muted); font-size: 10px; margin-left: 1px; }

/* ---------- 视图 ---------- */
.view {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 22px;
  scroll-behavior: smooth;
}
.view::-webkit-scrollbar { width: 0; }

/* ---------- 底部 tab ---------- */
.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(16, 21, 32, 0.94);
  backdrop-filter: blur(14px);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px;
  font-size: 10.5px;
  color: var(--muted);
  border-top: 2px solid transparent;
  transition: color 0.18s ease;
}
.tab span { font-size: 18px; line-height: 1; filter: grayscale(0.55); transition: filter 0.18s ease; }
.tab em { font-style: normal; }
.tab.active { color: var(--text); border-top-color: var(--accent); }
.tab.active span { filter: none; }
.tab:active span { transform: scale(0.92); }

/* ---------- 通用块 ---------- */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 10px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.6px;
}
.section-title:first-child { margin-top: 2px; }
.section-title b { color: var(--text); font-size: 13px; letter-spacing: 0; }
.section-title .link { color: var(--accent); font-size: 12px; }

.panel {
  background: linear-gradient(165deg, var(--panel), #111725);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -8px rgba(107, 139, 255, 0.75);
}
.btn-ok { border-color: rgba(62, 207, 142, 0.35); background: rgba(62, 207, 142, 0.12); color: #7cf0b6; }
.btn-danger-soft { border-color: rgba(255, 107, 107, 0.28); background: rgba(255, 107, 107, 0.10); color: #ff9a9a; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel);
}
.chip.active {
  color: var(--text);
  border-color: rgba(107, 139, 255, 0.6);
  background: rgba(107, 139, 255, 0.16);
}

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.empty .big { display: block; font-size: 26px; margin-bottom: 8px; opacity: 0.85; }

/* ---------- 统计条 ---------- */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 2px; }
.stats-row.four { grid-template-columns: repeat(4, 1fr); gap: 7px; }
.stats-row.four .stat { padding: 10px 9px 9px; }
.stats-row.four .stat b { font-size: 19px; }
.stats-row.four .stat span { font-size: 10px; }
.stat {
  padding: 12px 12px 10px;
  border-radius: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.stat b { display: block; font-size: 22px; line-height: 1.15; letter-spacing: 0.5px; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.hl b { color: var(--gold); }

/* ---------- 赌约提醒 ---------- */
.invite {
  border-radius: var(--radius);
  border: 1px solid var(--r-line, rgba(245, 185, 66, 0.32));
  border-left: 3px solid var(--r, #f5a524);
  background: linear-gradient(150deg, var(--r-bg, rgba(245, 185, 66, 0.14)), rgba(0, 0, 0, 0) 55%), var(--panel);
  padding: 13px 14px;
  margin-bottom: 10px;
  animation: cardUp 0.28s ease both;
}

/* 卡片上浮：处理掉最上面那张之后，新的会从下方升上来 */
@keyframes cardUp {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* 向上翻页：卡片绕底边往前翻起、淡出 */
@keyframes cardOut {
  from { opacity: 1; transform: translateY(0) rotateX(0deg) scale(1); }
  to { opacity: 0; transform: translateY(-64px) rotateX(-26deg) scale(0.94); }
}

.invite.leaving {
  transform-origin: 50% 100%;
  animation: cardOut 0.25s cubic-bezier(0.4, 0, 0.9, 1) forwards;
  pointer-events: none;
}

/* 叠层：收起时只露最上面一张；2 个透一层边，3 个及以上透两层 */
.stack-wrap { position: relative; perspective: 800px; }

.stack-wrap.has-more::before,
.stack-wrap.has-many::after {
  content: "";
  position: absolute;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 185, 66, 0.16);
  background: #131a27;
}

/* 2 个：卡片下面露一条边 */
.stack-wrap.has-more {
  padding-bottom: 14px;
  margin-bottom: 8px;
}
.stack-wrap.has-more::before {
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 40px;
  z-index: 2;
}

/* 3 个及以上：再往下多露一条更窄的边 */
.stack-wrap.has-many {
  padding-bottom: 24px;
}
.stack-wrap.has-many::before {
  bottom: 10px;
}
.stack-wrap.has-many::after {
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 40px;
  z-index: 1;
}

.stack-wrap .invite {
  position: relative;
  z-index: 3;
  margin-bottom: 0;
}
.stack-wrap .invite + .invite { margin-top: 10px; }
.stack-more { margin: 2px 0 6px; }
.invite-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--r, var(--gold)); }
.invite-top .who-line { flex: 1; color: var(--text); font-weight: 600; font-size: 13.5px; }
.invite-top .tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: var(--r-bg, rgba(245, 185, 66, 0.18));
  color: var(--r, var(--gold));
}
.invite-preview {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: #c9d2e4;
}
.invite-preview em { font-style: normal; color: var(--muted); display: block; margin-top: 3px; font-size: 11.5px; }
.invite-actions { display: flex; gap: 8px; }
.invite-actions .btn { flex: 1; min-height: 38px; }

/* ---------- 卡牌网格 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }

.gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 156px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  overflow: hidden;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  animation: rise 0.32s ease both;
}
.gcard:active { transform: scale(0.975); }
.gcard::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 55%);
  pointer-events: none;
}
.gcard .em { font-size: 30px; line-height: 1; }
.gcard .nm { font-size: 13.5px; font-weight: 700; letter-spacing: 0.3px; }
.gcard .fx { font-size: 11px; color: #b9c4d8; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gcard .rar {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.28);
  color: #dfe6f5;
}
.gcard .go { font-size: 10.5px; color: rgba(255, 255, 255, 0.72); }

/* 稀有度配色变量：任何带 data-r 的元素都能直接用 --r / --r-bg / --r-line */
[data-r="common"] { --r: #8b93a7; --r-bg: rgba(139, 147, 167, 0.12); --r-line: rgba(139, 147, 167, 0.42); }
[data-r="rare"] { --r: #4f8ff7; --r-bg: rgba(79, 143, 247, 0.12); --r-line: rgba(79, 143, 247, 0.45); }
[data-r="epic"] { --r: #a768ff; --r-bg: rgba(167, 104, 255, 0.13); --r-line: rgba(167, 104, 255, 0.45); }
[data-r="legend"] { --r: #f5a524; --r-bg: rgba(245, 165, 36, 0.14); --r-line: rgba(245, 165, 36, 0.48); }

.gcard[data-r="common"] { background: linear-gradient(158deg, #3c4456, #1a2030 78%); }
.gcard[data-r="rare"] { background: linear-gradient(158deg, #2c4a86, #141c2e 78%); }
.gcard[data-r="epic"] { background: linear-gradient(158deg, #4a2f86, #1a1430 78%); }
.gcard[data-r="legend"] { background: linear-gradient(158deg, #7a5416, #2a1c0a 78%); }

.gcard[data-r="common"] { border-color: rgba(139, 147, 167, 0.4); }
.gcard[data-r="rare"] { border-color: rgba(79, 143, 247, 0.5); box-shadow: 0 8px 22px -14px rgba(79, 143, 247, 0.9); }
.gcard[data-r="epic"] { border-color: rgba(167, 104, 255, 0.55); box-shadow: 0 8px 22px -14px rgba(167, 104, 255, 0.9); }
.gcard[data-r="legend"] {
  border-color: rgba(245, 165, 36, 0.62);
  box-shadow: 0 8px 26px -12px rgba(245, 165, 36, 0.85);
}

.gcard.used { filter: grayscale(0.85) brightness(0.62); }
.gcard .stamp {
  position: absolute;
  top: 12px; right: 10px;
  transform: rotate(9deg);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.4);
  color: #e5ebf7;
  letter-spacing: 1px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 14px; }
.label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.label .req { color: var(--danger); margin-left: 2px; }
.label .hint { color: #626d82; font-size: 11px; margin-left: 6px; }

.input, .textarea, select.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.24);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input:focus, .textarea:focus {
  border-color: rgba(107, 139, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(107, 139, 255, 0.16);
}
.textarea { resize: none; min-height: 62px; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 49%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 51%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.tpl-strip {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.tpl-strip.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}
.tpl-strip::-webkit-scrollbar { display: none; }
.tpl {
  flex: 0 0 auto;
  width: 92px;
  padding: 10px 9px;
  border-radius: 13px;
  border: 1px solid var(--r-line, var(--line));
  background: var(--panel);
  text-align: left;
}
.tpl .em { font-size: 19px; display: block; }
.tpl .nm { font-size: 11px; margin-top: 5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl.active { border-color: var(--r, rgba(107, 139, 255, 0.7)); background: var(--r-bg, rgba(107, 139, 255, 0.14)); }

.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px 7px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
}
.fchip .av { font-size: 14px; }
.fchip.active { color: var(--text); border-color: rgba(107, 139, 255, 0.65); background: rgba(107, 139, 255, 0.16); }

/* 预览卡 */
.preview {
  padding: 12px;
  border-radius: 15px;
  border: 1px dashed var(--r-line, var(--line-2));
  background: linear-gradient(160deg, var(--r-bg, rgba(0, 0, 0, 0.18)), rgba(0, 0, 0, 0.12) 72%);
}
.preview .top { display: flex; align-items: center; gap: 10px; }
.preview .em { font-size: 26px; }
.preview .nm { font-size: 14px; font-weight: 700; }
.preview .rar { font-size: 10px; color: var(--r, var(--muted)); border: 1px solid var(--r-line, var(--line-2)); padding: 1px 7px; border-radius: 999px; margin-left: auto; }
.preview .fx { margin-top: 8px; font-size: 12.5px; color: #c3cde0; line-height: 1.5; }
.preview .fx.ghost { color: #5d687d; }

/* ---------- 好友 ---------- */
.friend-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 9px;
}
.friend-row .av {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 21px;
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(107, 139, 255, 0.28), rgba(160, 107, 255, 0.18));
  border: 1px solid var(--line-2);
}
.friend-row .meta { flex: 1; min-width: 0; }
.friend-row .meta b { font-size: 14px; display: block; }
.friend-row .meta small { font-size: 11px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-serial {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 5px;
  letter-spacing: 0.3px;
}
.friend-row .pend {
  font-size: 10.5px; color: var(--gold);
  border: 1px solid rgba(245, 185, 66, 0.4);
  background: rgba(245, 185, 66, 0.12);
  padding: 2px 7px; border-radius: 999px;
}

/* ---------- 我的 ---------- */
.profile {
  display: flex; align-items: center; gap: 13px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: linear-gradient(150deg, rgba(107, 139, 255, 0.22), rgba(160, 107, 255, 0.10) 60%), var(--panel);
}
.profile .big-av {
  width: 58px; height: 58px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 30px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-2);
}
.profile .info { flex: 1; min-width: 0; }
.profile .info b { font-size: 17px; }
.profile .info small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.qr-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
}
.qr-btn:active { transform: scale(0.94); }

.emoji-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* 头像选择（比原来的 emoji 行更大、分组） */
.avatar-group { margin-bottom: 12px; }
.avatar-group .label { margin-bottom: 6px; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.avatar-cell {
  aspect-ratio: 1;
  font-size: 19px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.avatar-cell.active {
  border-color: rgba(107, 139, 255, 0.75);
  background: rgba(107, 139, 255, 0.18);
}
.avatar-cell:active { transform: scale(0.92); }
.avatar-toggle { margin-top: 8px; }
.emoji-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.emoji-btn.active { border-color: rgba(107, 139, 255, 0.75); background: rgba(107, 139, 255, 0.18); }

.record {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.record:last-child { border-bottom: 0; }
.record[data-action] { cursor: pointer; }
.record[data-action]:active { opacity: 0.85; }
.record .em {
  font-size: 17px;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--r-bg, transparent);
  border: 1px solid var(--r-line, transparent);
}
.record .txt { flex: 1; min-width: 0; }
.record .txt b { font-size: 12.5px; font-weight: 600; display: block; }
.record .txt small { color: var(--muted); font-size: 11px; }
.record .st { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.record .st.pending { color: var(--gold); background: rgba(245, 185, 66, 0.14); }
.record .st.accepted { color: #7cf0b6; background: rgba(62, 207, 142, 0.14); }
.record .st.rejected { color: #ff9a9a; background: rgba(255, 107, 107, 0.14); }

.danger-zone { margin-top: 18px; }
.danger-zone .btn { width: 100%; }

/* ---------- 底部弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(4, 7, 12, 0.66);
  backdrop-filter: blur(3px);
  z-index: 40;
  animation: fade 0.18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  z-index: 41;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  background: linear-gradient(180deg, #1a2232, #121826 65%);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  animation: slideup 0.24s cubic-bezier(0.22, 0.8, 0.3, 1);
}
@keyframes slideup { from { transform: translate(-50%, 24px); opacity: 0.4; } to { transform: translate(-50%, 0); opacity: 1; } }

.sheet::-webkit-scrollbar { width: 0; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.sheet-head b { font-size: 15px; }
.sheet-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 15px;
}
.sheet-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13.5px;
  text-align: left;
}
.sheet-user .av { font-size: 19px; }
.sheet-user small { color: var(--muted); font-size: 11px; margin-left: auto; }
.sheet-user.active { border-color: rgba(107, 139, 255, 0.7); background: rgba(107, 139, 255, 0.14); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(360px, calc(100% - 40px));
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(28, 36, 52, 0.97);
  border: 1px solid var(--line-2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  animation: toastin 0.22s ease;
}
.toast.err { border-color: rgba(255, 107, 107, 0.5); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 稀有度按钮 */
.rarity-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rarity-btn {
  padding: 10px 0;
  border-radius: 11px;
  font-size: 12.5px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--muted);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.rarity-btn[data-id="common"] { color: #a3abbb; }
.rarity-btn[data-id="rare"] { color: #6fa5ff; }
.rarity-btn[data-id="epic"] { color: #b985ff; }
.rarity-btn[data-id="legend"] { color: #f0b23f; }

.rarity-btn[data-id="common"].active {
  color: #fff;
  background: rgba(139, 147, 167, 0.3);
  border-color: rgba(139, 147, 167, 0.8);
  box-shadow: 0 8px 20px -12px rgba(139, 147, 167, 0.9);
}
.rarity-btn[data-id="rare"].active {
  color: #fff;
  background: rgba(79, 143, 247, 0.28);
  border-color: rgba(79, 143, 247, 0.85);
  box-shadow: 0 8px 20px -12px rgba(79, 143, 247, 0.95);
}
.rarity-btn[data-id="epic"].active {
  color: #fff;
  background: rgba(167, 104, 255, 0.28);
  border-color: rgba(167, 104, 255, 0.85);
  box-shadow: 0 8px 20px -12px rgba(167, 104, 255, 0.95);
}
.rarity-btn[data-id="legend"].active {
  color: #fff;
  background: rgba(245, 165, 36, 0.28);
  border-color: rgba(245, 165, 36, 0.9);
  box-shadow: 0 8px 20px -12px rgba(245, 165, 36, 0.95);
}
.rarity-btn:active { transform: scale(0.96); }

/* 二维码 */
.qr-box {
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 18px;
  background: #0b0f17;
  border: 1px solid var(--line-2);
}
.qr-img {
  width: 220px;
  height: 220px;
  display: block;
}

/* 待裁决：双方投票 */
.vote-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 11px;
}
.vote-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
}
.vote-chip.done {
  color: var(--r, var(--text));
  border-color: var(--r-line, var(--line-2));
  background: var(--r-bg, rgba(255, 255, 255, 0.06));
}

/* 使用对象多选：默认两行，多了折叠 */
.use-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 84px;
  overflow: hidden;
}
.use-targets.expanded { max-height: none; }

/* 等待他人：我已经处理完、在等别人的项 */
.waiting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--r-line, var(--line));
  background: linear-gradient(150deg, var(--r-bg, rgba(255, 255, 255, 0.03)), rgba(0, 0, 0, 0) 70%), rgba(255, 255, 255, 0.02);
  margin-bottom: 8px;
  font-size: 12.5px;
}
.waiting-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waiting-row small { color: var(--muted); font-size: 11px; white-space: nowrap; flex: 0 0 auto; }
.waiting-row b::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: var(--r, transparent);
  margin-right: 7px;
  vertical-align: -1px;
}
.waiting-row[data-action] { cursor: pointer; }
.waiting-row:active { transform: scale(0.995); }

/* 详情里的投票行 */
.vote-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.vote-line:last-of-type { border-bottom: 0; }
.vote-line span { color: var(--text); }
.vote-line b { font-weight: 600; color: var(--muted); }
.vote-line.conflict b { color: var(--danger); }

/* 扫码取景框 */
.scan-box {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 52vh;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  margin-bottom: 12px;
}
.scan-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scan-frame {
  position: absolute;
  inset: 16% 12%;
  border: 2px solid rgba(107, 139, 255, 0.9);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.scan-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* 聊天 */
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.chat-head b { flex: 1; font-size: 15px; }
.chat-body {
  height: 44vh;
  overflow-y: auto;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.chat-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 78%;
}
.chat-row.mine { align-self: flex-end; align-items: flex-end; }
.chat-row.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-row.mine .chat-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-bottom-right-radius: 5px;
}
.chat-row.theirs .chat-bubble {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.chat-time { font-size: 10px; color: var(--muted); }
.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.chat-input .input { flex: 1; }
.chat-input .btn { flex: 0 0 auto; }

.tab { position: relative; }
.tab-dot {
  position: absolute;
  top: 6px;
  right: 50%;
  transform: translateX(14px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

/* twemoji 统一图标：尺寸跟着字号走 */
img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 0.06em;
  vertical-align: -0.12em;
  display: inline-block;
  object-fit: contain;
}

/* ---------- 补充 ---------- */
[hidden] { display: none !important; }

.tip {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 8px 0 0;
}

/* 登录页 */
.login {
  padding: 48px 10px 24px;
  text-align: center;
}
.login-mark {
  font-size: 58px;
  line-height: 1;
  filter: drop-shadow(0 12px 26px rgba(107, 139, 255, 0.45));
}
.login h1 {
  font-size: 25px;
  margin: 18px 0 4px;
  letter-spacing: 3px;
}
.login-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0 0 30px;
  letter-spacing: 1.5px;
}
.login .form-group { margin-bottom: 12px; }
.login .input { text-align: left; }
.login .tip { margin-top: 16px; }

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 18px;
  max-width: 240px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}
.login-tab {
  padding: 8px 0;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
}
.login-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
}

/* 图标选择 */
.icon-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.24);
  text-align: left;
}
.icon-picker:active { transform: scale(0.99); }
.icon-current {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  overflow: hidden;
}
.icon-current img { width: 100%; height: 100%; object-fit: cover; display: block; }
.icon-hint { flex: 1; font-size: 12.5px; color: var(--muted); }
.icon-arrow { color: var(--muted); font-size: 17px; }

.icon-img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; display: block; }
.preview .icon-img { width: 28px; height: 28px; border-radius: 8px; }

.icon-group { margin-bottom: 14px; }
.icon-group .label { margin-bottom: 8px; }
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-cell {
  aspect-ratio: 1;
  font-size: 20px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.icon-cell.active {
  border-color: rgba(107, 139, 255, 0.75);
  background: rgba(107, 139, 255, 0.18);
}
.icon-cell:active { transform: scale(0.92); }
.preview .nm.ghost { color: #5d687d; }
.section-title .link { cursor: pointer; }
.gcard[data-action] { cursor: pointer; }

/* ---------- 小屏微调 ---------- */
@media (max-width: 360px) {
  .view { padding: 13px 13px 20px; }
  .gcard { min-height: 144px; padding: 10px; }
  .gcard .em { font-size: 26px; }
  .gcard .nm { font-size: 12.5px; }
  .btn { padding: 0 14px; }
}
