/* ============================================================
   corridor.css — 回忆走廊（demo/corridor.html 专用）
   走廊本身是应用壳：一屏一个系统，整页换成那个时代的桌面。
   组件仍用 css/components.css + 主题令牌；这里只管「桌面 / 窗口框 / 任务栏 /
   菜单栏 / Dock / 壁纸」这些不属于控件库的东西。
   壁纸是 CSS 渐变的抽象示意，不是系统自带壁纸。
   ============================================================ */

* {
  box-sizing: border-box;
}

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

body.corridor {
  overflow: hidden;
  background: #111;
  font-family: var(--ui-font);
}

/* ---------------- 走廊骨架 ---------------- */

.rooms {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

@supports (-moz-appearance: none) {
  .rooms {
    scrollbar-width: var(--scrollbar-width, auto);
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  }
}

/* 走廊自己的滚动条也跟当前时代走；主题令牌由 js/corridor.js 挂到 .rooms 上 */
.rooms::-webkit-scrollbar {
  width: var(--scrollbar-size, 8px);
}

.rooms::-webkit-scrollbar-track {
  background: var(--scrollbar-track, transparent);
}

.rooms::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, rgba(0, 0, 0, 0.35));
  border-radius: var(--scrollbar-radius, 0px);
  border: var(--scrollbar-border, 0px) solid transparent;
  background-clip: padding-box;
  box-shadow: var(--scrollbar-thumb-shadow, none);
}

.rooms::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover, var(--scrollbar-thumb));
}

.rooms::-webkit-scrollbar-button {
  display: none;
}

.rooms::-webkit-scrollbar-corner {
  background: var(--scrollbar-track, transparent);
}

.room {
  position: relative;
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.room__wall {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.room__stage {
  position: relative;
  z-index: 2;
  width: min(760px, 86vw);
  max-height: calc(100vh - 200px);
  display: flex;
  margin-top: 56px;
  margin-bottom: 72px;
}

/* ---------------- Windows 11 ---------------- */

.room[data-era="win11"] {
  --window-radius: 8px;
  --window-bar-h: 32px;
  --window-bar-bg: #2b2b2b;
  --window-bar-fg: #ffffff;
  --window-border: rgba(255, 255, 255, 0.08);
  --window-border-w: 1px;
  --window-body-bg: var(--ui-surface);
  --window-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.room[data-era="win11"] .room__wall {
  background:
    radial-gradient(80% 70% at 18% 18%, rgba(96, 148, 255, 0.5), transparent 62%),
    radial-gradient(70% 80% at 82% 78%, rgba(180, 120, 255, 0.42), transparent 60%),
    radial-gradient(60% 60% at 50% 50%, rgba(40, 90, 190, 0.55), transparent 70%),
    #0a1224;
}

.shell--win11 {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 27, 34, 0.82);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.shell--win11 .tb-icons {
  display: flex;
  gap: 8px;
}

.shell--win11 .tb-icons i {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
}

.shell--win11 .tb-icons i:nth-child(1) {
  background: rgba(96, 205, 255, 0.75);
}

.shell--win11 .tb-icons i:nth-child(2) {
  background: rgba(255, 255, 255, 0.22);
}

.shell--win11 .tb-clock {
  position: absolute;
  right: 16px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------------- Windows 10 ---------------- */

.room[data-era="win10"] {
  --window-radius: 0px;
  --window-bar-h: 31px;
  --window-title-weight: 400;
  --window-bar-bg: #ffffff;
  --window-bar-fg: #000000;
  --window-border: #c8c8c8;
  --window-border-w: 1px;
  --window-body-bg: var(--ui-surface);
  --window-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.room[data-era="win10"] .room__wall {
  background:
    radial-gradient(90% 80% at 50% 15%, rgba(0, 120, 215, 0.65), transparent 65%),
    linear-gradient(160deg, #0a4f8a 0%, #0a2f55 60%, #061a30 100%);
}

.shell--win10 {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  background: #101820;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.shell--win10 .tb-start {
  width: 26px;
  height: 26px;
  background: #0078d7;
  border-radius: 2px;
}

.shell--win10 .tb-search {
  width: 150px;
  height: 24px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.shell--win10 .tb-icons {
  display: flex;
  gap: 8px;
}

.shell--win10 .tb-icons i {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}

.shell--win10 .tb-clock {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------------- Windows XP ---------------- */

.room[data-era="winxp"] {
  --window-radius: 0px;
  --window-bar-h: 26px;
  --window-bar-bg: linear-gradient(180deg, #0058e6 0%, #3a93ff 8%, #0054e3 92%, #003bb5 100%);
  --window-bar-fg: #ffffff;
  --window-border: #0054e3;
  --window-border-w: 3px;
  --window-body-bg: var(--ui-surface);
  --window-title-weight: 700;
  --window-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

.room[data-era="winxp"] .room__wall {
  background:
    radial-gradient(120% 62% at 50% 112%, #2f7a1f 0 38%, #4aa32b 52%, #8fce6a 64%, transparent 72%),
    linear-gradient(180deg, #2f6cb3 0%, #6ea6dd 42%, #a8cdec 68%, #d9e8f5 100%);
}

.shell--xp {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  background: linear-gradient(180deg, #245edb 0%, #3f8cf3 10%, #245edb 88%, #1941a5 100%);
  border-top: 1px solid #1a49b8;
}

.shell--xp .tb-start {
  display: flex;
  align-items: center;
  padding: 0 14px 0 10px;
  height: 28px;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, #3fa32b 0%, #2f8b1f 60%, #1f6a13 100%);
  color: #fff;
  font-size: 12px;
  font-style: italic;
  font-weight: 700;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
}

.shell--xp .tb-quick {
  display: flex;
  gap: 6px;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.shell--xp .tb-quick i {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
}

.shell--xp .tb-clock {
  margin-left: auto;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #0f8fe3 0%, #0a6fc0 100%);
  color: #fff;
  font-size: 11px;
  border-left: 1px solid #1a49b8;
}

/* ---------------- macOS 26 / 11–15 ---------------- */

.room[data-era="macos"],
.room[data-era="macos15"] {
  --window-radius: 10px;
  --window-bar-h: 28px;
  --window-bar-bg: rgba(246, 246, 246, 0.92);
  --window-bar-fg: #1a1a1a;
  --window-border: rgba(0, 0, 0, 0.12);
  --window-border-w: 1px;
  --window-body-bg: var(--ui-surface);
  --window-title-weight: 600;
  --window-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.room[data-era="macos"] .room__wall {
  background:
    radial-gradient(70% 60% at 22% 20%, rgba(255, 190, 220, 0.85), transparent 62%),
    radial-gradient(80% 70% at 82% 30%, rgba(120, 170, 255, 0.9), transparent 65%),
    radial-gradient(90% 80% at 50% 110%, rgba(255, 150, 80, 0.55), transparent 70%),
    linear-gradient(180deg, #f6d8ec 0%, #b9d4ff 55%, #5e7fd8 100%);
}

.room[data-era="macos15"] {
  --window-bar-bg: rgba(38, 38, 41, 0.94);
  --window-bar-fg: #f5f5f7;
  --window-border: rgba(255, 255, 255, 0.1);
}

.room[data-era="macos15"] .room__wall {
  background:
    radial-gradient(70% 60% at 20% 18%, rgba(120, 90, 200, 0.65), transparent 60%),
    radial-gradient(80% 70% at 85% 25%, rgba(60, 120, 230, 0.6), transparent 65%),
    linear-gradient(180deg, #191d33 0%, #0e1224 60%, #060814 100%);
}

.shell--mac {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shell--mac .dock,
.shell--gnome .dock {
  pointer-events: auto;
}

.shell--mac .mb {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px);
  color: #1a1a1a;
  font-size: 12px;
}

.room[data-era="macos15"] .shell--mac .mb {
  background: rgba(20, 22, 34, 0.55);
  color: #f5f5f7;
}

.shell--mac .mb b {
  font-weight: 600;
}

.shell--mac .mb .clock {
  margin-left: auto;
}

.shell--mac .dock {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.room[data-era="macos15"] .shell--mac .dock {
  background: rgba(30, 32, 46, 0.5);
  border-color: rgba(255, 255, 255, 0.12);
}

.shell--mac .dock i {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(180deg, #7fc4ff, #2f7de0);
}

.shell--mac .dock i:nth-child(2) {
  background: linear-gradient(180deg, #ffd27f, #e08c2f);
}

.shell--mac .dock i:nth-child(3) {
  background: linear-gradient(180deg, #9ef0b0, #2fae5a);
}

.shell--mac .dock i:nth-child(4) {
  background: linear-gradient(180deg, #ff9fb8, #d23f6b);
}

.shell--mac .dock i:nth-child(5) {
  background: linear-gradient(180deg, #d7d7dd, #8b8b95);
}

/* ---------------- GNOME ---------------- */

.room[data-era="gnome"] {
  --window-radius: 12px;
  --window-bar-h: 38px;
  --window-bar-bg: #2b2b2f;
  --window-bar-fg: #ffffff;
  --window-border: rgba(255, 255, 255, 0.08);
  --window-border-w: 1px;
  --window-body-bg: var(--ui-surface);
  --window-title-weight: 700;
  --window-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.room[data-era="gnome"] .room__wall {
  background:
    radial-gradient(70% 60% at 25% 20%, rgba(53, 132, 228, 0.35), transparent 62%),
    radial-gradient(70% 60% at 78% 75%, rgba(145, 65, 172, 0.35), transparent 60%),
    linear-gradient(180deg, #2b2b33 0%, #1c1c22 55%, #121216 100%);
}

.shell--gnome .topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 12px;
}

.shell--gnome .topbar .clock {
  margin-left: auto;
}

.shell--gnome .dock {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.shell--gnome .dock i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
}

.shell--gnome .dock i:nth-child(1) {
  background: rgba(53, 132, 228, 0.9);
}

/* ---------------- 走廊 HUD ---------------- */

.hud {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
}

.hud b {
  color: #fff;
  font-weight: 600;
}

.hud span {
  color: rgba(255, 255, 255, 0.55);
}

.hint {
  position: fixed;
  right: 24px;
  top: 42px;
  z-index: 20;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.45);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  pointer-events: none;
}

@media (max-width: 760px) {
  .hud {
    top: 12px;
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
  }
  .room__stage {
    width: 92vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rooms {
    scroll-behavior: auto;
  }
}

/* ============================================================
   炫酷层：滚动视差、壁纸漂移、鼠标光斑、尘埃粒子、入场动画
   ============================================================ */

.room[data-era="winxp"] {
  --era-accent: #3a93ff;
  --era-cursor: url("../assets/cursors/winxp/arrow.png") 2 2, default;
  --era-text-cursor: url("../assets/cursors/winxp/text.png") 16 16, text;
}
.room[data-era="win10"] {
  --era-accent: #0078d7;
  --era-cursor: url("../assets/cursors/win11/arrow.png") 2 2, default;
  --era-text-cursor: url("../assets/cursors/win11/text.png") 16 16, text;
}
.room[data-era="win11"] {
  --era-accent: #60cdff;
  --era-cursor: url("../assets/cursors/win11/arrow.png") 2 2, default;
  --era-text-cursor: url("../assets/cursors/win11/text.png") 16 16, text;
}
.room[data-era="macos15"] {
  --era-accent: #8b7bff;
  --era-cursor: url("../assets/cursors/macos/arrow.png") 2 2, default;
  --era-text-cursor: url("../assets/cursors/macos/text.png") 16 16, text;
}
.room[data-era="macos"] {
  --era-accent: #ff7ab6;
  --era-cursor: url("../assets/cursors/macos/arrow.png") 2 2, default;
  --era-text-cursor: url("../assets/cursors/macos/text.png") 16 16, text;
}
.room[data-era="gnome"] {
  --era-accent: #3584e4;
  --era-cursor: url("../assets/cursors/gnome/arrow.png") 2 1, default;
  --era-text-cursor: url("../assets/cursors/gnome/text.png") 16 16, text;
}

.room__wall {
  background-size: 150% 150%;
  background-position: center;
  transform: translateY(var(--wall-y, 0px)) scale(1.06);
  animation: wall-drift 28s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes wall-drift {
  0% { background-position: 42% 38%; }
  50% { background-position: 56% 48%; }
  100% { background-position: 48% 60%; }
}

.room__stage {
  transform: translateY(var(--window-y, 0px)) scale(var(--window-scale, 1));
  opacity: var(--window-opacity, 1);
  filter: blur(var(--window-blur, 0px));
  will-change: transform, opacity, filter;
}

@keyframes win-in {
  from {
    opacity: 0;
    transform: translateY(34px) scale(0.955);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 尘埃粒子画布 */
#dust {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* 镜头暗角 */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(
    120% 100% at 50% 45%,
    transparent 55%,
    rgba(0, 0, 0, 0.28) 100%
  );
}

/* HUD 跟着时代强调色发光 */
.hud {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--era-accent) 30%, transparent),
    0 8px 30px color-mix(in srgb, var(--era-accent) 22%, transparent);
  transition: box-shadow 260ms ease;
}

.hud__era {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hud__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--era-accent, #fff);
  box-shadow: 0 0 10px var(--era-accent, #fff);
}

.hud__index {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.45);
}

.hud__steps {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
}

.hud__step {
  appearance: none;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: inherit;
  transition: width 200ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 180ms ease, box-shadow 180ms ease;
}

.hud__step:hover:not([aria-current="true"]) {
  background: rgba(255, 255, 255, 0.55);
}

.hud__step[aria-current="true"] {
  width: 20px;
  background: var(--era-accent, #fff);
  box-shadow: 0 0 10px var(--era-accent, #fff);
}

.hud__modes {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.hud__mode {
  appearance: none;
  padding: 2px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.hud__mode[aria-pressed="true"] {
  background: color-mix(in srgb, var(--era-accent) 60%, #ffffff 20%);
  color: #0a0a12;
  font-weight: 600;
}

/* Dock / 任务栏图标悬浮时抬起来 */
.shell--mac .dock i,
.shell--gnome .dock i {
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.shell--mac .dock i:hover,
.shell--gnome .dock i:hover {
  transform: translateY(-8px) scale(1.12);
}

/* 时代氛围的额外光晕 */
.room[data-era="winxp"] .room__wall::after,
.room[data-era="macos"] .room__wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    60% 40% at 20% 10%,
    rgba(255, 255, 255, 0.35),
    transparent 70%
  );
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .room__wall {
    animation: none;
    transform: none;
  }

  .room.is-active .window {
    animation: none;
  }

  #dust {
    display: none;
  }
}

/* 时代鼠标：桌面区域用各系统的箭头；输入框保留文本光标 */
.room {
  cursor: var(--era-cursor, default);
}

.room input:not([type="range"]),
.room textarea,
.room [contenteditable] {
  cursor: var(--era-text-cursor, text);
}

.room button,
.room .btn,
.room .tabs__tab,
.room .segmented__item,
.room .select__button,
.room .menu__item,
.room .check,
.room .radio,
.room .switch,
.room input[type="range"] {
  cursor: inherit;
}

/* 只保留顶部「上」和底部「下」两个按钮；Chrome 自己会生成四个 button 盒子 */
.rooms::-webkit-scrollbar-button {
  display: none;
}

.rooms::-webkit-scrollbar-button:vertical:start:decrement,
.rooms::-webkit-scrollbar-button:vertical:end:increment {
  display: var(--scrollbar-buttons, none);
  height: var(--scrollbar-size, 0px);
  background-color: var(--scrollbar-button-bg, var(--scrollbar-track));
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--scrollbar-button-shadow, none);
}

.rooms::-webkit-scrollbar-button:vertical:start:decrement {
  background-image: var(--scrollbar-arrow-up, none);
}

.rooms::-webkit-scrollbar-button:vertical:end:increment {
  background-image: var(--scrollbar-arrow-down, none);
}
