/* ============================================================
   千纪盐toki 资料站 · 布局参考「观测终端」式面板
   配色沿用原有的暗色 + 金 / 紫 / 粉
   ============================================================ */

/* ============ 基础 ============ */
:root {
  --bg: #0b0a14;
  --bg2: #151030;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --panel: rgba(255, 255, 255, 0.028);
  --text: #e8e6f2;
  --text-dim: #a8a3c4;
  --gold: #f0c96c;
  --purple: #9d7bff;
  --pink: #ff8fb8;
  --danger: #ff7b8a;
  --line: rgba(255, 255, 255, 0.1);
  --gold-line: rgba(240, 201, 108, 0.4);
  --purple-line: rgba(157, 123, 255, 0.4);
  --pink-line: rgba(255, 143, 184, 0.4);
  --danger-line: rgba(255, 123, 138, 0.35);
  --radius: 16px;
  --shell: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* hidden 属性必须真的隐藏：下面不少元素自带 display:flex/grid，
   那会盖过 UA 样式里的 [hidden]{display:none}，所以这里强制一下 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Serif SC", serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 60%, #1b1440 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
  /* 让短内容的分区也能把页脚顶到屏幕底部 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============ 背景装饰 ============ */
.bg-rings {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-rings span {
  position: absolute;
  border: 1px solid rgba(240, 201, 108, 0.055);
  border-radius: 50%;
}

.bg-rings span:nth-child(1) { width: 520px; height: 520px; left: -170px; top: 110px; }
.bg-rings span:nth-child(2) { width: 340px; height: 340px; right: -120px; top: 40px; border-color: rgba(157, 123, 255, 0.08); }
.bg-rings span:nth-child(3) { width: 700px; height: 700px; right: -240px; bottom: -280px; }
.bg-rings span:nth-child(4) { width: 260px; height: 260px; left: 7%; bottom: 5%; border-color: rgba(255, 143, 184, 0.06); }

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.2); }
}

/* ============ 顶部控制条 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 10, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.topbar-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 11px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--gold-line);
  background: rgba(240, 201, 108, 0.08);
}

.brand-text { line-height: 1.35; }

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
}

.brand-sub {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* 分区按钮 */
.tabs {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.22s, background 0.22s, border-color 0.22s, transform 0.22s;
}

.tab .ico { font-size: 12px; color: var(--purple); transition: color 0.22s; }

.tab:hover {
  color: var(--text);
  border-color: var(--gold-line);
  transform: translateY(-1px);
}

.tab[aria-selected="true"] {
  color: var(--gold);
  background: rgba(240, 201, 108, 0.1);
  border-color: var(--gold-line);
}

.tab[aria-selected="true"] .ico { color: var(--gold); }

/* 右侧：时钟 + 状态 */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.clock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.clock-label { color: var(--text-dim); }

.clock-value {
  color: var(--gold);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.clock-caret { font-size: 10px; color: var(--text-dim); }

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 3px rgba(168, 163, 196, 0.15);
}

/* B站主页入口：沿用时钟那款胶囊，颜色走粉色区分开 */
.toplink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--pink);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--pink-line);
  border-radius: 10px;
  background: rgba(255, 143, 184, 0.07);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.toplink:hover {
  color: #fff;
  border-color: var(--pink);
  background: rgba(255, 143, 184, 0.18);
}

.toplink:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.toplink-ico {
  font-size: 9px;
  line-height: 1;
  transform: translateY(-1px);
}

/* ============ 主区域 ============ */
.stage {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 20px 22px 56px;
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
}

.view-tab {
  display: inline-block;
  margin: 0 0 -1px 4px;
  padding: 7px 22px;
  font-size: 13.5px;
  letter-spacing: 2px;
  color: var(--gold);
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}

.panel {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0 18px 18px 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.view.is-active { animation: viewIn 0.34s ease both; }

/* ============ 排列 ============ */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
}

.split-side { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

/* ============ 面板 ============ */
.sheet {
  position: relative;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: border-color 0.25s;
}

.sheet:hover { border-color: rgba(240, 201, 108, 0.24); }

.sheet-danger { border-color: var(--danger-line); }
.sheet-danger:hover { border-color: rgba(255, 123, 138, 0.6); }

.sheet-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 12px;
}

.sheet-name {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1.25;
  background: linear-gradient(110deg, #fff 15%, var(--gold) 62%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sheet-meta {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.sheet-h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--purple);
}

.sheet-tagline {
  padding-left: 14px;
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.65;
  border-left: 3px solid var(--purple);
}

.sheet-quote {
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* 资料行 */
.fields { display: grid; }

.field {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 10px 0;
}

.field dt {
  padding-top: 2px;
  font-size: 13.5px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.field dd {
  min-width: 0;
  font-size: 15.5px;
  line-height: 1.7;
}

.field dd .accent {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
}

.fields-tight .field { padding: 7px 0; }

.mini {
  margin-left: 10px;
  font-size: 12.5px;
  color: var(--pink);
  white-space: nowrap;
}

/* 胶囊按钮 */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-block;
  padding: 5px 14px;
  font-size: 13.5px;
  white-space: nowrap;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: color 0.22s, border-color 0.22s, transform 0.22s;
}

.pill:hover {
  color: var(--gold);
  border-color: var(--gold-line);
  transform: translateY(-1px);
}

.pills-gold .pill {
  color: var(--gold);
  background: rgba(240, 201, 108, 0.08);
  border-color: var(--gold-line);
}

/* 面板内小组件（标题 + 内容） */
.subbox {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.subbox-title {
  padding: 9px 18px;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--gold);
  background: rgba(240, 201, 108, 0.07);
  border-bottom: 1px dashed var(--line);
}

.subbox-body {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
}

.subrow {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.sub-label {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.sub-value {
  font-size: 15px;
  line-height: 1.7;
  min-width: 0;
}

.slash-list .slash { margin: 0 7px; color: var(--gold); opacity: 0.65; }

/* ============ 列表 ============ */
.list {
  list-style: none;
  display: grid;
  gap: 9px;
}

.list li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  line-height: 1.75;
}

.list li::before {
  content: "❖";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 12px;
  color: var(--purple);
}

.para-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.para-list li {
  position: relative;
  padding: 11px 14px 11px 34px;
  font-size: 15px;
  line-height: 1.75;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.para-list li::before {
  content: "♡";
  position: absolute;
  left: 13px;
  top: 11px;
  font-size: 13px;
  color: var(--pink);
}

/* 老婆名单 */
.waifu-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.waifu-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  background: rgba(255, 143, 184, 0.07);
  border: 1px solid var(--pink-line);
  border-radius: 12px;
  transition: background 0.25s, transform 0.25s;
}

.waifu-item:hover {
  background: rgba(255, 143, 184, 0.14);
  transform: translateX(3px);
}

.waifu-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--pink);
}

.waifu-note { font-size: 12.5px; color: var(--text-dim); }

/* ============ 文字块 ============ */
.block + .block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.block-title {
  margin-bottom: 8px;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--gold);
}

.block-text {
  font-size: 15px;
  line-height: 1.9;
}

.note {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-dim);
}

.note.warn { color: var(--danger); }

/* ============ 副作用阶段 ============ */
.stage-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
}

.stage-row + .stage-row { border-top: 1px dashed var(--danger-line); }

.stage-num {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 2px 12px;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--danger);
  border: 1px solid var(--danger-line);
  border-radius: 999px;
}

.stage-effects { flex: 1; min-width: 0; }
.stage-effects li::before { color: var(--danger); }

/* ============ 语录 ============ */
.quote-list {
  display: grid;
  gap: 18px;
}

.quote {
  position: relative;
  padding: 26px 30px 26px 48px;
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.95;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}

.quote::before {
  content: "「";
  position: absolute;
  left: 16px;
  top: 14px;
  font-size: 26px;
  line-height: 1;
  color: rgba(240, 201, 108, 0.5);
}

/* ============ 立绘位 ============ */
.art-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.art-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(157, 123, 255, 0.14), rgba(11, 10, 20, 0.55));
}

.art-svg {
  display: block;
  width: 100%;
  height: auto;
}

.art-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.art-img.is-on { display: block; }

.art-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.art-tag {
  padding: 2px 11px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
}

.art-name { color: var(--text-dim); letter-spacing: 1px; }

.art-hint {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(168, 163, 196, 0.75);
}

.art-hint code {
  padding: 1px 6px;
  font-size: 12px;
  color: var(--gold);
  background: rgba(240, 201, 108, 0.08);
  border: 1px solid var(--gold-line);
  border-radius: 6px;
}

/* ============ 图稿 ============ */
.gallery-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.gallery-bar .pill {
  font-family: inherit;
  cursor: pointer;
}

.gallery-bar .pill.is-on {
  color: var(--gold);
  background: rgba(240, 201, 108, 0.12);
  border-color: var(--gold-line);
}

.gallery-count {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-dim);
  white-space: nowrap;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 14px;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  /* button 的 UA 样式带 align-items: flex-start，不覆盖的话子元素不会拉伸 */
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  font-family: inherit;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  outline: none;
  transform: translateY(-4px);
  border-color: var(--gold-line);
  box-shadow: 0 14px 30px rgba(11, 10, 20, 0.55);
}

.gallery-thumb {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 0;
  padding-bottom: 133.33%;   /* 固定 3:4 比例；不依赖 flex 布局里的 aspect-ratio */
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, rgba(157, 123, 255, 0.16), rgba(11, 10, 20, 0.5));
}

.gallery-thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-thumb img { transform: scale(1.06); }

/* 缺图时的占位（和立绘占位同一套观感），不显示破图图标 */
.gallery-missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  color: rgba(168, 163, 196, 0.7);
}

.gallery-missing::before {
  content: "✧";
  font-size: 26px;
  color: rgba(240, 201, 108, 0.5);
}

.gallery-missing code,
.gallery-empty code {
  padding: 1px 6px;
  font-size: 11px;
  color: var(--gold);
  background: rgba(240, 201, 108, 0.08);
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  word-break: break-all;
}

.gallery-cap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--card-border);
}

.gallery-title {
  font-size: 13.5px;
  letter-spacing: 0.5px;
  color: var(--text);
}

.gallery-sub {
  font-size: 11.5px;
  color: var(--text-dim);
}

.gallery-empty {
  padding: 24px 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.gallery-empty-title {
  margin-bottom: 8px;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--gold);
}

.gallery-empty-text {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text-dim);
}

.gallery-snippet {
  display: inline-block;
  margin: 12px 0 8px;
  padding: 10px 14px;
  font-size: 12px;
  text-align: left;
  color: var(--text);
  background: rgba(11, 10, 20, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- 灯箱 ---- */
body.lb-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
}

.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 14, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-body {
  position: relative;
  z-index: 1;
  width: 940px;
  max-width: 100%;
}

.lightbox-panel {
  width: 940px;
  max-width: 100%;
  overflow: hidden;
  background: rgba(21, 16, 48, 0.74);
  border: 1px solid var(--gold-line);
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.lightbox-stage {
  position: relative;
  display: block;
  width: 100%;
  min-height: 180px;
  max-height: 68vh;
  overflow: auto;
  text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(157, 123, 255, 0.16), rgba(11, 10, 20, 0.6));
}

.lightbox-stage img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.lightbox-stage .gallery-missing { inset: 0; padding: 24px; font-size: 13px; }
.lightbox-stage .gallery-missing::before { font-size: 34px; }

.lightbox-cap {
  padding: 14px 20px 16px;
  border-top: 1px dashed var(--line);
}

.lightbox-title {
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--gold);
}

.lightbox-meta {
  margin-top: 4px;
  font-size: 12.5px;
  letter-spacing: 1px;
  color: var(--purple);
}

.lightbox-note {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
  background: rgba(11, 10, 20, 0.75);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  color: var(--gold);
  background: rgba(240, 201, 108, 0.14);
  border-color: var(--gold-line);
}

.lightbox-close { top: -50px; right: 0; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: -54px; }
.lightbox-next { right: -54px; }

/* ============ 页脚 ============ */
.footer {
  position: relative;
  z-index: 1;
  padding: 40px 20px 54px;
  text-align: center;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-small {
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(240, 201, 108, 0.7);
}

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 10px; }
  .tabs { order: 3; flex: 1 1 100%; }
  /* 右侧这组要允许被压缩 + 自身能折行：它是 flex 子项，原本 flex-shrink:0，
     宽度只会取 max-content，于是窄屏时不是折行而是直接溢出视口右边被裁掉。
     断点取 1180 是因为 .topbar-inner 的 max-width 就是 --shell:1180px，
     视口再宽可用宽度也不变，所以 >=1181 一定是单行版式。 */
  .topbar-right {
    margin-left: auto;
    flex-shrink: 1;
    flex-wrap: wrap;
    row-gap: 8px;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .split,
  .split-side,
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .art-frame { min-height: 380px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  /* 窄屏放不下外挂的按钮，挪进画面里 */
  .lightbox-close { top: 8px; right: 8px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@media (max-width: 640px) {
  .stage { padding: 14px 14px 44px; }
  .panel { padding: 14px; border-radius: 0 14px 14px 14px; }
  .sheet { padding: 16px; }
  .field,
  .subrow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .field dt { padding-top: 0; font-size: 12.5px; }
  .sub-label { font-size: 12.5px; }
  .stage-row { flex-direction: column; gap: 8px; }
  .brand-sub { display: none; }
  .clock-label { display: none; }
  /* 手机上干脆让这组独占一整行，宽度有保证，不会再被裁 */
  .topbar-right { flex: 1 1 100%; margin-left: 0; gap: 8px; }
  .toplink { padding: 6px 10px; font-size: 12.5px; }
  .quote { padding: 22px 20px 22px 42px; }
  .gallery-bar { margin-bottom: 14px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .gallery-empty { padding: 18px 14px; }
  .gallery-snippet { font-size: 11.5px; }
  .lightbox { padding: 12px; }
  .lightbox-cap { padding: 12px 14px 14px; }
  .lightbox-title { font-size: 15px; }
}
