/* ============================================================
   手机端适配（白天 / 夜间双主题）
   暗色由 <html data-theme="dark"> 启用（与 iniche_style_full.css 一致）
   颜色统一引用主样式表的 CSS 变量；半透明悬浮层专用变量在下方声明。
   ============================================================ */

/* 移动端悬浮头部 / 底部导航的半透明背景（主样式表未定义，这里自包含声明） */
:root {
  --header-bg: rgba(255, 255, 255, 0.94);
  --bottom-nav-bg: rgba(255, 255, 255, 0.96);
}
[data-theme="dark"] {
  --header-bg: rgba(22, 27, 34, 0.94);
  --bottom-nav-bg: rgba(22, 27, 34, 0.96);
}

@media screen and (max-width: 768px) {

  /* ============================================================
     头部固定悬浮
     ============================================================ */
  #header {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    flex-wrap: nowrap;
  }
  #header .hdr-search { height: 36px; padding: 0 12px; }
  #header .hdr-search .hdr-search-ico { width: 18px; height: 18px; }
  #header .hdr-search input[type="search"] { font-size: 14px; }
  #header .hdr-actions { gap: 8px; }
  #header .hdr-ico { width: 32px; height: 32px; }
  #header .hdr-ico svg { width: 23px; height: 23px; }

  .user-entry { font-size: 13px; padding: 2px 4px; }
  .user-entry img { width: 26px; height: 26px; }
  .user-entry .user-name { display: none; }


  /* ============================================================
     底部悬浮导航
     ============================================================ */
  #bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    z-index: 999 !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 6px 0 env(safe-area-inset-bottom) !important;
    background: var(--bottom-nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--border-2);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  }
  #bottom-nav a {
    flex: 1;
    text-align: center;
    font-size: 12px;
    padding: 6px 0;
    color: var(--text-weak);
  }
  #bottom-nav a.router-link-active {
    color: var(--accent);
    font-weight: 600;
  }


  /* ============================================================
     主内容避开悬浮层
     ============================================================ */
  #main {
    padding-top: 56px;
    padding-bottom: 70px;
  }


  /* ============================================================
     Home 微调
     ============================================================ */
  .hero { padding: 24px 16px 18px; border-radius: 0 0 24px 24px; }
  .hero-title { font-size: 20px; }
  .hero-desc  { font-size: 14px; }
  .btn-login  { padding: 9px 32px; font-size: 15px; }

  .systems-header { padding: 0 12px; }
  .systems-title  { font-size: 17px; }

  .tabs { padding: 0 4px; margin: 4px 0 12px; }
  .tab  { font-size: 14px; padding: 12px 0; }


  /* ============================================================
     应用网格（首页 / 列表共用）
     ============================================================ */
  .app-grid {
    grid-template-columns: 1fr 1fr !important;
    padding: 8px 12px 16px;
    column-gap: 12px;
    row-gap: 18px;
    overflow: hidden;
  }
  .app-card { min-width: 0; overflow: hidden; gap: 10px; }
  .app-card-info { min-width: 0; }
  .app-card-title {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .app-card-meta { font-size: 11px; }
  .app-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }


  /* ============================================================
     筛选栏
     ============================================================ */
  .filter-bar { padding: 10px 12px; }
  .filter-row { gap: 8px; }
  .filter-item select { height: 32px; font-size: 12px; }
  .btn-filter { height: 32px; font-size: 13px; }


  /* ============================================================
     分页
     ============================================================ */
  .pagination {
    padding: 16px 12px 30px;
    gap: 12px;
  }
  .page-btn {
    min-width: 32px;
    height: 32px;
    font-size: 13px;
    padding: 0 8px;
  }
  .page-info { font-size: 13px; }
  .page-jump { font-size: 13px; }
  .page-jump input { width: 56px; height: 32px; font-size: 13px; }
  .page-jump button { height: 32px; padding: 0 16px; font-size: 13px; }


  /* ============================================================
     AppDetail
     ============================================================ */
  .app-header {
    padding: 16px 12px;
    gap: 10px;
  }
  .app-header-left {
    gap: 12px;
  }
  .app-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }
  .app-title {
    font-size: 17px;
  }
  .app-platform {
    font-size: 11px;
    padding: 2px 8px;
  }

  .app-header-actions {
    width: 152px;
    gap: 5px;
  }
  .app-action-btn {
    height: 30px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 15px;
  }

  .app-attrs {
    padding: 10px 12px;
    gap: 18px;
  }
  .attr-label { font-size: 10px; }
  .attr-value { font-size: 12px; }

  .detail-tab {
    font-size: 14px;
    padding: 12px 0;
  }
  .detail-tab-content {
    padding: 14px 12px;
  }
  .intro-text {
    font-size: 13px;
  }


  /* ============================================================
     登录页
     ============================================================ */
  .box { padding: 20px 16px; }
  .box h2 { font-size: 14px; margin-bottom: 16px; }
  .box button {
    height: 42px;
    font-size: 14px;
    margin-bottom: 10px;
  }


  /* ============================================================
     发布弹窗（手机居中）
     ============================================================ */
  .publish-modal { align-items: center; }
  .publish-sheet {
    border-radius: 20px;
    max-width: 480px;
    padding: 20px;
  }


  /* ============================================================
     全局错误提示条
     ============================================================ */
  .global-error-bar {
    left: 12px;
    right: 12px;
    font-size: 13px;
    padding: 12px 16px;
  }


  /* ============================================================
     以下原文件排在媒体查询外、实为移动端规则，已收回本媒体查询内
     （修正：原 .upload-page / .edit-page / .screenshot-* 等漏在
      768px 媒体查询之外，会全局生效，现统一限定为移动端）
     ============================================================ */
  .upload-page { padding: 12px 12px 100px; }
  .upload-dropzone { padding: 32px 16px; }
  .upload-icon { font-size: 40px; }
  .upload-hint { font-size: 14px; }
  .upload-item { padding: 10px 12px; }
  .upload-item-name { font-size: 13px; }
  .upload-item-meta { font-size: 11px; }

  .upload-notice {
    padding: 10px 12px;
    font-size: 12px;
    margin-bottom: 12px;
  }

  .app-stats {
    padding: 0 12px 12px;
    gap: 10px;
  }
  .app-stat {
    height: 40px;
    border-radius: 10px;
    gap: 5px;
  }
  .app-stat-num { font-size: 15px; }
  .app-stat-label { font-size: 11px; }

  .edit-page {
    padding: 12px 12px 30px;
  }

  .edit-icon-preview {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }

  .edit-ss-item,
  .edit-ss-add {
    width: 76px;
    height: 100px;
  }

  .edit-dropzone {
    padding: 20px 12px;
  }

  .reset-box {
    padding: 20px 16px;
  }
  .reset-row {
    flex-direction: row;
    gap: 8px;
  }
  .reset-code-btn {
    padding: 0 14px;
    font-size: 13px;
  }

  .screenshot-scroll {
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .screenshot-item {
    width: 160px;
    height: 120px;
    border-radius: 8px;
  }
}

/* ============================================================
   超小屏
   ============================================================ */
@media screen and (max-width: 360px) {
  .app-card-icon { width: 40px; height: 40px; border-radius: 10px; }
  .app-card-title { font-size: 13px; }
  .app-grid { column-gap: 8px; }
}
