/* ============================================================
 * 旧时光杂货铺（导航 hub 版）样式
 * 三套主题通过 body[data-theme] 切换 CSS 变量
 * ============================================================ */
:root {
  --bg: #0a0a0f;
  --orange: #ff8c1a;
  --yellow: #ffd43b;
  --red: #e03131;
  --panel: #c0c0c0;
  --title-a: #000080;
  --title-b: #1084d0;
  --text: #f5f5f5;
  --line: #2a2a33;
}
body[data-theme="eva"] {
  --bg: #07111a;
  --orange: #29b6c4;
  --yellow: #7fd1e0;
  --red: #c92a4b;
  --title-a: #0a2a3a;
  --title-b: #29b6c4;
  --line: #14323f;
}
body[data-theme="classic"] {
  --bg: #008080;
  --orange: #000080;
  --yellow: #c0c0c0;
  --red: #800000;
  --panel: #c0c0c0;
  --title-a: #000080;
  --title-b: #1084d0;
  --text: #000;
  --line: #808080;
}
/* 经典灰：桌面保留 Y2K 线条，背景图由 JS 控制 */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; height: 100dvh; margin: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  user-select: none;
}

/* Win98 经典青绿色底色 + Y2K 爆炸线条叠加 */
#desktop {
  position: absolute; inset: 0; bottom: calc(40px + env(safe-area-inset-bottom));
  background-color: #008080;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,140,26,0.12), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,212,59,0.10), transparent 40%),
    repeating-linear-gradient(45deg, transparent 0 22px, rgba(255,140,26,0.04) 22px 24px),
    #008080;
  overflow: auto;
}

/* 换背景：JS 设置内联 style.backgroundImage 后添加 .bg-active 类
 * background-image:none 清掉 #desktop 简写里的 Y2K 渐变（兜底），
 * 内联 style.backgroundImage 优先级更高会自动生效；
 * background-color 兜底为黑，避免背景图加载时透出渐变 */
#desktop.bg-active {
  background-color: #000;
  background-image: none;
  background-size: auto;
  background-repeat: repeat;
  background-position: 0 0;
}

/* ---------- 开机动画 ---------- */
#boot {
  position: fixed; inset: 0; z-index: 999;
  background: #000; color: #8aff8a;
  font-family: "Courier New", monospace; padding: 40px;
  cursor: pointer;
}
#boot-text { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.boot-hint { margin-top: 24px; color: #ffd43b; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Win98 启动画面 ---------- */
#win98boot {
  position: fixed; inset: 0; z-index: 998;
  background: #000; color: #fff;
  font-family: Arial, sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: none;
}
#win98boot[hidden] { display: none !important; }

.w98-logo {
  text-align: center; user-select: none;
  margin-bottom: 32px;
}
.w98-brand {
  font-size: 13px; color: #aaa; margin-bottom: 6px;
  letter-spacing: 1px;
}
.w98-windows {
  font-size: 38px; font-weight: bold; color: #fff;
  letter-spacing: 2px; margin-bottom: 16px; margin-top: 8px;
  font-family: "Arial Black", "Arial Bold", Arial, sans-serif;
}

/* 四色旗：Win98 经典 logo（四个独立色块窗格） */
.w98-flag {
  width: 260px; height: 170px; margin: 0 auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
}
.w98-flag span { display: block; }
.w98-p1 { background: #e60000; } /* 红 */
.w98-p2 { background: #00b500; } /* 绿 */
.w98-p3 { background: #0000d6; } /* 蓝 */
.w98-p4 { background: #f2e400; } /* 黄 */

/* 进度条：Win98 原版彩虹渐变 */
.w98-progress {
  width: 330px; height: 16px;
  background: #111; border: 1px solid #3a3a3a;
  overflow: hidden; position: relative;
  margin: 36px auto 0;
  align-self: center;
}
.w98-slide {
  width: 200%; height: 100%;
  background: linear-gradient(90deg,
    #ff4d4d 0%, #ffa64d 10%, #ffff4d 20%,
    #4dff4d 30%, #4dd2ff 40%, #8a4dff 50%,
    #ff4dff 60%, #ff4d4d 70%, #ffa64d 80%,
    #ffff4d 90%, #4dff4d 100%
  );
  animation: w98slide 2s linear infinite;
}

@keyframes w98slide {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- 贵宾室粉丝数（原桌面 LED 粉丝牌，迁入窗内） ---------- */
.vip-led {
  margin-top: 14px; text-align: center;
  background: #111; border: 2px solid var(--orange);
  border-radius: 8px; padding: 10px 12px;
  box-shadow: 0 0 12px rgba(255,140,26,0.4);
}
.vip-led-num {
  font-family: "Courier New", monospace; font-weight: bold; font-size: 26px;
  color: #ff5a3c; text-shadow: 0 0 6px rgba(255,90,60,0.8);
  letter-spacing: 2px;
}
.vip-led-label { font-size: 12px; color: var(--yellow); letter-spacing: 2px; }

/* ---------- 桌面图标 ---------- */
#icons {
  position: relative;  /* 支持图标 absolute 拖动定位 */
  min-height: 100%;
  padding: 18px;
}
.desk-icon {
  position: absolute;  /* 可拖动 */
  width: 84px; height: 84px; background: transparent; border: 1px solid transparent;
  border-radius: 0; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 4px 2px 2px;
  user-select: none; -webkit-user-select: none;
}
.desk-icon.dragging { opacity: 0.85; z-index: 99; }
.desk-icon:active, .desk-icon:hover {
  background: #000080; border-color: #000080;
}
.desk-icon.selected {
  background: #000080; border-color: #000080;
}
.desk-icon.selected .desk-icon-label {
  background: #000080; color: #fff; border-color: #000080;
}
.desk-icon:active .desk-icon-label, .desk-icon:hover .desk-icon-label { color: #fff; }
.desk-icon-img { width: 40px; height: 40px; }
.desk-icon-img svg { width: 100%; height: 100%; image-rendering: pixelated; }
.desk-game .desk-icon-img { filter: drop-shadow(0 0 4px rgba(255,140,26,0.6)); }
.desk-icon-label {
  font-size: 12px; text-align: center; line-height: 1.2;
  background: transparent; color: var(--text);
  padding: 1px 4px; border: 1px solid transparent;
  max-width: 80px; word-break: break-all;
}
.desk-icon:active .desk-icon-label, .desk-icon:hover .desk-icon-label {
  background: #000080; color: #fff; border-color: #000080;
}

/* 文件夹窗口内图标网格 */
.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 84px);
  gap: 14px; padding: 8px;
}

/* ---------- 窗口 ---------- */
.win {
  position: absolute; background: var(--panel); color: #000;
  border: 2px solid; border-color: #fff #000 #000 #fff;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5); display: flex; flex-direction: column;
  min-width: 260px; min-height: 160px;
}
.win.dragging { opacity: 0.95; }
.win-mobile {
  position: fixed !important; left: 0 !important; top: 0 !important;
  width: 100% !important; height: calc(100dvh - 40px - env(safe-area-inset-bottom)) !important; border-width: 0;
}
.win-maxed { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100dvh - 40px) !important; }
.win-title {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: #fff; padding: 4px 6px; cursor: move; font-weight: bold; font-size: 13px;
}
.win-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btns { display: flex; gap: 3px; }
.win-btn {
  width: 20px; height: 18px; border: 1px solid; border-color: #fff #000 #000 #fff;
  background: var(--panel); color: #000; font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.win-body { flex: 1; overflow: auto; background: #fff; color: #000; }

/* ---------- 窗口内通用 ---------- */
.pad { padding: 12px; font-size: 13px; }
.pad.center { text-align: center; }
hr { border: none; border-top: 1px solid #999; margin: 8px 0; }
.hint { color: #666; font-size: 12px; }
.loading, .empty { color: #888; padding: 16px; text-align: center; }
.btn {
  border: 1px solid; border-color: #fff #000 #000 #fff; background: var(--panel);
  color: #000; padding: 6px 14px; cursor: pointer; font-size: 13px; margin-top: 8px;
}
.btn:active { border-color: #000 #fff #fff #000; }

/* 系统帮助（Win98 帮助窗口风格） */
.help-header { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #999; margin-bottom: 12px; }
.help-icon {
  width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #3fb8d6, #0a6c8c); color: #fff; font-weight: bold;
  font-size: 20px; border: 2px solid #000; border-color: #fff #000 #000 #fff;
}
.help-title { font-weight: bold; font-size: 14px; }
.help-sub { color: #666; font-size: 11px; margin-top: 2px; }
.help-section { margin-bottom: 14px; }
.help-section-title { font-weight: bold; font-size: 13px; margin-bottom: 4px; padding-left: 6px; border-left: 3px solid #1084d0; }
.help-desc { color: #444; font-size: 12px; margin: 4px 0; line-height: 1.5; }
.help-btn { margin-right: 8px; }
.help-link-box { margin-top: 8px; }
.help-link-input {
  width: 100%; box-sizing: border-box; padding: 5px 6px; font-size: 12px;
  border: 1px solid; border-color: #000 #fff #fff #000; background: #fff; color: #333;
}

.profile { display: flex; align-items: center; gap: 10px; }
.avatar { width: 48px; height: 48px; border: 2px solid #000; background: #ddd; }
.pc-name { font-weight: bold; font-size: 15px; }
.pc-sub { color: #666; font-size: 12px; }
.kv { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted #ccc; }

/* 电视机 */
.vlist { display: flex; flex-direction: column; gap: 6px; }
.vitem {
  display: flex; gap: 8px; align-items: center; width: 100%; text-align: left;
  border: 1px solid #ccc; background: #f6f6f6; padding: 6px; cursor: pointer;
}
.vitem:active { background: #e8e8e8; }
.vpic { width: 56px; height: 42px; background: #ddd; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.vpic img { width: 100%; height: 100%; object-fit: cover; }
.vmeta { display: flex; flex-direction: column; min-width: 0; }
.vtitle { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vview { color: #888; font-size: 12px; }

/* 门禁 */
.unlocked, .locked { text-align: center; padding: 10px; }
.big { font-size: 18px; font-weight: bold; margin-bottom: 8px; }
.furn { margin-top: 10px; font-size: 20px; letter-spacing: 4px; }

/* 二维码 */
.qr { width: 220px; height: 220px; border: 1px solid #000; background: #fff; }

/* 排行榜 */
.rlist { display: flex; flex-direction: column; }
.ritem { display: flex; align-items: center; padding: 4px 6px; border-bottom: 1px dotted #ccc; }
.rrank { width: 32px; font-weight: bold; color: var(--orange); }
.rname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rscore { color: #c92a4b; font-weight: bold; }
.rank-me { margin-top: 8px; padding: 6px; background: #fff3bf; border: 1px solid #ffd43b; font-size: 13px; }

/* 勋章墙已移除 */
.cat svg { width: 80px; height: 80px; image-rendering: pixelated; }

/* ---------- 成就墙 ---------- */
.ach-prog { padding: 8px 10px; background: #c3c7cb; border: 2px solid; border-color: #fff #7a7f85 #7a7f85 #fff; margin-bottom: 8px; font-size: 13px; }
.ach-prog b { color: #0a6c2c; }
.ach-list { display: flex; flex-direction: column; gap: 6px; max-height: 372px; overflow-y: auto; }
.ach-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #f4f4f4; border: 2px solid; border-color: #fff #7a7f85 #7a7f85 #fff; }
.ach-item.on { background: #fff7d6; border-color: #ffd43b #caa04a #caa04a #ffd43b; }
.ach-item.locked { opacity: .72; filter: grayscale(.45); }
.ach-item.hid .ach-name { letter-spacing: 3px; }
.ach-ico { font-size: 24px; width: 32px; text-align: center; flex: none; line-height: 1; }
.ach-ico svg { width: 30px; height: 30px; display: block; margin: 0 auto; }
.ach-meta { flex: 1; min-width: 0; }
.ach-name { font-size: 13px; font-weight: bold; color: #222; }
.ach-pts { color: #c92a4b; font-weight: bold; font-size: 12px; margin-left: 4px; }
.ach-desc { font-size: 11px; color: #666; margin-top: 2px; }
.pc-ach-btn { display: block; width: 100%; margin: 8px 0 2px; padding: 7px 0; font-size: 13px; cursor: pointer; background: #c3c7cb; border: 2px solid; border-color: #fff #7a7f85 #7a7f85 #fff; color: #000; }
.pc-ach-btn:active { background: #aeb2b6; }

/* ---------- 任务栏 ---------- */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; min-height: 40px; z-index: 50;
  background: var(--panel); border-top: 2px solid #fff;
  display: flex; align-items: center; gap: 6px; padding: 0 6px env(safe-area-inset-bottom);
}
#start-btn {
  border: 1px solid; border-color: #fff #000 #000 #fff; background: var(--panel);
  font-weight: bold; padding: 6px 14px; cursor: pointer; flex: none;
}
#taskbar-windows { flex: 1; display: flex; gap: 4px; overflow: auto; }
.task-win {
  border: 1px solid; border-color: #fff #000 #000 #fff; background: var(--panel);
  padding: 4px 10px; cursor: pointer; white-space: nowrap; font-size: 12px; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis;
}
.task-win.active { border-color: #000 #fff #fff #000; background: #bdbdbd; }
#clock {
  flex: none; border: 1px solid; border-color: #000 #fff #fff #000;
  background: var(--panel); padding: 4px 8px; font-size: 12px; min-width: 48px; text-align: center;
}

/* 开始菜单 */
#startmenu {
  position: fixed; left: 0; bottom: calc(40px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--panel); border: 2px solid; border-color: #fff #000 #000 #fff;
  min-width: 180px; padding: 4px;
}
.start-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  padding: 8px 12px; cursor: pointer; font-size: 13px; color: #000;
}
.start-item:hover { background: linear-gradient(90deg, var(--title-a), var(--title-b)); color: #fff; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%) translateY(20px);
  background: #000; color: #ffd43b; border: 1px solid var(--orange);
  padding: 8px 16px; border-radius: 6px; font-size: 13px; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 80%;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 移动端 */
@media (max-width: 768px) {
  #icons { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .desk-icon { width: auto; }
  /* 标题栏按钮放大到可触摸（≥44 触摸目标） */
  .win-btn { width: 36px; height: 34px; font-size: 18px; }
  .win-btns { gap: 5px; }
}
/* 触摸设备：关掉 hover 粘滞高亮（tap 后残留），保留 :active 即时反馈 */
@media (pointer: coarse) {
  .desk-icon:hover { background: transparent; border-color: transparent; }
  .desk-icon:hover .desk-icon-label { color: var(--text); }
  .start-item:hover { background: transparent; color: #000; }
}

/* ============================================================
 * 手机端：塞班 S60 外壳（仅 data-ui="symbian" 生效，PC 端完全不受影响）
 * ============================================================ */
body[data-ui="symbian"] #taskbar,
body[data-ui="symbian"] #startmenu { display: none !important; }

/* 塞班整机：S60 经典深蓝渐变背景，覆盖 Win98 青绿 */
body[data-ui="symbian"] { background: #050a18 !important; color: #fff; }
body[data-ui="symbian"] #desktop {
  position: fixed; inset: 0 0 0 0; display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -20%, #20406e 0%, #0e2244 45%, #050a18 100%) !important;
  bottom: 0;
}

/* 状态栏（S60 顶部细条：左菜单键 / 中运营商+信号 / 右时间+电量） */
body[data-ui="symbian"] .s-statusbar {
  flex: none; height: 36px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; color: #fff; font-size: 13px;
  background: linear-gradient(180deg, #122murky 0%, #0a1526 100%);
  background: linear-gradient(180deg, #122c52, #0a1526);
  border-bottom: 1px solid #0a1428;
}
body[data-ui="symbian"] .s-menukey { width: 18px; height: 18px; flex: none; opacity: 0.9; }
body[data-ui="symbian"] .s-menukey svg { width: 100%; height: 100%; }
body[data-ui="symbian"] .s-signal { letter-spacing: -1px; font-size: 11px; color: #9ee6a0; }
body[data-ui="symbian"] .s-carrier { flex: 1; font-weight: bold; letter-spacing: 0.5px; font-size: 12px; }
body[data-ui="symbian"] .s-clock { font-family: "Courier New", monospace; font-size: 13px; }
body[data-ui="symbian"] .s-battery { font-size: 12px; color: #9ee6a0; }

/* 应用宫格（S60 功能表：3列，深蓝渐变底，圆角玻璃图标 + 右侧细滚动条） */
body[data-ui="symbian"] .s-grid {
  flex: 1; overflow-y: auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px;
  padding: 22px 18px calc(74px + env(safe-area-inset-bottom, 0));
  align-content: start;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.35) transparent;
}
body[data-ui="symbian"] .s-grid::-webkit-scrollbar { width: 4px; }
body[data-ui="symbian"] .s-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 4px; }
body[data-ui="symbian"] .s-app {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: transparent; border: none; padding: 4px; cursor: pointer;
}
body[data-ui="symbian"] .s-app-icon {
  width: 66px; height: 66px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.45),
    inset 0 -3px 4px rgba(0,0,0,0.25),
    0 3px 6px rgba(0,0,0,0.5);
}
body[data-ui="symbian"] .s-app-icon svg { width: 40px; height: 40px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25)); }
body[data-ui="symbian"] .s-app:active .s-app-icon { filter: brightness(0.85); transform: scale(0.95); }
body[data-ui="symbian"] .s-app-label { font-size: 12px; color: #eaf2ff; text-shadow: 0 1px 2px rgba(0,0,0,0.7); }

/* S60 统一图标底板：浅蓝圆形（诺基亚 S60 功能表标准），文件夹用黄色 */
body[data-ui="symbian"] .s-app .s-app-icon {
  background: radial-gradient(circle at 35% 30%, #3a7ec8, #1a4e8c);
  border-radius: 50%;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}
body[data-ui="symbian"] .s-app-folder .s-app-icon,
body[data-ui="symbian"] .s-app-folderMulti .s-app-icon,
body[data-ui="symbian"] .s-app-folderTool .s-app-icon,
body[data-ui="symbian"] .s-app-folderGame .s-app-icon {
  background: radial-gradient(circle at 35% 30%, #e8c840, #b89610);
}
body[data-ui="symbian"] .s-app-icon svg {
  width: 28px; height: 28px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}

/* 软键栏：底部固定，左软键 / 中央选择键 / 右软键（S60 三键布局）
 * z-index 9000：必须始终压在窗口（zTop 从 100 递增）之上，
 * 否则全屏游戏窗口会盖住软键栏，导致窗口无法关闭。 */
body[data-ui="symbian"] .s-softkeys {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
  height: 56px; padding: 0 14px calc(env(safe-area-inset-bottom, 0));
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, #122c52, #0a1526);
  border-top: 1px solid #2a4a78;
}
body[data-ui="symbian"] .s-key {
  background: transparent; color: #eaf2ff; border: none;
  font-size: 14px; font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  padding: 10px 16px; min-width: 56px;
}
body[data-ui="symbian"] .s-key:active { color: #9ee6a0; }

/* S60 功能表弹出菜单（仿 S60 原生菜单） */
body[data-ui="symbian"] .s-menu {
  position: fixed; left: 8px; right: 8px; bottom: 62px; z-index: 8999;
  background: linear-gradient(180deg, #1a2a4a, #0a1526);
  border: 1px solid #2a4a78; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  padding: 6px 0;
  display: flex; flex-direction: column;
}
body[data-ui="symbian"] .s-menu[hidden],
body[data-ui="symbian"] .s-menu.hidden { display: none !important; }
body[data-ui="symbian"] .s-menu-item {
  display: flex; align-items: center; gap: 12px;
  background: transparent; border: none; color: #eaf2ff;
  font-size: 15px; padding: 10px 16px; cursor: pointer;
  text-align: left; width: 100%;
}
body[data-ui="symbian"] .s-menu-item:active { background: #2a4a78; }
body[data-ui="symbian"] .s-menu-icon {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #3a7ec8, #1a4e8c);
}
body[data-ui="symbian"] .s-menu-icon svg { width: 20px; height: 20px; }
/* 中央选择键：圆形导航键 */
body[data-ui="symbian"] .s-key-center {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid #2a4a78;
  background: radial-gradient(circle at 38% 32%, #3a5a8a, #16294a);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.3), 0 1px 3px rgba(0,0,0,0.6);
  cursor: pointer; padding: 0;
}
body[data-ui="symbian"] .s-key-center:active { background: radial-gradient(circle at 38% 32%, #4a6a9a, #1a3050); }

/* 详情窗口：占满状态栏与软键栏之间的区域 */
body[data-ui="symbian"] .win.win-mobile {
  top: 36px !important; left: 0 !important; width: 100% !important;
  height: calc(100dvh - 36px - 56px - env(safe-area-inset-bottom, 0)) !important;
  border-width: 0; border-radius: 0; box-shadow: none;
}
/* S60 详情标题栏：深蓝 + 白字，去掉 Win98 的 ×/_/□ 按钮 */
body[data-ui="symbian"] .win-title {
  background: linear-gradient(180deg, #122c52, #0a1526); color: #fff; cursor: default;
}
body[data-ui="symbian"] .win-btns { display: none; }
body[data-ui="symbian"] .win-body { font-size: 14px; background: #fff; color: #000; }

/* ============================================================
 * 唐诗（Word97 风格阅读器 + Clippit 曲别针助手）
 * ============================================================ */
/* 整体窗口内容区：模拟 Word97 内部布局 */
.tang-wrap {
  display: flex; flex-direction: column; height: 100%; position: relative;
  background: #c0c0c0;          /* Win98 灰色背景，不是白底 */
  font-family: "SimSun", "NSimSun", "宋体", serif;
  font-size: 12px;
}
/* Word97 菜单栏 */
.tang-menubar {
  display: flex; align-items: center; height: 22px; padding: 0 4px;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  font-size: 12px; cursor: default; user-select: none;
  flex-shrink: 0;
}
.tang-menubar span {
  padding: 2px 6px; white-space: nowrap;
}
.tang-menubar span:hover {
  background: #000080; color: #fff;
}
/* Word97 工具栏（图标按钮行） */
.tang-toolbar {
  display: flex; align-items: center; gap: 1px; padding: 3px 4px;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
}
.tang-tb-btn {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: none; cursor: pointer;
  font-size: 11px; padding: 0;
}
.tang-tb-btn:hover { border-color: #fff #808080 #808080 #fff; }
.tang-tb-btn:active { border-color: #808080 #fff #fff #808080; }
.tang-tb-sep {
  width: 1px; height: 18px; background: #808080; margin: 0 3px;
  border-right: 1px solid #fff;
}
/* Word97 水平标尺 */
.tang-ruler {
  height: 18px; background: #c0c0c0;
  border-bottom: 1px solid #808080;
  position: relative; flex-shrink: 0;
  font-size: 9px; color: #333;
}
.tang-ruler::before {
  content: '0       2       4       6       8       10      12      14      16';
  position: absolute; top: 2px; left: 8px; letter-spacing: 6px;
}
.tang-ruler::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0;
  height: 100%; margin: 0 8px;
  background: repeating-linear-gradient(90deg, #808080 0, #808080 1px, transparent 1px, transparent 12px);
}
/* 编辑区：白色 A4 纸效果 */
.tang-edit-area {
  flex: 1; overflow-y: auto; background: #808080;
  padding: 8px 12px;
}
.tang-page {
  background: #fff; margin: 0 auto; max-width: 480px; min-height: 100%;
  padding: 24px 32px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  font-size: 14px; line-height: 2; color: #222;
  text-align: justify;
}
.tang-title {
  font-size: 20px; font-weight: bold; text-align: center; color: #000;
  margin-bottom: 2px; line-height: 1.6;
}
.tang-meta {
  text-align: center; color: #555; font-size: 12px;
  margin-bottom: 12px; line-height: 1.6;
}
.tang-content { letter-spacing: 1px; }
/* Word97 状态栏 */
.tang-statusbar {
  display: flex; align-items: center; height: 20px; padding: 0 4px;
  background: #c0c0c0; border-top: 1px solid #808080;
  font-size: 11px; color: #000;
  flex-shrink: 0; user-select: none;
}
.tang-statusbar span { padding: 0 6px; border: 1px solid; border-color: #808080 #fff #fff #808080; }
.tang-statusbar .tang-sb-main { flex: 1; }
/* 导航按钮行（放在状态栏上方） */
.tang-nav {
  display: flex; align-items: center; gap: 4px; padding: 3px 8px;
  background: #c0c0c0; border-top: 1px solid #fff; border-bottom: 1px solid #808080;
  flex-shrink: 0;
}
.tang-nav-btn {
  font-size: 11px; padding: 1px 8px; cursor: pointer;
  border: 1px solid; border-color: #fff #808080 #808080 #fff; background: #c0c0c0;
}
.tang-nav-btn:active { border-color: #808080 #fff #fff #808080; }
.tang-nav-pos { margin-left: auto; font-size: 11px; color: #333; }

/* Clippit 曲别针助手（右下角固定）—— PNG 抠图 */
.tang-clippy {
  position: absolute; right: 8px; bottom: 28px;
  cursor: pointer; width: 90px; height: 90px;
  user-select: none; z-index: 10;
}
.clippy-img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
/* 气泡：黄色便签纸风格，带折角 */
.clippy-bubble {
  position: absolute; right: 72px; bottom: 20px; min-width: 160px; max-width: 220px;
  background: #ffffcc; border: 1px solid #999; border-radius: 4px 4px 4px 0;
  padding: 8px 10px; font-size: 12px; color: #222; line-height: 1.5;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  opacity: 0; transform: translateY(6px); transition: all .25s ease; pointer-events: none;
}
.clippy-bubble::before {
  content: ''; position: absolute; right: -10px; bottom: 0;
  width: 0; height: 0;
  border: 6px solid transparent; border-left-color: #999; border-bottom-color: #999;
}
.clippy-bubble::after {
  content: ''; position: absolute; right: -9px; bottom: 1px;
  width: 0; height: 0;
  border: 5px solid transparent; border-left-color: #ffffcc; border-bottom-color: #ffffcc;
}
.clippy-bubble.show { opacity: 1; transform: translateY(0); }

/* ============================================================
 * DOS 模拟器（jsdos 上传自定义游戏运行）
 * ============================================================ */
.dos-wrap { display: flex; flex-direction: column; height: 100%; background: #c0c0c0; }
.dos-upload {
  flex: 1; margin: 14px; display: flex; align-items: center; justify-content: center;
  border: 2px dashed #808080; border-radius: 6px; cursor: pointer;
  background: #d4d0c8; transition: background .15s, border-color .15s;
}
.dos-upload:hover, .dos-upload.over { background: #e8e8e8; border-color: #1084d0; }
.dos-upload-inner { text-align: center; padding: 24px; }
.dos-upload-icon { font-size: 42px; margin-bottom: 8px; }
.dos-upload-text { font-size: 14px; color: #222; margin-bottom: 6px; }
.dos-upload-hint { font-size: 11px; color: #666; line-height: 1.5; max-width: 420px; }
.dos-run { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dos-bar {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  background: linear-gradient(180deg, #f8f8f8, #dcdcdc); border-bottom: 1px solid #808080;
}
.dos-fname { font-size: 12px; color: #333; font-family: "Courier New", monospace; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dos-btn {
  font-size: 12px; padding: 3px 10px; cursor: pointer;
  border: 1px solid; border-color: #fff #000 #000 #fff; background: #e8e8e8;
}
.dos-btn:active { border-color: #000 #fff #fff #000; }
.dos-stage { flex: 1; min-height: 0; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dos-stage .dosbox-container, .dos-stage > div { max-width: 100%; max-height: 100%; }
.dos-stage canvas { image-rendering: pixelated; max-width: 100%; max-height: 100%; }
.dos-msg {
  margin: 0 14px 12px; padding: 7px 10px; font-size: 12px; border-radius: 4px;
  background: #fff6d6; border: 1px solid #d8b84a; color: #5a4500;
}
.dos-msg.err { background: #ffe0e0; border-color: #d86a6a; color: #7a0000; }

/* ============================================================
 * 手机端：塞班启动动画（类 BIOS，自动/点击解锁进入）
 * ============================================================ */
body[data-ui="symbian"] #lock {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; flex-direction: column;
  background: #04140c;   /* 深绿黑底，BIOS 质感 */
  color: #6bff9a;
  touch-action: none;
}
body[data-ui="symbian"] #lock.unlocking { opacity: 0; transition: opacity .3s ease; }
/* 关键：hidden 属性必须生效，否则 unlock 后锁屏仍 display:flex 盖住桌面 → 黑屏 */
body[data-ui="symbian"] #lock[hidden] { display: none !important; }

/* 顶部状态栏：信号/运营商/时间/电量 */
body[data-ui="symbian"] .lock-statusbar {
  flex: none; height: 32px; display: flex; align-items: center; gap: 8px;
  padding: env(safe-area-inset-top, 0) 12px 0;
  background: rgba(0,0,0,0.4); color: #9ee6a0; font-size: 12px;
  border-bottom: 1px solid rgba(107,255,154,0.25);
}
body[data-ui="symbian"] .lock-signal { letter-spacing: -1px; }
body[data-ui="symbian"] .lock-carrier { flex: 1; font-weight: 600; }
body[data-ui="symbian"] .lock-clock { font-family: "Courier New", monospace; }
body[data-ui="symbian"] .lock-battery { color: #9ee6a0; }

/* BIOS 启动区：绿色等宽字 + 进度条 */
body[data-ui="symbian"] .lock-bios {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 0 22px; font-family: "Courier New", monospace;
}
body[data-ui="symbian"] .lock-bios-title {
  font-size: 20px; font-weight: bold; letter-spacing: 3px; margin-bottom: 16px;
  text-shadow: 0 0 8px rgba(107,255,154,0.6);
}
body[data-ui="symbian"] .lock-bios-log {
  font-size: 13px; line-height: 1.8; min-height: 150px; color: #6bff9a;
}
body[data-ui="symbian"] .lock-bios-log div { opacity: 0; animation: biosIn .25s ease forwards; }
@keyframes biosIn { to { opacity: 1; } }
body[data-ui="symbian"] .lock-bios-bar {
  margin-top: 16px; height: 6px; border: 1px solid #2f7d4f; border-radius: 3px;
  overflow: hidden; background: rgba(0,0,0,0.4);
}
body[data-ui="symbian"] .lock-bios-bar i {
  display: block; height: 100%; width: 0%; background: #6bff9a; box-shadow: 0 0 8px #6bff9a;
}
body[data-ui="symbian"] .lock-bios-hint {
  margin-top: 18px; font-size: 13px; color: #9ee6a0; letter-spacing: 1px;
  animation: biosBlink 1.1s steps(2, jump-none) infinite;
}

/* ========== 画图 Paint ========== */
.paint-wrap { display: flex; flex-direction: column; height: 100%; font-family: 'Tahoma', sans-serif; }
.paint-toolbar { display: flex; align-items: center; gap: 4px; padding: 4px 6px; background: #c3c7cb; border-bottom: 1px solid #7a7f85; flex-wrap: wrap; }
.paint-btn { padding: 2px 8px; font-size: 11px; cursor: pointer; background: #c3c7cb; border: 1px solid #7a7f85; }
.paint-btn:hover { background: #fff; }
.paint-btn.active { background: #0a6c8c; color: #fff; border-color: #0a6c8c; }
.paint-btn.paint-save-btn { background: #ffd43b; border-color: #f0c000; }
.paint-sep { width: 1px; height: 18px; background: #7a7f85; margin: 0 4px; }
.paint-wrap #paint-canvas { border: 1px solid #7a7f85; cursor: crosshair; flex: 1; }
.paint-status { padding: 2px 8px; font-size: 11px; background: #c3c7cb; border-top: 1px solid #7a7f85; color: #333; }
.paint-wrap input[type="color"] { width: 24px; height: 18px; border: 1px solid #7a7f85; cursor: pointer; }
.paint-wrap input[type="range"] { width: 60px; vertical-align: middle; }

/* ========== 趣味拍照大头贴（Purikura 风格） ========== */
.cam-wrap { display: flex; flex-direction: column; height: 100%; font-family: 'Tahoma', sans-serif; overflow: hidden; }
.cam-stage { position: relative; background: #000; flex: 0 0 200px; min-height: 0; overflow: hidden; }
.cam-stage #cam-video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.cam-stage #cam-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.2s; }
.cam-stage #cam-canvas.show { opacity: 1; }
.cam-stage #cam-drawlayer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-stage.drawing #cam-drawlayer { pointer-events: auto; }
.cam-stage .cam-count { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 64px; font-weight: bold; color: #fff; text-shadow: 0 0 20px #ff6b9d; display: none; pointer-events: none; }
.cam-toolbar { background: #c3c7cb; border-bottom: 1px solid #7a7f85; padding: 4px 6px; flex-shrink: 0; overflow-x: auto; }
.cam-row { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.cam-row-label { font-size: 11px; color: #333; margin-right: 2px; white-space: nowrap; }
.cam-chip { padding: 2px 8px; font-size: 11px; cursor: pointer; background: #fff; border: 1px solid #7a7f85; border-radius: 3px; white-space: nowrap; }
.cam-chip:hover { background: #e0e0e0; }
.cam-chip.active { background: #ffd43b; border-color: #f0c000; }
.cam-chip.cam-pen { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid #7a7f85; }
.cam-chip.cam-pen.active { border-color: #ff6b9d; box-shadow: 0 0 0 2px #ff6b9d; }
.cam-4grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; background: #ffd43b; flex: 1; min-height: 0; overflow: auto; }
.cam-thumb { width: 100%; height: 100%; border: 3px solid #fff; background: #333; box-sizing: border-box; }
.cam-thumb:hover { cursor: pointer; }
.cam-bar { display: flex; justify-content: center; gap: 8px; padding: 6px 8px; background: #c3c7cb; border-top: 1px solid #7a7f85; flex-shrink: 0; }
.cam-btn { padding: 3px 10px; font-size: 11px; cursor: pointer; background: #c3c7cb; border: 1px solid #7a7f85; }
.cam-btn:hover { background: #fff; }
.cam-btn:disabled { opacity: 0.5; cursor: default; }
.cam-status { padding: 3px 8px; font-size: 11px; background: #c3c7cb; border-top: 1px solid #7a7f85; color: #333; flex-shrink: 0; text-align: center; }

/* ========== 计算器 Win98 经典款 ========== */
.calc-win98 { display: flex; flex-direction: column; height: 100%; background: #c3c7cb; padding: 6px; font-family: 'Tahoma', sans-serif; box-sizing: border-box; }
.calc-win98-display { background: #fff; border: 2px solid; border-color: #7a7f85 #fff #fff #7a7f85; padding: 2px 4px; margin-bottom: 6px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; }
.calc-win98-disp-text { font-size: 18px; font-family: 'Courier New', monospace; color: #000080; font-weight: bold; }
.calc-win98-keys { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(4, 1fr); gap: 2px; flex: 1; min-height: 0; }
.calc-win98-key { padding: 0; font-size: 12px; cursor: pointer; border: 2px solid; border-color: #fff #7a7f85 #7a7f85 #fff; background: #c3c7cb; text-align: center; font-weight: bold; min-height: 0; }
.calc-win98-key:hover { background: #fff; }
.calc-win98-key:active { border-color: #7a7f85 #fff #fff #7a7f85; }
.calc-win98-key-calc-r { color: #ff0000; } /* 红字：内存/清空/等号 */
.calc-win98-key-calc-b { color: #000000; } /* 黑字：运算符 */
.calc-win98-key-calc-bl { color: #0000ff; } /* 蓝字：数字 */

/* ========== 碎片整理 Win98 经典风格 ========== */
.df98-wrap { display: flex; flex-direction: column; height: 100%; font-family: 'Tahoma', sans-serif; font-size: 12px; background: #c3c7cb; }
.df98-titlebar { background: #0a6c8c; color: #fff; padding: 4px 8px; font-weight: bold; display: flex; align-items: center; gap: 4px; }
.df98-title-icon { font-size: 14px; }
.df98-body { flex: 1; display: flex; flex-direction: column; padding: 0; }
.df98-drive { padding: 4px 8px; background: #c3c7cb; border-bottom: 1px solid #7a7f85; }
.df98-map { flex: 1; display: flex; flex-wrap: wrap; padding: 4px; background: #000; gap: 0; }
.df98-block { width: 10px; height: 10px; border: 0.5px solid #333; }
.df98-block[data-type="file"] { background: #1084d0; }
.df98-block[data-type="frag"] { background: #e03131; }
.df98-block[data-type="free"] { background: #c3c7cb; }
.df98-block[data-type="done"] { background: #40c057; }
.df98-legend { display: flex; gap: 10px; padding: 4px 8px; background: #c3c7cb; border-top: 1px solid #7a7f85; font-size: 11px; align-items: center; }
.df98-swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid #555; margin-right: 2px; vertical-align: middle; }
.df98-swatch.df98-file { background: #1084d0; }
.df98-swatch.df98-frag { background: #e03131; }
.df98-swatch.df98-free { background: #c3c7cb; }
.df98-swatch.df98-done { background: #40c057; }
.df98-progress-wrap { display: flex; align-items: center; gap: 4px; padding: 2px 8px; background: #c3c7cb; }
.df98-progress-label { font-size: 11px; }
.df98-progress { flex: 1; height: 10px; background: #fff; border: 1px solid #7a7f85; }
.df98-progress-inner { height: 100%; width: 0%; background: #1084d0; transition: width 0.3s; }
.df98-pct { font-size: 11px; min-width: 30px; }
.df98-status { padding: 2px 8px; font-size: 11px; color: #333; background: #c3c7cb; border-top: 1px solid #7a7f85; }
.df98-bar { display: flex; gap: 6px; padding: 4px 8px; background: #c3c7cb; border-top: 1px solid #7a7f85; }
.df98-btn { padding: 2px 10px; font-size: 11px; cursor: pointer; background: #c3c7cb; border: 1px solid #7a7f85; }
.df98-btn:hover { background: #fff; }
.df98-btn:disabled { opacity: 0.5; cursor: default; }

/* ========== 三维管道屏保 ========== */
#pipes-canvas { width: 100%; height: 100%; display: block; }
@keyframes biosBlink { 50% { opacity: 0.25; } }
