/* =====================================================
   Hetty's Bubble World — layout + assigned pixel fonts
   标题字体：ZLabsRoundPix_16px_MD_CN.ttf
   正文字体：WenQuanYi Bitmap Song 12px.ttf
   注意：字体文件需由设计者放入 assets/fonts/，本包不内置字体文件。
   ===================================================== */
@font-face {
  font-family: "HettyTitlePixel";
  src: url("assets/fonts/ZLabsRoundPix_16px_MD_CN.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "HettyBodyPixel";
  src: url("assets/fonts/WenQuanYi Bitmap Song 12px.ttf") format("truetype");
  font-display: swap;
}
:root {
  --font-title: "HettyTitlePixel", "Microsoft YaHei", "SimSun", monospace;
  --font-body: "HettyBodyPixel", "Microsoft YaHei", "SimSun", monospace;
  --font-pixel: var(--font-body);
  --bg-cream: #fbfbf7;
  --ink: #1d2740;
  --ink-soft: #43536f;
  --line: #aeb9c9;
  --panel: rgba(255,255,255,.82);
  --panel-solid: #fbfcff;
  --glass: rgba(255,255,255,.46);
  --blue: #aee1ff;
  --purple: #d5c2ff;
  --pink: #ffc5f4;
  --green: #ddf3bd;
  --shadow-panel: 0 10px 30px rgba(55,74,110,.16);
  --safe-top: 34px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
}
body, button, input, textarea, select, a {
  font-family: var(--font-body) !important;
  font-weight: 400;
  letter-spacing: .025em;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  text-shadow: none !important;
}
h1, h2, h3, .world-title h1, .category-header h2, .message-wrap h2, .mac-titlebar strong, .music-info strong {
  font-family: var(--font-title) !important;
  font-weight: 400;
  letter-spacing: .035em;
  text-shadow: none !important;
}
body {
  background: var(--bg-cream);
  color: var(--ink);
  cursor: none;
}
button, a, .interactive-bubble, .pixel-bubble, .photo-window, .desktop-icon, .work-bubble, .message-bubble, .media-button { cursor: none; }
button { font: inherit; border: 0; }
img, video { max-width: 100%; height: auto; }
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 8px, 0);
  transition: opacity .55s ease, visibility .55s ease, transform .55s ease;
  will-change: opacity, transform;
  overflow: hidden;
}
.screen.active { opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(0, 0, 0); }

/* old Mac 基础组件 */
.mac-menu-bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--safe-top);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  padding: 0 24px;
  background: linear-gradient(#fff, #e3e7ed 60%, #f5f6f8);
  border-bottom: 1px solid #b7bec9;
  color: #141b2b;
  font-size: 14px;
  white-space: nowrap;
}
.menu-bubble-mark {
  width: 22px;
  height: 22px;
  border: 3px solid #8e7dff;
  border-top-color: transparent;
  border-radius: 45%;
  display: inline-block;
}
.mac-panel,
.mac-window {
  background: var(--panel);
  border: 1px solid rgba(154,170,194,.9);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(10px);
}
.mac-titlebar {
  height: 28px;
  display: grid;
  grid-template-columns: 66px 1fr 66px;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  background: linear-gradient(#f9fbff, #dfe4eb 58%, #f7f9fc);
  border-bottom: 1px solid #b6bfcc;
  color: #1a2438;
  font-size: 13px;
}
.mac-titlebar strong { justify-self: center; }
.mac-titlebar .dot,
.mac-titlebar .dot::before,
.mac-titlebar .dot::after {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #8d99ac;
  border-radius: 50%;
  background: #fbfdff;
  content: "";
}
.mac-titlebar .dot { position: relative; }
.mac-titlebar .dot::before { position: absolute; left: 18px; top: -2px; }
.mac-titlebar .dot::after { position: absolute; left: 36px; top: -2px; }
.mac-titlebar.mini { height: 26px; grid-template-columns: 62px 1fr 26px; }

/* 入口桌面：使用网格避免错位 */
.desktop-stage {
  position: absolute;
  inset: var(--safe-top) 0 0 0;
  display: grid;
  grid-template-columns: minmax(360px, 690px) minmax(160px, 240px);
  justify-content: center;
  align-content: center;
  gap: clamp(36px, 7vw, 92px);
  padding: clamp(32px, 5vh, 48px) clamp(24px, 4vw, 48px) clamp(96px, 12vh, 128px);
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 10%, rgba(206,235,255,.28), transparent 20%),
    radial-gradient(circle at 24% 78%, rgba(222,211,255,.28), transparent 22%),
    linear-gradient(90deg, #fff 0%, #fbfdfb 48%, #f6fbff 100%);
}
.desktop-window {
  position: relative;
  z-index: 12;
  width: 100%;
  max-width: 690px;
  min-width: 0;
  min-height: 510px;
  border-radius: 10px;
  overflow: hidden;
  align-self: center;
}
.toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 92px;
  border-bottom: 1px solid #cbd3de;
  background: rgba(255,255,255,.46);
}
.toolbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #655bb0;
  background: transparent;
  border-right: 1px solid #d4dbe5;
  font-size: 26px;
  min-width: 0;
  overflow: hidden;
}
.toolbar button small { color: var(--ink-soft); font-size: 12px; }
.desktop-files {
  min-height: 386px;
  background:
    linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.12)),
    repeating-linear-gradient(0deg, rgba(190,204,226,.16) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(190,204,226,.12) 0 1px, transparent 1px 24px);
  padding: 34px;
}
.file-tile {
  min-width: 0;
  text-align: center;
  color: #25304a;
  font-size: 12px;
}
.file-thumb {
  width: 82px;
  height: 82px;
  margin: 0 auto 10px;
  display: block;
  object-fit: cover;
  border: 2px solid #e4e9f5;
  background:
    linear-gradient(135deg, rgba(198,215,255,.8), rgba(255,255,255,.8)),
    repeating-linear-gradient(0deg, rgba(136,154,190,.18) 0 2px, transparent 2px 6px);
}
.file-tile.empty .file-thumb,
.file-thumb:empty {
  clip-path: polygon(0 0, 74% 0, 100% 24%, 100% 100%, 0 100%);
  background:
    linear-gradient(135deg, #fff 0 68%, #dfe8ff 69% 100%),
    repeating-linear-gradient(0deg, #f7f9ff 0 4px, #eef3ff 4px 8px);
}
.desktop-icons {
  position: relative;
  z-index: 12;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, 112px);
  gap: 46px 34px;
  justify-content: center;
}
.desktop-icon {
  display: grid;
  place-items: center;
  gap: 9px;
  background: transparent;
  color: #1f2c44;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.desktop-icon span { width: 72px; height: 64px; display: block; filter: drop-shadow(4px 6px 0 rgba(46,61,91,.15)); }
.icon-drive { border-radius: 8px; border: 3px solid #8c96a4; background: radial-gradient(circle at 50% 45%, #d8dde5 0 24%, transparent 25%), linear-gradient(#f1f4f7,#9fa9b8); }
.icon-folder { border: 3px solid #9ebc70; border-radius: 8px; background: linear-gradient(#dfff90,#bfe36d); position: relative; }
.icon-folder::before { content:""; position:absolute; top:-14px; left:7px; width:38px; height:18px; border:3px solid #9ebc70; border-bottom:0; border-radius:7px 7px 0 0; background:#dfff90; }
.icon-folder.message::after { content:""; position:absolute; inset:15px 10px; border:2px solid rgba(110,135,160,.5); transform: skewY(-10deg); }
.icon-camera { border-radius: 18px 18px 10px 10px; background: radial-gradient(circle at 53% 48%, #697ac5 0 18%, #151b34 20% 24%, transparent 25%), linear-gradient(135deg,#e5e7ff,#8b9be5); border: 3px solid #9ca5c7; }
.entry-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  min-height: clamp(140px, 18vh, 160px);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 90;
  background: rgba(255,255,255,.88);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.2s ease, visibility 1.2s ease;
}
.entry-dialog.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.entry-dialog p { margin: 0; color: #1d2740; font-size: clamp(17px, 2vw, 24px); text-align: center; }
.dialog-actions { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.pixel-button,
.nav-button {
  background: rgba(255,255,255,.84);
  color: #1d2740;
  border: 2px solid rgba(110,130,170,.85);
  border-radius: 0;
  padding: 10px 18px;
  box-shadow: 3px 3px 0 rgba(82,92,128,.22);
  transition: transform .16s ease, background .16s ease;
}
.pixel-button.primary { background: #dff3ff; }
.pixel-button.small { padding: 7px 10px; font-size: 12px; }
.pixel-button:hover,
.nav-button:hover,
.interactive-bubble:hover,
.work-bubble:hover,
.message-bubble:hover {
  transform: translate(-1px, -1px);
  background: #f8fcff;
}
.entry-dialog.shake { animation: shake .36s ease; }
@keyframes shake { 20%,60%{ transform: translate(-52%,-50%);} 40%,80%{ transform: translate(-48%,-50%);} }

/* 全局返回按钮 */
.global-nav {
  position: fixed;
  top: 48px;
  left: 18px;
  z-index: 120;
  display: flex;
  gap: 8px;
  max-width: calc(100vw - 360px);
  flex-wrap: wrap;
}
.nav-button { font-size: 12px; padding: 8px 11px; background: rgba(255,255,255,.86); }

/* 音乐播放器 */
.music-player {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 304px;
  max-width: calc(100vw - 24px);
  border-radius: 0;
  overflow: hidden;
  z-index: 115;
  background: rgba(250,252,255,.88);
}
.music-body { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 14px; padding: 14px; align-items: center; }
.cd-disc {
  width: 78px; height: 78px; border-radius: 50%; border: 2px solid #9aa8bd;
  background:
    radial-gradient(circle, #fff 0 8%, #90a1b9 9% 11%, transparent 12%),
    conic-gradient(from 10deg, #fff4aa, #ffb4ef, #c5f0ff, #e2d5ff, #fff4aa);
}
.cd-disc.is-playing { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.music-info span { display: block; font-size: 11px; color: var(--ink-soft); }
.music-info strong { display: block; font-size: 18px; color: #1d2740; margin: 3px 0 10px; line-height: 1.2; }
.music-controls { display: flex; gap: 6px; flex-wrap: wrap; }

/* 泡泡 */
.decor-bubble, .floating-bubble, .interactive-bubble, .pixel-bubble, .work-bubble, .message-bubble, .bubble-cursor, .bubble-click-ripple {
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,.95) 0 7%, transparent 13%),
    radial-gradient(circle at 72% 76%, rgba(255,198,244,.42), transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(185,226,255,.18), rgba(255,255,255,.03) 68%);
  border: 1.5px solid rgba(207,238,255,.82);
  box-shadow: inset 0 0 18px rgba(255,255,255,.68), 0 0 18px rgba(173,218,255,.35);
  backdrop-filter: blur(2px);
}
.decor-bubble { position: absolute; pointer-events: none; opacity: .55; animation: floatSoft 10s ease-in-out infinite; z-index: 1; }
.decor-bubble.d1 { width: 120px; height: 120px; right: 25%; top: 8%; }
.decor-bubble.d2 { width: 70px; height: 70px; right: 39%; top: 20%; animation-delay: -3s; }
.decor-bubble.d3 { width: 150px; height: 150px; left: 15%; bottom: 7%; animation-delay: -6s; }
@keyframes floatSoft { 0%,100%{ transform: translate3d(0,0,0);} 50%{ transform: translate3d(12px,-22px,0);} }
.interactive-bubble, .pixel-bubble, .work-bubble, .message-bubble {
  position: relative;
  display: grid;
  place-items: center;
  color: #19284a;
  text-align: center;
  font-weight: 800;
  border: 2px solid rgba(255,255,255,.98);
  outline: 2px dashed rgba(88,106,172,.85);
  outline-offset: 3px;
  background-color: rgba(232,246,255,.45);
  overflow-wrap: anywhere;
}
.interactive-bubble::after,
.pixel-bubble::after,
.work-bubble::after,
.message-bubble::after {
  content: "点击进入";
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  font-size: 10px;
  color: #15223f;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(100,120,170,.42);
  padding: 2px 5px;
}
.interactive-bubble:hover::after,
.pixel-bubble:hover::after,
.work-bubble:hover::after,
.message-bubble:hover::after { opacity: 1; }

/* 加载转场 */
#loading-screen { background: #fbfbf7; }
.loading-sea-layer, .photo-sea-layer, .world-bg {
  position: absolute; inset: 0;
  background-image: url("assets/images/bubble-ocean-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.loading-sea-layer { opacity: var(--sea-opacity, 0); transition: opacity .28s linear; filter: saturate(1.08) brightness(1.04); }
.loading-desktop-ghost {
  position: absolute; inset: var(--safe-top) 0 0 0;
  opacity: var(--desktop-opacity, 1);
  transition: opacity .28s linear;
  background: linear-gradient(rgba(251,251,247,.78), rgba(251,251,247,.34)), linear-gradient(#fbfbf7, #eef7ff);
}
.loading-desktop-ghost::before {
  content: "Hetty";
  position: absolute;
  left: 7%; top: 16%;
  width: min(560px, 46vw); height: 42vh;
  border: 1px solid #b9c2cf;
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  box-shadow: var(--shadow-panel);
  text-align: center;
  padding-top: 10px;
}
.loading-bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.floating-bubble { position: absolute; bottom: -120px; opacity: .68; animation: riseBubble var(--duration, 8s) linear forwards; z-index: 1; }
@keyframes riseBubble { to { transform: translate3d(var(--drift, 0px), -115vh, 0); opacity: .08; } }
.loading-card {
  position: absolute; z-index: 10; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, 84vw);
  border-radius: 0;
  padding: 12px 16px;
  text-align: center;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(170,187,214,.62);
  box-shadow: 4px 4px 0 rgba(82,92,128,.08);
  backdrop-filter: blur(8px);
}
.loading-card p { margin: 0 0 9px; font-size: 13px; color: #1d2740; }
.progress-shell { height: 9px; border: 1px solid rgba(126,146,184,.7); border-radius: 0; overflow: hidden; background: rgba(255,255,255,.42); }
#progress-bar { display:block; height: 100%; width: 0%; background: linear-gradient(90deg,#bda3ff,#aee4ff,#d8ffed); transition: width .16s linear; }

/* 照片页 */
.photo-sea-layer { opacity: .88; filter: brightness(1.08) saturate(.98); }
.photo-hint {
  position: absolute; left: 50%; top: 8%; transform: translateX(-50%); z-index: 4;
  width: min(520px, 86vw);
  border-radius: 0;
  padding: 10px 14px;
  text-align: center;
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(170,187,214,.62);
  box-shadow: 4px 4px 0 rgba(82,92,128,.08);
  backdrop-filter: blur(8px);
}
.photo-hint p { margin: 0 0 5px; font-size: 13px; color: #1d2740; }
.photo-hint span { color: #4c4c9a; font-size: 12px; }
.photo-window-area { position: relative; z-index: 3; width: 100%; height: 100%; }
.photo-window {
  position: absolute;
  width: 210px;
  min-height: 248px;
  background: rgba(255,255,255,.84);
  border: 1px solid #aab5c5;
  box-shadow: var(--shadow-panel);
  border-radius: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(140px) scale(.92);
  transition: transform .7s ease, opacity .7s ease, filter .3s ease;
}
.photo-window.rise-in { opacity: 1; transform: translateY(0) rotate(var(--rot, 0deg)); }
.photo-window:hover { filter: drop-shadow(0 0 12px rgba(190,230,255,.8)); }
.photo-window .mac-titlebar { height: 24px; grid-template-columns: 55px 1fr 16px; font-size: 10px; }
.photo-window img { width: calc(100% - 20px); height: 164px; object-fit: cover; display:block; margin: 11px auto 8px; border: 2px solid rgba(225,232,244,.9); }
.photo-window p { margin: 0 10px 13px; text-align:center; color: #1d2740; font-size: 13px; }
.photo-window.collected { pointer-events:none; animation: photoPop .75s ease forwards; }
@keyframes photoPop { 55%{ transform: scale(1.06) rotate(0deg); border-radius: 40%; } 100%{ opacity: 0; transform: scale(.2) translateY(-90px); border-radius: 50%; } }
.photo-memory-bubble { position: fixed; z-index: 130; border-radius: 50%; background-size: cover; background-position: center; border: 2px solid rgba(226,244,255,.92); box-shadow: inset 0 0 20px rgba(255,255,255,.72), 0 0 22px rgba(190,230,255,.72); animation: memoryRise 1.8s ease-out forwards; overflow: hidden; }
.photo-memory-bubble::after { content:""; position:absolute; inset:0; border-radius:inherit; background: radial-gradient(circle at 28% 20%, rgba(255,255,255,.85) 0 8%, transparent 14%), radial-gradient(circle at 72% 78%, rgba(255,192,244,.35), transparent 34%); }
@keyframes memoryRise { to { transform: translateY(-42vh) scale(.85); opacity: 0; } }

/* 泡泡世界 */
.world-bg { opacity: 1; }
.world-bg::after { content:""; position:absolute; inset:0; background: linear-gradient(rgba(112,170,230,.04), rgba(113,140,224,.10)); }
.world-bg.soft::after { background: rgba(222,238,255,.16); }
.world-decor-bubbles { position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:1; }
.world-decor-bubbles .decor-bubble { animation: floatWorld 12s ease-in-out infinite, driftWorld var(--drift-duration, 18s) linear infinite; opacity: var(--bubble-opacity, .55); }
body.photo-wall-mode .world-decor-bubbles .decor-bubble:nth-child(n+37) { display:none; }
body.photo-wall-mode .world-decor-bubbles .decor-bubble { animation-duration: 18s, 28s; filter:none !important; }
@keyframes driftWorld { 0% { transform: translate3d(0, 105vh, 0) scale(.9); } 100% { transform: translate3d(var(--drift-x, 18px), -30vh, 0) scale(1.08); } }
@keyframes floatWorld { 0%,100%{ filter: blur(var(--bubble-blur, 0px)); } 50%{ filter: blur(calc(var(--bubble-blur, 0px) + .35px)); } }
.world-title {
  position:absolute;
  left:50%; top:7%; transform:translateX(-50%);
  text-align:center;
  z-index:5;
  color:#172544;
  width:min(900px,92vw);
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.58);
  padding: 12px 18px;
}
.world-title .tiny-file { display:block; font-size:11px; color:#38506f; }
.world-title h1 { margin: 6px 0 10px; font-size: clamp(27px, 5vw, 58px); color:#15213e; line-height: 1.12; }
.world-title p { margin:0; font-size: clamp(12px, 1.4vw, 15px); color:#21304d; }
.bubble-category-area {
  position:absolute;
  inset: 27% clamp(260px, 24vw, 350px) 10% 5%;
  z-index:18;
}
.bubble-world-tip {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  z-index: 18;
  margin: 0;
  padding: 8px 14px;
  color: #1f2d47;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(139,160,196,.52);
  font-size: 13px;
  text-align: center;
}
.pixel-bubble {
  position:absolute;
  width: clamp(108px, 11vw, 160px);
  height: clamp(108px, 11vw, 160px);
  font-size: clamp(13px, 1.35vw, 17px);
  animation: floatSoft 6s ease-in-out infinite;
}
.pixel-bubble .bubble-label { padding: 0 12px; line-height: 1.35; max-width: 100%; }

/* 分区 / 作品 / 留言 */
.category-wrap,
.message-wrap {
  position:absolute;
  z-index:18;
  left:50%; top:54%; transform:translate(-50%,-50%);
  width:min(980px, calc(100vw - 32px));
  max-height:min(78vh, calc(100dvh - 116px));
  overflow:auto;
  border-radius: 0;
  padding: 26px;
  background:rgba(255,255,255,.84);
  will-change: opacity, transform;
}
.category-header h2,
.message-wrap h2 { margin:0 0 8px; color:#1d2740; font-size: clamp(24px, 3.6vw, 42px); }
.category-header p,
.message-wrap p { margin:0 0 20px; color:#25324b; }
.category-header p:empty { display:none; }
.profile-card {
  display:grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 24px;
  align-items:start;
  background: rgba(255,255,255,.56);
  border:1px solid rgba(150,170,200,.56);
  border-radius:0;
  padding:22px;
}
.profile-avatar { width:118px; height:118px; border-radius:50%; background:url("assets/images/photo4.jpg") center/cover; border:2px solid rgba(255,255,255,.95); }
.profile-card h3 { margin:0 0 10px; font-size: 26px; line-height: 1.25; }
.profile-card p { margin: 8px 0; color:#1f2d47; line-height:1.65; }
.keywords { display:flex; flex-wrap:wrap; gap:9px; margin:14px 0; }
.keywords span { border:1px solid #8da0cc; background:rgba(246,251,255,.82); padding:6px 9px; border-radius:999px; font-size:12px; line-height:1.2; }
.profile-contacts { display:grid; gap:4px; margin-top:12px; }
.section-intro { margin: 0 0 14px; color:#243654; line-height:1.7; }
.action-hint {
  margin: 0 0 20px;
  color:#2d4163;
  font-size: 13px;
  line-height:1.6;
  text-align:center;
  background: rgba(255,255,255,.48);
  border:1px solid rgba(150,170,200,.42);
  padding:7px 10px;
}
.work-bubble-area,
.message-bubble-area {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 34px 28px;
  align-items:center;
  padding: 18px 0 10px;
}
.work-bubble,
.message-bubble {
  width: 132px; height: 132px;
  justify-self:center;
  padding: 16px;
  font-size: 13px;
  line-height: 1.35;
}
.work-bubble small { display:block; margin-top:6px; font-size:10px; color:#2e4165; }
.subcategory-bubble { background-color: rgba(245,250,255,.68); }
.subcategory-area { margin-top: 8px; }
.fanedit-panel {
  display:grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.fanedit-list {
  display:grid;
  gap: 10px;
  align-content:start;
}
.fanedit-entry {
  text-align:left;
  padding: 12px;
  color:#1d2740;
  background: rgba(255,255,255,.66);
  border:1px solid rgba(139,160,196,.62);
}
.fanedit-entry span { display:block; font-size:14px; margin-bottom:5px; }
.fanedit-entry small { color:#3a4d6e; font-size:11px; }
.fanedit-entry.active { background:#e9f7ff; outline:2px solid rgba(142,162,214,.45); }
.fanedit-player {
  min-width:0;
  padding: 12px;
  background: rgba(255,255,255,.62);
  border:1px solid rgba(139,160,196,.52);
}
.fanedit-player video { width:100%; max-width:100%; max-height:52vh; display:block; background:#10172b; object-fit:contain; }
.fanedit-player p { margin:10px 0 0; color:#25324b; font-size:13px; }
.photo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  contain: layout paint;
}
.photo-wall-item {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  color: #1d2740;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(139,160,196,.52);
  text-align: center;
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  animation: photoTileIn .42s ease forwards;
  animation-delay: var(--stagger, 0ms);
  will-change: opacity, transform;
}
.photo-thumb-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(238,246,255,.9), rgba(255,255,255,.72)),
    repeating-linear-gradient(45deg, rgba(160,180,210,.14) 0 7px, transparent 7px 14px);
  border: 1px solid rgba(170,187,214,.5);
}
.photo-wall-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .25s ease;
  transform: translate3d(0,0,0);
}
.photo-wall-item.loaded img { opacity: 1; }
.photo-wall-label { font-size: 13px; color:#182642; }
.photo-wall-item.missing-photo::before {
  content: "照片待补充";
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(45deg, #eef6ff 0 8px, #f9fcff 8px 16px);
  border: 1px dashed #9eb1cf;
  color: #304667;
}
@keyframes photoTileIn {
  to { opacity: 1; transform: translate3d(0,0,0); }
}
.empty-state { padding: 26px; text-align:center; color:#263552; background:rgba(255,255,255,.7); border:1px solid rgba(130,150,180,.4); }
textarea#message-input {
  width:100%; min-height: 130px;
  resize: vertical;
  border:2px solid #99a9ca;
  background:rgba(255,255,255,.9);
  color:#1d2740;
  padding:12px;
  border-radius:0;
  font-size:14px;
}
.message-actions { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:12px 0 10px; }
#message-tip { color:#324a70; font-size:12px; }
.message-bubble.new { animation: newBubble .9s ease; }
@keyframes newBubble { 0%{ transform: translateY(20px) scale(.75); opacity:0; } 100%{ transform: translateY(0) scale(1); opacity:1; } }

/* 弹窗 / 媒体 */
.modal-root {
  position:fixed; inset:0;
  z-index:140;
  display:grid;
  place-items:center;
  background:rgba(20,30,55,.32);
  padding: clamp(12px, 3vw, 22px);
  overflow: hidden;
}
.modal-card {
  width:min(720px, calc(100vw - 28px));
  max-height:min(80vh, calc(100dvh - 28px));
  overflow:auto;
  background:rgba(255,255,255,.94);
  border:2px solid rgba(130,150,190,.75);
  box-shadow: 0 18px 48px rgba(25,35,70,.24);
  padding:clamp(16px, 3vw, 24px);
  color:#1d2740;
}
.modal-card h3 { margin:0 0 12px; font-size:25px; }
.modal-card p { line-height:1.75; overflow-wrap:anywhere; }
.modal-card video { width:100%; max-width:100%; max-height:54vh; object-fit:contain; background:#10172b; }
.modal-meta { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.modal-meta span { padding:4px 8px; border:1px solid #95a5c2; background:#f3f8ff; font-size:11px; }
.modal-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }
.modal-side-hint {
  align-self:center;
  color:#334767;
  font-size:12px;
  line-height:1.6;
  padding: 4px 2px;
  text-shadow:none !important;
}
.media-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(140px, 100%),1fr)); gap:10px; margin-top:14px; }
.media-button { padding:0; border:2px solid #c5cede; background:#fff; }
.media-button img { width:100%; height:150px; object-fit:cover; display:block; }
.media-button.missing-media {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: #304667;
  background: repeating-linear-gradient(45deg, #eef6ff 0 8px, #f9fcff 8px 16px);
}
.video-cover { width:100%; min-height:clamp(180px, 34vh, 260px); margin-top:14px; color:#fff; font-size:18px; background-size:cover; background-position:center; border:0; }
.lightbox-img { max-width:min(88vw,1000px); max-height:min(74vh, calc(100dvh - 130px)); display:block; border:3px solid #fff; background:#fff; object-fit:contain; }
.audio-work { margin-top: 14px; padding: 14px; background: rgba(244,249,255,.8); border: 1px solid rgba(139,160,196,.52); }
.audio-work audio { width: 100%; }
.asset-fallback { color:#405675; font-size:12px; line-height:1.6; }
.script-quote {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 4px solid #9bb8ff;
  background: rgba(247,251,255,.86);
  color:#1f2d47;
}
.novel-card { width:min(900px, calc(100vw - 28px)); max-height:min(80vh, calc(100dvh - 28px)); }
.novel-reader {
  max-height: min(54vh, calc(80vh - 190px));
  height: min(54vh, 520px);
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.8;
  padding: 16px;
  border: 1px solid rgba(139,160,196,.58);
  background: rgba(255,255,255,.86);
  color:#1b2942;
}
.novel-controls { position: sticky; bottom: 0; padding-top: 10px; background: rgba(255,255,255,.9); }
.photo-lightbox-card { width:min(1000px, calc(100vw - 28px)); }
.photo-lightbox-card .lightbox-img { margin:auto; }

/* 泡泡鼠标 */
.bubble-cursor {
  position: fixed;
  left: 0; top: 0;
  width: 28px; height: 28px;
  pointer-events: none;
  z-index: 99999;
  opacity: .9;
  transition: width .16s ease, height .16s ease, opacity .16s ease;
}
.bubble-cursor.is-hovering { width:42px; height:42px; }
.bubble-click-ripple {
  position: fixed;
  width: 18px; height: 18px;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  animation: bubbleRipple .6s ease-out forwards;
}
@keyframes bubbleRipple { to { width: 80px; height: 80px; opacity: 0; } }

/* 响应式 */
@media (max-width: 1180px) {
  .desktop-stage { grid-template-columns: minmax(340px, 640px) minmax(150px, 180px); gap: 34px; padding: 44px 30px 120px; }
  .desktop-icons { grid-template-columns: 100px; gap: 26px; }
  .bubble-category-area { inset: 29% clamp(220px, 24vw, 300px) 12% 4%; }
  .pixel-bubble { width: clamp(108px, 10.5vw, 118px); height: clamp(108px, 10.5vw, 118px); }
}
@media (max-width: 900px) {
  html, body { overflow-x: hidden; overflow-y: auto; }
  .screen { position: absolute; min-height: 100vh; min-height:100dvh; overflow: auto; overflow-x:hidden; }
  .desktop-stage { min-height: 100vh; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:22px; padding: 54px 14px 210px; overflow-x:hidden; }
  .desktop-window {
  position: relative;
  z-index: 12; width: min(92vw, 650px); max-width: 100%; min-height: auto; }
  .desktop-icons { grid-template-columns: repeat(4, 80px); gap: 14px; }
  .desktop-icon span { width: 55px; height: 50px; }
  .entry-dialog { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); order: initial; margin: 0; }
  .music-player { width: min(278px, calc(100vw - 24px)); right: 12px; bottom: 12px; }
  .global-nav { max-width: calc(100vw - 24px); top: 42px; left: 12px; }
  .photo-window-area { display:grid; grid-template-columns: repeat(2, minmax(150px, 210px)); gap: 16px; justify-content:center; align-content:start; padding: 190px 12px 160px; height:auto; min-height:100vh; }
  .photo-window { position:relative !important; left:auto !important; top:auto !important; width:100%; transform: translateY(80px) scale(.92); }
  .photo-window.rise-in { transform: translateY(0) rotate(0deg); }
  .bubble-category-area { position:relative; inset:auto; display:grid; grid-template-columns:repeat(2, minmax(116px, 150px)); gap:36px 30px; justify-content:center; padding: 220px 14px 190px; }
  .pixel-bubble { position:relative !important; left:auto !important; top:auto !important; width:132px; height:132px; }
  .bubble-world-tip { position: relative; left: auto; bottom: auto; transform: none; width: fit-content; max-width: calc(100vw - 32px); margin: -130px auto 150px; }
  .world-title { top: 58px; width: calc(100vw - 28px); }
  .category-wrap, .message-wrap { position:relative; left:auto; top:auto; transform:none; width:min(92vw, 880px); margin: 122px auto 210px; max-height:none; }
  .fanedit-panel { grid-template-columns: 1fr; }
  .fanedit-list { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .fanedit-player video { max-height: 46vh; }
  .modal-root { padding: 12px; align-items:center; }
  .modal-card { width: min(720px, calc(100vw - 24px)); max-height: min(80vh, calc(100dvh - 24px)); }
  .novel-card { max-height: min(80vh, calc(100dvh - 24px)); }
}
@media (max-width: 560px) {
  .mac-menu-bar { gap: 12px; padding:0 10px; font-size:11px; overflow:hidden; }
  .desktop-stage { width:100%; max-width:100vw; align-items:center; padding-left:12px; padding-right:12px; }
  .desktop-window { width:min(370px, calc(100vw - 24px)); max-width:100%; align-self:flex-start; }
  .desktop-files { grid-template-columns: repeat(2, minmax(0,1fr)); padding:18px 14px; gap:16px; }
  .toolbar { min-height: 84px; }
  .toolbar button { font-size:18px; padding: 0 2px; }
  .toolbar button small { font-size:10px; }
  .file-thumb { width: 70px; height: 70px; }
  .file-tile { font-size: 11px; overflow-wrap: anywhere; }
  .desktop-icons { grid-template-columns: repeat(2, 86px); }
  .entry-dialog { width: calc(100vw - 28px); min-height: 150px; padding: 12px; }
  .dialog-actions { gap: 12px; }
  .pixel-button { padding: 9px 12px; font-size:12px; }
  .nav-button { font-size:10px; padding:7px 8px; }
  .music-player { width: min(206px, calc(100vw - 20px)); left: 50%; right: auto; bottom: 10px; transform: translateX(-50%); }
  .music-body { grid-template-columns:48px minmax(0, 1fr); gap:7px; padding:8px; }
  .cd-disc { width:48px; height:48px; }
  .music-info strong { font-size:13px; overflow-wrap:anywhere; }
  .pixel-button.small { font-size:10px; padding:6px 7px; }
  .photo-hint { top: 86px; }
  .photo-window-area { grid-template-columns: minmax(170px, min(230px, calc(100vw - 28px))); padding: 210px 12px 180px; }
  .world-title h1 { font-size: 28px; }
  .world-title p { font-size: 11px; }
  .bubble-category-area { grid-template-columns: repeat(2, minmax(104px, 112px)); gap: 32px 18px; padding: 230px 10px 210px; }
  .bubble-world-tip { margin-top: -132px; font-size: 12px; }
  .pixel-bubble { width:108px; height:108px; font-size:11px; }
  .category-wrap, .message-wrap { width: calc(100vw - 24px); padding:16px; margin-top: 132px; margin-bottom: 220px; }
  .profile-card { grid-template-columns:1fr; text-align:center; }
  .profile-avatar { margin:auto; }
  .work-bubble-area, .message-bubble-area { grid-template-columns: repeat(2, minmax(104px, 1fr)); gap:24px 16px; }
  .work-bubble, .message-bubble { width:108px; height:108px; font-size:11px; }
  .photo-wall { grid-template-columns: 1fr; }
  .novel-reader { height: min(44vh, 360px); max-height: min(44vh, calc(80vh - 190px)); padding:12px; }
  .profile-card { padding:16px; }
  .action-hint { font-size:12px; margin-bottom:16px; }
  .fanedit-list { grid-template-columns: 1fr; }
  .modal-card h3 { font-size:20px; line-height:1.35; }
  .modal-meta span { font-size:10px; line-height:1.5; }
  .modal-actions { align-items:center; }
  .lightbox-img { max-width: calc(100vw - 28px); max-height: min(68vh, calc(100dvh - 150px)); }
}
@media (max-width: 400px) {
  .desktop-stage { padding-left: 8px; padding-right: 8px; }
  .desktop-window { width:min(370px, calc(100vw - 16px)); max-width:100%; align-self:flex-start; }
  .toolbar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .toolbar button { font-size:16px; }
  .toolbar button small { font-size:9px; }
  .desktop-icons { grid-template-columns: repeat(2, 78px); gap: 12px; }
  .desktop-icon { font-size: 11px; }
  .bubble-category-area { grid-template-columns: repeat(2, 104px); gap: 30px 14px; }
  .pixel-bubble, .work-bubble, .message-bubble { width:104px; height:104px; font-size:10.5px; }
  .work-bubble-area, .message-bubble-area { grid-template-columns: repeat(2, minmax(100px, 1fr)); gap:22px 12px; }
  .modal-root { padding: 10px; }
  .modal-card, .novel-card, .photo-lightbox-card { width: calc(100vw - 20px); padding: 14px; }
  .music-player { width: min(196px, calc(100vw - 18px)); }
}
