/* me.css — the 我的 personal page (requires theme.css + stats.css for the
   stats-row / heatmap / SC cards).
   Structure: login gate (poster card) → poster hero (avatar + name + four
   cells) → bento. */


/* 登录卡与页头卡都用 .surface-aurora（ui.css）作底。 */

/* ── Login gate ── */
.me-gate {
  max-width: var(--w-read);
  margin: 18px auto 24px;
  padding: 32px 28px 26px;
  text-align: center;
}
.me-gate-mark {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--blue2);
  background: rgba(255,255,255,0.7);
  border: 3px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 2px var(--bow), calc(var(--shadow-dx) * 6px) 8px 22px rgba(var(--blue-rgb), 0.25);
  position: relative;
}
[data-theme="dark"] .me-gate-mark { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); color: var(--text); }
.me-gate-title h2 {
  font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(135deg, var(--blue2) 20%, var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 6px; position: relative;
}
.me-gate-title p { font-size: 13px; color: var(--text2); line-height: 1.6; margin: 0 0 18px; position: relative; }
.me-gate-step { font-size: 12px; color: var(--text2); margin: 0 0 6px; position: relative; }
/* Links in the body text (the "send a danmaku in the live room" one): the
   default #0000EE and visited purple are unreadable on the dark card, so they
   match the rest of the site's body links. */
.me-gate p a { color: var(--blue2); text-decoration: none; border-bottom: 1px solid rgba(var(--blue-rgb), .45); }
.me-gate p a:hover { border-bottom-color: var(--blue2); }
.me-gate-code {
  font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: .22em;
  color: var(--text); padding: 6px 0 10px .22em; position: relative;
  font-variant-numeric: tabular-nums;
}
.me-gate-btns { display: flex; gap: 8px; justify-content: center; position: relative; }
.me-gate-btns > * { flex: 1; max-width: 170px; }
.me-gate-hint { font-size: 11px; color: var(--text3); line-height: 1.6; margin: 14px 0 8px; position: relative; }
.me-gate-status { font-size: 13px; color: var(--text2); margin: 0; position: relative; }
.me-gate-done { font-size: 32px; color: var(--blue2); margin-bottom: 6px; position: relative; }
.me-gate-done svg { display: block; margin: 0 auto; }
.me-gate-welcome { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); margin: 0; position: relative; }

/* ── Logged out: the verification card floats over a blurred sample report,
   like a modal. The sample is blurred as a whole, fades downward and is not
   clickable; the numbers are made up. ── */
#meAuth { position: relative; max-width: var(--w-page); margin: 0 auto; }
#meAuth .me-gate {
  position: absolute; top: 36px; left: 0; right: 0; z-index: 2;
  width: min(var(--w-read), calc(100% - 24px)); margin: 0 auto;
}
.me-preview { position: relative; z-index: 1; }
.me-preview-body {
  filter: blur(5px) saturate(.9); opacity: .55;
  pointer-events: none; user-select: none;
  mask-image: linear-gradient(#000 40%, transparent 96%);
  -webkit-mask-image: linear-gradient(#000 40%, transparent 96%);
}
.me-preview-body .me-hero { margin-top: 18px; }
.me-preview-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bow), var(--blue));
  border: 3px solid rgba(255,255,255,0.95);
}
.me-preview-lines { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.me-preview-lines i { display: block; height: 12px; border-radius: 6px; background: rgba(var(--blue-rgb), .18); }
.me-preview-lines i:nth-child(2) { width: 70%; }
.me-preview-lines i:nth-child(3) { width: 85%; }
.me-preview-lines i:nth-child(4) { width: 55%; }
.me-preview-heat {
  height: 96px; border-radius: var(--r-inner);
  background:
    repeating-linear-gradient(90deg, rgba(var(--blue-rgb), .35) 0 10px, transparent 10px 13px),
    repeating-linear-gradient(0deg, rgba(var(--blue-rgb), .12) 0 10px, transparent 10px 13px);
}
@media (prefers-reduced-transparency: reduce) { .me-preview-body { filter: none; opacity: .35; } }

/* ── Hero: avatar + name + four cells ── */
.me-hero {
  max-width: var(--w-page);
  margin: 18px auto var(--gap-grid);
  padding: var(--pad-card);
}
.me-profile {
  display: flex; align-items: center; gap: 18px;
  position: relative; margin-bottom: var(--s-4);
}
.me-avatar { flex: none; }
.me-avatar .avatar-frame-wrap { width: 84px; height: 84px; }
.me-avatar .avatar { border-radius: 50%; object-fit: cover; display: block; }
/* 尺寸、描边与投影只作用于无框头像；头像框内的头像尺寸由 stats.css 的
   .avatar-frame-wrap .avatar（72%）决定，与这条同特异性时会被 me.css 覆盖。 */
.me-avatar > .avatar {
  width: 84px; height: 84px;
  border: 3px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 2px var(--bow), calc(var(--shadow-dx) * 6px) 8px 22px rgba(var(--blue-rgb), 0.25);
}
.me-profile-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.me-profile-eyebrow { --eyebrow-fg: var(--blue2-deep); }
.me-profile-name {
  font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: .02em;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me-profile-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.me-profile-badges > * { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* 渐变两端均为深色，深色主题的 --on-accent（深字）与它们不搭，字色固定为白 */
.badge-solid.me-profile-guard { color: #fff; }
.me-profile-guard.guard-3 { --badge-solid-bg: linear-gradient(135deg, #1d4ed8, #2563eb); }  /* 舰长 */
.me-profile-guard.guard-2 { --badge-solid-bg: linear-gradient(135deg, #6d28d9, #7c3aed); }  /* 提督 */
.me-profile-guard.guard-1 { --badge-solid-bg: linear-gradient(135deg, #b45309, #dc2626); }  /* 总督 */

.my-rank-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2);
  position: relative;
}
/* 四格位于页头卡之内，为 .surface-flat（L0） */
.my-rank-card { --surface-flat-pad: var(--s-3) var(--s-2); text-align: center; min-width: 0; }
/* 四格不配图标：小号标签在上，大号数字在下，数字是格子里唯一的视觉重心。 */
.my-rank-label { font-size: 11px; font-weight: 400; color: var(--text3); letter-spacing: .2em; margin-bottom: 8px; }
.my-rank-num {
  font-family: var(--font-display); font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; line-height: 1.15;
  color: var(--text); margin-bottom: 3px; letter-spacing: .01em;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px;
  min-width: 0; overflow-wrap: anywhere;   /* 粉丝牌名与大数字在窄格内折行，不撑开网格 */
  font-variant-numeric: tabular-nums;
}
.my-rank-value { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── bento ── */
.me-bento {
  max-width: var(--w-page); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-grid);
  position: relative; z-index: 1;
}
/* dense：后面的单列卡片回填前面空出的半格（奇数张时的补齐见 me.js balanceBento） */
.me-bento { grid-auto-flow: row dense; }
.me-span2, .me-fill { grid-column: span 2; }
/* 单列卡片独占一行时（balanceBento 加的 .me-fill）限宽居中：不限宽时列表行的
   名称在左、数值在最右，两端相距整行宽度。窄屏为单列，不需要限宽。 */
@media (min-width: 721px) {
  .me-bento > .me-fill { box-sizing: border-box; width: 100%; max-width: 600px; justify-self: center; }
}
/* 卡片为 .surface-glass，/me 的卡片标题为 .title-star（带 ✦）；
   /me/seat 的卡片标题不带 ✦，用下面这条。 */
.surface-glass > h2:not(.title-star) {
  font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: var(--s-3); letter-spacing: .02em;
}

.me-songs-summary { font-size: 13px; color: var(--text3); margin-bottom: 10px; }
.me-songs-summary b { color: var(--text); }
.me-songs-list { max-height: 280px; overflow-y: auto; margin-bottom: 10px; scrollbar-width: thin; }
/* 卡片底部的「去歌单 →」等为 .btn-ghost.is-sm，左移内边距与正文对齐 */
.me-more { margin-left: -8px; }
/* 触屏与窄屏：.is-sm 的幽灵按钮高约 30px，纵向内边距加到 10px，高度约 36px */
@media (pointer: coarse), (max-width: 720px) { .btn-ghost.is-sm.me-more { --btn-pad: 10px 8px; } }

/* Paging for the SCs you sent: pill buttons plus a page number, not native buttons */
.sc-wall-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.sc-wall-pager:empty { display: none; }
.sc-page-info { font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; min-width: 44px; text-align: center; }

/* Marshmallows you submitted — a summary card listing the latest 5 */
.me-mhm-list { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: var(--s-2); }
/* 卡片内的条目为 .surface-flat（L0） */
.me-mhm-row { --surface-flat-pad: var(--s-1) var(--s-2); }
.me-mhm-text {
  font-size: 13px; color: var(--text); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.me-mhm-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 5px; font-size: 11px; color: var(--text3);
}
.me-mhm-replied { color: var(--blue2); }

.me-pool-rank {
  font-size: 12px; font-weight: 700; color: var(--blue2);
  white-space: nowrap; flex-shrink: 0;
}

/* ── Yearly / monthly report ── */
.me-report-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: var(--s-3);
}
.me-report-head .title-star { margin: 0; }
.me-report-toggle { display: flex; gap: 6px; }
@media (max-width: 720px) { .me-report-toggle .pill-soft { --pill-pad: 8px 14px; } }
/* 报告数字排成一行，格与格之间用细竖线分隔，上下各一条细横线收边。
   用 grid-auto-flow: column 而不是 auto-fit：auto-fit 在中等宽度会折成 4+2，
   第二行首格左侧会多出一条竖线。窄屏改为两列，见下方媒体查询。 */
.me-report-grid {
  display: grid;
  grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 4px 0;
  margin-bottom: 18px;
}
.me-report-cell {
  position: relative;
  padding: 16px 4px 14px;
  text-align: center;
  min-width: 0;
}
.me-report-cell + .me-report-cell::before {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 1px; background: var(--border);
}
/* 字号随视口缩放：6 格一行时，720px 附近每格约 100px，固定 26px 会让「64 / 172 场」溢出。 */
.me-report-num {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 26px); font-weight: 700; line-height: 1.2; color: var(--text);
  min-width: 0; overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.me-report-unit { font-size: 11px; font-weight: 400; color: var(--text3); margin-left: 3px; }
.me-report-label { font-size: 11px; color: var(--text3); margin-top: 4px; letter-spacing: .5px; }
.me-report-lines { display: flex; flex-direction: column; gap: 8px; }
.me-report-line { font-size: 13px; color: var(--text2); line-height: 1.6; }
.me-report-line b { color: var(--blue2); font-weight: 700; }
.me-report-star { color: var(--blue); margin-right: 8px; font-size: 11px; }
/* 学歌池卡片沿用报告的数字格，只有三格，窄屏也保持一行；下面没有列表时不留底部间距 */
#mePoolCard .me-report-grid:last-child { margin-bottom: 0; }


@media (max-width: 720px) {
  .me-bento { grid-template-columns: 1fr; }
  .me-span2, .me-fill { grid-column: auto; }
  .me-hero { margin-top: 12px; }
  .me-avatar > .avatar, .me-avatar .avatar-frame-wrap { width: 64px; height: 64px; }
  .me-profile { gap: 14px; margin-bottom: var(--s-3); }
  .me-profile-name { font-size: 22px; }
  .my-rank-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-1); }
  .my-rank-card { padding: var(--s-2) var(--s-1); }
  .my-rank-num { font-size: 19px; }
  .me-report-grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me-report-cell { padding: 12px 6px 10px; }
  .me-report-num { font-size: 21px; }
  /* 两列时每行首格（奇数格）不画左侧竖线 */
  .me-report-cell:nth-child(odd)::before { display: none; }
  #mePoolCard .me-report-grid { grid-auto-flow: column; grid-template-columns: none; }
  #mePoolCard .me-report-cell + .me-report-cell::before { display: block; }
  .me-gate { padding: 26px 18px 22px; margin-top: 12px; }
  .me-gate-code { font-size: 28px; }
}

/* /seat link card between the hero and the bento */
.me-seat-link {
  max-width: var(--w-page); box-sizing: border-box;
  display: flex; align-items: center; gap: 14px; margin: 0 auto var(--gap-grid);
  text-decoration: none; color: var(--text);
}
.me-seat-link:hover { border-color: var(--blue2); }
.me-seat-link .me-seat-ic { font-size: 26px; line-height: 1; }
.me-seat-link > span:nth-child(2) { flex: 1; min-width: 0; }
.me-seat-link b { display: block; font-family: var(--font-display); font-size: 15px; margin-bottom: 3px; }
.me-seat-link small { color: var(--text3); font-size: 12px; line-height: 1.5; }
.me-seat-link .me-seat-arrow { font-size: 22px; color: var(--text3); }

/* ── 集章本入口 ───────────────────────────────────────────────────────────
   /me 上的一张卡，点进去是 /me/stamps 的本子。整块 #meContent 只在验证过
   身份之后才显示，所以这个入口天然只对登录后的人出现。
   卡片跨两列（模板上的 .me-span2），不与「点过的歌」等高度不定的卡同行；
   与它们同行时，纸条会被拉高，章之外的部分留白。 */
.me-stampcard { display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: transform var(--dur-fast), box-shadow var(--dur-base); }
@media (hover: hover) {
  .me-stampcard:hover { transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(var(--blue-rgb), .16); }
}
.me-stampcard:active { transform: var(--ui-press, scale(.985)); }
.me-stampcard:hover .me-stamp-go { color: var(--accent, #c8412f); }
/* 印需置于纸色底上：钤痕的「薄」和「飞白」两层涂的是纸色（seal.js 的 PAPER，
   #f7f3e9），换成别的底色会露出一片浅斑，因此这一条也铺纸色。深色主题下整体
   压暗：纸色与浅斑同比变暗，不会错位。 */
.me-stamp-row { display: grid; grid-template-columns: repeat(auto-fit, 68px); gap: 12px 14px;
  justify-content: center; align-items: center; justify-items: center;
  min-height: 64px; margin: 4px 0 var(--s-3); padding: var(--s-3) var(--s-3); border-radius: var(--r-inner);
  border: 1px solid rgba(122, 104, 72, .18);
  background: linear-gradient(180deg, #f7f3e9, #eee8da); }
[data-theme="dark"] .me-stamp-row { filter: brightness(.8) saturate(.9); border-color: rgba(255, 255, 255, .12); }
.me-stamp-row svg { width: 68px; height: 68px; display: block; }
/* 卡片上同样不作对齐，倾斜方式与册子里一致 */
.me-stamp-row .me-stamp-one { line-height: 0; }
.me-stamp-slot { width: 68px; height: 68px; box-sizing: border-box; border-radius: var(--r-inner);
  border: 1.5px dashed rgba(122, 104, 72, .32); }
.me-stamp-empty { grid-column: 1 / -1; font-size: 13px; color: #7a6848; }
.me-stamp-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.me-stamp-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.me-stamp-count { font-size: 14px; color: var(--text); }
.me-stamp-count b { font-weight: 700; font-variant-numeric: tabular-nums; }
/* 副行的进度括号不折行；章名过长时只截断章名 */
.me-stamp-next { display: flex; min-width: 0; font-size: 12px; color: var(--text3); white-space: nowrap; }
.me-stamp-next[hidden] { display: none; }
.me-stamp-next-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.me-stamp-next-have { flex: none; font-variant-numeric: tabular-nums; }
.me-stamp-go { flex: none; font-size: 13px; color: var(--text3); white-space: nowrap; transition: color var(--dur-base); }
@media (max-width: 720px) {
  /* 手机端改为可换行的居中排布：末行不足一整行时居中，不靠左落单 */
  .me-stamp-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; padding: var(--s-3) var(--s-2); }
  .me-stamp-row svg, .me-stamp-slot { width: 64px; height: 64px; flex: none; }
}

/* 不可拆开的词组（座位页说明）：text-wrap 只调整断点的位置，不会保护末尾的词 */
.nowrap { white-space: nowrap; }

/* 头卡骨架（me.js 的 ME_SK_HERO）：灰条材质为 .skel-line / .skel-circle（ui.css），
   尺寸按数据到达后的头卡取值：头像 84px（手机 64px），排名格内容区 65.8px（手机 59.8px）。
   排名格内的三条只写上外边距：相邻块级外边距会合并，写成上下各一份会使总高偏小。 */
.me-sk-avatar { width: 84px; }
.me-sk-eyebrow { --skel-h: 9px; width: 96px; margin: 2px 0; }
.me-sk-name { --skel-h: 20px; width: 140px; margin: 5.6px 0; }
.me-sk-badge { --skel-h: 16px; width: 112px; margin: 2.25px 0; }
.my-rank-card .me-sk-label { --skel-h: 8px; width: 44%; margin: 2.5px auto 0; }
.my-rank-card .me-sk-num { --skel-h: 20px; width: 56%; margin: 14.4px auto 0; }
.my-rank-card .me-sk-sub { --skel-h: 8px; width: 36%; margin: 10.4px auto 2.5px; }
@media (max-width: 720px) {
  .me-sk-avatar { width: 64px; }
  .me-sk-name { --skel-h: 16px; margin: 5.2px 0; }
  .my-rank-card .me-sk-num { --skel-h: 16px; margin-top: 13.4px; }
  .my-rank-card .me-sk-sub { margin-top: 9.4px; }
}
