/* 2026-11-28 interaction polish before the Android / Windows apps.
   Everything here is additive: removing this file's <link> from index.html
   (plus the matching app.js / studio.js lines) restores the old look. */

/* ---------------------------------------------------------------- boot splash */
/* Covers the first session check so the page never opens on an empty screen.
   app.js fades it out when the first connect() settles; if app.js never runs,
   the timeout animation below clears it after 12 s on its own. */
.boot-splash {
  position: fixed; inset: 0; z-index: 2147483000;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: #090b0f;
  transition: opacity .32s ease, visibility 0s linear .32s;
  animation: bootSplashTimeout .3s ease 12s forwards;
}
.boot-splash.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-splash-brand {
  font-size: clamp(40px, 11vw, 56px); font-weight: 820; line-height: 1; letter-spacing: -.055em;
  color: transparent;
  background: linear-gradient(112deg, #ffffff 8%, #e8ffd1 38%, #d8ff4f 61%, #87dfff 96%);
  -webkit-background-clip: text; background-clip: text;
}
.boot-splash-bar { position: relative; width: 96px; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .08); }
.boot-splash-bar::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
  border-radius: inherit; background: #d8ff4f;
  animation: bootSplashBar 1.1s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes bootSplashBar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes bootSplashTimeout { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) {
  .boot-splash-bar::after { animation: none; width: 100%; opacity: .45; }
}

/* ---------------------------------------------------------------- phone layout */
@media (max-width: 619px) {
  /* Mode tabs: one row that scrolls sideways (owner's 2026-11-26 side-by-side order is
     kept). studio.js fades whichever edge has more tabs behind it. */
  .studio-layout .studio-composer .studio-mode-tabs,
  html.ui-v2 .studio-layout .studio-composer .studio-mode-tabs {
    display: flex; flex-wrap: nowrap; grid-template-columns: none; gap: 4px;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .studio-layout .studio-composer .studio-mode-tabs::-webkit-scrollbar { display: none; }
  .studio-layout .studio-composer .studio-mode-tabs button,
  html.ui-v2 .studio-layout .studio-composer .studio-mode-tabs button {
    flex: 0 0 auto; min-height: 36px; padding: 6px 13px; font-size: 13px; scroll-snap-align: center;
  }
  .studio-layout .studio-composer .studio-mode-tabs.fade-end {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  }
  .studio-layout .studio-composer .studio-mode-tabs.fade-start {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px);
    mask-image: linear-gradient(90deg, transparent, #000 36px);
  }
  .studio-layout .studio-composer .studio-mode-tabs.fade-start.fade-end {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
  }

  /* Tab bar: as many slots as visible tabs (工具 is gone, 广场 follows its admin
     switch). app.js sets --nav-count / --nav-index; this replaces the per-tab
     transforms in styles.css, studio.css, ui-v2.css and gallery.css. */
  .studio-layout:not(.auth-mode) #mobileNav:not(.hidden) { grid-template-columns: repeat(var(--nav-count, 4), minmax(0, 1fr)) !important; }
  .studio-layout:not(.auth-mode) #mobileNav .mobile-nav-indicator {
    width: calc((100% - 12px) / var(--nav-count, 4)) !important;
    transform: translate3d(calc(var(--nav-index, 0) * 100%), 0, 0) !important;
  }
  html.ui-v2 .studio-layout:not(.auth-mode) #mobileNav .mobile-nav-indicator { width: calc((100% - 16px) / var(--nav-count, 4)) !important; }

  /* 开始生成 pill: slides under the tab bar while you scroll down through 最近作品
     (studio.js sets generate-pill-away) and comes back when you scroll up. */
  html.ui-v2 .studio-layout:not(.auth-mode) .studio-submit-row { transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
  html.ui-v2 .studio-layout.generate-pill-away:not(.auth-mode):not(.keyboard-open) .studio-submit-row { transform: translateY(calc(100% + 28px)); opacity: 0; }
  html.ui-v2 .studio-layout.generate-pill-away #studioSubmitSlot,
  html.ui-v2 .studio-layout.generate-pill-away #studioSubmitSlot .action-dock { pointer-events: none; }
}
@media (max-width: 619px) and (prefers-reduced-motion: reduce) {
  html.ui-v2 .studio-layout:not(.auth-mode) .studio-submit-row { transition: opacity .15s linear; }
}

/* ---------------------------------------------------------------- works lists */
/* 最近作品 on the create page: the ••• menu replaces the always-on red 删除. */
.studio-layout .history-item { position: relative; }
@media (hover: hover) {
  .studio-layout .history-item:hover .history-item-menu,
  .studio-layout .history-item:focus-within .history-item-menu { opacity: 1; }
}
/* Phones: load more as you scroll instead of numbered pages (app.js renderHistoryPager). */
.history-pagination.is-load-more { padding-top: 16px; padding-bottom: 4px; }
.history-load-more {
  min-height: 40px; padding: 0 22px;
  border: 1px solid var(--v2-line, rgba(242, 248, 246, .12)); border-radius: 999px;
  background: transparent; color: #aeb9c1; font-size: 13px;
}
.history-load-end { color: #6f7b85; font-size: 12px; }

/* The video panel's 「← 返回工具」 led to the 工具 page, which is no longer in the tab bar. */
#videoBackButton { display: none !important; }
