/* ============================================================
   S2 漫游模式：全屏沉浸层 + 奶油大卡（重温收藏册）
   B7：纸边毛边感 = 细噪点纹理（SVG feTurbulence，克制）
   ============================================================ */

.roam-layer {
  position: fixed; inset: 0; z-index: 88;
  background: rgba(0, 0, 0, 0.45); /* 剧院式幕布，白卡被灯照亮 */
  overflow: hidden;
  outline: none;
}

.roam-stage {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 3.5vh 16px 2.5vh;
}

/* 奶油大卡：卡面语言的放大版 */
.roam-card {
  position: relative;
  width: min(780px, 94vw); max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--paper-edge); border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32), 0 4px 20px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

/* B7 纸边毛边：细噪点纹理（fractalNoise 灰噪，multiply 压在纸面上） */
.roam-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.065;
  mix-blend-mode: multiply;
}

.roam-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 0;
}
.roam-head .type-plate { font-size: 11.5px; }
.roam-no { font-size: 11px; color: var(--ink-faint); }

.roam-title {
  font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.4;
  color: var(--ink); letter-spacing: 0.01em;
  padding: 10px 24px 12px; margin: 0;
  display: flex; align-items: center; gap: 8px;
  word-break: break-word;
}
.roam-title .star-ic { color: var(--accent); flex: none; }

.roam-body {
  flex: 1; min-height: 0; overflow: auto;
  padding: 0 24px;
  scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent;
}
.roam-body::-webkit-scrollbar { width: 4px; }
.roam-body::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 2px; }

/* 内容三态：大图 / 代码 / 文本（measure），与纸卡同语言 */
.roam-body.img {
  display: flex; align-items: center; justify-content: center;
  padding: 4px 24px 14px;
}
.roam-img {
  max-width: 100%; max-height: 58vh;
  border-radius: 4px; border: 1px solid var(--paper-edge);
  display: block;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.roam-img.ready { opacity: 1; }
.roam-body.code { padding-bottom: 16px; }
.roam-code { font-size: 13.5px; line-height: 1.7; }
.roam-body.url { padding-bottom: 16px; }
.roam-url {
  font-family: var(--mono); font-size: 15px; line-height: 1.7;
  color: var(--accent-ink); word-break: break-all;
  background: var(--bg-deep); border: 1px solid var(--paper-edge); border-radius: 6px;
  padding: 14px 16px;
}
.roam-body.text { padding-bottom: 16px; }
.roam-body.text p {
  max-width: 40em; margin: 0 auto;
  font-size: 15px; line-height: 1.85; color: var(--ink);
}
.roam-body.text p + p { margin-top: 0.75em; }

/* 卡脚：开封状态一行 */
.roam-foot {
  flex: none; display: flex; justify-content: center;
  padding: 10px 24px 14px;
  border-top: 1px dashed var(--paper-edge);
  font-size: 12px; color: var(--ink-faint);
}
.roam-foot .roam-unopened {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); letter-spacing: 0.02em;
}
.roam-foot .roam-unopened .icon { width: 14px; height: 14px; color: var(--accent); }
.roam-foot .roam-used { color: var(--ink-faint); }

/* 幕布上的按键提示 */
.roam-hints {
  font-size: 11.5px; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.roam-hints kbd { margin: 0 1px; }

/* 卡片切换 120ms 淡入（reduced-motion 由全局规则关闭） */
@keyframes roam-fade { from { opacity: 0; transform: translateY(4px); } }
.roam-card.roam-fade { animation: roam-fade 0.12s var(--ease); }

/* ---------- 「漫游合集…」选择层（模态） ---------- */
.roam-modal { width: 420px; }
.roam-coll-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow: auto; padding: 4px; }
.roam-coll-row em { font-style: normal; font-size: 11px; color: var(--text-faint); margin-left: auto; }

@media (max-width: 719px) {
  .roam-card { width: 100vw; max-height: 88vh; border-radius: 0; border-left: none; border-right: none; }
  .roam-stage { padding: 2.5vh 10px 1.5vh; }
  .roam-body.text p { font-size: 14px; }
}
