/* BB机 98: the Y2K "blue cyber" look. Loaded after base.css and chat.css and restyles them
   through their tokens and class names; a custom CSS from 美化 still loads after this.
   Art in /img/y2k was drawn by Codex (built-in image generation). */
@font-face {
  font-family: "HY Pixel 11";
  src: url("/fonts/hypixel.woff2") format("woff2");
  font-display: swap;
}

:root {
  --y-cobalt: #2a39cf;
  --y-cobalt-deep: #161e7a;
  --y-peri: #93a0f2;
  --y-lilac: #e2e4fb;
  --y-silver: #c5c7d9;
  --y-ink: #10154d;
  --y-white: #fbfbff;
  --f-pixel: "HY Pixel 11", -apple-system, "PingFang SC", sans-serif;
  --y-wall: url("/img/y2k/wallpaper.jpg");

  /* chat.css tokens */
  --chat-bg-color: #8d90aa;
  --chat-bg-image: linear-gradient(rgba(20, 27, 120, 0.12), rgba(20, 27, 120, 0.12)), var(--y-wall);
  --bubble-font-size: 14px;
  --bubble-padding: 7px 10px;
  --bubble-gap-same: 8px;
  --bubble-gap-diff: 14px;
  --bubble-me-bg: var(--y-cobalt);
  --bubble-me-color: #ffffff;
  --bubble-them-bg: var(--y-white);
  --bubble-them-color: var(--y-ink);
  --text-main: var(--y-ink);
  --text-sub: #5d6290;
  --typing-dot-color: var(--y-cobalt);
  --btn-back-bg: rgba(255, 255, 255, 0.6);
  --more-options-bg: var(--y-lilac);
  --more-options-color: var(--y-ink);
  --more-options-divider: rgba(16, 21, 77, 0.12);
  --header-card-height: 50px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --chat-bg-color: #8d90aa;
    --bubble-me-bg: var(--y-cobalt);
    --bubble-them-bg: var(--y-white);
    --bubble-them-color: var(--y-ink);
    --text-main: var(--y-ink);
    --text-sub: #5d6290;
    --btn-back-bg: rgba(255, 255, 255, 0.6);
    --more-options-bg: var(--y-lilac);
    --more-options-color: var(--y-ink);
    --more-options-divider: rgba(16, 21, 77, 0.12);
  }
}

/* ---------- Win98 pieces ---------- */
.w98 {
  background: var(--y-silver); color: var(--y-ink); padding: 3px;
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), inset -2px -2px 0 #8a8ca3, inset 2px 2px 0 #eceef8, 4px 5px 0 rgba(16, 21, 77, 0.28);
}
.w98-title {
  display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 3px 0 7px; white-space: nowrap;
  background: linear-gradient(90deg, var(--y-cobalt-deep), var(--y-cobalt) 55%, #5a6ae6); color: var(--y-white);
  font-family: var(--f-pixel); font-size: 12px;
}
.w98-title > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.w98-x { flex: none; width: 16px; height: 14px; background: var(--y-silver); color: var(--y-ink); font: 10px/13px var(--f-pixel); text-align: center; font-style: normal;
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white); }
.w98-btn {
  min-width: 60px; padding: 4px 10px; background: var(--y-silver); color: var(--y-ink); border: 0; cursor: pointer; font: 13px var(--f-pixel);
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), inset -2px -2px 0 #8a8ca3, inset 2px 2px 0 #eceef8;
}
.w98-btn:active { box-shadow: inset 1px 1px 0 #3c3f58, inset -1px -1px 0 var(--y-white); }

/* ---------- splash: the iMac powers on ---------- */
.y-splash {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 30%, rgba(58, 71, 207, 0.35), rgba(10, 14, 70, 0.82) 70%), var(--y-wall) center / cover, #141b78;
  transition: opacity 0.45s ease;
}
.y-splash.is-leaving { opacity: 0; pointer-events: none; }
.y-splash .monitor { position: relative; width: min(84vw, 340px); transform: translateX(4%); filter: drop-shadow(0 26px 28px rgba(0, 0, 30, 0.55)); }
.y-splash .monitor > img { position: relative; z-index: 2; display: block; width: 100%; pointer-events: none; }
/* the screen sits behind the monitor's punched-out glass (measured from the render) */
.y-screen { position: absolute; z-index: 1; left: 14.5%; top: 11.35%; width: 64.74%; height: 49.08%; overflow: hidden; border-radius: 6%;
  background: radial-gradient(85% 85% at 50% 42%, #4659f2, #16208f 70%, #0a0f55); animation: y-poweron 0.9s 0.1s ease-out both; }
@keyframes y-poweron {
  0% { transform: scale(0.02, 0.004); filter: brightness(6); }
  30% { transform: scale(1, 0.006); filter: brightness(5); }
  60% { transform: scale(1, 1); filter: brightness(1.8); }
  100% { transform: none; filter: none; }
}
.y-screen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 30, 0.2) 2px 3px); }
.y-grid { position: absolute; inset: 52% -30% -10%; background:
  linear-gradient(rgba(170, 185, 255, 0.55) 1px, transparent 1px) 0 0 / 100% 14px,
  linear-gradient(90deg, rgba(170, 185, 255, 0.55) 1px, transparent 1px) 0 0 / 24px 100%;
  transform: perspective(160px) rotateX(58deg); transform-origin: top; animation: y-roll 1.6s linear infinite;
  -webkit-mask: linear-gradient(transparent, #000 40%); mask: linear-gradient(transparent, #000 40%); }
@keyframes y-roll { to { background-position: 0 14px, 0 0; } }
.y-logo { position: absolute; inset: 0 0 18% 0; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--y-white); text-align: center;
  font-family: var(--f-pixel); opacity: 0; animation: y-rise 0.4s 0.9s ease-out forwards; }
.y-logo b { font-size: clamp(22px, 7vw, 28px); font-weight: 400; text-shadow: 0 0 12px rgba(170, 190, 255, 0.95), 2px 2px 0 #0b1050; }
.y-logo small { font-size: 13px; color: #c9d0ff; }
.y-bar { position: absolute; left: 18%; right: 18%; bottom: 14%; height: 11px; padding: 2px; display: flex; gap: 2px; background: rgba(8, 12, 60, 0.75); }
.y-bar i { flex: 1; background: linear-gradient(#c9d1ff, var(--y-peri)); opacity: 0; animation: y-seg 0.08s linear forwards; }
@keyframes y-seg { to { opacity: 1; } }
@keyframes y-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.y-deco { position: absolute; pointer-events: none; filter: drop-shadow(2px 5px 5px rgba(16, 21, 77, 0.3)); animation: y-bob 5s ease-in-out infinite; }
@keyframes y-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

/* ---------- home: the desk ---------- */
/* a wallpaper chosen in 美化 still wins */
.home.y-desk { background: var(--y-desk-wall, var(--y-wall)) center / cover no-repeat, #8d90aa; padding: 0; overflow: hidden; touch-action: manipulation; isolation: isolate; }
.y-desk .layer { position: absolute; inset: 0; transition: transform 0.25s ease-out; pointer-events: none; }
.y-desk .layer > * { pointer-events: auto; }
.y-obj { position: absolute; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.y-obj .inner { animation: y-bob 6s ease-in-out infinite; animation-delay: var(--d, 0s); transition: transform 0.18s ease; }
.y-obj.is-dragging { z-index: 40; cursor: grabbing; will-change: transform; }
/* the pet stays above the icons, so it can always be picked up again wherever it was dropped */
/* Draggable desk things sit above the app icons, so one left over an icon can still be picked up again. */
.y-obj { z-index: 25; }
.y-obj:has(.y-pet) { z-index: 30; }
.y-obj:has(.y-pet).is-dragging { z-index: 41; }
.y-obj.is-dragging .inner { transform: scale(1.05) rotate(-2deg); animation-play-state: paused; }
.y-clockmood { width: min(176px, 46vw); }
.y-clockmood .lcd { margin: 8px 8px 0; padding: 6px 8px; background: #c9d6c2; box-shadow: inset 1px 1px 0 #6f7290, inset -1px -1px 0 var(--y-white); color: #23304a; font-family: var(--f-pixel); display: flex; flex-direction: column; align-items: center; }
.y-clockmood .lcd b { font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: 1px; }
.y-clockmood .lcd span { font-size: 11px; }
.y-clockmood .feel { padding: 7px 9px 9px; display: grid; gap: 4px; font: 12px/1.3 var(--f-pixel); }
.y-clockmood .feel > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.y-clockmood .feel .k { color: #6f7290; }
.y-clockmood .feel .v { color: var(--y-cobalt-deep); }
.y-clockmood .segs { display: inline-flex; gap: 2px; }
.y-clockmood .segs i { width: 10px; height: 9px; background: #d9dae6; box-shadow: inset 1px 1px 0 #9a9cb6; }
.y-clockmood .segs i.on { background: var(--y-cobalt-deep); box-shadow: inset -1px -1px 0 rgba(0, 0, 0, 0.25); }
.y-phone { position: relative; width: 96px; }
.y-phone img { position: relative; z-index: 2; display: block; width: 100%; filter: drop-shadow(3px 8px 6px rgba(16, 21, 77, 0.35)); pointer-events: none; }
.y-phone .lcd { position: absolute; z-index: 1; left: 13.5%; top: 12.3%; width: 48.5%; height: 28%; padding: 2px;
  background: linear-gradient(170deg, #eef0ff, #b9c3ff); display: grid; align-content: center; justify-items: center; gap: 1px;
  font-family: var(--f-pixel); color: var(--y-cobalt-deep); text-align: center; line-height: 1.15; overflow: hidden; }
.y-phone .lcd b { font-weight: 400; font-size: 11px; }
.y-phone .lcd span { font-size: 9px; overflow-wrap: anywhere; }
.y-phone .lcd .blink, .y-clockmood .blink { animation: y-blink 1.1s steps(1) infinite; }
@keyframes y-blink { 50% { opacity: 0; } }
.y-icons { position: absolute; left: 0; right: 0; padding: 0 12px; pointer-events: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 4px; justify-items: center; }
.y-icon { pointer-events: auto; width: 78px; display: grid; justify-items: center; gap: 4px; padding: 2px 0; background: none; border: 0; cursor: pointer; }
.y-icon-face { display: grid; justify-items: center; gap: 4px; }
.y-icons { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.y-icons.is-editing { touch-action: none; }
.y-icons.is-editing .y-icon-face { animation: y-icon-wiggle 0.28s ease-in-out infinite alternate; animation-delay: var(--wiggle-delay); }
.y-icons .is-lifted { opacity: 0; }
.y-icons-done { position: absolute; right: 14px; top: calc(var(--safe-top) + 8px); z-index: 20; padding: 8px 16px; }
.y-icon-ghost { position: fixed; left: 0; top: 0; margin: 0; z-index: 100; pointer-events: none !important; opacity: 0.85; filter: drop-shadow(0 8px 8px rgba(16, 21, 77, 0.4)); will-change: transform; }
@keyframes y-icon-wiggle { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
.y-icon img { width: 56px; height: 56px; filter: drop-shadow(1px 3px 3px rgba(16, 21, 77, 0.35)); transition: transform 0.15s ease; }

/* His room is a bug on the desk: every few seconds the door glitches (slices slip, red/cyan split) and settles. */
.y-icons:not(.is-editing) .y-icon[data-id="room"] img { animation: y-bug 5.2s steps(1, end) infinite; }
.y-icon[data-id="room"] span { font-family: var(--f-pixel); letter-spacing: .02em; }
@keyframes y-bug {
  0%, 88%, 100% { transform: none; clip-path: none; filter: drop-shadow(1px 3px 3px rgba(16, 21, 77, 0.35)); }
  89% { transform: translateX(3px); clip-path: inset(0 0 55% 0); filter: drop-shadow(-2px 0 #ff2a55) drop-shadow(2px 0 #22e6ff); }
  90% { transform: translateX(-4px) skewX(-6deg); clip-path: inset(40% 0 0 0); filter: drop-shadow(2px 0 #ff2a55) drop-shadow(-2px 0 #22e6ff); }
  92% { transform: translateX(2px); clip-path: inset(20% 0 30% 0); filter: drop-shadow(-3px 0 #ff2a55) drop-shadow(3px 0 #22e6ff); }
  94% { transform: translateX(-1px); clip-path: none; filter: drop-shadow(1px 0 #ff2a55) drop-shadow(-1px 0 #22e6ff); }
}
.rift { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 10000; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
body.rift-glitching .home { animation: y-rift-shake .09s steps(2, end) infinite; }
@keyframes y-rift-shake { 0% { transform: translate(2px, 0); filter: drop-shadow(-3px 0 #ff2a5599) drop-shadow(3px 0 #22e6ff99); } 100% { transform: translate(-3px, 1px); filter: none; } }
.y-icon:active img { transform: scale(0.9); }
.y-icon span { font: 12px var(--f-pixel); color: var(--y-white); padding: 1px 4px; text-shadow: 1px 1px 0 var(--y-cobalt-deep), 0 0 6px rgba(16, 21, 77, 0.7); }
.y-icon:focus-visible { outline: none; }
.y-icon:focus-visible span { background: var(--y-cobalt); text-shadow: none; outline: 1px dotted #fff; }
.y-taskbar { position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 10px); height: 52px; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 0 8px;
  border-radius: 18px; background: rgba(226, 228, 251, 0.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 8px 24px rgba(16, 21, 77, 0.25); }
.y-start { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 6px; }
.y-start img { width: 22px; height: 22px; }
.y-taskbar .hint { flex: 1; min-width: 0; font: 12px/1.3 var(--f-pixel); color: var(--y-ink); opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.y-clock { font: 16px var(--f-pixel); padding: 4px 8px; color: var(--y-ink); font-variant-numeric: tabular-nums;
  box-shadow: inset 1px 1px 0 rgba(60, 63, 88, 0.6), inset -1px -1px 0 rgba(255, 255, 255, 0.8); }

/* ---------- chat ---------- */
.chat-detail-screen { font-family: var(--f-pixel); }
.chat-detail-screen .chat-header-custom {
  top: calc(var(--safe-top) + 8px); left: 8px; right: 8px; height: var(--header-card-height); border-radius: 0; gap: 8px; padding: 0 6px;
  background: linear-gradient(90deg, var(--y-cobalt-deep), var(--y-cobalt) 60%, #5a6ae6); color: var(--y-white); -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 0 0 3px var(--y-silver), 0 0 0 4px #3c3f58, 5px 6px 0 2px rgba(16, 21, 77, 0.3);
}
.chat-detail-screen .chat-header-custom .header-btn-back,
.chat-detail-screen .chat-header-custom .header-btn-info { width: 30px; height: 28px; border-radius: 0; background: var(--y-silver); color: var(--y-ink);
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white); }
.chat-detail-screen .chat-header-custom .header-btn-back svg, .chat-detail-screen .chat-header-custom .header-btn-info svg { width: 16px; height: 16px; }
.chat-detail-screen .chat-header-name { font-size: 15px; font-weight: 400; }
.chat-detail-screen .chat-header-subtitle { color: #c9d0ff; font-size: 11px; }
.chat-detail-screen .header-avatar-container { border-radius: 0; box-shadow: 0 0 0 1.5px var(--y-ink); width: 24px; height: 24px; }
.chat-detail-screen .chat-messages-area { background: rgba(226, 228, 251, 0.55); margin: 0 8px; inset: 0 0 0 0; }
.chat-detail-screen .msg-me { padding: 0 12px 0 40px; }
.chat-detail-screen .msg-them { padding: 0 40px 0 12px; }
.chat-detail-screen .bubble-me-custom, .chat-detail-screen .bubble-them-custom {
  border-radius: 3px !important; border: 1.5px solid var(--y-ink); line-height: 1.6; font-family: var(--f-pixel); }
.chat-detail-screen .bubble-them-custom { box-shadow: 2px 2px 0 var(--y-peri); }
.chat-detail-screen .bubble-me-custom { background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%), var(--y-cobalt);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 2px 2px 0 rgba(16, 21, 77, 0.35); }
.chat-detail-screen .bubble-me-custom:has(.msg-image-wrapper), .chat-detail-screen .bubble-them-custom:has(.msg-image-wrapper) { border: 0; box-shadow: none; background: transparent; }
.chat-detail-screen .msg-image-wrapper img:not(.msg-sticker) { border-radius: 0; border: 5px solid #fff; border-bottom-width: 16px; box-shadow: 2px 3px 0 rgba(16, 21, 77, 0.3); }
.chat-detail-screen .timestamp-custom { font-size: 12px; color: var(--y-white); text-shadow: 1px 1px 0 var(--y-cobalt-deep); }
.chat-detail-screen .msg-tool-chip { border-radius: 0; background: var(--y-silver); color: var(--y-ink); font: 12px var(--f-pixel);
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), 3px 3px 0 rgba(16, 21, 77, 0.25); }
.chat-detail-screen .msg-subtext-toggle { border-radius: 0; background: var(--y-cobalt-deep); color: var(--y-white); font-family: var(--f-pixel); }
.chat-detail-screen .msg-subtext-body { border-radius: 0; background: #d6dbff; color: var(--y-cobalt-deep); font-family: var(--f-pixel); }
.chat-detail-screen .msg-meta-caption { font-family: var(--f-pixel); color: var(--text-sub); }
.chat-detail-screen .msg-reply-block-detached { border-radius: 0; font-family: var(--f-pixel); }
.chat-detail-screen .msg-translation-detached-content { font-family: var(--f-pixel); color: var(--y-white); text-shadow: 1px 1px 0 var(--y-cobalt-deep); }
.chat-detail-screen .msg-system-notice.is-info { color: var(--y-white); text-shadow: 1px 1px 0 var(--y-cobalt-deep); font-family: var(--f-pixel); }
.chat-detail-screen .input-box-custom { font-family: var(--f-pixel); }
.chat-detail-screen .bb-sticker-btn img, .chat-detail-screen .y-btn-img { width: 30px; height: 30px; }
.chat-detail-screen .send-btn-custom, .chat-detail-screen .input-btn-ai { background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 50%), var(--y-cobalt); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.chat-detail-screen .chat-empty p { color: var(--y-white); text-shadow: 1px 1px 0 var(--y-cobalt-deep); }

@media (prefers-reduced-motion: reduce) {
  .y-splash *, .y-desk * { animation: none !important; transition: none !important; }
  .y-logo, .y-bar i { opacity: 1; }
}

/* ---------- popups: Win98 windows instead of iOS sheets ---------- */
.action-sheet { background: rgba(10, 14, 70, 0.35); }
.action-panel { gap: 8px; padding: 12px 14px calc(var(--safe-bottom) + 14px); font-family: var(--f-pixel); }
.action-items, .action-cancel, .reaction-picker { -webkit-backdrop-filter: none; backdrop-filter: none; }
.action-items {
  border-radius: 0; padding: 3px; background: var(--y-silver);
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), inset -2px -2px 0 #8a8ca3, inset 2px 2px 0 #eceef8, 4px 5px 0 rgba(16, 21, 77, 0.3);
}
.action-title {
  margin: 0 0 3px; padding: 5px 8px; border: 0; text-align: left; font-size: 13px; color: var(--y-white);
  background: linear-gradient(90deg, var(--y-cobalt-deep), var(--y-cobalt) 55%, #5a6ae6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.action-items button { padding: 12px 14px; font-size: 15px; text-align: left; color: var(--y-ink); background: var(--y-white); font-family: var(--f-pixel); }
.action-items button + button { border-top: 1px solid #d3d5e6; }
.action-items button:active { background: var(--y-cobalt); color: var(--y-white); }
.action-items button.danger { color: #c4214a; }
.action-items .pick-chips { background: var(--y-white); }
.action-items .pick-chips button, .action-items .pick-chips button + button { border-radius: 0; padding: 7px 11px; border: 1px solid #8a8ca3; box-shadow: inset -1px -1px 0 #c9cbdc; }
.action-items .pick-chips button.is-picked { background: var(--y-cobalt); color: var(--y-white); border-color: var(--y-cobalt-deep); }
.action-items .pick-done { border-top: 1px solid #d3d5e6; text-align: center; }
.action-cancel {
  border-radius: 0; padding: 10px; font-size: 15px; font-weight: 400; color: var(--y-ink); background: var(--y-silver); font-family: var(--f-pixel);
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), inset -2px -2px 0 #8a8ca3, inset 2px 2px 0 #eceef8;
}
.action-cancel:active { transform: none; box-shadow: inset 1px 1px 0 #3c3f58, inset -1px -1px 0 var(--y-white); }
.reaction-picker { border-radius: 0; background: var(--y-silver); box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), 4px 5px 0 rgba(16, 21, 77, 0.3); }
.reaction-picker button { border-radius: 0; }
.reaction-picker button.is-selected { background: var(--y-cobalt); }
.toast {
  border-radius: 0; padding: 9px 14px 9px 12px; color: var(--y-ink); background: var(--y-silver); font: 14px/1.4 var(--f-pixel);
  -webkit-backdrop-filter: none; backdrop-filter: none; border-left: 22px solid var(--y-cobalt);
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), 4px 5px 0 rgba(16, 21, 77, 0.3);
}
.more-options-popup { border-radius: 0; background: var(--y-silver); -webkit-backdrop-filter: none; backdrop-filter: none; font-family: var(--f-pixel);
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), 4px 5px 0 rgba(16, 21, 77, 0.3); }
.more-options-item-row:active { background: var(--y-cobalt); color: var(--y-white); }

/* ---------- login ---------- */
.screen.login { background: radial-gradient(120% 80% at 50% 30%, rgba(58, 71, 207, 0.3), rgba(10, 14, 70, 0.75) 70%), var(--y-wall) center / cover, #141b78; }
.login-card {
  padding: 3px 3px 16px; gap: 12px; background: var(--y-silver); font-family: var(--f-pixel);
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), inset -2px -2px 0 #8a8ca3, inset 2px 2px 0 #eceef8, 6px 7px 0 rgba(0, 0, 30, 0.35);
}
.login-logo { display: none; }
.login-card h1 { margin: 0; padding: 6px 8px; font-size: 14px; font-weight: 400; text-align: left; color: var(--y-white);
  background: linear-gradient(90deg, var(--y-cobalt-deep), var(--y-cobalt) 55%, #5a6ae6); }
.login-card h1::after { content: " — 请输入密码"; }
.login-card input { margin: 4px 14px 0; height: 40px; border-radius: 0; font-family: var(--f-pixel); box-shadow: inset 1px 1px 0 #6f7290, inset -1px -1px 0 var(--y-white); }
.login-card .btn-primary { margin: 0 14px; height: 40px; border-radius: 0; background: var(--y-silver); color: var(--y-ink); font-family: var(--f-pixel); box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), inset -2px -2px 0 #8a8ca3; }
.form-error { padding: 0 14px; }

/* in-app message popup (while the app is open on another page) */
.y-notice {
  position: fixed; z-index: 450; top: calc(var(--safe-top) + 10px); left: 12px; right: 12px; display: grid; gap: 0; padding: 3px; text-align: left; border: 0;
  background: var(--y-silver); color: var(--y-ink); font-family: var(--f-pixel); cursor: pointer; animation: y-notice-in 0.35s ease-out;
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), inset -2px -2px 0 #8a8ca3, inset 2px 2px 0 #eceef8, 5px 6px 0 rgba(16, 21, 77, 0.35);
}
.y-notice-body { padding: 8px 10px 9px; font-size: 14px; line-height: 1.5; background: var(--y-white); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes y-notice-in { from { transform: translateY(-120%); } to { transform: none; } }

/* settings rows: 3D icons instead of coloured tiles */
.row-art { flex: none; width: 34px; height: 34px; margin: -4px 0; filter: drop-shadow(1px 2px 2px rgba(16, 21, 77, 0.3)); }

/* GPT subscription: used quota, with the five-hour window outside and the week inside. */
/* on the desk the whole window is the tap target (it can be dragged), so the card itself doesn't take taps */
.y-quota { width: min(200px, 52vw); }
.y-quota .quota-card { pointer-events: none; border-top: 0; min-height: 0; padding: 8px 10px; gap: 8px; }
.y-quota .quota-rings { width: 58px; height: 58px; }
.y-quota .quota-copy { font-size: 11px; }
.quota-card { width: 100%; min-height: 92px; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border: 0; border-top: 0.5px solid var(--line); background: var(--y-white); color: var(--y-ink); text-align: left; cursor: pointer; font: 13px/1.5 var(--f-pixel); }
.quota-card:active { background: var(--y-lilac); }
.quota-card:disabled { color: var(--y-ink); cursor: wait; }
.quota-rings { flex: none; width: 74px; height: 74px; overflow: visible; }
.quota-rings circle { fill: none; stroke-width: 7; }
.quota-track { stroke: var(--y-lilac); }
.quota-used { stroke: var(--y-cobalt); stroke-linecap: butt; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray 0.3s ease; }
.quota-used.quota-week { stroke: var(--y-peri); }
.quota-used.is-low { stroke: #d92f4c; }
.quota-rings text { fill: var(--y-cobalt-deep); font: 700 13px var(--f-pixel); }
.quota-copy { flex: 1; min-width: 0; display: grid; gap: 5px; }
.quota-copy span { white-space: normal; }
.quota-refresh { flex: none; color: var(--y-cobalt); font: 20px/1 var(--f-pixel); }
.quota-card.is-refreshing .quota-refresh { animation: quota-spin 0.8s linear infinite; }
@keyframes quota-spin { to { transform: rotate(360deg); } }

/* 桌宠 */
.y-pet { position: relative; width: 72px; height: 72px; }
/* 许晏本体 emotes: 64×64 pixel art at exactly 2×, each SVG animates itself */
/* the SVG frame is twice the knot (room to roll, bounce, hold a balloon); the knot itself sits on the 72px box (¾ of the old 2×) */
.y-pet-emote { display: block; width: 144px; height: 144px; margin: -45px 0 0 -36px; image-rendering: pixelated; pointer-events: none; }
.y-pet-say { position: absolute; left: 50%; bottom: 100%; transform: translateX(-30%); margin-bottom: 4px; max-width: 180px; width: max-content;
  padding: 6px 9px; background: var(--y-white); color: var(--y-ink); font: 12px/1.45 var(--f-pixel); border: 1.5px solid var(--y-ink);
  box-shadow: 2px 2px 0 var(--y-peri); animation: y-rise 0.2s ease-out; z-index: 3; }
.y-pet-say::after { content: ""; position: absolute; left: 22%; top: 100%; border: 6px solid transparent; border-top-color: var(--y-ink); }
.y-zzz { position: absolute; right: 10px; top: 4px; font: 16px var(--f-pixel); color: var(--y-white); text-shadow: 1px 1px 0 #222; animation: y-zzz 2.4s ease-in-out infinite; }
@keyframes y-zzz { 0% { opacity: 0; transform: translate(0, 6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -14px); } }

/* 夜巡 */
.patrol-url { padding: 8px 16px 12px; font: 12px/1.5 ui-monospace, Menlo, monospace; color: var(--text-sub, #5d6290); word-break: break-all; user-select: all; -webkit-user-select: all; }
.patrol-steps { margin: 0; padding: 12px 16px 14px 34px; display: grid; gap: 8px; font-size: 14px; line-height: 1.55; }

/* A page TA made ([网页:…]): a small envelope card that opens it */
.msg-page-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-width: 190px; padding: 10px 12px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #eef1ff, #d9defa); color: var(--y-cobalt-deep, #1f2a8c); text-align: left; font: inherit; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(60, 70, 160, 0.25); }
.msg-page-icon { grid-row: span 2; font-size: 26px; line-height: 1; }
.msg-page-title { font-weight: 600; font-size: 15px; }
.msg-page-sub { font-size: 12px; opacity: 0.7; }
.msg-page-inline { width: min(320px, 74vw); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(60, 70, 160, 0.25), 0 4px 14px rgba(16, 21, 77, 0.18); }
.msg-page-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: linear-gradient(135deg, #eef1ff, #d9defa); color: var(--y-cobalt-deep, #1f2a8c); font-size: 13px; }
.msg-page-bar span { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-page-bar button { flex: none; padding: 4px 10px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.8); color: inherit; font: inherit; font-size: 12px; }
.msg-page-frame { display: block; width: 100%; height: 420px; border: 0; background: #fff; }

/* ---------- voice: notes, recordings, the mic button ---------- */
.voice-bubble { display: flex; flex-direction: column; gap: 4px; min-width: 110px; width: var(--w, 50%); max-width: 230px; }
.voice-play { display: flex; align-items: center; gap: 10px; padding: 2px 0; border: 0; background: none; color: inherit; font: 14px var(--f-pixel); cursor: pointer; }
.voice-wave { display: inline-flex; align-items: center; gap: 3px; height: 16px; }
.voice-wave i { width: 3px; border-radius: 2px; background: currentColor; height: 6px; }
.voice-wave i:nth-child(2) { height: 12px; }
.voice-wave i:nth-child(3) { height: 16px; }
.voice-bubble.is-playing .voice-wave i { animation: y-voice 0.9s ease-in-out infinite; }
.voice-bubble.is-playing .voice-wave i:nth-child(2) { animation-delay: 0.15s; }
.voice-bubble.is-playing .voice-wave i:nth-child(3) { animation-delay: 0.3s; }
@keyframes y-voice { 50% { transform: scaleY(0.35); } }
.voice-len { opacity: 0.8; }
.voice-text-toggle { align-self: flex-start; border: 0; background: none; padding: 0; color: inherit; opacity: 0.75; font: 12px/1.45 inherit; text-align: left; cursor: pointer; }
.chat-detail-screen .bb-mic-btn { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 0; background: none; color: var(--text-sub); }
.chat-detail-screen .bb-mic-btn.is-recording { background: #e8344e; color: #fff; box-shadow: 0 0 0 4px rgba(232, 52, 78, 0.25); animation: y-blink 1.1s steps(1) infinite; }
.bb-rec-time { font: 12px var(--f-pixel); }
.chat-detail-screen .bb-mic-btn { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.bb-hold { position: fixed; left: 50%; bottom: calc(var(--safe-bottom, 0px) + 120px); transform: translateX(-50%); z-index: 40; pointer-events: none;
  min-width: 170px; padding: 16px 20px 12px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(20, 40, 110, 0.88); color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.bb-hold b { font: 18px var(--f-pixel); }
.bb-hold.is-cancel { background: rgba(200, 40, 60, 0.92); }
.bb-hold-wave { display: flex; gap: 4px; height: 22px; align-items: center; }
.bb-hold-wave i { width: 4px; height: 100%; border-radius: 2px; background: #9fe3ff; animation: bb-wave 0.9s ease-in-out infinite; }
.bb-hold-wave i:nth-child(2) { animation-delay: -0.2s; } .bb-hold-wave i:nth-child(3) { animation-delay: -0.4s; }
.bb-hold-wave i:nth-child(4) { animation-delay: -0.6s; } .bb-hold-wave i:nth-child(5) { animation-delay: -0.8s; }
.bb-hold.is-cancel .bb-hold-wave i { background: #ffd0d6; animation-play-state: paused; }
@keyframes bb-wave { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

/* ---------- the phone call: a chrome flip phone with an icy LCD ---------- */
.call-screen { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom, 0px) + 16px);
  background: var(--y-wall) center / cover, var(--y-cobalt-deep); }
.call-window { width: min(360px, 100%); display: flex; flex-direction: column; }
.call-phone { position: relative; margin: 10px auto 0; width: min(290px, 76vw); }
.call-phone img { position: relative; z-index: 2; display: block; width: 100%; filter: drop-shadow(4px 12px 10px rgba(16, 21, 77, 0.4)); pointer-events: none; }
/* the screen hole in call-phone.webp (measured when it was cut out) */
.call-lcd { position: absolute; z-index: 1; left: 12.9%; top: 11.3%; width: 48.7%; height: 27.4%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; border-radius: 6px;
  background: linear-gradient(180deg, #bfe6ff, #7cc4f2); box-shadow: inset 0 0 0 2px rgba(16, 40, 90, 0.35), inset 0 6px 14px rgba(255, 255, 255, 0.55);
  color: #0d2350; font-family: var(--f-pixel); text-align: center; }
.call-lcd b { font-weight: 400; font-size: 20px; }
.call-clock { font-size: 28px; letter-spacing: 1px; }
.call-state { font-size: 13px; }
.call-state.blink { animation: y-blink 1.1s steps(1) infinite; }
.call-meter { display: flex; gap: 2px; margin-top: 2px; }
.call-meter i { width: 7px; height: 10px; background: rgba(13, 35, 80, 0.18); }
.call-meter i.on { background: #0d2350; }
.call-heard { margin: 8px 12px 0; font: 12px/1.5 var(--f-pixel); color: var(--y-ink); opacity: 0.75; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.call-btns { display: flex; justify-content: center; gap: 12px; padding: 12px 10px 14px; }
.call-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 14px; }
.call-btn svg { width: 18px; height: 18px; }
.call-btn.is-hangup { background: #e8344e; color: #fff; }
.call-btn.is-answer { background: #2fbf5b; color: #fff; }
.call-incoming { z-index: 60; }
.call-reason { font-size: 12px; line-height: 1.35; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.call-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 10px 12px 0; }
.call-quick .w98-btn { font-size: 13px; padding: 6px 10px; }
.call-leds { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.call-leds i { width: 8px; height: 8px; border-radius: 50%; background: #5d6178; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5); }
.call-leds i.g { background: #3ddc6a; box-shadow: 0 0 6px #3ddc6a; }
.call-leds i.a { background: #ffb02e; box-shadow: 0 0 6px #ffb02e; }
.call-leds i.r { background: #ff3b52; box-shadow: 0 0 6px #ff3b52; }

/* call: live captions, replay, and the card it leaves in the chat */
.call-phone { width: min(210px, 56vw); }
.call-captions, .call-replay { margin: 8px 10px 0; max-height: 26vh; overflow-y: auto; padding: 8px 10px; background: var(--y-white); box-shadow: inset 1px 1px 0 #3c3f58, inset -1px -1px 0 var(--y-white), inset 2px 2px 0 #8a8ca3; font: 13px/1.55 var(--f-pixel); color: var(--y-ink); }
.call-replay { max-height: 62vh; display: flex; flex-direction: column; gap: 4px; }
.call-captions p { margin: 0 0 6px; }
.call-captions b, .replay-line b { margin-right: 6px; color: var(--y-cobalt); font-weight: 400; }
.call-captions p.me b, .replay-line.me b { color: #b0306a; }
.call-hint { margin: 0; opacity: 0.6; text-align: center; }
.replay-line { display: block; width: 100%; padding: 6px 8px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.replay-line.is-playing { background: var(--y-lilac); }
.msg-call-card { align-self: center; display: flex; align-items: center; gap: 8px; margin: 10px auto; padding: 8px 14px; border: 0; background: var(--y-silver); color: var(--y-ink); font: 13px var(--f-pixel); cursor: pointer;
  box-shadow: inset -1px -1px 0 #3c3f58, inset 1px 1px 0 var(--y-white), inset -2px -2px 0 #8a8ca3, inset 2px 2px 0 #eceef8; }
.msg-call-card svg { width: 16px; height: 16px; }
.msg-call-card em { font-style: normal; color: var(--y-cobalt); }
.y-clockmood .feel .doing .v { max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--y-ink); }

/* ---------- the call shrunk to a floating bar, so the chat can be used meanwhile ---------- */
.call-title-btns { display: flex; gap: 4px; }
.call-resume { margin: 8px 12px 0; padding: 8px; font-size: 14px; animation: y-blink 1.1s steps(1) infinite; }
.call-mini { position: fixed; z-index: 35; top: calc(var(--safe-top, 0px) + 60px); left: 50%; transform: translateX(-50%);
  width: min(340px, calc(100% - 32px)); display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 6px;
  border-radius: 22px; background: linear-gradient(180deg, #2c4fd8, #16308f); color: #fff; box-shadow: 0 6px 18px rgba(10, 20, 80, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.call-mini-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: inherit; padding: 6px 4px; font-size: 14px; text-align: left; }
.call-mini-main b { font-weight: 600; }
.call-mini-clock { font: 12px var(--f-pixel); opacity: 0.85; }
.call-mini-state { margin-left: auto; font-size: 12px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-mini-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #5dff8a; box-shadow: 0 0 6px #5dff8a; }
.call-mini-dot.is-talk { animation: y-blink 0.8s steps(1) infinite; }
.call-mini-end { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #e8344e; color: #fff; }
.call-mini-end svg { width: 18px; height: 18px; transform: rotate(135deg); }
.chat-detail-screen .chat-scene-tag { color: #ffd36b; }
/* the photo stack as polaroids: each card framed */
.chat-detail-screen .msg-image-wrapper .photo-stack .photo-card { border-radius: 0; background: #fff; border: 5px solid #fff; border-bottom-width: 16px; box-shadow: 2px 3px 0 rgba(16, 21, 77, 0.3); box-sizing: border-box; }
.chat-detail-screen .photo-stack-count { font: 11px var(--f-pixel); border-radius: 0; background: rgba(16, 21, 77, 0.7); }

/* 购物申请单 */
.purchase-card { width: min(260px, 70vw); padding: 12px 14px 10px; background: #fffdf6; color: #2a2a3a; border: 1.5px solid #2a2a3a; box-shadow: 3px 3px 0 rgba(42, 42, 58, 0.25);
  font-family: var(--f-pixel); position: relative; text-align: left; }
.purchase-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.5px dashed #2a2a3a; padding-bottom: 6px; margin-bottom: 6px; }
.purchase-head b { font-weight: 400; font-size: 16px; letter-spacing: 2px; }
.purchase-head span { font-size: 11px; opacity: 0.6; }
.purchase-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 13px; line-height: 1.45; }
.purchase-card dt { opacity: 0.6; }
.purchase-card dd { margin: 0; word-break: break-all; }
.purchase-card a { color: #3550c8; }
.purchase-foot { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; padding-top: 6px; border-top: 1.5px dashed #2a2a3a; }
.purchase-wait { font-size: 12px; opacity: 0.55; }
.purchase-stamp { flex: none; display: grid; place-items: center; width: 62px; height: 62px; margin: -6px 0 -4px; border: 3px double currentColor; border-radius: 50%;
  font-size: 13px; line-height: 1.1; text-align: center; transform: rotate(-14deg); color: #d23a3a; opacity: 0.88; animation: stamp-in 0.35s cubic-bezier(.3, 1.6, .5, 1); }
.purchase-stamp.is-conditional { color: #d98a1a; font-size: 11px; }
.purchase-stamp.is-reject { color: #5a5f78; }
@keyframes stamp-in { from { transform: rotate(-14deg) scale(1.8); opacity: 0; } }
.purchase-note { font-size: 13px; line-height: 1.45; }
.purchase-sheet { position: fixed; inset: 0; z-index: 80; display: grid; align-items: end; background: rgba(10, 12, 30, 0.35); animation: fade-in 0.2s; }
.purchase-form { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px calc(var(--safe-bottom, 0px) + 16px); background: #fffdf6; color: #2a2a3a;
  border-top: 2px solid #2a2a3a; font-family: var(--f-pixel); max-height: 88vh; overflow-y: auto; }
.purchase-form h3 { margin: 0 0 2px; font-weight: 400; font-size: 18px; letter-spacing: 3px; text-align: center; }
.purchase-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; opacity: 0.9; }
.purchase-form input, .purchase-form textarea { font: 16px/1.4 -apple-system, "PingFang SC", sans-serif; padding: 8px 10px; border: 1.5px solid #2a2a3a; border-radius: 0; background: #fff; color: #111; resize: none; }
.purchase-urgency { display: flex; gap: 8px; }
.purchase-urgency button, .purchase-actions button { flex: 1; padding: 9px 0; font: 14px var(--f-pixel); border: 1.5px solid #2a2a3a; background: #fff; color: #2a2a3a; }
.purchase-urgency button.on { background: #2a2a3a; color: #fffdf6; }
.purchase-actions { display: flex; gap: 10px; margin-top: 4px; }
.purchase-actions .primary { background: #d23a3a; border-color: #d23a3a; color: #fff; }
.purchase-actions .primary:disabled { opacity: 0.4; }

.song-card { width: min(260px, 70vw); padding: 12px; background: #fffdf6; color: #2a2a3a; border: 1.5px solid #2a2a3a; box-shadow: 3px 3px 0 rgba(42, 42, 58, 0.25); }
.song-head { padding-bottom: 8px; border-bottom: 1px dashed #a4a6bb; font-size: 12px; color: var(--y-cobalt-deep, #1f2a8c); }
.song-info { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.song-info > div:last-child { min-width: 0; }
.song-cover { flex: none; width: 56px; height: 56px; display: grid; place-items: center; background: #d9defa; color: #1f2a8c; font-size: 28px; border: 1px solid #a4a6bb; }
.song-cover img { width: 100%; height: 100%; object-fit: cover; }
.song-name, .song-artist { display: block; overflow-wrap: anywhere; }
.song-name { font-size: 15px; }
.song-artist { margin-top: 4px; font-size: 12px; opacity: .7; }
.song-note { margin: 10px 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.song-listen { width: 100%; padding: 8px; border: 1px solid #777b9f; background: linear-gradient(#eef1ff, #d9defa); color: #1f2a8c; box-shadow: inset 1px 1px #fff; font: inherit; font-size: 13px; cursor: pointer; }
