/*
 * 美图牛 手机端适配样式
 * 使用方法：将此文件放到 /css/ 目录下
 * 在 index.html 的 </head> 前加一行：
 * <link href="/css/mobile.css" rel="stylesheet">
 */

/* ============================================
   手机端适配 (屏幕宽度 <= 768px)
   ============================================ */
@media screen and (max-width: 768px) {

  /* --- 全局字体放大 --- */
  body {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
  }

  /* --- 头部导航 --- */
  .header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: auto !important;
  }

  .header .container {
    padding: 0 8px !important;
    height: auto !important;
    flex-wrap: wrap !important;
  }

  .header .link {
    padding: 8px 0 !important;
  }

  .header .link .link-a {
    width: 70px !important;
    height: 22px !important;
    background-size: 70px 22px !important;
  }

  /* 用户头像区缩小 */
  .header .user-main {
    margin-left: auto !important;
  }

  .header .user-main .user-img {
    width: 28px !important;
    height: 28px !important;
  }

  /* --- 顶部导航改为横向滚动（第二行） --- */
  .header .nav-one {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    order: 10;
    border-top: 1px solid #f0f0f0;
    background: #fff;
  }

  .header .nav-one::-webkit-scrollbar {
    display: none;
  }

  .header .nav-one .li-one {
    flex-shrink: 0 !important;
    padding: 0 8px !important;
    font-size: 13px !important;
    height: 44px !important;
    line-height: 44px !important;
  }

  .header .nav-one .li-one .h-name {
    font-size: 13px !important;
  }

  /* 隐藏桌面端下拉子菜单的箭头和NEW标签 */
  .header .nav-one .li-one .h-name .h-down,
  .header .nav-one .li-one .h-name .h-up,
  .header .nav-one .li-one .h-name sup {
    display: none !important;
  }

  /* 下拉菜单全屏显示 */
  .header .nav-one .more-nav,
  .header .nav-one .more-nav1,
  .header .nav-one .more-nav2,
  .header .nav-one .more-nav3 {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 56px !important;
    width: 100% !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
  }

  .header .nav-one .more-nav .nav-list .nav-item {
    width: 50% !important;
  }

  /* 隐藏推广返现和开通会员按钮，给导航腾出空间 */
  .header .open-vip {
    display: none !important;
  }

  .header .user-tips,
  .header .user-tips a {
    display: none !important;
  }

  /* --- 主内容区 --- */
  .common-container main {
    padding-top: 90px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* 左侧导航改为横向滚动标签 */
  .common-container .left-nav {
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 4px !important;
    margin-bottom: 8px !important;
    border-radius: 8px !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
  }

  .common-container .left-nav::-webkit-scrollbar {
    display: none;
  }

  .common-container .left-nav a {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    height: 36px !important;
    line-height: 36px !important;
    padding: 0 14px !important;
    margin: 0 4px !important;
    margin-bottom: 0 !important;
    font-size: 13px !important;
    border-radius: 18px !important;
    background: #f5f7fa !important;
    white-space: nowrap !important;
  }

  .common-container .left-nav a img {
    width: 16px !important;
    height: 16px !important;
    margin-right: 6px !important;
  }

  .common-container .left-nav .router-link-active {
    background: #165dff !important;
    color: #fff !important;
  }

  /* 右侧内容撑满 */
  .common-container .right-compress {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 0 !important;
  }

  /* 标题适配 */
  .common-container main .web-title {
    font-size: 20px !important;
    padding: 12px 0 !important;
  }

  /* --- 首页工具卡片 --- */
  .tool-nav h1 {
    font-size: 24px !important;
    padding: 16px 12px 0 !important;
  }

  .tool-nav h2 {
    font-size: 14px !important;
    padding-bottom: 24px !important;
  }

  .tool-nav .list {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
    margin-bottom: 12px !important;
    height: auto !important;
    min-height: 200px;
  }

  .tool-nav .list:nth-of-type(3n) {
    margin-right: 0 !important;
  }

  .tool-nav .info {
    height: auto !important;
    padding: 16px !important;
  }

  .tool-nav .info .title {
    font-size: 18px !important;
  }

  .tool-nav .info .sub_title {
    font-size: 14px !important;
  }

  .tool-nav .video-wrap {
    position: relative !important;
    height: 180px !important;
  }

  .tool-nav .button {
    width: 120px !important;
  }

  /* --- 上传区域 --- */
  .compress-container {
    padding: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .compress-container .upload-area,
  .compress-container .el-upload,
  .compress-container .el-upload-dragger,
  .compress-container .el-upload--text {
    width: 100% !important;
    height: auto !important;
    min-height: 200px !important;
    box-sizing: border-box !important;
  }

  /* 上传区域内的文字居中 */
  .el-upload-dragger {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 30px 16px !important;
  }

  /* 主内容区域强制满宽 */
  .common-container main,
  .common-container main > div,
  .common-container .right-compress > div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* 在线客服按钮缩小移到角落 */
  .float-btn,
  .float-button,
  [class*="float"] {
    transform: scale(0.8) !important;
    right: 4px !important;
    bottom: 70px !important;
  }

  /* --- 按钮放大（方便手指点击） --- */
  .compress-btn,
  .el-button,
  button {
    min-height: 44px !important;
    font-size: 15px !important;
    padding: 10px 20px !important;
  }

  .compress-btn span {
    font-size: 15px !important;
  }

  /* --- 表格/列表适配 --- */
  .el-table {
    font-size: 13px !important;
  }

  .el-table th,
  .el-table td {
    padding: 8px 4px !important;
    font-size: 13px !important;
  }

  /* 隐藏不重要的表格列 */
  .el-table .el-table__cell:nth-child(n+4) {
    display: none !important;
  }

  /* --- 弹窗/对话框适配 --- */
  .el-dialog {
    width: 95% !important;
    margin: 10px auto !important;
    border-radius: 12px !important;
  }

  .el-dialog__header {
    padding: 16px !important;
  }

  .el-dialog__body {
    padding: 12px !important;
  }

  .el-dialog__title {
    font-size: 17px !important;
  }

  /* --- VIP/充值弹窗 --- */
  .pay-web-wrap {
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }

  .pay-web-wrap .pay-header-pc1-5 {
    flex-direction: column !important;
  }

  .pay-web-wrap .pay-header-pc1-5 .left {
    width: 100% !important;
  }

  .vip-time {
    font-size: 13px !important;
  }

  /* --- 输入框适配 --- */
  .el-input__inner,
  .el-textarea__inner,
  input,
  select,
  textarea {
    font-size: 16px !important; /* 防止iOS自动缩放 */
    min-height: 44px !important;
  }

  /* --- 底部/页脚 --- */
  .footer,
  footer {
    padding: 16px 12px !important;
    font-size: 13px !important;
  }

  /* --- 通用间距调整 --- */
  .el-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .el-col {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* 所有固定宽度容器改为自适应 */
  [style*="width: 1200px"],
  [style*="width:1200px"],
  [style*="max-width: 1200px"],
  [style*="max-width:1200px"] {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
  }

  /* 图片自适应 */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* 水平滚动防止 */
  html, body {
    overflow-x: hidden !important;
  }

  /* --- 隐藏桌面端专属元素 --- */
  .pc-only,
  .desktop-only {
    display: none !important;
  }
}

/* ============================================
   小屏手机适配 (屏幕宽度 <= 480px)
   ============================================ */
@media screen and (max-width: 480px) {

  .tool-nav h1 {
    font-size: 20px !important;
  }

  .tool-nav .list {
    min-height: 160px;
  }

  .tool-nav .video-wrap {
    height: 140px !important;
  }

  .el-dialog {
    width: 98% !important;
  }

  .header .link .link-a {
    width: 70px !important;
    height: 20px !important;
    background-size: 70px 20px !important;
  }
}

/* ============================================
   手机端底部导航栏（可选）
   如需要，在 Vue 组件中添加对应 HTML
   ============================================ */
@media screen and (max-width: 768px) {
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  }

  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: #666;
    text-decoration: none;
  }

  .mobile-bottom-nav a.active {
    color: #165dff;
  }

  .mobile-bottom-nav a i {
    font-size: 22px;
    margin-bottom: 2px;
  }

  /* 有底部导航时，主内容区底部留出空间 */
  .common-container main {
    padding-bottom: 70px !important;
  }
}

/* ============================================
   手机端汉堡菜单（可选）
   ============================================ */
@media screen and (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
  }

  .mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    margin: 4px auto;
    transition: 0.3s;
    border-radius: 1px;
  }

  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
  }

  .mobile-menu-overlay.active {
    display: block;
  }

  .mobile-menu {
    position: fixed;
    top: 56px;
    right: -280px;
    width: 280px;
    height: calc(100vh - 56px);
    background: #fff;
    z-index: 999;
    transition: right 0.3s;
    overflow-y: auto;
    padding: 16px;
    box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  }

  .mobile-menu.active {
    right: 0;
  }

  .mobile-menu a {
    display: block;
    padding: 14px 16px;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
  }

  .mobile-menu a:active {
    background: #f5f7fa;
  }
}

/* 桌面端隐藏手机专属元素 */
@media screen and (min-width: 769px) {
  .mobile-menu-btn,
  .mobile-menu,
  .mobile-menu-overlay,
  .mobile-bottom-nav,
  .mobile-only {
    display: none !important;
  }
}
