/* ==========================================================================
   goods-mobile.css · 商品订购页（cart/goods）移动端适配层
   加载位置：goods.php 中位于 goods.css / goods-ref.css 之后
   作用范围：仅 @media (max-width: 750px)，桌面端样式完全不受影响

   选择器统一带 .goods 前缀：插件 mf_cloud.css 是随内容 HTML 注入 DOM 的，
   位置在 head 样式之后，同一优先级会覆盖本文件，加前缀保证窄屏规则生效。

   背景：
   1. 本站商品 9 走上游代理（mf_cloud，only_api），插件只提供 PC 模板，
      移动主题无法命中该模块（checkModuleMobile 为 false），因此只能在 PC 模板上做响应式。
   2. common.js 在 <=750px 时把根字号设为 viewport/7.5（375px 屏 = 50px），
      PC 模板里以 rem 书写的字号（0.14rem 等）会被压到 7px，必须用 px 兜底。
   3. 结算条 .f-order 是 position:fixed + 固定 1.2rem 高，窄屏放不下，需改为两行。
   ========================================================================== */

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

  /* -------------------------------------------------- 外壳布局 */
  /* 侧栏隐藏，导航走顶栏汉堡按钮（topMenu 的 drawer-menu） */
  .goods .el-aside {
    display: none !important;
  }

  .goods .el-header {
    width: 100% !important;
  }

  /* 正文区：顶部让开 56px 固定头，底部让开结算条 */
  .goods .el-main {
    padding: 64px 12px 132px !important;
    font-size: 14px !important;
    line-height: 1.5;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .goods .config-box,
  .goods .config-box .content {
    height: auto !important;
  }

  .goods .config-box .content {
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.5;
  }

  /* -------------------------------------------------- 标题与说明文字 */
  .goods .mf-cloud {
    padding: 12px 12px 20px;
    border-radius: 8px;
  }

  .goods .mf-cloud .con {
    padding: 0;
  }

  .goods .template > .tit {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 14px;
  }

  .goods .mf-cloud .com-tit {
    font-size: 16px;
    line-height: 1.4;
    padding-left: 8px;
    margin-bottom: 12px;
  }

  .goods .mf-cloud .com-tit::before {
    width: 3px;
    height: 14px;
  }

  .goods .mf-cloud .s-tip {
    font-size: 12px;
    line-height: 1.6;
    margin-top: 6px;
  }

  /* -------------------------------------------------- 选项卡：横向滚动，去掉移动端模板的顶边距 */
  .goods .mf-cloud .el-tabs__header {
    margin: 0 0 12px;
  }

  .goods .mf-cloud .el-tabs__nav-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .goods .mf-cloud .el-tabs__nav-wrap::after {
    display: none;
  }

  .goods .mf-cloud .el-tabs__nav {
    float: none;
    display: inline-block;
    white-space: nowrap;
  }

  .goods .mf-cloud .el-tabs__item {
    margin: 0 !important;
    height: 40px;
    line-height: 40px;
    padding: 0 14px !important;
    font-size: 15px !important;
  }

  .goods .mf-cloud .el-tabs__active-bar {
    bottom: 0;
  }

  .goods .mf-cloud .el-tabs__content {
    overflow: visible;
  }

  /* -------------------------------------------------- 表单：标签置顶、控件满宽 */
  .goods .mf-cloud .el-form .el-form-item {
    margin-bottom: 16px;
  }

  .goods .mf-cloud .el-form-item__label {
    float: none !important;
    display: block;
    width: auto !important;
    padding: 0 0 6px !important;
    text-align: left;
    line-height: 1.4;
    font-size: 14px;
    color: #1a1a1a;
  }

  .goods .mf-cloud .el-form-item__content {
    margin-left: 0 !important;
    line-height: 1.5;
  }

  .goods .mf-cloud .el-input,
  .goods .mf-cloud .el-select,
  .goods .mf-cloud .el-textarea,
  .goods .mf-cloud .el-input-number,
  .goods .custom-config .el-input,
  .goods .custom-config .el-select,
  .goods .custom-config .el-textarea {
    width: 100% !important;
    max-width: 100%;
  }

  .goods .mf-cloud .el-input-number .el-input {
    width: 100% !important;
  }

  /* 单选/多选按钮组换行，避免横向溢出 */
  .goods .mf-cloud .el-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .goods .mf-cloud .el-radio-button {
    margin: 0;
  }

  .goods .mf-cloud .el-radio-button__inner {
    height: 36px;
    line-height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border: 2px solid transparent !important;
    border-radius: 4px !important;
    box-shadow: none !important;
  }

  .goods .mf-cloud .el-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .goods .mf-cloud .el-checkbox {
    margin-right: 0;
  }

  /* -------------------------------------------------- 机型 / 镜像卡片：单列 */
  .goods .mf-cloud .cloud-box {
    margin: 0;
    flex-direction: column;
  }

  .goods .mf-cloud .cloud-box .cloud-item {
    width: 100%;
    margin: 0 0 10px;
  }

  .goods .mf-cloud .cloud-box .cloud-item .top {
    padding: 0 12px;
    line-height: 40px;
  }

  .goods .mf-cloud .cloud-box .info {
    padding: 10px 12px;
  }

  .goods .mf-cloud .cloud-box .info p {
    flex-wrap: wrap;
    line-height: 1.8;
  }

  .goods .mf-cloud .cloud-box .info .name {
    width: auto;
    min-width: 96px;
  }

  .goods .mf-cloud .image-box,
  .goods .mf-cloud .image-ul {
    max-width: 100%;
  }

  .goods .mf-cloud .image-item {
    width: calc(50% - 5px);
    height: auto;
    min-height: 64px;
    padding: 10px;
    margin: 0 0 10px;
  }

  .goods .mf-cloud .image-item:nth-child(odd) {
    margin-right: 10px;
  }

  .goods .mf-cloud .image-item .name {
    font-size: 14px;
  }

  .goods .mf-cloud .image-item .version {
    font-size: 12px;
  }

  /* -------------------------------------------------- 表格：容器内横向滚动 */
  .goods .mf-cloud .line-spec-table-scroll,
  .goods .mf-cloud .line-spec-picker .line-spec-table-scroll {
    width: 100%;
    max-width: 100%;
  }

  .goods .line-spec-picker table.line-spec-table {
    min-width: 480px;
  }

  .goods .line-spec-table th,
  .goods .line-spec-table td {
    padding: 8px;
  }

  .goods .mf-cloud .el-table {
    font-size: 12px;
  }

  .goods .mf-cloud .el-table .cell {
    padding: 0 6px;
    line-height: 1.4;
  }

  .goods .mf-cloud .el-slider {
    margin-right: 14px;
  }

  /* -------------------------------------------------- 底部结算条：两行布局 */
  .goods .f-order {
    height: auto !important;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, .06);
    font-size: 13px;
  }

  .goods .f-order .l-empty {
    display: none;
  }

  .goods .f-order .el-main {
    width: 100%;
    padding: 0 !important;
    background: transparent;
    box-shadow: none;
  }

  .goods .f-order .main-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    width: 100%;
  }

  .goods .f-order .main-card .left {
    flex: 1 1 100%;
    align-items: flex-end;
    gap: 10px;
  }

  .goods .f-order .time {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
  }

  .goods .f-order .l-txt {
    display: block;
    margin: 0 0 4px;
    font-size: 12px;
    color: #909399;
    line-height: 1.2;
  }

  .goods .f-order .duration-select {
    width: 100% !important;
  }

  .goods .f-order .num {
    flex: 0 0 108px;
    line-height: 1.2;
  }

  .goods .f-order .el-input-number {
    width: 100% !important;
  }

  /* 配置概览浮层收起，窄屏容量优先 */
  .goods .f-order .mid,
  .goods .f-order .line-empty {
    display: none;
  }

  .goods .f-order .bot-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-left: auto;
    font-size: 12px;
    text-align: right;
  }

  .goods .f-order .bot-price .new {
    display: flex;
    align-items: baseline;
    gap: 2px;
  }

  .goods .f-order .bot-price .new::before {
    font-size: 13px;
  }

  .goods .f-order .bot-price .new span {
    font-size: 22px;
    font-weight: 700;
    color: #ff0000;
    margin-left: 0;
  }

  .goods .f-order .bot-price .old {
    margin-top: 0;
    font-size: 12px;
  }

  .goods .f-order .bot-price .used span,
  .goods .f-order .bot-price .use {
    font-size: 12px;
  }

  .goods .f-order .right {
    display: flex;
    align-items: center;
    margin-left: auto;
  }

  .goods .f-order .right .add-cart {
    width: 44px;
    height: 40px;
  }

  .goods .f-order .right .buy {
    width: auto;
    min-width: 120px;
    height: 40px;
    line-height: 40px;
    margin-left: 8px;
    padding: 0 16px;
    font-size: 15px;
    border-radius: 4px;
  }

  /* -------------------------------------------------- 加入购物车弹窗 */
  .goods .cartDialog {
    width: 90% !important;
    max-width: 360px;
  }

  .goods .cartDialog .tit {
    font-size: 18px;
  }

  .goods .cartDialog .dialog-footer {
    padding-bottom: 20px;
  }

  .goods .cartDialog .dialog-footer .el-button {
    width: auto !important;
    min-width: 110px;
    height: 40px;
  }

  .goods .cartDialog .dialog-footer .el-button span {
    font-size: 14px;
  }
}
