/* ============================================================
   DAYMOON 08 设计图工作台 · 移动端响应式适配（≤768px）
   在 index.html 里最后引入。
   ============================================================ */

@media (max-width: 768px) {
  body { display: block; margin: 0; }

  /* aside 变成 sticky 顶部简洁横条，避免与 07 主页顶栏双层重叠 */
  aside {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    height: auto;
    padding: 8px 10px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  /* brand 紧凑：只留 "DM" 圆角图标 */
  .brand {
    padding: 0;
    gap: 0;
    font-size: 0;
    flex: 0 0 auto;
  }
  .brand span {
    font-size: 16px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: #2b2945;
    border-radius: 10px;
  }
  .brand b, .brand small { display: none; }

  /* nav 横滑占满中间（icon + label 上下排，省宽度）*/
  nav {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }
  nav button {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    color: #aaa9bd;
    background: none;
    text-align: center;
    border-radius: 10px;
    min-width: 56px;
  }
  nav button.active, nav button:hover { background: #2b2945; color: #fff; }
  nav .nav-icon { width: 16px; height: 16px; }
  nav .nav-label { font-size: 11px; line-height: 1; }

  /* 隐藏 mobile 不必要的侧栏块 */
  .ai-channel { display: none !important; }
  .status {
    margin: 0;
    padding: 6px 8px;
    border: none;
    background: none;
    flex: 0 0 auto;
  }
  .status i { width: 8px; height: 8px; margin: 0; }
  .status b, .status small { display: none; }

  /* main 留给 aside 顶部空间 */
  main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding: 14px 14px 90px;
  }

  /* main header 简化 */
  header {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
  }
  header > div { flex: 1 1 100%; min-width: 0; }
  h1 { font-size: 20px; line-height: 1.25; }
  header p { font-size: 13px; }
  .ghost { padding: 8px 12px; font-size: 13px; }

  /* 两列 grid 全转单列 */
  .grid, .form-grid, .modes { grid-template-columns: 1fr; gap: 12px; }
  .panel { padding: 16px; border-radius: 14px; margin-bottom: 12px; }
  .step { font-size: 11px; margin-bottom: 12px; }

  /* 上传区 */
  .drop { height: 130px; }
  .drop-icon { width: 38px; height: 38px; font-size: 22px; }
  .drop b { font-size: 13px; }
  .drop small { font-size: 12px; }

  /* 表单触控目标 */
  input, textarea, select {
    font-size: 16px !important; /* 16px 防 iOS 聚焦缩放 */
    min-height: 44px;
  }
  textarea { min-height: 88px; }
  button { min-height: 44px; font-size: 14px; }
  .primary { width: 100%; min-height: 50px; font-size: 16px; }
  .settings, .setting-row { display: grid; gap: 12px; }
  .check { padding-bottom: 8px; }

  /* 历史/最近/已选版本图 */
  .projects { gap: 14px; }
  .project { padding: 16px; border-radius: 14px; }
  .versions { grid-template-columns: 1fr; gap: 12px; }
  .version img { height: 220px; }
  .v-actions { grid-template-columns: 1fr 1fr; }

  /* 任务进度面板 */
  .job-panel { padding: 14px; border-radius: 12px; }
  .job-events { max-height: 120px; }

  /* 弹层全宽 */
  .modal { padding: 10px; }
  .dialog { max-width: 100%; padding: 18px; }
  .dialog img { max-height: 65vh; }
  #toast {
    left: 12px; right: 12px; bottom: 16px;
    font-size: 13px;
  }
}
