﻿/* ============================================
   /portal/assets/css/mobile_mega_menu.css
   手机端——双栏抽屉菜单（阿里云风格 / 挂网式精简版）
============================================ */
@media (max-width: 768px) {

  /* ============================
     ⭐ 抽屉整体容器
     ============================ */
  .portal-mobile-mega {
      display: none;
      background: #fff;
      flex-direction: row;
      height: 100%;
      overflow: hidden;
  }

  body.portal-menu-open .portal-mobile-mega {
      display: flex;
  }

  /* ============================
     ⭐ 左栏（一级 + 二级组）
     ============================ */
  .mobile-l1-column {
      width: 35%;
      background: #f3f4f6;
      border-right: 1px solid #e5e7eb;
      overflow-y: auto;
      padding-bottom: var(--mobile-bottom-nav-height);
      box-sizing: border-box;
  }

  .mobile-l1-item {
      padding: 14px 16px;
      font-size: 15px;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: transparent !important;
  }

  .mobile-l1-item.active {
      color: #1d4ed8;
      font-weight: 500;
  }

  .mobile-l1-arrow {
      width: 0;
      height: 0;
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-top: 6px solid #6b7280;
      transition: transform 0.2s ease;
  }

  .mobile-l1-item.active .mobile-l1-arrow {
      transform: rotate(180deg);
  }

  .mobile-l1-block.active {
      background: #e0e7ff;
  }

  .mobile-l1-group {
      display: none;
      border-top: 1px solid #e5e7eb;
      overflow-y: auto;
  }

  .mobile-l1-group.active {
      display: block;
  }

  .mobile-l2-item-left {
      padding: 12px 16px;
      font-size: 15px;
      cursor: pointer;
      border-bottom: 1px solid #eee;
      background: transparent !important;
  }

  .mobile-l2-item-left.active {
      color: #1d4ed8;
      font-weight: 500;
  }

  /* ============================
     ⭐ 右栏（挂网式 L2/L3 网格）
     ============================ */
  .mobile-l2-column {
      flex: 1;
      overflow-y: auto;
      padding: 12px 16px;
      padding-bottom: var(--mobile-bottom-nav-height);
      box-sizing: border-box;
  }

  .mobile-panel-title {
      font-size: 16px;
      font-weight: 550;
      color: #111827;
      padding: 4px 0 10px 0;
      margin-bottom: 10px;
      border-bottom: 1px solid #e5e7eb;
  }

  /* ============================
     ⭐ 情况 1：只有二级（L2）→ 二级网格
     ============================ */
  .mobile-l2-panel {
      display: none;
  }

  .mobile-l2-panel.active {
      display: block;
  }

/* ⭐⭐ 在这里插入 hover_height 支持 ⭐⭐ */
.mobile-l2-panel,
.mobile-l3-panel {
    height: var(--drawer-hover-height, 130px);
    overflow-y: auto;
}  
  
  .mobile-l2-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px 12px;
      margin-top: 8px;
  }

.mobile-l2-grid-item {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;

    /* ⭐⭐ 关键：让长文字自动换行 ⭐⭐ */
    word-wrap: break-word;
    overflow-wrap: break-word;
	white-space: normal;   /* ⭐⭐ 强制允许换行（非常关键） */
}

  .mobile-l2-grid-item:hover {
      background: #eff6ff;
      box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
      transform: translateY(-1px);
      color: #1d4ed8;
  }

  /* ============================
     ⭐ 情况 2：有三级（L3）→ L2 分组标题 + L3 网格
     ============================ */
  .mobile-l3-panel {
      display: none;
      margin-bottom: 16px;
  }

  .mobile-l3-panel.active {
      display: block;
  }

  .mobile-l3-grid-title {
      font-size: 15px;
      font-weight: 500;
      color: #111827;
      margin-bottom: 8px;
      padding-bottom: 6px;
      border-bottom: 1px solid #e5e7eb;
  }

  .mobile-l3-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px 12px;
      margin-top: 4px;
  }

.mobile-l3-grid-item {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;

    /* ⭐⭐ 关键：让长文字自动换行 ⭐⭐ */
    word-wrap: break-word;
    overflow-wrap: break-word;
	white-space: normal;   /* ⭐⭐ 强制允许换行（非常关键） */
}

  .mobile-l3-grid-item:hover {
      background: #eff6ff;
      box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
      transform: translateY(-1px);
      color: #1d4ed8;
  }

/* ⭐ L2 描述说明 */
.mobile-l2-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
    white-space: normal;
    word-break: break-all;
}

/* ⭐ L3 描述说明 */
.mobile-l3-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
    white-space: normal;
    word-break: break-all;
}
  
  .mobile-l3-grid-empty {
      padding: 20px;
      text-align: center;
      color: #9ca3af;
      font-size: 14px;
  }

  /* ============================
     ⭐ 三级 → 四级手风琴（保留原版）
     ============================ */
  .mobile-l3-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 0;
      cursor: pointer;
  }

  .mobile-l3-arrow {
      width: 0;
      height: 0;
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-top: 6px solid #6b7280;
      transition: transform 0.2s ease;
  }

  .mobile-l3-item.active .mobile-l3-arrow {
      transform: rotate(180deg);
  }

  .mobile-l4-panel {
      display: none;
      padding-left: 16px;
      border-left: 2px solid #e5e7eb;
      margin-bottom: 8px;
  }

  .mobile-l4-link {
      display: block;
      padding: 6px 0;
      font-size: 14px;
      color: #374151;
  }
}
