/* ADR-0520: 移动端工效学流式排盘与嵌入式 App 原生机壳仿真器样式 */
/* SSOT: ram.liuzengyu.vip · Architecture: ADR-0520 / Skill 146 */

/* 1. App 仿真机壳外层容器 (PC 端演示模式) */
.simulator-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0;
  min-height: calc(100vh - 120px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.simulator-active .app-phone-shell {
  width: 393px;
  min-height: 852px;
  background: var(--bg-card);
  border: 10px solid #2d3748;
  border-radius: 46px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1.5px rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 钛合金双层质感边框微阴影 */
[data-theme="midnight"] .simulator-active .app-phone-shell {
  border-color: #1e293b;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px #334155;
}
[data-theme="eyecare"] .simulator-active .app-phone-shell {
  border-color: #4a3e31;
  box-shadow: 0 20px 50px -10px rgba(60, 40, 20, 0.3);
}

/* 2. 仿真硬件：灵动岛与顶部状态栏 */
.simulator-active .shell-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 22px 6px;
  font-size: 12px;
  font-weight: 700;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}
.shell-status-bar { display: none; }

.dynamic-island {
  width: 90px;
  height: 22px;
  background: #000000;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #22c55e;
  font-size: 9px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.island-pulse {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulseLight 1.5s infinite;
}
@keyframes pulseLight { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* 3. 仿真机壳内滚动视口与底部常驻导航 */
.simulator-active .app-phone-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 75px;
  -webkit-overflow-scrolling: touch;
}

.simulator-active .mobile-bottom-bar {
  display: flex;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 6px 10px 18px;
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}
.mobile-bottom-bar { display: none; }

.mobile-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
  min-height: 44px;
}
.mobile-tab-item.active { color: var(--brand-blue); font-weight: 800; }
.mobile-tab-item .icon { font-size: 16px; margin-bottom: 2px; }

/* 底部 Home 手势条 */
.home-indicator {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  opacity: 0.6;
}

/* 4. 移动端真机环境自适应脱壳 (@media <= 768px) */
@media (max-width: 768px) {
  body { padding: 8px 10px 75px; }
  header { flex-direction: column; align-items: flex-start; gap: 10px; padding-bottom: 10px; }
  .header-actions { width: 100%; justify-content: space-between; }
  
  /* 隐藏 PC 端顶部 Tab，使用手机底部原生固定 Tab */
  .tabs-nav { display: none !important; }
  
  /* 在真实移动设备上隐藏仿真外壳边框与灵动岛，直接全屏呈现 */
  .simulator-active .app-phone-shell {
    width: 100% !important;
    min-height: auto !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .shell-status-bar { display: none !important; }
  .simulator-active .app-phone-content { padding: 0 !important; }
  
  /* 手机端固定常驻底部导航 */
  .mobile-bottom-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 6px 6px 14px !important;
    z-index: 9999 !important;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.08) !important;
  }

  /* 触控工效学：按钮与点击靶心放大 */
  .btn, .tab-btn, .q-opt-label { min-height: 44px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-value { font-size: 20px; }
  .chips-row { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .questionnaire-layout { grid-template-columns: 1fr; }
  .questionnaire-summary-aside { position: static; margin-top: 16px; }
}
