/* Anoawa 社区 — 共用样式
 *
 * 设计原则：做减法，让曲绘说话。
 *
 * 页面底子刻意是中性近黑、零渐变、零辉光、零玻璃、零圆角。曲绘是这个站唯一
 * 真正的视觉资产，页面上任何多余的颜色都在跟它抢注意力。上一版满屏紫粉青的
 * 结果是每张谱面自带的 themeColor 完全浮不出来——那恰恰是这里唯一别处抄不走
 * 的东西。
 *
 * 颜色只在两处出现，且都是功能性的：
 *   1. 谱面自己的 themeColor（LevelResponse.themeColor）
 *   2. 难度档色，取自客户端 ChartFolderScanner.DiffColors，五档一一对应
 * 除此之外全站只有黑白灰。交互色就是白，因为在近黑底上它已经足够强。
 *
 * 不引 Google Fonts：游戏用的 Saira 虽然有，但 fonts.googleapis.com 在国内不稳。
 * 系统字体栈 + 字阶 + tabular-nums 足够。
 */

:root {
  --bg: #0b0b0d;              /* 真中性近黑。带紫调会跟曲绘抢色 */
  --bg-raised: #101012;
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(255, 255, 255, .22);

  --text: #f2f2f3;
  --muted: #9a9aa2;
  --faint: #67676f;

  --danger: #ff5a5f;
  --gold: #e8c268;

  /* 谱面主题色，由各页内联注入。默认值与后端 CreateLevelRequest.ThemeColor 一致 */
  --theme: #4b65b0;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);

  --gutter: 24px;
  --topbar: 56px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* 数字一律等宽对齐：难度、BPM、时长、分数在列表里要能竖着比 */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* 小号全大写标签，页面里所有"字段名"都用它。承担原来标题渐变的区分作用 */
.eyebrow {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.topbar-inner {
  width: min(1240px, 100%);
  height: var(--topbar);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand small { color: var(--faint); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.top-link {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s var(--ease);
}
.top-link:hover { color: var(--text); }
.top-link.current { color: var(--text); }

/* flex item 的自动最小尺寸取 min-content，而中文的 min-content 就是一个字——
   窄屏下每个链接会被压成一字宽、文字竖着堆起来。必须显式不收缩、不换行 */
.top-link { flex: none; white-space: nowrap; }

/* 移动端折叠导航的开关。默认不存在，由 js/nav.js 注入，同时给 .topbar 加
   .nav-collapsed——折叠样式全都挂在那个类下面，脚本没跑成功时导航必须还能用 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  height: 30px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: none;
  font-size: 13px;
  cursor: pointer;
}
.nav-toggle:hover { color: var(--text); border-color: var(--line-strong); }

/* 导航收起时站内信角标跟着被藏了，未读状态得在按钮上留个信儿。沿用角标那套
   反白小方块，只是不带数字——数字点开就看得到 */
.nav-toggle-dot { display: block; width: 6px; height: 6px; background: var(--text); }
.nav-toggle-dot[hidden] { display: none; }

/* ---------- 布局 ---------- */

.page {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 40px var(--gutter) 96px;
}
.page-narrow { width: min(420px, 100%); padding-top: 72px; }

.page-head {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.035em;
}
.page-head p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* 上一版的渐变文字。留着定义只为兼容还没清干净的标记，不再有视觉效果 */
.gradient-text { color: inherit; }

.card {
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
}

.section-title {
  margin: 44px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.divider { margin: 26px 0; border: 0; border-top: 1px solid var(--line); }

/* ---------- 表单 ---------- */

.field { margin-bottom: 20px; }
.field > label {
  display: block;
  margin-bottom: 7px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.field .hint { margin: 7px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.55; }

.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 15px;
  transition: border-color .15s var(--ease);
}
textarea.input { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--text); }
.input:disabled { color: var(--faint); cursor: not-allowed; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }

.input.code { font-family: var(--mono); font-size: 19px; letter-spacing: .38em; text-align: center; }

/* ---------- 按钮 ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.button:hover:not(:disabled) { border-color: var(--text); }
.button:disabled { color: var(--faint); border-color: var(--line); cursor: not-allowed; }

/* 主按钮就是反白 —— 近黑底上白色已经足够强，不需要再加颜色 */
.button.primary { color: var(--bg); border-color: var(--text); background: var(--text); }
.button.primary:hover:not(:disabled) { background: #fff; border-color: #fff; }
.button.primary:disabled { color: var(--bg); background: var(--faint); border-color: var(--faint); }

.button.ghost { border-color: transparent; color: var(--muted); }
.button.ghost:hover:not(:disabled) { border-color: transparent; color: var(--text); }
.button.block { width: 100%; }
.button.small { height: 32px; padding: 0 12px; font-size: 13px; }
/* .button 的 display 会盖过 [hidden]，不压一下 hidden 的按钮照样显示 */
.button[hidden] { display: none; }

/* ---------- 提示条 ---------- */

.callout {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--muted);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.callout.success { border-left-color: var(--text); color: var(--text); }
.callout.warning { border-left-color: var(--gold); color: #d9c08f; }
.callout.error   { border-left-color: var(--danger); color: #ffa7aa; }
.callout[hidden] { display: none; }
.callout p { margin: 6px 0 0; }
.callout p:first-child { margin-top: 0; }
.callout strong { color: var(--text); font-weight: 600; }
.callout code { font-family: var(--mono); font-size: .92em; }

/* ---------- 标签页 ---------- */

.tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 0 0 11px;
  border: 0;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  color: var(--faint);
  background: none;
  font-size: 14px;
  cursor: pointer;
  transition: color .15s var(--ease);
}
.tab:hover { color: var(--muted); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.tabpanel[hidden] { display: none; }

/* ---------- 杂项 ---------- */

.spinner {
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-foot { margin-top: 20px; color: var(--faint); font-size: 13px; text-align: center; }
.result-meta { margin: 0 0 16px; color: var(--faint); font-size: 12.5px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .spinner { animation-duration: 1.4s !important; }
}

/* ==========================================================================
   谱面库
   ========================================================================== */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.toolbar .search { flex: 1 1 240px; min-width: 0; }
.select {
  height: 42px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  font: inherit;
  font-size: 14px;
  appearance: none;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--text); }
.select option { color: var(--text); background: var(--bg-raised); }

/* ---------- 热榜 ---------- */

.hot-periods { display: flex; gap: 2px; margin-bottom: 22px; }
/* 类选择器的 display 优先级高于 [hidden] 属性，不显式压一下，
   切回「全部谱面」时周期按钮还会留在那儿。和 .pager 是同一个坑。 */
.hot-periods[hidden] { display: none; }
.period {
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.period:hover { color: var(--text); border-color: var(--line-strong); }
.period.current { color: var(--bg); border-color: var(--text); background: var(--text); }

/* 名次和周期内次数是热榜特有的，卡片本身复用谱面库那套 */
.hot-slot { position: relative; display: flex; flex-direction: column; }
.hot-rank {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  padding: 2px 8px;
  color: var(--bg);
  background: var(--text);
  font-size: 12px;
  font-weight: 600;
}
/* 前三名反白，和排行榜里的处理一致 */
.hot-slot:nth-child(-n+3) .hot-rank { background: var(--gold); }
.hot-plays { margin-top: 5px; color: var(--faint); font-size: 11.5px; }

/* ---------- 封面 ---------- */

.cover {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  /* 没有曲绘时用谱面自己的主题色兜底，是全站唯一让 themeColor 大面积出现的地方 */
  background: var(--theme);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .62));
}

/* ---------- 网格 ---------- */

/* 列数锁死在每页条数（20）的因数上——2 / 4 / 5——这样最后一行总是正好铺满。
   用 auto-fill 的话列数随视口自由浮动，一旦落到 3、6、7 列，末行必然缺口。
   代价是卡片宽度随视口变化，但那本来就是响应式该有的样子。 */
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px 20px;
}
@media (max-width: 1023px) {
  .level-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
}
@media (max-width: 679px) {
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
}

/* 卡片没有边框没有底色没有阴影：曲绘本身就是卡片，文字挂在它下面。
   hover 不做位移和辉光，只让曲绘轻微放大——页面上唯一动的东西是图本身。 */
.level-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
.level-card .cover img { transition: transform .4s var(--ease); }
.level-card:hover .cover img { transform: scale(1.03); }
.level-card:hover .level-title { text-decoration: underline; text-underline-offset: 3px; }

/* 自己空间里的编辑角标。卡片本身是 <a>，<a> 里不能嵌 <a>，所以角标是它的
   兄弟节点，由 .card-slot 提供定位上下文。 */
.card-slot { position: relative; display: flex; flex-direction: column; }
.card-edit {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
  padding: 3px 9px;
  color: var(--text);
  background: rgba(11, 11, 13, .82);
  font-size: 11.5px;
  text-decoration: none;
  opacity: 0;
  transition: opacity .15s var(--ease);
}
.card-slot:hover .card-edit,
.card-edit:focus-visible { opacity: 1; }

/* 曲绘下方一条 2px 的谱面主题色，是卡片上唯一的彩色元素 */
.level-accent { height: 2px; background: var(--theme); }

.level-meta { padding-top: 9px; }
.level-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.level-sub {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.level-foot {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 11.5px;
}
.level-foot .stat { display: inline-flex; align-items: center; gap: 3px; }

/* ---------- 难度徽章 ---------- */

/* 颜色是功能性的：五个难度档一一对应，取自客户端 ChartFolderScanner.DiffColors。
   没能从显示难度里认出档位时回落到谱面主题色。 */
.diff-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 30px;
  padding: 2px 7px;
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: var(--theme);
}
.diff-badge[data-tier="0"] { background: #3a6fc4; }
.diff-badge[data-tier="1"] { background: #4b9b4b; }
.diff-badge[data-tier="2"] { background: #7b3fa0; }
.diff-badge[data-tier="3"] { background: #b03030; }
.diff-badge[data-tier="4"] { background: #5d4e76; }

.status-badge {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.status-badge.pending  { color: #0b0b0d; background: var(--gold); }
.status-badge.rejected { color: #fff;    background: var(--danger); }

/* ---------- 空态 / 骨架 ---------- */

.empty { padding: 72px 20px; color: var(--faint); text-align: center; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; font-weight: 500; }
.empty p { margin: 0; font-size: 13.5px; }

.skeleton { background: rgba(255, 255, 255, .05); }
.skeleton-card { aspect-ratio: .82; }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager[hidden] { display: none; }
.pager .page-info { color: var(--faint); font-size: 12.5px; }

/* ==========================================================================
   谱面详情
   ========================================================================== */

.hero { margin-bottom: 8px; }
.hero-layout { display: flex; gap: 32px; align-items: flex-start; }
.hero-cover { flex: 0 0 240px; }
.hero-info { flex: 1; min-width: 0; padding-top: 2px; }

/* 标题上方一条谱面主题色，详情页唯一的彩色元素 */
.hero-info::before {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 16px;
  background: var(--theme);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.035em;
  word-break: break-word;
}
.hero-artist { margin: 0; font-size: 16px; }
.hero-charter { margin: 5px 0 0; color: var(--faint); font-size: 13.5px; }

/* 规格用定义列表式的两行结构，字段名在上、值在下，靠发丝线分栏 */
.spec-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 1px;
  margin-top: 26px;
  border: 1px solid var(--line);
  background: var(--line);
}
.spec {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--bg);
}
.spec .label { color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.spec .value { font-size: 14px; }

/* ---------- 上传者 ---------- */

.uploader { margin-top: 20px; }
.uploader > .label {
  display: block;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.uploader-card {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s var(--ease);
}
a.uploader-card:hover { border-color: var(--line-strong); }
a.uploader-card:hover .uploader-name { text-decoration: underline; text-underline-offset: 3px; }
.uploader-card.is-anonymized { color: var(--faint); }
.uploader-name { font-size: 14px; }
.uploader-time { margin-top: 2px; color: var(--faint); font-size: 12px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { padding: 2px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.like-button.liked { color: var(--bg); background: var(--text); border-color: var(--text); }

.preview-block { margin-top: 34px; }
.preview-block audio { width: 100%; height: 38px; }
.preview-block .hint { margin: 8px 0 0; color: var(--faint); font-size: 12.5px; }

.intro { color: var(--muted); font-size: 14px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }

/* ---------- 排行榜 ---------- */

/* Top 100 塞进一个限高的滚动区：排行榜是用来上下扫的，翻页会打断这件事。
   100 行的 DOM 量很小，不值得上虚拟滚动。 */
.board-scroll {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--line);
  /* 滚动到边界时不要把整个页面也带着滚 */
  overscroll-behavior: contain;
}
.board-scroll::-webkit-scrollbar { width: 8px; }
.board-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); }
.board-scroll::-webkit-scrollbar-track { background: transparent; }

.board { border: 0; }
.board-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 9px 14px;
  font-size: 14px;
}
.board-row + .board-row { border-top: 1px solid var(--line); }
.board-rank { color: var(--faint); font-family: var(--mono); text-align: right; }
.board-row:nth-child(-n+3) .board-rank { color: var(--text); }
.board-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-name.anonymized { color: var(--faint); }
.board-score { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.board-combo { color: var(--faint); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.board-combo.pm { color: var(--gold); }
.board-combo.fr { color: var(--text); }

/* 自己那一行在榜里高亮，左边一道竖线 */
.board-row.is-me {
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 2px 0 0 var(--text);
}

/* 固定在榜单上方的自己那条 */
.my-score {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
}
.my-score > .label {
  display: block;
  margin-bottom: 7px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.my-score-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; }
.my-rank { color: var(--muted); font-size: 14px; }
.my-value { font-size: 19px; font-variant-numeric: tabular-nums; }
.my-judge { margin-left: auto; color: var(--faint); font-size: 12px; }
.my-note { margin: 8px 0 0; color: var(--gold); font-size: 12px; }
.my-hint { margin: 8px 0 0; color: var(--faint); font-size: 11.5px; line-height: 1.55; }
.my-score.is-empty { border-color: var(--line); }

.board-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 12.5px;
}
.board-foot .button { margin-left: auto; }

.launch-fallback { margin-top: 14px; }

/* ---------- 逐个资源替换 ---------- */

.resource-section { margin-top: 40px; }
.resource-list { border: 1px solid var(--line); }
.resource-row { padding: 14px 16px; }
.resource-row + .resource-row { border-top: 1px solid var(--line); }
.resource-head { margin-bottom: 10px; }
.resource-head strong { display: block; font-size: 14px; font-weight: 600; }
.resource-hint { display: block; margin-top: 3px; color: var(--faint); font-size: 12.5px; line-height: 1.55; }
.resource-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.resource-file { flex: 1; min-width: 0; color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-range { margin-top: 12px; }
.resource-range:empty { display: none; }
.resource-status { margin-top: 8px; color: var(--muted); font-size: 12.5px; min-height: 0; }
.resource-status:empty { display: none; }
.resource-status.is-done { color: var(--text); }
.resource-status.is-error { color: var(--danger); }

/* ---------- 可复制的命令块 ---------- */

.command-block { margin-top: 12px; }
.command-note { margin: 0 0 7px; color: var(--faint); font-size: 12.5px; line-height: 1.55; }
.command-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .3);
}
.command-line pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  /* 长命令换行而不是横向滚动：用户要整条复制，看得全比省地方重要 */
  white-space: pre-wrap;
  word-break: break-all;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.command-line .button { flex: 0 0 auto; }

.resource-extra:empty { display: none; }

/* ---------- 合作者挂名 ---------- */

/* 详情页的制作者列表：上传者和合作者用同一套卡片，横向排开 */
.credit-list { display: flex; flex-wrap: wrap; gap: 8px; }

.collab-section { margin-top: 40px; }
.collab-list { margin-top: 14px; border: 1px solid var(--line); }
.collab-row { padding: 13px 15px; }
.collab-row + .collab-row { border-top: 1px solid var(--line); }
.collab-who { display: flex; align-items: center; gap: 10px; }
.collab-who strong { display: block; font-size: 14px; font-weight: 500; }
.collab-who span { display: block; color: var(--faint); font-size: 12px; }
.collab-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.collab-actions .input { flex: 1 1 140px; height: 32px; font-size: 13.5px; }

.collab-invite { margin-top: 18px; padding: 16px; border: 1px solid var(--line); }
.collab-invite > .label {
  display: block;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.collab-invite .hint { margin: 0 0 10px; }
.collab-invite-row { display: flex; flex-wrap: wrap; gap: 8px; }
.collab-invite-row .input:first-child { flex: 0 0 130px; }
.collab-invite-row .input:nth-child(2) { flex: 1 1 160px; }

/* 待确认的挂名邀请 */
.pending-collabs { margin-top: 36px; }
.pending-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--gold);
}
.pending-row + .pending-row { margin-top: -1px; }
.pending-cover { flex: 0 0 52px; width: 52px; height: 52px; overflow: hidden; background: var(--bg-raised); }
.pending-cover img { width: 100%; height: 100%; object-fit: cover; }
.pending-info { flex: 1 1 200px; min-width: 0; }
.pending-info strong { display: block; font-size: 14.5px; }
.pending-info span { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.pending-note { color: var(--faint) !important; }
.pending-actions { display: flex; gap: 6px; }

/* 我发出的邀请。行的骨架和 .pending-row 共用（.pending-cover/-info/-actions），
   但边框是中性灰不是金色：收到的邀请要用户做决定，发出的只是管理，不该抢同一级注意力 */
.sent-invites { margin-top: 36px; }
.sent-invites .hint { margin: 0 0 14px; }
.sent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
}
.sent-row + .sent-row { margin-top: -1px; }

/* 按昵称选人。下拉结果紧贴搜索框，不做浮层——表单本来就在一块独立面板里，
   浮层要处理点击外部关闭、滚动跟随、层级，这里都不需要 */
.user-picker { margin-bottom: 8px; }
.user-picker .input { width: 100%; }
.user-picker-results {
  display: flex;
  flex-direction: column;
  margin-top: -1px;
  border: 1px solid var(--line);
  max-height: 260px;
  overflow-y: auto;
}
/* 类选择器的 display 会盖过 [hidden]，不压一下这块永远关不掉 */
.user-picker-results[hidden] { display: none; }
.user-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.user-picker-option + .user-picker-option { border-top: 1px solid var(--line); }
.user-picker-option:hover { background: var(--bg-raised); }
.user-picker-name { flex: 1 1 auto; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 昵称可能重名，UID 才是认人的依据——不能因为它"次要"就藏起来 */
.user-picker-uid { flex: 0 0 auto; color: var(--faint); font-size: 12px; }
.user-picker-empty { margin: 0; padding: 10px 11px; color: var(--faint); font-size: 13px; }

/* ---------- 转让所有权 ---------- */

.transfer-section { margin-top: 40px; }

/* 领取页的预览：卡片本身复用谱面库那套，居中放一张 */
.claim-preview { margin-top: 18px; }
.claim-card { max-width: 200px; margin-top: 10px; }
.claim-owner { margin: 12px 0 0; color: var(--faint); font-size: 13px; }

/* 危险操作区：删除不可逆，视觉上要和普通表单区分开 */
.danger-zone { margin-top: 48px; }
.danger-zone .section-title { color: var(--danger); border-bottom-color: rgba(255, 90, 95, .3); }
.danger-zone .field { max-width: 320px; }

.delete-panel {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 90, 95, .3);
  max-width: 520px;
}
.delete-panel[hidden] { display: none; }
.delete-panel .field { max-width: none; }

.scope-list { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.scope-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  background: var(--bg);
  cursor: pointer;
}
.scope-item input { margin-top: 4px; flex: 0 0 auto; }
.scope-item strong { display: block; font-size: 14px; font-weight: 500; }
.scope-item span { display: block; margin-top: 2px; color: var(--faint); font-size: 12.5px; line-height: 1.5; }

.button.danger { border-color: rgba(255, 90, 95, .5); color: var(--danger); }
.button.danger:hover:not(:disabled) { border-color: var(--danger); background: rgba(255, 90, 95, .1); }
.button.danger:disabled { border-color: var(--line); color: var(--faint); }

/* ==========================================================================
   个人空间
   ========================================================================== */

.profile {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  overflow: hidden;
  background: var(--bg-raised);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* 没头像时用昵称首字，比一个空框或占位图标干净 */
.avatar-sm {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.avatar-empty {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 34px;
  font-weight: 600;
}

.profile-meta { flex: 1 1 240px; min-width: 0; }
.profile-meta h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -.03em;
  word-break: break-word;
}
.profile-sub { margin: 5px 0 0; color: var(--faint); font-size: 13px; }
/* 行内的"值 + 复制按钮"，用于 UID 这类短值 */
.copyable { display: inline-flex; align-items: baseline; gap: 6px; }
.copyable-value { color: var(--muted); }
.copyable-button {
  padding: 1px 7px;
  border: 1px solid var(--line);
  color: var(--faint);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.copyable-button:hover { color: var(--text); border-color: var(--line-strong); }

/* B 站空间按钮和复制按钮并排时留点距离 */
.profile-sub .copyable + .copyable-button { margin-left: 6px; }

.unverified {
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
}

.role-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.profile-actions { flex: 0 0 100%; }
.profile-edit {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  max-width: 460px;
}
.profile-edit[hidden] { display: none; }
.avatar-pick { display: flex; align-items: center; gap: 12px; }

/* ---------- 用户数据（身份）管理 ---------- */

.profiles-section { margin-top: 40px; }
.profile-switch-hint { color: var(--faint); }

/* 谱师名与当前身份不一致时的就地提示 */
.hint.is-warn { color: var(--gold); }

.profile-list { border: 1px solid var(--line); }
.profile-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
}
.profile-row + .profile-row,
.profile-manage + .profile-row { border-top: 1px solid var(--line); }
.profile-row.is-current { background: rgba(255, 255, 255, .04); }

.profile-info { flex: 1 1 200px; min-width: 0; }
.profile-info strong { display: block; font-size: 14.5px; font-weight: 600; }
.profile-info span { display: block; margin-top: 2px; color: var(--faint); font-size: 12.5px; }
.current-tag { color: var(--text) !important; }
.transfer-tag { color: var(--gold) !important; }
.profile-row-actions { display: flex; gap: 6px; }

.profile-manage {
  padding: 16px 15px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, .24);
}
.manage-block + .manage-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.manage-block > .label {
  display: block;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.manage-block .hint { margin: 0 0 10px; }

.profiles-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 12.5px;
}
.profiles-foot .button { margin-left: 0; }
.profiles-foot span { margin-right: auto; }

.inline-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  max-width: 460px;
}

/* 代传引导。转让走的是整个身份，这一条不说清楚会有人把主号送出去 */
.transfer-guide {
  margin-top: 16px;
  border: 1px solid var(--line);
}
.transfer-guide summary {
  padding: 11px 15px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
}
.transfer-guide summary:hover { color: var(--text); }
.transfer-guide[open] summary { border-bottom: 1px solid var(--line); }
.transfer-guide-body { padding: 15px; font-size: 13.5px; line-height: 1.7; }
.transfer-guide-body p { margin: 0 0 8px; color: var(--muted); }
.transfer-guide-body strong { color: var(--text); }
.transfer-guide-body ol { margin: 8px 0; padding-left: 20px; color: var(--muted); }
.transfer-guide-body li { margin-bottom: 4px; }
.guide-warn { color: var(--gold) !important; }

/* ---------- 最近游玩 ---------- */

.plays { border: 1px solid var(--line); }
.play-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 16px;
  align-items: baseline;
  padding: 10px 14px;
  color: inherit;
  font-size: 14px;
  text-decoration: none;
}
.play-row + .play-row { border-top: 1px solid var(--line); }
.play-row:hover { background: var(--bg-raised); }
.play-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-diff { margin-left: 8px; color: var(--faint); font-size: 12px; }
.play-judge { color: var(--faint); font-size: 12px; }
.play-score { font-variant-numeric: tabular-nums; }
.play-time { color: var(--faint); font-size: 12px; min-width: 56px; text-align: right; }

@media (max-width: 720px) {
  .play-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .play-judge, .board-row .board-combo { display: none; }
}

/* ==========================================================================
   获取游戏
   ========================================================================== */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}
.platform-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 22px 20px;
  background: var(--bg);
}
.platform-card .os {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.platform-card h3 { margin: 0; font-size: 16px; font-weight: 600; }
.platform-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.platform-card .button { margin-top: auto; align-self: flex-start; }

.community-box { border: 1px solid var(--line); }
.community-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  font-size: 14px;
}
.community-item + .community-item { border-top: 1px solid var(--line); }
.community-label { flex: 0 0 78px; color: var(--faint); font-size: 12.5px; }
.community-value { flex: 1; min-width: 0; user-select: all; }
.community-note { display: block; color: var(--faint); font-size: 12.5px; line-height: 1.6; }

.next-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}
.next-step {
  display: block;
  padding: 18px 20px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  transition: background .15s var(--ease);
}
.next-step:hover { background: var(--bg-raised); }
.next-step strong { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 600; }
.next-step span { color: var(--muted); font-size: 13px; }

/* 谱面库上给未登录访客/爬虫看的站点介绍，登录后由脚本移除 */
.intro-block {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.intro-block .lead {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.intro-block code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .88em;
}
.intro-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.intro-note { margin: 12px 0 0; color: var(--faint); font-size: 12.5px; }

/* 登录页和谱面库上的获取游戏条 */
.get-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
}
.get-strip-copy { flex: 1 1 200px; min-width: 0; }
.get-strip strong { display: block; font-size: 14px; font-weight: 600; }
.get-strip span { color: var(--faint); font-size: 12.5px; }

/* ==========================================================================
   试听播放器（不支持 Vorbis 的浏览器走 Web Audio，控件自绘）
   ========================================================================== */

.wa-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
}
.wa-play {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.wa-play:hover { border-color: var(--text); }
.wa-track { flex: 1; height: 2px; background: var(--line-strong); cursor: pointer; }
.wa-fill { width: 0; height: 100%; background: var(--text); }
.wa-time { flex: 0 0 auto; min-width: 82px; color: var(--faint); font-size: 12px; text-align: right; }
.wa-player.is-loading .wa-play { opacity: .5; pointer-events: none; }
.wa-player.is-error { border-color: var(--danger); }
.wa-player.is-error .wa-time { color: var(--danger); }

/* ==========================================================================
   试听区间选择器（上传页）
   ========================================================================== */

.range-loading {
  padding: 34px;
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}

.range-canvas-wrap {
  position: relative;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;   /* 否则移动端拖动会被当成滚动 */
  user-select: none;
}
.range-canvas { display: block; width: 100%; }

.range-window {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--text);
  border-right: 1px solid var(--text);
  background: rgba(255, 255, 255, .09);
  cursor: grab;
}
.range-window:active { cursor: grabbing; }

.range-handle { position: absolute; top: 0; bottom: 0; width: 13px; cursor: ew-resize; }
.range-handle.left { left: -7px; }
.range-handle.right { right: -7px; }
.range-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 22px;
  transform: translate(-50%, -50%);
  background: var(--text);
}
.range-handle:focus-visible::after { background: var(--gold); }

.range-playhead { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--gold); pointer-events: none; }
.range-playhead[hidden] { display: none; }

.range-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.range-readout { color: var(--faint); font-size: 12.5px; }
.range-readout.at-limit { color: var(--gold); }

/* ==========================================================================
   上传页
   ========================================================================== */

.dropzone {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 52px 24px;
  border: 1px dashed var(--line-strong);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s var(--ease);
}
.dropzone:hover, .dropzone.over { border-color: var(--text); border-style: solid; }
.dropzone h3 { margin: 0; font-size: 15px; font-weight: 500; }
.dropzone p { margin: 0; color: var(--muted); font-size: 13px; }
.dropzone .or { color: var(--faint); font-size: 12px; }
.dropzone code { font-family: var(--mono); font-size: .92em; }

.claims { margin-top: 22px; border: 1px solid var(--line); }
.claim { display: flex; align-items: center; gap: 12px; padding: 8px 13px; font-size: 13.5px; }
.claim + .claim { border-top: 1px solid var(--line); }
.claim .role { flex: 0 0 78px; color: var(--faint); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.claim .file { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.claim .note { color: var(--faint); font-size: 12px; }
.claim.missing .file { color: var(--danger); }
.claim.rejected .note { color: var(--gold); }

.difficulties { display: flex; flex-wrap: wrap; gap: 6px; }
.diff-pick {
  position: relative;
  padding: 7px 14px;
  border: 1px solid var(--line);
  font-size: 13.5px;
  cursor: pointer;
}
.diff-pick input { position: absolute; opacity: 0; pointer-events: none; }
.diff-pick:hover { border-color: var(--line-strong); }
/* 选中态用该难度档自己的颜色，和列表里的徽章是同一套 */
.diff-pick:has(input:checked) { color: #fff; border-color: transparent; background: var(--tier, var(--text)); }
.diff-pick small { display: block; color: var(--faint); font-size: 11px; }
.diff-pick:has(input:checked) small { color: rgba(255, 255, 255, .8); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.progress { height: 2px; margin-top: 14px; background: var(--line-strong); }
.progress span { display: block; height: 100%; width: 0; background: var(--text); transition: width .25s var(--ease); }
.stage { margin-top: 10px; color: var(--muted); font-size: 13px; }
.swatch { width: 42px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; }

.title-options { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.title-options[hidden] { display: none; }
.title-option {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.title-option:hover { color: var(--text); border-color: var(--line-strong); }
.title-option.active { color: var(--bg); border-color: var(--text); background: var(--text); }
.title-option .locale { flex: 0 0 auto; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.title-option .value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 站内信 ---------- */

/* 顶栏未读角标。交互色就是白，所以角标是反白的小方块，不引入新的强调色。
   类选择器的 display 会盖过 [hidden]，必须配一条压回去——这坑栽过三次 */
.top-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  margin-left: 6px;
  padding: 0 4px;
  color: var(--bg);
  background: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.top-badge[hidden] { display: none; }

.inbox-toolbar { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.inbox-toolbar .result-meta { margin-bottom: 16px; }

.inbox-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border: 1px solid var(--line);
}
.inbox-row + .inbox-row { margin-top: -1px; }
/* 未读那条的左边一条竖线。只用白，读过之后线消失，列表就安静下来 */
.inbox-row.is-unread { border-left: 2px solid var(--text); }

.inbox-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 13px 15px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.inbox-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inbox-new { color: var(--text); }
.inbox-version { color: var(--muted); letter-spacing: .06em; text-transform: none; }
.inbox-summary { color: var(--muted); font-size: 14.5px; }
.inbox-row.is-unread .inbox-summary { color: var(--text); }
.inbox-date { color: var(--faint); font-size: 12.5px; }
.inbox-delete { flex: 0 0 auto; align-self: center; margin-right: 9px; }

.inbox-detail {
  flex: 1 1 100%;
  padding: 0 15px 15px;
  border-top: 1px solid var(--line);
  margin-top: -1px;
}
.inbox-detail[hidden] { display: none; }
/* 公告正文是 Markdown 原文，服务端和客户端都不渲染，这里也原样摆出来 */
.inbox-body {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.inbox-edited { margin: 10px 0 0; color: var(--faint); font-size: 12.5px; }
.inbox-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 720px) {
  .hero-layout { flex-direction: column; gap: 20px; }
  .hero-cover { flex: none; width: min(240px, 62%); }
  .board-row { grid-template-columns: 32px 1fr auto; gap: 10px; padding: 9px 11px; font-size: 13px; }
  .board-row .board-combo { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .page { padding-top: 28px; padding-bottom: 64px; }
  .brand small { display: none; }
  .card { padding: 20px 16px; }
  .topbar-inner { gap: 12px; }

  /* 没有 js/nav.js 时的兜底：导航还是一行，放不下就横向滑，至少不竖排。
     链接少于 4 条的页面（login、get）也一直是这个形态——本来就放得下 */
  .top-actions { overflow-x: auto; scrollbar-width: none; }
  .top-actions::-webkit-scrollbar { display: none; }

  /* 有 js/nav.js 时：折成顶栏下方的面板，跟 docs/ 的目录面板同一套行为 */
  .topbar.nav-collapsed .nav-toggle { display: inline-flex; }
  .topbar.nav-collapsed .top-actions {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--topbar);
    z-index: 40;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - var(--topbar));
    padding: 6px 0 10px;
    overflow-y: auto;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }
  .topbar.nav-collapsed .top-actions.open { display: flex; }
  .topbar.nav-collapsed .top-link {
    height: 44px;
    /* 有角标的行靠 space-between 把角标推到右边；没角标的只有一个匿名 flex
       item，space-between 等同于靠左，两种情况共用一条规则 */
    justify-content: space-between;
    padding: 0 var(--gutter);
    border-left: 2px solid transparent;
    font-size: 15px;
  }
  .topbar.nav-collapsed .top-link.current { border-left-color: var(--text); }
  .topbar.nav-collapsed .top-badge { margin-left: 0; }
}
