/**
 * 制作台 · UX2 壳层窄屏 / 移动底栏（P-css-n：自 shell.css 切出）
 * 加载：须在 ink-gag-studio-shell.css 之后。
 */

/* ≤900px：侧栏改为浮层（desktop-first 不启用） */
@media (max-width: 900px) {
  body:not(.igs-ux2-desktop-first).igs-on-workspace .igs-workspace.igs-shell-on,
  body:not(.igs-ux2-desktop-first) .igs-workspace.igs-shell-on {
    --igs-shell-drawer-active: 0px !important;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-on .igs-shell-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(20rem, 92vw);
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 28px rgba(16, 36, 28, 0.18);
    z-index: 220;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-on.igs-shell-drawer-open .igs-shell-drawer {
    transform: none;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-on:not(.igs-shell-drawer-open) .igs-shell-drawer__peek {
    display: none;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-on:not(.igs-shell-drawer-open) .igs-shell-drawer__panel {
    display: flex;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-drawer-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 210;
    border: 0;
    background: rgba(12, 24, 20, 0.42);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-on.igs-shell-drawer-open .igs-shell-drawer-scrim {
    display: block;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-drawer-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: max(0.55rem, env(safe-area-inset-left));
    bottom: calc(var(--igs-shell-mnav-h) + 0.7rem);
    z-index: 130;
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--igs-accent, #2d6a4f) 35%, transparent);
    background: var(--igs-surface, #fff);
    color: var(--igs-accent, #2d6a4f);
    box-shadow: 0 8px 22px rgba(20, 40, 32, 0.16);
    cursor: pointer;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-on.igs-shell-drawer-open .igs-shell-drawer-fab {
    display: none;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-drawer-fab svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 900px) {
  body:not(.igs-ux2-desktop-first) .igs-shell-on .igs-shell-station-nav { display: none; }
  body:not(.igs-ux2-desktop-first).igs-ux2-show-tabs.igs-on-workspace .igs-workspace.igs-shell-on > #igsTabs {
    display: none !important;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-mnav {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 120;
    justify-content: space-around;
    gap: 0.1rem;
    padding: 0.3rem 0.2rem calc(0.3rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--igs-surface, #fff) 92%, #e8f2ed);
    border-top: 1px solid var(--igs-line);
    backdrop-filter: blur(10px);
  }
  .igs-shell-mnav button {
    flex: 1;
    min-height: 3rem;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.68rem;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    color: var(--igs-ink-muted, #556);
    border-radius: 0.55rem;
  }
  .igs-shell-mnav button svg {
    width: 18px;
    height: 18px;
    opacity: 0.95;
  }
  .igs-shell-mnav button.is-on {
    color: var(--igs-accent, #2d6a4f);
    font-weight: 700;
    background: color-mix(in srgb, var(--igs-accent, #2d6a4f) 12%, transparent);
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-on .igs-main { padding-bottom: var(--igs-shell-mnav-h); }
}

.igs-shell-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.igs-shell-more-sheet.is-open { display: flex; }
.igs-shell-more-sheet__panel {
  width: min(100%, 28rem);
  max-height: 70dvh;
  overflow: auto;
  background: var(--igs-surface);
  border-radius: 1rem 1rem 0 0;
  padding: 0 1rem 1rem;
}
.igs-shell-more-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  padding: 0.85rem 0 0.65rem;
  background: var(--igs-surface);
  border-bottom: 1px solid var(--igs-line);
  margin-bottom: 0.65rem;
}
.igs-shell-more-sheet__head h2 {
  margin: 0;
  font-size: 1rem;
}
.igs-shell-more-sheet__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.igs-shell-more-group__title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--igs-muted, #667);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.igs-shell-more-group__title svg {
  opacity: 0.75;
}
.igs-shell-more-group--cta {
  padding: 0.65rem 0.5rem;
  border-radius: 0.5rem;
  background: var(--igs-surface-2);
  text-align: center;
}
.igs-shell-more-group--foot {
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--igs-line, rgba(0, 0, 0, 0.08));
}
.igs-shell-more-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}
.igs-shell-more-help-inline {
  margin-top: 0.45rem;
}
.igs-shell-more-tab {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.4rem;
  text-align: left;
}
.igs-shell-more-tab__ico {
  flex: 0 0 auto;
  margin-top: 0.08rem;
}
.igs-shell-more-tab__ico svg {
  width: 16px;
  height: 16px;
  opacity: 0.88;
}
.igs-shell-more-tab__copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.igs-shell-more-tab strong {
  font-weight: 650;
  font-size: 0.88rem;
}
.igs-shell-more-tab__hint {
  font-size: 0.68rem;
  color: var(--igs-muted, #667);
  font-weight: 400;
  line-height: 1.25;
}
.igs-shell-more-tab.is-on {
  border-color: var(--igs-accent);
  color: var(--igs-accent);
  font-weight: 600;
}
.igs-shell-shared-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.06);
}
/* display:flex 会盖掉 UA [hidden]；个人空间必须彻底藏横幅 */
.igs-shell-shared-banner[hidden] {
  display: none !important;
}
body.igs-space-personal .igs-shell-shared-banner {
  display: none !important;
}
.igs-shell-shared-banner__ico svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}
.igs-shell-shared-banner__copy {
  flex: 1;
  min-width: 10rem;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}
.igs-shell-shared-banner__copy strong {
  display: block;
  font-size: 0.88rem;
}
.igs-shell-shared-banner__switch {
  flex-shrink: 0;
}
.igs-shell-more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}
.igs-shell-more-grid button {
  min-height: 2.75rem;
  font-size: 0.78rem;
  border: 1px solid var(--igs-line);
  border-radius: 0.45rem;
  background: var(--igs-surface-2);
  cursor: pointer;
}


/* 窄屏钉死「本书资料 / 工具」入口（仅非 desktop-first 移动栈） */
@media (max-width: 900px) {
  body:not(.igs-ux2-desktop-first) .igs-shell-chrome-zone--work #igsShellDrawerBtn,
  body:not(.igs-ux2-desktop-first) .igs-shell-chrome-zone--work #igsShellToolsBtn {
    display: inline-flex !important;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-chrome-zone--work #igsShellDrawerBtn span,
  body:not(.igs-ux2-desktop-first) .igs-shell-chrome-zone--work #igsShellToolsBtn span {
    display: none;
  }
  body:not(.igs-ux2-desktop-first) .igs-shell-chrome-zone--system .igs-shell-mode-switch span,
  body:not(.igs-ux2-desktop-first) .igs-shell-chrome-zone--system #igsShellVersion {
    display: none;
  }
}
