/*
 * viral-remix-mobile.css — 爆款贴图复刻移动端增强层（v2 单屏聚焦）
 * ────────────────────────────────────────────────────────────────
 * 定位：只增强 ≤760px 的移动端；桌面端样式零改动。
 * 原则（用户约束）：
 *   1. 不隐藏、不删减任何既有功能——本层只重排、放大、加底栏，
 *      表单、方向选择、发布文案、历史创作、保存弹窗全部保留可达。
 *   2. 低粉爆图「一键提取并复刻」→ sticker-extract → importStickerReferenceFiles
 *      带图进入本页的链路不经过本层任何改动的节点。
 * 材质沿用 liquid-glass.css 的分级：A 级真玻璃 / B 级磨砂片。
 */
@media (max-width: 760px) {

  /* ── 单列聚焦：表单占满，输出面板跟在下方 ── */
  body #viral-remix { padding: 10px 10px calc(96px + env(safe-area-inset-bottom)) !important; }
  #viral-remix .v3-meta { margin-bottom: 12px !important; font-size: 10px !important; }
  #viral-remix .skill-shell { grid-template-columns: 1fr !important; gap: 12px !important; }
  #viral-remix .skill-form-col,
  #viral-remix .skill-output-col { padding: 15px !important; border-radius: 16px !important; }

  /* ── 大上传区：视觉中心 ── */
  #viral-remix h1 { font-size: 24px !important; margin: 10px 0 8px !important; }
  #viral-remix .viral-upload { min-height: 240px !important; gap: 12px !important; border-radius: 16px !important; }
  #viral-remix .viral-upload-icon { width: 54px; height: 54px; font-size: 32px; }
  #viral-remix .viral-upload strong { font-size: 15px !important; }
  #viral-remix .field-wide { margin-top: 16px !important; }
  #viral-remix textarea { min-height: 84px !important; font-size: 14px !important; }

  /* 触控目标 ≥44px */
  #viral-remix .creation-actions button,
  #viral-remix #remix-history-open,
  #viral-remix .remix-source-choices button { min-height: 44px; }
  #viral-remix .viral-notice { font-size: 11.5px !important; line-height: 1.6 !important; }
  #viral-remix #viral-remix-start { min-height: 48px !important; margin-top: 16px !important; }

  /* ── 结果区：包裹层做吸顶玻璃条；阶段条本身保持原生结构（app.js 按下标切高亮） ── */
  #vrm-tabwrap {
    position: sticky; top: 8px; z-index: 14;
    display: flex; align-items: center; gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, .73);
    -webkit-backdrop-filter: blur(24px) saturate(165%);
    backdrop-filter: blur(24px) saturate(165%);
    border: 1px solid rgba(255, 255, 255, .72); border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,1), 0 10px 26px -18px rgba(12,45,30,.3);
  }
  #vrm-tabwrap .remix-result-tabs {
    display: flex; flex: 1; min-width: 0; gap: 2px; padding: 0;
    position: static; background: transparent; border: none; box-shadow: none;
  }
  #viral-remix .remix-result-tabs button {
    flex: 1; min-height: 40px; border-radius: 10px; font-size: 12px;
  }
  /* ── 阶段条 v2：分段控件式选中态（实心墨绿），一眼可辨 ── */
  #viral-remix .remix-result-tabs button {
    background: transparent; border: none;
    color: var(--ink-3, #7C8C82); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px;
    transition: background .2s cubic-bezier(.16,1,.3,1), color .2s cubic-bezier(.16,1,.3,1);
  }
  #viral-remix .remix-result-tabs button[aria-selected="true"] {
    background: linear-gradient(150deg, #1A7A56, #0E4A35);
    color: #fff; font-weight: 600;
    box-shadow: 0 6px 14px -8px rgba(14,74,53,.5);
  }
  /* ── 分阶段屏幕：每个结果面板是独立一屏，内部滚动，不靠页面长滚动 ── */
  #viral-remix .remix-panel {
    max-height: calc(100dvh - 190px);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 !important;
    scrollbar-width: none;
  }
  #viral-remix .remix-panel::-webkit-scrollbar { display: none; }
  #viral-remix .remix-panel > * { margin-left: 2px; margin-right: 2px; }
  #viral-remix .viral-result-card { padding: 14px !important; border-radius: 14px !important; }
  #viral-remix .viral-empty { min-height: 200px !important; padding: 6px !important; }
  /* 阶段条上的「返回」入口（JS 注入，仅移动端）：文字链样式，不参与选中态 */
  #vrm-back {
    flex: none !important; min-width: 0 !important; min-height: 40px; padding: 0 8px 0 4px !important;
    background: transparent !important; border: none !important; box-shadow: none !important;
    color: #14684A !important; font: 600 12.5px/1 inherit !important;
    white-space: nowrap; cursor: pointer;
  }
  #viral-remix .viral-empty h2 { font-size: 20px !important; }

  /* 顶部进度线已移除：阶段条（01/02/03）本身即进度指示，避免与 v3-meta 叠成视觉冗余 */
  #vrm-progress { display: none !important; }

  /* 阶段 tab：防文字折行 */
  #viral-remix .remix-result-tabs button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
  #viral-remix .remix-result-tabs #vrm-back { white-space: nowrap; }
  /* C：阶段微提示（自动消失） */
  .vrm-hint { display: flex; gap: 8px; align-items: flex-start; margin: 8px 14px 0; padding: 10px 12px;
    border-radius: 12px; font-size: 11.5px; color: #4A5D53; line-height: 1.6;
    background: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.62);
    box-shadow: 0 4px 14px -8px rgba(12,45,30,.25);
    animation: vrmHint 6s cubic-bezier(.16,1,.3,1) forwards; }
  .vrm-hint .hb { width: 16px; height: 16px; border-radius: 50%; flex: none; background: #14684A; color: #fff;
    font-size: 10px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
  @keyframes vrmHint { 0%{opacity:0;transform:translateY(-6px)} 5%{opacity:1;transform:none}
    88%{opacity:1} 100%{opacity:0;visibility:hidden} }

  /* ── 吸底 dock（JS 注入的镜像主按钮；主按钮可见时自动隐藏） ── */
  #vrm-dock {
    position: fixed; left: 10px; right: 10px;
    bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 30;
    padding-top: 18px;
    background: linear-gradient(180deg, rgba(240,243,236,0) 0%, rgba(240,243,236,.92) 36%, #F0F3EC 100%);
    transition: opacity .25s cubic-bezier(.16,1,.3,1), transform .25s cubic-bezier(.16,1,.3,1);
  }
  #vrm-dock[data-off="1"] { opacity: 0; transform: translateY(12px); pointer-events: none; }
  #vrm-dock button {
    width: 100%; height: 48px; border: none; border-radius: 14px; cursor: pointer;
    font: 600 15px/1 inherit; letter-spacing: 2px; color: #fff;
    background: linear-gradient(150deg, #1A7A56, #0E4A35);
    box-shadow: 0 14px 26px -12px rgba(14,74,53,.55), inset 0 1px 0 rgba(255,255,255,.25);
    transition: transform .15s cubic-bezier(.16,1,.3,1);
  }
  #vrm-dock button:active { transform: scale(.975); }
  #vrm-dock button[disabled] { background: rgba(31,46,38,.16); box-shadow: none; color: rgba(255,255,255,.75); }

  /* ── 顶部进度线（指示不可点，不替代 tab） ── */
  #vrm-progress { display: flex; gap: 4px; padding: 6px 14px 0; }
  #vrm-progress i { flex: 1; height: 3px; border-radius: 2px; background: rgba(31,46,38,.12); transition: background .4s cubic-bezier(.16,1,.3,1); }
  #vrm-progress i.done { background: #14684A; }
  #vrm-progress i.cur { background: linear-gradient(90deg, #14684A, #1A7A56); }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  #vrm-dock, #vrm-dock button, #vrm-progress i { transition: none !important; }
}

@media (min-width: 761px) {
  /* 桌面端：本层完全休眠，不注入任何可见元素 */
  #vrm-dock, #vrm-progress { display: none !important; }
}
