/* ============================================================
   hall-models.css — 大厅书页右侧的 3D 小模型
   拍立得 / 词云星球 / 六面皮书 / CRT 电子宠物电视 / 左页说明
   依赖 base.css 的主题变量
   ============================================================ */

/* ============================================================
   左页说明（sheet 背面 + 封面内页）
   ============================================================ */
.back-desc { text-align: center; opacity: .85; padding: 0 26px; }
.bd-num {
  font-family: var(--hand-en);
  font-size: 60px; color: var(--ink-2);
  opacity: .5; display: block; line-height: 1;
}
.bd-title { font-size: 40px; color: var(--ink); letter-spacing: 4px; margin-top: 4px; }
.bd-line {
  width: 56%; height: 1.5px;
  margin: 14px auto 12px;
  background: linear-gradient(90deg, transparent, rgba(74, 66, 56, .3), transparent);
}
.bd-text { font-family: var(--hand); font-size: 21px; color: var(--ink-2); line-height: 1.9; }
.cover-desc { margin-bottom: 4px; }
.cover-desc .bd-title { font-size: 34px; }
.cover-desc .bd-line { margin: 10px auto 8px; }

/* 手机端：单页模式下在正面补一行说明 */
.m-desc { display: none; }

/* ============================================================
   ① 关于我：拍立得照片
   ============================================================ */
.polaroid {
  position: relative;
  margin: 30px auto 0;
  width: 74%; max-width: 235px;
  background: #FFFDF8;
  padding: 12px 12px 14px;
  box-shadow: 0 8px 18px rgba(74, 66, 56, .18);
  transform: rotate(-2.5deg);
  text-align: center;
  animation: pol-bob 7s ease-in-out infinite;
}
@keyframes pol-bob {
  0%, 100% { transform: rotate(-2.5deg) translateY(0); }
  50%      { transform: rotate(-2.5deg) translateY(-4px); }
}
.polaroid::before {
  content: '';
  position: absolute;
  top: -10px; left: 50%;
  width: 74px; height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(201, 163, 156, .5);
  box-shadow: 0 1px 2px rgba(74, 66, 56, .12);
}
.polaroid img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  filter: sepia(.12) saturate(.92);
  background: var(--cream-3);
}
.polaroid p { margin-top: 10px; font-family: var(--hand); font-size: 22px; color: var(--ink); }

/* ============================================================
   ② GitHub：代码云星球（悬浮黄铜星球，词条从球面蹦出）
   ============================================================ */
.cp-stage {
  position: relative;
  height: 302px;
  perspective: 900px;
}
.cp-globe {
  position: absolute; left: 50%; top: 46%;
  width: 168px; height: 168px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #EBD9AE 0%, #C9A96B 26%, #A98F63 48%, #6E5738 78%, #453423 100%);
  box-shadow:
    inset -14px -18px 30px rgba(58, 42, 24, .45),
    inset 8px 10px 22px rgba(255, 240, 205, .35),
    0 18px 30px rgba(74, 66, 56, .22);
  overflow: hidden;
  animation: cp-bob 5s ease-in-out infinite;
}
@keyframes cp-bob {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-9px); }
}
/* 经纬网格（慢速滚动模拟自转） */
.cp-globe::before {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 50%;
  opacity: .42;
  background:
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(70, 52, 32, .5) 20px 21.5px),
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(70, 52, 32, .38) 20px 21.5px);
  animation: cp-spin 22s linear infinite;
}
/* 做旧斑驳 */
.cp-globe::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(28px 20px at 62% 40%, rgba(127, 160, 140, .30), transparent 70%),
    radial-gradient(40px 26px at 30% 62%, rgba(69, 52, 35, .25), transparent 70%),
    radial-gradient(20px 14px at 52% 74%, rgba(127, 160, 140, .20), transparent 70%);
}
@keyframes cp-spin {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 43px 0, 0 0; }
}
.cp-ring {
  position: absolute; left: 50%; top: 46%;
  width: 236px; height: 236px;
  transform: translate(-50%, -50%) rotateX(74deg);
  transform-style: preserve-3d;
  border: 2px solid rgba(110, 87, 56, .45);
  border-radius: 50%;
}
.cp-ring::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; margin: -4.5px;
  border-radius: 50%;
  background: #7FA08C;
  box-shadow: 0 0 6px rgba(127, 160, 140, .8);
  animation: cp-orbit 7s linear infinite;
}
@keyframes cp-orbit {
  from { transform: rotate(0deg) translateX(118px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(118px) rotate(-360deg); }
}
/* 地面投影（悬浮感） */
.cp-shadow {
  position: absolute;
  left: 50%; top: 86%;
  width: 150px; height: 20px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(74, 66, 56, .26), transparent 65%);
  filter: blur(3px);
  animation: cp-sh 5s ease-in-out infinite;
}
@keyframes cp-sh {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .8; }
  50%      { transform: translateX(-50%) scale(.82); opacity: .5; }
}
/* 蹦出的词条 */
.cp-word {
  position: absolute;
  font-family: var(--hand-en);
  font-size: 19px; font-weight: 600;
  letter-spacing: .5px;
  padding: 3px 12px;
  background: var(--paper);
  border: 1.5px solid currentColor;
  border-radius: 14px;
  box-shadow: 0 3px 8px rgba(74, 66, 56, .18);
  white-space: nowrap;
  z-index: 5;
  animation: cp-pop 3.4s ease-out forwards;
}
@keyframes cp-pop {
  0%   { transform: translate(-50%, -50%) rotate(var(--wr, 0deg)) scale(.2); opacity: 0; }
  12%  { transform: translate(-50%, -50%) rotate(var(--wr, 0deg)) scale(1.1); opacity: 1; }
  20%  { transform: translate(-50%, -50%) rotate(var(--wr, 0deg)) scale(1); }
  78%  { opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(var(--wr, 0deg)) scale(.94) translateY(-12px); opacity: 0; }
}

/* ============================================================
   ③ 藏书：六面漂浮皮书（烫金压凹 + 做旧书口，可拖拽带回弹）
   ============================================================ */
.fb-stage {
  position: relative;
  height: 318px;
  perspective: 1000px;
  touch-action: pan-y;
  cursor: grab;
}
.fb-stage:active { cursor: grabbing; }
.fb-float {
  position: absolute; left: 50%; top: 42%;
  width: 0; height: 0;
  animation: fb-bob 5.2s ease-in-out infinite;
}
@keyframes fb-bob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50%      { transform: translateY(-14px) rotate(1.2deg); }
}
.fb-book {
  position: absolute;
  left: -78px; top: -104px;
  width: 156px; height: 208px;
  transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(-16deg);
  transition: transform .55s cubic-bezier(.2, 1.35, .32, 1); /* 松手过冲回弹 */
}
.fb-book.dragging { transition: none; }
.fb-face { position: absolute; }

/* 封面 */
.fb-front {
  inset: 0;
  transform: translateZ(13px);
  border-radius: 4px 10px 10px 4px;
  background:
    var(--paper-noise),
    radial-gradient(120% 90% at 50% 0%, rgba(255, 220, 190, .10), transparent 55%),
    linear-gradient(140deg, #7C4434 0%, #63352A 45%, #46231C 100%);
  box-shadow:
    inset 0 0 0 1px rgba(232, 200, 106, .22),
    inset 6px 0 14px rgba(0, 0, 0, .28),
    inset -3px -3px 10px rgba(0, 0, 0, .30),
    inset 0 -18px 26px rgba(0, 0, 0, .22);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 18px 14px;
  text-align: center;
}
/* 封底 */
.fb-backc {
  inset: 0;
  transform: translateZ(-13px) rotateY(180deg);
  border-radius: 10px 4px 4px 10px;
  background:
    var(--paper-noise),
    linear-gradient(220deg, #5A2E24, #3A1C15);
  box-shadow: inset 0 0 0 1px rgba(232, 200, 106, .12);
}
/* 书脊 */
.fb-spine {
  left: 0; top: 0; bottom: 0;
  width: 26px;
  transform: rotateY(-90deg) translateZ(13px);
  background: linear-gradient(90deg, #552A20, #3A1C15 70%);
  border-radius: 4px 0 0 4px;
  display: flex; flex-direction: column;
  justify-content: space-around;
  padding: 22% 0;
}
.fb-spine i {
  height: 3px; margin: 0 5px;
  background: linear-gradient(90deg, #D4AF37, #A8862F);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .5);
}
/* 三个书口（做旧纸边） */
.fb-edge-r, .fb-edge-t, .fb-edge-b {
  background:
    radial-gradient(60% 40% at 60% 40%, rgba(160, 130, 80, .30), transparent 70%),
    repeating-linear-gradient(90deg, #F0E5CB 0 2px, #D3C5A2 2px 3px);
}
.fb-edge-r {
  right: 0; top: 0; bottom: 0;
  width: 26px;
  transform: rotateY(90deg) translateZ(13px);
  border-radius: 0 3px 3px 0;
}
.fb-edge-t {
  left: 0; right: 0; top: 0;
  height: 26px;
  transform: rotateX(90deg) translateZ(13px);
  background:
    radial-gradient(50% 60% at 50% 30%, rgba(160, 130, 80, .35), transparent 70%),
    repeating-linear-gradient(0deg, #F0E5CB 0 2px, #D3C5A2 2px 3px);
}
.fb-edge-b {
  left: 0; right: 0; bottom: 0;
  height: 26px;
  transform: rotateX(-90deg) translateZ(13px);
  background:
    radial-gradient(50% 60% at 50% 70%, rgba(120, 95, 60, .35), transparent 70%),
    repeating-linear-gradient(0deg, #EBDFC2 0 2px, #C9BA96 2px 3px);
}
/* 烫金（压凹感） */
.fb-ornament {
  width: 62%; height: 8px;
  border-top: 1.5px solid rgba(232, 200, 106, .75);
  border-bottom: 1px solid rgba(232, 200, 106, .4);
}
.fb-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 20px; line-height: 1.4;
  letter-spacing: 1px;
  color: #D4AF37;
  background: linear-gradient(180deg, #F3DC9A 0%, #D4AF37 55%, #A8862F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 -1px 1px rgba(0, 0, 0, .65);
  filter: drop-shadow(0 1px 0 rgba(255, 230, 160, .18));
}
.fb-author {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 15px; letter-spacing: 2px;
  color: #C39B30;
  background: linear-gradient(180deg, #EFD58E, #C39B30);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 -1px 1px rgba(0, 0, 0, .5);
}
.fb-shadow {
  position: absolute;
  left: 50%; top: 84%;
  width: 150px; height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(74, 66, 56, .3), transparent 65%);
  filter: blur(3px);
  animation: fb-sh 5.2s ease-in-out infinite;
}
@keyframes fb-sh {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .85; }
  50%      { transform: translateX(-50%) scale(.8); opacity: .5; }
}

/* ============================================================
   ④ 追番：CRT 电子宠物电视（完整机身+后背，自由旋转看背面）
   ============================================================ */
.tv-stage {
  position: relative;
  height: 302px;
  perspective: 1100px;
  touch-action: pan-y;
  cursor: grab;
}
.tv-stage:active { cursor: grabbing; }
.tv-set {
  position: absolute; left: 50%; top: 44%;
  width: 232px; height: 168px;
  transform: translate(-50%, -50%) rotateX(4deg) rotateY(-12deg);
  transform-style: preserve-3d;
  animation: tv-bob 6s ease-in-out infinite;
}
.tv-set.dragging { transition: none; animation-play-state: paused; }
/* 用 margin 做悬浮（不占用 transform，留给自由旋转） */
@keyframes tv-bob {
  0%, 100% { margin-top: 0; }
  50%      { margin-top: -7px; }
}
/* 地面投影（悬浮感） */
.tv-stage::after {
  content: '';
  position: absolute;
  left: 50%; top: 87%;
  width: 190px; height: 20px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(74, 66, 56, .24), transparent 65%);
  filter: blur(3px);
  animation: tv-sh 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes tv-sh {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .8; }
  50%      { transform: translateX(-50%) scale(.86); opacity: .52; }
}

/* 前面板 */
.tv-body {
  position: absolute; inset: 0;
  transform: translateZ(2px);
  background: linear-gradient(160deg, #EFE3C8, #D9C39A);
  border-radius: 16px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .5),
    inset 0 -3px 6px rgba(74, 66, 56, .15),
    0 14px 26px rgba(74, 66, 56, .25);
  display: flex;
  padding: 15px 14px;
  gap: 11px;
}
/* 两侧 */
.tv-side {
  position: absolute; top: 0;
  width: 104px; height: 168px;
  background: linear-gradient(90deg, #D9C39A, #96805C);
}
.tv-side-l {
  left: -52px;
  transform: rotateY(-90deg);
  transform-origin: right center;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(270deg, #D9C39A, #8A7350);
}
.tv-side-r {
  right: -52px;
  transform: rotateY(90deg);
  transform-origin: left center;
  border-radius: 0 10px 10px 0;
}
/* 侧面散热孔 */
.tv-side::after {
  content: '';
  position: absolute; inset: 30px 18px;
  background: repeating-linear-gradient(0deg, transparent 0 8px, rgba(74, 66, 56, .30) 8px 10px);
  border-radius: 4px;
}
/* 顶面 */
.tv-top {
  position: absolute; left: 0; top: -52px;
  width: 232px; height: 104px;
  transform: rotateX(90deg);
  transform-origin: center bottom;
  background: linear-gradient(180deg, #EFE3C8, #C9B28A);
  border-radius: 10px 10px 0 0;
}
/* 大屁股后背（CRT 梯形收束 + 散热 + 电源线） */
.tv-back {
  position: absolute;
  left: 18px; top: 10px;
  width: 196px; height: 148px;
  transform: translateZ(-100px) rotateY(180deg);
  background: linear-gradient(160deg, #C4AC82, #96805C);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(74, 66, 56, .15);
}
.tv-back::after {
  content: '';
  position: absolute; inset: 22px 26px;
  background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(74, 66, 56, .35) 6px 8px);
  border-radius: 6px;
}
.tv-cord {
  position: absolute;
  left: 34px; bottom: -12px;
  width: 42px; height: 26px;
  border: 3px solid #5A5148;
  border-top: none; border-right: none;
  border-radius: 0 0 0 18px;
  transform: translateZ(-96px);
}
/* 天线 */
.tv-antenna {
  position: absolute;
  left: 50%; top: -44px;
  width: 2.5px; height: 46px;
  background: #8B8172;
  transform: translateZ(2px) rotate(-18deg);
  transform-origin: bottom center;
}
.tv-antenna::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 2.5px; height: 40px;
  background: #8B8172;
  transform: rotate(40deg);
  transform-origin: bottom center;
}
.tv-antenna::before {
  content: '';
  position: absolute;
  top: -5px; left: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #8B8172;
}
/* CRT 屏幕（曲面 + 辉光 + 色散） */
.tv-screen {
  position: relative;
  flex: 1;
  background: radial-gradient(circle at 50% 42%, #3A3A46, #22222B 78%);
  border-radius: 12px / 16px;
  border: 3px solid #4A4238;
  overflow: hidden;
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, .6),
    0 0 18px rgba(157, 176, 192, .25);
  animation: tv-flick 3.7s steps(2) infinite;
  transition: background .5s;
}
.tv-screen.ch-play { background: radial-gradient(circle at 50% 42%, #443A46, #2A2230 78%); }
.tv-screen.ch-night { background: radial-gradient(circle at 50% 42%, #26262E, #16161C 78%); }
@keyframes tv-flick {
  0%, 100% { filter: brightness(1); }
  29% { filter: brightness(1); }
  30% { filter: brightness(1.13); }
  31% { filter: brightness(.93); }
  32% { filter: brightness(1.04); }
  77% { filter: brightness(1); }
  78% { filter: brightness(1.15); }
  79% { filter: brightness(.96); }
  80% { filter: brightness(1); }
}
/* 曲面玻璃反光 */
.tv-glass {
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 70% 45% at 32% 18%, rgba(255, 255, 255, .13), transparent 60%),
    radial-gradient(ellipse 130% 110% at 50% 55%, transparent 62%, rgba(0, 0, 0, .38) 100%);
  pointer-events: none;
}
/* 电子宠物（JS 注入像素帧） */
.tv-pet {
  position: absolute;
  left: 50%; bottom: 12%;
  width: 72px;
  transform: translateX(-50%);
  filter:
    drop-shadow(1px 0 0 rgba(255, 70, 70, .30))
    drop-shadow(-1px 0 0 rgba(80, 190, 255, .30));
}
.tv-pet svg { display: block; width: 100%; shape-rendering: crispEdges; }
.tv-pet.walking { animation: tv-petwalk 6s ease-in-out infinite alternate; }
@keyframes tv-petwalk {
  from { transform: translateX(-92%); }
  to   { transform: translateX(-8%); }
}
.tv-pet .pz { animation: tv-z 2.2s ease-in-out infinite; transform-origin: center; }
@keyframes tv-z {
  0%   { opacity: 0; transform: translateY(2px) scale(.8); }
  35%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-5px) scale(1.1); }
}
/* 扫描线 + 移动亮带 */
.tv-scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.tv-scan::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -30%;
  height: 26%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .07), transparent);
  animation: tv-band 4.8s linear infinite;
}
@keyframes tv-band { to { top: 110%; } }
/* 面板：旋钮（可点换台）+ 喇叭 */
.tv-panel {
  width: 42px;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  padding-top: 4px;
}
.tv-knob {
  width: 21px; height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F2E6CC, #B49A72);
  border: 2px solid #6B5B43;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .3);
  position: relative;
  cursor: pointer;
  transition: transform .25s ease;
}
.tv-knob:hover { transform: rotate(38deg); }
.tv-knob::after {
  content: '';
  position: absolute;
  left: 50%; top: 2px;
  width: 2px; height: 7px;
  background: #6B5B43;
  transform: translateX(-50%) rotate(24deg);
  transform-origin: bottom center;
}
.tv-knob-static { pointer-events: none; }
.tv-speaker { display: flex; gap: 4px; margin-top: 6px; }
.tv-speaker i {
  width: 4px; height: 36px;
  border-radius: 2px;
  background: rgba(74, 66, 56, .32);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}
.tv-legs { display: flex; justify-content: space-between; padding: 0 30px; }
.tv-legs i {
  width: 10px; height: 15px;
  background: linear-gradient(180deg, #B49A72, #8A6F4E);
  border-radius: 0 0 4px 4px;
}
.tv-legs i:first-child { transform: skewX(-9deg); }
.tv-legs i:last-child { transform: skewX(9deg); }

/* ============================================================
   响应式与动效减弱
   ============================================================ */
@media (max-width: 760px) {
  .m-desc {
    display: block;
    text-align: center;
    font-size: 18px;
    color: var(--ink-2);
    margin-top: 4px;
  }
  .cp-stage { height: 262px; }
  .fb-stage { height: 292px; }
  .tv-stage { height: 268px; }
  .polaroid { margin-top: 18px; }
  .bd-title { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .polaroid, .cp-globe, .cp-globe::before, .cp-ring, .cp-ring::after, .cp-shadow, .cp-word,
  .fb-float, .fb-shadow,
  .tv-screen, .tv-scan::after, .tv-pet.walking, .tv-pet .pz,
  .st-sweep::after {
    animation: none !important;
  }
}
