/*
 * mobile.css — 移动端专用响应式样式
 * 原则：PC端样式完全不动，所有移动端修改集中于此文件
 * 断点：max-width: 768px（手机/平板竖屏）
 */

/* ============================================================
   1. 全局基础重置
   ============================================================ */
@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; }
  * { box-sizing: border-box !important; }

  /* 容器全宽 */
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 10px !important;
    margin: 0 auto !important;
  }

  img { max-width: 100% !important; height: auto !important; }
  .float-fix { overflow: visible !important; }
}

/* ============================================================
   2. 头部 Logo + 搜索框
   ============================================================ */
@media (max-width: 768px) {
  .top_middle {
    height: auto !important;
    overflow: visible !important;
    padding: 6px 0 !important;
  }
  .top_middle .container {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-align-items: center !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 6px 10px !important;
  }

  /* Logo */
  .top_middle_logo {
    float: none !important;
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
  }
  .top_middle_logo .logo {
    display: block !important;
    height: 34px !important;
    width: auto !important;
    max-width: 120px !important;
    padding-top: 0 !important;
  }

  /* 隐藏PC端广告和其他区块 */
  .top_middle_ad    { display: none !important; }
  .top_middle_othoer { display: none !important; }
  .txtScroll-top    { display: none !important; }
  .site-top-nav     { display: none !important; }
  .top_nav_r        { display: none !important; }

  /* 搜索区域 */
  .top_middle_s {
    float: none !important;
    -webkit-flex: 1 !important;
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    margin-left: 8px !important;
    padding-top: 0 !important;
  }
  /* form div + 内层form标签均设flex，确保单行 */
  .form,
  .form form {
    display: -webkit-flex !important;
    display: flex !important;
    width: 100% !important;
    -webkit-align-items: center !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  .form form { -webkit-flex: 1 !important; flex: 1 !important; min-width: 0 !important; }
  /* hidden inputs 不占空间 */
  .form input[type="hidden"] {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    flex: none !important;
  }
  /* 可见搜索输入框 */
  .form input[type="text"],
  .form input:not([type]),
  .form input[type="search"] {
    -webkit-flex: 1 1 0 !important;
    flex: 1 1 0 !important;
    min-width: 60px !important;
    width: 0 !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 13px !important;
    float: none !important;
    margin-right: 0 !important;
    border-radius: 2px 0 0 2px !important;
  }
  /* 搜索按钮 */
  .search-submit {
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
    float: none !important;
    width: 50px !important;
    height: 32px !important;
    font-size: 13px !important;
    padding: 0 !important;
    border-radius: 0 2px 2px 0 !important;
  }
}

/* ============================================================
   3. 导航栏 — 汉堡菜单（不修改原nav.css，只追加移动端层）
   ============================================================ */

/* PC端隐藏移动端专用元素 */
.m-nav-toggle { display: none; }
.m-nav-title   { display: none; }
.m-nav-drawer  { display: none; }
.m-nav-overlay { display: none; }

/* 导航遮罩：默认隐藏（移动端覆盖） */
.m-nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
}
.m-nav-overlay.open { display: block; }

@media (max-width: 768px) {
  /* 隐藏PC快捷链接 */
  .sub-nav { display: none !important; }

  /* 导航容器：固定44px高度 */
  .nav_cnt {
    height: 44px !important;
    overflow: visible !important;
    position: relative !important;
    background: #fff !important;
    border-top: 3px solid #ff7939 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
    margin-bottom: 0 !important;
  }
  .nav_cnt .container {
    height: 44px !important;
    padding: 0 12px !important;
    overflow: visible !important;
    position: relative !important;
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-align-items: center !important;
    align-items: center !important;
  }

  /* 原始 ul.navs 隐藏，由抽屉替代 */
  .nav_cnt ul.navs {
    display: none !important;
  }

  /* 汉堡按钮：仅移动端显示 */
  .m-nav-toggle {
    display: -webkit-flex !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    width: 40px !important;
    height: 36px !important;
    background: #f5f5f5 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    -webkit-transform: translateY(-50%) !important;
    transform: translateY(-50%) !important;
    z-index: 9999 !important;
    padding: 0 !important;
  }
  .m-nav-toggle .m-bar {
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    background: #444 !important;
    border-radius: 2px !important;
    -webkit-transition: all 0.25s !important;
    transition: all 0.25s !important;
  }
  .m-nav-toggle.open .m-bar:nth-child(1) {
    -webkit-transform: rotate(45deg) translate(5px, 5px) !important;
    transform: rotate(45deg) translate(5px, 5px) !important;
  }
  .m-nav-toggle.open .m-bar:nth-child(2) { opacity: 0 !important; }
  .m-nav-toggle.open .m-bar:nth-child(3) {
    -webkit-transform: rotate(-45deg) translate(5px, -5px) !important;
    transform: rotate(-45deg) translate(5px, -5px) !important;
  }

  /* 移动端导航标题文字 */
  .m-nav-title {
    display: block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 44px !important;
  }

  /* 抽屉式导航面板 */
  .m-nav-drawer {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: -260px !important;
    width: 240px !important;
    max-width: 80vw !important;
    height: 100vh !important;
    background: #fff !important;
    box-shadow: -2px 0 12px rgba(0,0,0,0.15) !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    -webkit-transition: right 0.3s ease !important;
    transition: right 0.3s ease !important;
    padding-top: 50px !important;
  }
  .m-nav-drawer.open { right: 0 !important; }
  .m-nav-drawer a {
    display: block !important;
    padding: 14px 20px !important;
    font-size: 15px !important;
    color: #333 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    text-decoration: none !important;
  }
  .m-nav-drawer a:active,
  .m-nav-drawer a:hover {
    background: #fff8f4 !important;
    color: #ff7939 !important;
  }
}

/* ============================================================
   4. 列表页：图左文右布局
   ============================================================ */
@media (max-width: 768px) {
  /* 单列容器 */
  .articlelist .pleft,
  .articlelist .pright,
  .channel .pright {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #sidebar-follow { width: 100% !important; }
  .pright ul.list-item { width: 100% !important; }
  .box-warp { padding: 12px 10px !important; }
  .mb30 { margin-bottom: 12px !important; }

  /* 文章列表：图左文右 */
  .article-list {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .article-list > li.media {
    float: none !important;
    width: 100% !important;
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-flex-direction: row !important;
    flex-direction: row !important;
    -webkit-align-items: flex-start !important;
    align-items: flex-start !important;
    border-bottom: 1px solid #eee !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
  /* 图片在左 */
  .article-list .media-left {
    float: none !important;
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
    width: 100px !important;
    height: 72px !important;
    overflow: hidden !important;
    margin-right: 10px !important;
    padding-right: 0 !important;
  }
  .article-list .media-left a,
  .article-list .media-left .thumbnail {
    display: block !important;
    width: 100px !important;
    height: 72px !important;
  }
  .article-list .media-left img {
    width: 100px !important;
    height: 72px !important;
    object-fit: cover !important;
    max-width: none !important;
    display: block !important;
  }
  .article-list .thumbnail { width: 100px !important; height: 72px !important; }
  .article-list .thumbnail img { width: 100px !important; height: 72px !important; object-fit: cover !important; }
  /* 文字在右 */
  .article-list .media-body {
    -webkit-flex: 1 !important;
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
  }
  .article-list .media-body h2,
  .article-list .media-body .ft18 {
    font-size: 14px !important;
    line-height: 1.45 !important;
    overflow: hidden !important;
    max-height: 2.9em !important;
    margin: 0 0 4px !important;
    white-space: normal !important;
    word-break: break-all !important;
  }
  .article-list .media-body .info {
    font-size: 11px !important;
    color: #aaa !important;
  }
  .article-list .media-body .info span { padding-left: 0 !important; padding-right: 6px !important; }
  .article-list .media-bottom {
    display: block !important;
    font-size: 12px !important;
    color: #888 !important;
    overflow: hidden !important;
    max-height: 2.4em !important;
    white-space: normal !important;
  }

  /* new-day 列表：图左文右 */
  .new-day li {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-align-items: flex-start !important;
    align-items: flex-start !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #efefef !important;
  }
  .new-day .media-left {
    float: none !important;
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
    width: 90px !important;
    height: 66px !important;
    overflow: hidden !important;
    margin-right: 8px !important;
  }
  .new-day .thumbnail { width: 90px !important; height: 66px !important; display: block !important; }
  .new-day .thumbnail img { width: 90px !important; height: 66px !important; object-fit: cover !important; }
  .new-day .media { -webkit-flex: 1 !important; flex: 1 !important; min-width: 0 !important; margin-top: 0 !important; }
  .new-day .media-body { width: 100% !important; overflow: hidden !important; }
  .new-day .media-body a { white-space: normal !important; word-break: break-all !important; font-size: 13px !important; }
  .new-day .media-bottom { white-space: normal !important; font-size: 11px !important; }

  /* 图片列表2列 */
  .list-img ol { width: 100% !important; overflow: hidden !important; }
  .list-img li {
    width: calc(50% - 4px) !important;
    margin-right: 4px !important;
    margin-bottom: 6px !important;
    float: left !important;
  }
  .list-img li:nth-child(2n) { margin-right: 0 !important; }
  .list-img li img { width: 100% !important; height: 80px !important; object-fit: cover !important; }

  /* 文字列表 */
  .list-item li {
    white-space: normal !important;
    word-break: break-all !important;
    height: auto !important;
    line-height: 1.6 !important;
    padding: 4px 0 4px 15px !important;
  }
}

/* ============================================================
   5. top商品区：移动端2列网格 + 左右滑动切换分类
   ============================================================ */
@media (max-width: 768px) {
  /* PC端 top_middle 高度重置 */
  .top_middle { height: auto !important; }

  /* 分类标签栏：横向滚动 */
  .topx-hd {
    width: 100% !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }
  .topx-hd::-webkit-scrollbar { display: none !important; }
  .topx-hd ol {
    display: -webkit-inline-flex !important;
    display: inline-flex !important;
    white-space: nowrap !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    float: none !important;
    vertical-align: top !important;
  }
  .topx-hd li {
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
    float: none !important;
    display: inline-block !important;
    height: auto !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
  }
  .topx-hd li.hover {
    border: none !important;
    border-bottom: 2px solid #f78613 !important;
    background: #fff !important;
    color: #f78613 !important;
  }

  /* 移动端限制每分类只显6个商品（2列×3行） */
  .topx-bd ol li:nth-child(n+7) { display: none !important; }

  /* 覆盖top.html body的overflow:hidden，确保touch事件正常 */
  body { overflow: visible !important; }
  .ad.wrap { overflow: hidden !important; }

  /* 商品列表容器 */
  .topx-bd {
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
    touch-action: pan-y !important;
  }
  .topx-bd ol {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-flex-wrap: wrap !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 4px !important;
    border: none !important;
    width: 100% !important;
  }
  .topx-bd ol.dis  { display: -webkit-flex !important; display: flex !important; }
  .topx-bd ol.undis { display: none !important; }

  /* 每个商品：2列 */
  .topx-bd li {
    float: none !important;
    width: calc(50% - 8px) !important;
    margin: 4px !important;
    padding: 8px !important;
    border: 1px solid #eee !important;
    border-bottom: 1px solid #eee !important;
    border-radius: 4px !important;
    background: #fff !important;
    box-sizing: border-box !important;
  }
  .topx-bd li .unit {
    width: 100% !important;
    height: auto !important;
    position: relative !important;
  }
  /* 图片：正方形比例 */
  .topx-bd li .unit .pic {
    display: block !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    background: #f8f8f8 !important;
    line-height: normal !important;
  }
  .topx-bd li .unit .pic img {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    object-fit: cover !important;
    vertical-align: middle !important;
    max-width: none !important;
  }
  .topx-bd li .unit .title {
    display: block !important;
    height: auto !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    overflow: hidden !important;
    max-height: 2.8em !important;
    white-space: normal !important;
    word-break: break-all !important;
    margin: 4px 0 2px !important;
    color: #333 !important;
  }
  .topx-bd li .unit .price {
    display: block !important;
    font-size: 12px !important;
    color: #a2a2a2 !important;
  }
  .topx-bd li .unit .price em {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #f78613 !important;
    font-style: normal !important;
  }
  .topx-bd li .unit .sales {
    display: block !important;
    font-size: 11px !important;
    color: #999 !important;
  }
  /* 排名角标 */
  .topx-bd li s {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: auto !important; height: auto !important;
    padding: 2px 6px !important;
    background: #f78613 !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-radius: 0 0 4px 0 !important;
    z-index: 1 !important;
  }

  /* 底部栏 */
  .topx-ft {
    height: auto !important;
    padding: 8px 12px !important;
    border: none !important;
    border-top: 1px solid #eee !important;
    overflow: visible !important;
  }

  /* 首页焦点图区 */
  .container-bar .col-xs-2 { display: none !important; }
  .container-bar .col-xs-6 { float: none !important; width: 100% !important; padding: 0 !important; }
  .container-bar .col-xs-4 { float: none !important; width: 100% !important; padding: 0 !important; margin-top: 2px !important; }
  .index-one-fours { height: 190px !important; }
  .index-one-fours .bd img { height: 190px !important; width: 100% !important; object-fit: cover !important; }

  /* tab横向滚动 */
  .tab-controller { width: 100% !important; overflow-x: auto !important; white-space: nowrap !important; scrollbar-width: none !important; }
  .tab-controller::-webkit-scrollbar { display: none !important; }
  .tab-controller li { display: inline-block !important; float: none !important; }

  /* 内容页 */
  .viewbox { padding: 10px !important; }
  .article-header .title { font-size: 18px !important; line-height: 1.4 !important; }
  .article-header .info .left,
  .article-header .info .right { float: none !important; display: block !important; width: 100% !important; }
  #main-content { font-size: 15px !important; line-height: 1.8 !important; overflow-x: hidden !important; word-break: break-word !important; }
  #main-content img { max-width: 100% !important; height: auto !important; }
  #main-content table { width: 100% !important; max-width: 100% !important; table-layout: fixed !important; overflow-x: auto !important; }

  /* 底部版权 */
  .footer_copyright { width: 100% !important; padding: 0 10px !important; }
  .footer_copyright_inner .company-copy .left,
  .footer_copyright_inner .company-copy .right { float: none !important; display: block !important; text-align: center !important; width: 100% !important; }

  /* 分页 */
  .pagelist { text-align: center !important; }
  .pagelist a, .thisclass { display: inline-block !important; padding: 5px 8px !important; margin: 2px !important; font-size: 12px !important; }
}

@media (max-width: 480px) {
  .container { padding: 0 8px !important; }
  .top_middle_logo .logo { height: 28px !important; max-width: 100px !important; }
  .form input[type="text"] { height: 28px !important; line-height: 28px !important; font-size: 12px !important; }
  .search-submit { width: 44px !important; height: 28px !important; font-size: 12px !important; }
  .article-list .media-left { width: 80px !important; height: 60px !important; }
  .article-list .media-left a,
  .article-list .media-left .thumbnail { width: 80px !important; height: 60px !important; }
  .article-list .media-left img,
  .article-list .thumbnail img { width: 80px !important; height: 60px !important; }
  .article-list .media-body h2,
  .article-list .media-body .ft18 { font-size: 13px !important; }
  .index-one-fours { height: 160px !important; }
  .index-one-fours .bd img { height: 160px !important; }
  .article-header .title { font-size: 16px !important; }
  #main-content { font-size: 14px !important; }
}
