/* 手机使用独立导航与操作区，桌面沿用原布局。 */
.mobile-bottom-nav { display: none; }
.mobile-action-placeholder { display: none; }
@media (max-width: 760px) {
  :root {
    --mobile-nav-height: 60px;
    --mobile-nav-space: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    --mobile-action-space: 0px;
  }
  html { scroll-padding-top: 68px; scroll-padding-bottom: calc(var(--mobile-nav-space) + 20px); }
  body { min-width: 0; padding-bottom: calc(var(--mobile-nav-space) + 20px); }
  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: var(--z-menu, 30);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: var(--mobile-nav-space);
    padding: 4px max(8px, env(safe-area-inset-right, 0px)) max(4px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #ffffff18;
    background: rgba(18, 21, 19, 0.94);
    backdrop-filter: blur(16px);
  }
  .mobile-bottom-nav a {
    display: flex;
    min-width: 0;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border-radius: 10px;
    color: #9ea89c;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .mobile-bottom-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; }
  .mobile-bottom-nav a[aria-current="page"] { color: var(--accent); background: rgba(213, 235, 158, 0.12); font-weight: 600; }
  .mobile-bottom-nav a:active { background: #2d3728; }
  .mobile-bottom-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .app-sidebar { display: none; }
  .workspace-shell { display: block; }
  .workspace-main { width: 100%; margin-left: 0; min-width: 0; }
  .workspace-topbar, .site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header, 20);
    background: rgba(16, 19, 17, 0.92);
    backdrop-filter: blur(16px);
  }
  .workspace-topbar { min-height: 58px; padding: 8px 16px; }
  .topbar-left { font-size: 15px; font-weight: 600; color: #eef2ea; }
  .topbar-actions { gap: 8px; }
  .site-header-inner { flex-wrap: nowrap; height: auto; min-height: 58px; padding: 8px 16px; gap: 10px; }
  .desktop-nav, .header-pricing, .header-cta, .locale-control { display: none; }
  .site-header .brand { font-size: 16px; }
  .site-header .brand small { display: none; }
  .header-actions { gap: 8px; min-width: 0; margin-left: auto; }
  .header-login { min-height: 38px; padding: 8px 13px; font-size: 12px; border-radius: 8px; }
  .public-credits:not([hidden]), .credit-chip:not([hidden]) { display: inline-flex; min-height: 34px; padding: 5px 10px; font-size: 11px; white-space: nowrap; }
  .app-content { padding: 18px 16px; }
  .section-container { width: calc(100% - 32px); }
  .workspace-page { padding: 0; }
  .workspace-heading { margin-bottom: 16px; }
  .workspace-heading h1, .page-heading h1 { font-size: 25px; line-height: 1.22; }
  .workspace-heading p { font-size: 13px; line-height: 1.6; }
  .workspace-pill { display: none; }
  .creation-grid, .home-creation-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  /* 首页与专题页手机端先看参考照片与成片效果，再填表生成 */
  .home-creation-grid > .home-preview { order: -1; }
  .home-preview .preview-pair { gap: 10px !important; padding: 12px !important; }
  .home-preview .preview-pair figure :is(img, video) { height: auto !important; max-height: 250px !important; object-fit: contain !important; }
  .home-preview .preview-caption { padding: 12px 14px 14px; font-size: 11px; }
  .editor.panel, .home-editor { min-width: 0; border-radius: 14px; }
  .editor-body, .editor-content { padding: 16px; }
  .mode-tabs, .creation-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; margin-bottom: 16px; }
  .mode-tabs button, .creation-modes button { min-height: 44px; padding: 8px 6px; justify-content: center; font-size: 13px; white-space: nowrap; }
  .input, textarea, select.select { font-size: 16px; min-height: 46px; }
  textarea { min-height: 112px; line-height: 1.6; }
  .field-label, .home-field > label, .field-label-row > label { font-size: 13px; }
  .settings-toggle { min-height: 44px; font-size: 13px; }
  .settings-grid { gap: 10px; }
  .home-upload { min-height: 116px; padding: 14px; }
  .reference-preview img, .home-reference img { max-height: 220px; object-fit: contain; }
  .icon-button { min-width: 44px; min-height: 44px; }
  #samplePrompt, #refreshButton, .preview-tabs button {
    min-height: 44px;
    touch-action: manipulation;
  }
  .creation-row { gap: 10px; padding: 14px; }
  .creation-row .button { min-height: 44px; flex-shrink: 0; }
  .generator-heading { padding-block: 14px 12px; margin-bottom: 16px; }
  .generator-heading h1 { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
  .generator-heading p { font-size: 13px; line-height: 1.6; }
  body:has(.workspace-page), body.mobile-home-creator {
    padding-bottom: calc(var(--mobile-nav-space) + 20px);
  }
  .workspace-page .home-generate-area,
  .mobile-home-creator .home-editor .home-generate-area {
    position: static;
    min-height: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: #141814;
  }
  .home-generate-area .cost-row { margin-bottom: 10px; font-size: 12px; line-height: 1.5; }
  .home-generate-area .generate-button { min-height: 48px; font-size: 15px; font-weight: 600; border-radius: 10px; }
  .home-editor .home-generate-area { margin-top: 0; }
  .toast { left: 16px; right: auto; transform: none; bottom: calc(var(--mobile-nav-space) + 14px); max-width: calc(100vw - 32px); font-size: 14px; }
  .modal-backdrop { align-items: flex-end; padding: 12px 12px max(12px, env(safe-area-inset-bottom, 0px)); }
  .modal-backdrop .panel { width: 100%; max-height: calc(100dvh - 24px); border-radius: 20px; }
  .modal-backdrop .field-label-row { flex-wrap: wrap; }
  .modal-backdrop .field-label-row > .input { flex: 1 1 160px; }
  .modal-backdrop .field-label-row > button { min-height: 44px; }
  .pricing-page .billing-switch button { min-height: 44px; min-width: 88px; font-size: 14px; }
  #filterBar { display: grid; gap: 10px; margin-bottom: 16px; }
  #filterBar .billing-switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 100%; gap: 4px; }
  #filterBar .billing-switch button { min-height: 44px; min-width: 0; font-size: 13px; }
  #filterBar #refreshButton { width: 100%; justify-content: center; }
  .mobile-home-creator .mobile-action-placeholder { display: none !important; height: 0 !important; }
  .pricing-heading { padding-top: 20px; margin-bottom: 20px; }
  .pricing-heading h1 { font-size: 28px; }
  .pricing-grid { gap: 14px; }
  .price-plan { padding: 20px; }
  .price-plan .button, .pack .button { min-height: 46px; font-size: 14px; }
  .pack { gap: 12px; }
  .pack strong { font-size: 15px; }
  .pack small { font-size: 13px; line-height: 1.65; }
  .account-tabs { overflow-x: auto; white-space: nowrap; }
  .account-tabs a { min-height: 44px; }
  .site-footer { width: calc(100% - 32px); margin-top: 40px; padding: 32px 0 20px; }
  .footer-top { flex-direction: column; gap: 24px; padding-bottom: 28px; }
  .footer-links { gap: 48px; margin-right: 0; }
  .mobile-keyboard-open .mobile-bottom-nav { display: none; }
  body.mobile-keyboard-open .toast { bottom: 12px; }
  .mobile-keyboard-open .mobile-action-placeholder { display: none; }
}
@media (max-width: 359px) {
  .site-header-inner { padding-inline: 12px; }
  .site-header .brand { font-size: 14px; gap: 6px; }
  .header-login { padding-inline: 10px; }
  .public-credits:not([hidden]), .credit-chip:not([hidden]) { max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
  .mode-tabs button, .creation-modes button { font-size: 12px; gap: 4px; }
  .home-preview .preview-pair figure :is(img, video) { height: auto !important; max-height: 210px !important; object-fit: contain !important; }
}
