/* 各种尺寸适配。档位：大屏 ≥1600 · 笔记本 1100–1599 · 平板 768–1099 · 手机 <768（再细分 ≤390、≤340）。
   触屏（没有悬停）单独处理：关掉倾斜/磁吸，悬停才出现的按钮常显，可点区域 ≥44px。 */

.tabbar { display: none; }

/* ---------- 大屏：内容不变宽，装饰纹往外铺 ---------- */
@media (min-width: 1600px) {
  .deco .orbit { right: -60px; } .deco .orbit2 { left: -120px; }
}

/* ---------- 笔记本：贴纸略小、往里收 ---------- */
@media (max-width: 1360px) {
  .fhero { padding-left: 24px; padding-right: 24px; }
  .fpx { scale: .9; transform-origin: center; }
}

/* ---------- 平板与手机共用：首屏贴纸从"围一圈"改成标题上方一排 ---------- */
@media (max-width: 1099px) {
  main { padding: 12px 20px 60px; }
  .top-in { padding: 0 20px; gap: 14px; }
  .bal { display: none; }
  .fhero { padding: 26px 16px 44px; }
  .fstks { position: relative; inset: auto; display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 232px; margin: 0 auto 18px; }
  .fpx { position: relative !important; left: auto !important; right: auto !important; top: auto !important; scale: 1; display: none; }
  .fpx[data-n='wave'], .fpx[data-n='heart'], .fpx[data-n='play'], .fpx[data-n='moon'], .fpx[data-n='clap'], .fpx[data-n='rocket'] { display: block; }
  .fpx[data-n='wave'] { width: 176px !important; order: 2; }
  .fpx[data-n='rocket'] { width: 84px !important; order: 4; align-self: center; }
  .fpx[data-n='heart'] { width: 52px !important; order: 3; align-self: center; }
  .fpx[data-n='play'], .fpx[data-n='moon'] { width: 92px !important; order: 5; align-self: flex-start; }
  .fpx[data-n='clap'] { width: 84px !important; order: 1; align-self: center; }
  .fhero h1 { font-size: 46px; }
  .band { padding: 36px 0 70px; }
  .wrap { padding: 0 20px; }
  .band .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > :nth-child(3):last-child { grid-column: 1 / -1; }
  .mgrid { grid-template-columns: 1fr; row-gap: 84px; }
  .page-models .ph { margin-bottom: 96px; }
  .page-tasks .toolbar { margin-bottom: 86px; }
  .quick { grid-template-columns: 1fr; padding: 22px; }
  .quick { position: relative; }
  .quick-ms { position: absolute; right: 10px; top: 6px; width: 92px !important; margin: 0 !important; z-index: 2; }
  .quick-b h2 { padding-right: 100px; min-height: 120px; display: flex; align-items: center; }
  .quick-b .steps { margin-top: 4px; }
  .steps { grid-template-columns: 1fr; }
  /* 登录：上下排，角色和轨道缩小 */
  .login { grid-template-columns: 1fr; gap: 104px; padding-top: 10px; }
  .login-art { justify-items: center; text-align: center; padding-top: 64px; }
  .login-art > .mascot { width: 220px !important; margin-left: 0; }
  .orbit-ring { left: 50%; top: 206px; --orbit-r: 160px !important; }
  .orb { width: 52px !important; height: 52px !important; margin: -26px 0 0 -26px !important; }
  .login-art h1 { font-size: 36px; margin-top: 30px; }
  .login-art p { margin-left: auto; margin-right: auto; }
  .login-card { max-width: 460px; width: 100%; margin: 0 auto; }
}

/* ---------- 手机 ---------- */
@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .top-in { height: 56px; padding: 0 14px; }
  .nav { display: none; }
  .brand { font-size: 17px; }
  .top-r { gap: 8px; }
  /* 底部标签栏 */
  .tabbar { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 -1px 0 var(--ring); }
  .tabbar a { min-height: 50px; border-radius: 14px; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
  .tabbar a.on { color: var(--blue); background: var(--blue-t); }
  main { padding: 6px 14px calc(96px + env(safe-area-inset-bottom)); }
  body[data-route='overview'] main { padding-bottom: 0; }
  .band { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  /* 首屏 */
  .fhero { padding: 14px 0 34px; }
  .fstks { height: 176px; gap: 2px; margin-bottom: 10px; }
  .fpx[data-n='wave'] { width: 132px !important; }
  .fpx[data-n='rocket'] { width: 58px !important; }
  .fpx[data-n='heart'] { width: 40px !important; }
  .fpx[data-n='play'], .fpx[data-n='moon'] { width: 66px !important; }
  .fpx[data-n='clap'] { width: 60px !important; }
  .fhero h1 { font-size: 32px; letter-spacing: -.8px; }
  .fhero .lead { font-size: 15px; line-height: 23px; margin: 12px auto 20px; }
  .row-btns.c { flex-direction: column; align-items: stretch; padding: 0 6px; }
  .btn.big { height: 48px; }
  /* 数字卡 */
  .wrap { padding: 0 14px; }
  .band .stats, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; row-gap: 34px; }
  .stat { min-height: 132px; padding: 16px; }
  .stat b { font-size: 26px; }
  .stat .sticker { width: 62px; height: 62px; top: -30px; right: -4px; }
  .stat .d { font-size: 12.5px; }
  .mline { font-size: 13px; flex-wrap: wrap; } .mline em { font-size: 12px; }
  .jarcard { padding-right: 16px; }
  .jarcard canvas.jar { width: 72px; height: 96px; top: auto; bottom: 8px; right: 6px; }
  .band .sec-h { margin-top: 64px; }
  .sec-h h2 { font-size: 20px; }
  /* 最近调用：两行 */
  .arow { grid-template-columns: 40px minmax(0, 1fr) 34px; grid-template-rows: auto auto; gap: 4px 10px; padding: 12px 10px; }
  .arow .av { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; }
  .arow .at { grid-column: 2; }
  .arow .ar { grid-column: 2; grid-row: 2; text-align: left; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .arow .ar .st, .arow .ar .am { display: inline; margin: 0; font-size: 13px; }
  .arow .ar canvas.film { margin: 0; width: 84px; }
  .arow .la { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .at b { font-size: 14.5px; }
  /* 页头 */
  .ph { flex-direction: column; align-items: flex-start; gap: 12px; margin: 8px 0 14px; }
  .ph h1 { font-size: 28px; }
  .ph .seg { align-self: stretch; } .ph .seg button { flex: 1; justify-content: center; }
  .ph > .btn { align-self: stretch; }
  /* 调用记录：筛选横向滚动，列表每条两行 */
  .toolbar { gap: 8px; }
  .toolbar .seg { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar .seg::-webkit-scrollbar { display: none; }
  .toolbar .seg button { flex: 1 0 auto; }
  .toolbar .dd { flex: 1; } .toolbar .dd-btn { width: 100%; justify-content: space-between; }
  .toolbar .search { margin-left: 0; flex: 1.4; } .search .input { width: 100%; }
  .page-tasks .toolbar { margin-bottom: 64px; }
  .lh { display: none; }
  .lr { grid-template-columns: 40px auto auto minmax(0, 1fr) 34px; grid-template-rows: auto auto; gap: 6px 10px; padding: 12px 10px; }
  .lr > .av { grid-column: 1; grid-row: 1 / 3; width: 40px; height: 40px; }
  .lr > .lt { grid-column: 2 / 5; grid-row: 1; }
  .lr > .lm { grid-column: 2; grid-row: 2; font-size: 12.5px; }
  .lr > .lst { grid-column: 3; grid-row: 2; display: flex; align-items: center; gap: 6px; }
  .lr > .lst .tag { height: 22px; font-size: 12px; padding: 0 8px; }
  .lr > .lst canvas.film { margin: 0; width: 64px; }
  .lr > .lw { grid-column: 4; grid-row: 2; font-size: 12.5px; text-align: right; }
  .lr > .la { grid-column: 5; grid-row: 1 / 3; }
  .lt b { font-size: 14.5px; }
  /* 密钥：每条两行 */
  .lr.k { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto; gap: 6px 10px; }
  .lr.k > .lt { grid-column: 1; grid-row: 1; }
  .lr.k > .kmask { grid-column: 1 / -1; grid-row: 2; }
  .lr.k > .num { grid-column: 1; grid-row: 3; font-size: 13px; color: var(--muted); }
  .lr.k > span:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; }
  .lr.k > .la { grid-column: 2; grid-row: 3; }
  .quick { padding: 18px 16px; }
  .quick .code { padding-right: 18px; padding-top: 48px; }
  .code { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .chip { max-width: 100%; }
  /* 用量 */
  .chart { height: 240px; grid-template-columns: 26px minmax(0, 1fr); }
  .chart-card { padding: 16px 12px; }
  .chart-card .sec-h { flex-direction: column; align-items: flex-start; gap: 6px; }
  .xax { font-size: 11.5px; }
  .page-usage .stats { grid-template-columns: 1fr 1fr; } .page-usage .stats > :last-child { grid-column: 1 / -1; }
  /* 模型状态 */
  .mnums b { font-size: 20px; }
  .hours { gap: 2px; } .hours i { height: 24px; border-radius: 4px; }
  .mh h2 { font-size: 17px; } .mic { width: 44px; height: 44px; font-size: 15px; }
  .legend2 { flex-wrap: wrap; gap: 12px; }
  /* 抽屉、弹窗 → 底部面板 */
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: min(88vh, 760px); border-radius: 26px 26px 0 0; transform: translateY(105%); }
  .drawer.on { transform: none; }
  .drawer::before { content: ''; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 5px; background: var(--ring-2); }
  .drawer-f { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .modal { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-width: none; border-radius: 26px 26px 0 0; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); transform: translateY(105%); opacity: 1; }
  .modal.on { transform: none; }
  .modal .mascot { width: 76px; top: -94px; }
  .modal .acts { flex-direction: column-reverse; } .modal .acts .btn { width: 100%; }
  .pop { width: calc(100vw - 24px) !important; left: 12px !important; }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .toast { max-width: 100%; height: auto; min-height: 50px; padding: 6px 16px 6px 6px; white-space: normal; line-height: 1.35; }
  .verswitch { display: none; }
  .demo-tag { display: none; }
  /* 登录 */
  body[data-route='login'] main { padding-bottom: 30px; }
  .login { gap: 86px; } .login-art { padding-top: 84px; }
  .login-art > .mascot { width: 170px !important; }
  .orbit-ring { top: 194px; --orbit-r: 128px !important; }
  .orb { width: 42px !important; height: 42px !important; margin: -21px 0 0 -21px !important; }
  .login-art h1 { font-size: 28px; margin-top: 18px; }
  .login-art p { font-size: 14.5px; }
  .login-card { padding: 24px 18px; }
  .agree { white-space: normal; }
  /* 装饰：手机上只留柔光和流星，省电也不挡字 */
  .deco .orbit, .deco .orbit2, .deco .frame, .deco .dots, .deco .wave { display: none; }
  .empty .mascot { width: 150px !important; }
}

/* ---------- 很窄的手机（≤390 / ≤340） ---------- */
@media (max-width: 390px) {
  .fhero h1 { font-size: 29px; }
  .fpx[data-n='clap'] { display: none; }
  .stat b { font-size: 23px; }
  .tabbar a { font-size: 10.5px; }
}
@media (max-width: 340px) {
  .band .stats, .stats { grid-template-columns: 1fr; row-gap: 30px; }
  .fpx[data-n='heart'] { display: none; }
  .fhero h1 { font-size: 26px; }
  .brand small { display: none; }
}

/* ---------- 触屏：没有悬停 ---------- */
@media (hover: none) {
  .tilt, .stat:hover, .stat.link:hover, .film:hover { transform: none !important; }
  .tilt::after { display: none; }
  .film .dl, .la .iconbtn { opacity: 1; transform: none; }
  .iconbtn.sm, .btn.sm { min-height: 40px; min-width: 40px; }
  .seg button { min-height: 36px; }
}

.menu .vers-m { display: none; }
@media (max-width: 767px) { .menu .vers-m { display: flex; } }

/* 一页只放一个她：手机上弹层打开时，背后陪伴的她先藏起来；提示条用星星图标 */
.toast .tstar { display: none; }
@media (max-width: 767px) {
  body.sheet-open .pet { opacity: 0 !important; pointer-events: none; }
  .toast img { display: none; }
  .toast .tstar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #fff; flex: none; }
}
