/* ============================================================
   驾驶舱手机端仪表盘样式
   仅在小屏（宽度 <= 768px）生效
   ============================================================ */

@media (max-width: 768px) {
  /* 隐藏桌面元素 */
  .sci-mobile-hide {
    display: none !important;
  }

  /* 根容器改为纵向 Flex */
  .sci-mobile-root {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }

  /* 地球容器：占上方 35vh */
  .sci-mobile-earth {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 35vh !important;
    flex: 0 0 auto !important;
    z-index: 1 !important;
  }

  /* 手机仪表盘主容器 */
  #sci-mobile-dashboard {
    position: fixed;
    top: 35vh;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: rgba(10, 14, 26, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    z-index: 2;
  }

  /* 顶部栏 */
  .sci-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 21, 37, 0.6);
    flex: 0 0 auto;
  }

  .sci-mobile-header-title {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.5px;
  }

  .sci-mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .sci-mobile-username {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sci-mobile-header-btn {
    font-size: 10px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 5px;
    padding: 2px 6px;
    cursor: pointer;
    white-space: nowrap;
  }

  .sci-mobile-header-btn-danger {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.25);
  }

  /* 视图切换 */
  .sci-mobile-view-switch {
    display: flex; gap: 0; padding: 6px 12px; background: rgba(15, 21, 37, 0.6); flex: 0 0 auto;
  }
  .sci-mobile-view-switch button {
    flex: 1; padding: 6px 0; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6); font-size: 12px; cursor: pointer;
  }
  .sci-mobile-view-switch button:first-child { border-radius: 6px 0 0 6px; border-right: none; }
  .sci-mobile-view-switch button:last-child { border-radius: 0 6px 6px 0; }
  .sci-mobile-view-switch button.active { background: #ef4444; color: #fff; border-color: #ef4444; }

  /* 业绩 KPI */
  .sci-mobile-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
  .sci-mobile-kpi-card { background: rgba(30,41,59,0.55); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px; }
  .sci-mobile-kpi-card .label { font-size: 11px; color: #94a3b8; }
  .sci-mobile-kpi-card .value { font-size: 16px; font-weight: 600; margin-top: 4px; }
  .sci-mobile-kpi-card .delta { font-size: 10px; margin-top: 2px; }
  .sci-mobile-kpi-card .delta.up { color: #f87171; }
  .sci-mobile-kpi-card .delta.down { color: #4ade80; }

  /* 主 Tab */
  .sci-mobile-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
  }

  .sci-mobile-tabs button {
    flex: 1;
    padding: 8px 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
  }

  .sci-mobile-tabs button.active {
    color: #38bdf8;
  }

  .sci-mobile-tabs button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #38bdf8;
    border-radius: 2px;
  }

  /* 内容区 */
  .sci-mobile-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 12px 0;
  }

  .sci-mobile-scroll-area {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
  }

  /* 选中国家提示条 */
  .sci-mobile-country-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: #e2e8f0;
  }

  .sci-mobile-country-bar button {
    font-size: 12px;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
  }

  /* 标签行 */
  .sci-mobile-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 8px;
    flex: 0 0 auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sci-mobile-tags::-webkit-scrollbar { display: none; }

  .sci-mobile-tag {
    flex: 0 0 auto;
    background: rgba(20, 28, 48, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 28px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }

  .sci-mobile-tag:active {
    transform: scale(0.98);
    background: rgba(30, 41, 59, 0.8);
  }

  .sci-mobile-tag.active {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.15);
  }

  .sci-mobile-tag-dot {
    flex: 0 0 auto;
    display: inline-block;
  }

  .sci-mobile-tag-title {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
  }

  .sci-mobile-tag-count {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }

  /* 列表页 */
  .sci-mobile-list-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }

  .sci-mobile-back {
    font-size: 13px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
  }

  .sci-mobile-list-title {
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
  }

  .sci-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .sci-mobile-list-item {
    background: rgba(20, 28, 48, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
  }

  .sci-mobile-list-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #f8fafc;
    margin-bottom: 4px;
  }

  .sci-mobile-list-item-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
  }

  /* 弹窗 */
  .sci-mobile-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
  }

  .sci-mobile-modal-content {
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .sci-mobile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(30, 41, 59, 0.5);
  }

  .sci-mobile-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
  }

  .sci-mobile-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
  }

  .sci-mobile-modal-body {
    overflow-y: auto;
    padding: 14px 16px;
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.6;
  }

  .sci-mobile-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .sci-mobile-detail-row:last-child {
    border-bottom: none;
  }

  .sci-mobile-detail-label {
    color: #94a3b8;
  }

  .sci-mobile-detail-value {
    color: #f8fafc;
    text-align: right;
    max-width: 60%;
  }

  .sci-mobile-empty {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    padding: 32px 0;
  }

  /* 更新记录弹窗列表项 */
  .sci-mobile-update-item {
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.5;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: rgba(20, 28, 48, 0.6);
    border-left: 3px solid rgba(56, 189, 248, 0.6);
  }
}

/* 桌面端隐藏手机仪表盘容器 */
@media (min-width: 769px) {
  #sci-mobile-dashboard {
    display: none !important;
  }
}
