/* Mobile app canvas, safe areas and touch-first component adaptation. */

.mobile-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100dvh;
  padding: 28px;
  background: #e9eef5;
}

.mobile-device {
  --mobile-canvas-width: 390px;
  position: relative;
  width: min(100%, var(--mobile-canvas-width));
  min-width: 320px;
  min-height: min(844px, calc(100dvh - 56px));
  overflow: hidden;
  border: 10px solid #18202a;
  border-radius: 38px;
  background: var(--el-bg-color-page);
  box-shadow: 0 22px 50px rgb(16 24 40 / 22%);
}
.mobile-device.is-375 { --mobile-canvas-width: 375px; }
.mobile-device.is-390 { --mobile-canvas-width: 390px; }
.mobile-device.is-414 { --mobile-canvas-width: 414px; }

.mobile-app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  color: var(--el-text-color-primary);
  font-size: 15px;
  line-height: 1.55;
  background: var(--el-bg-color-page);
}

.mobile-device .mobile-app {
  min-height: min(824px, calc(100dvh - 76px));
  max-height: min(824px, calc(100dvh - 76px));
}

.mobile-statusbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: calc(24px + var(--safe-top));
  padding: var(--safe-top) 18px 3px;
  color: var(--el-text-color-primary);
  font-size: 11px;
  font-weight: 600;
  background: var(--el-bg-color);
}

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: var(--touch-target) minmax(0, 1fr) var(--touch-target);
  align-items: center;
  min-height: var(--mobile-header-height);
  padding: 0 8px;
  border-bottom: 1px solid var(--el-border-color-lighter);
  background: rgb(255 255 255 / 96%);
}
.mobile-topbar__title { min-width: 0; margin: 0; overflow: hidden; color: var(--el-text-color-primary); font-size: 17px; font-weight: 650; line-height: 24px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.mobile-topbar__action { display: inline-flex; align-items: center; justify-content: center; min-width: var(--touch-target); min-height: var(--touch-target); padding: 0; border: 0; border-radius: var(--radius-base); color: var(--el-text-color-primary); background: transparent; font-size: 20px; }
.mobile-topbar__action:hover,
.mobile-topbar__action:active { background: var(--el-fill-color); }

.mobile-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 14px calc(18px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding-block: 64px calc(24px + var(--safe-bottom));
  scrollbar-width: thin;
}
.mobile-app.has-bottom-nav .mobile-content {
  padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom) + 18px);
  scroll-padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom) + 24px);
}
.mobile-content.has-sticky-action {
  padding-bottom: calc(84px + var(--safe-bottom));
  scroll-padding-bottom: calc(92px + var(--safe-bottom));
}

.mobile-app > .mobile-page-actionbar {
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: calc(var(--z-sticky) + 2) !important;
  display: flex !important;
  align-items: center;
  width: auto !important;
  margin: 0 !important;
  padding: 10px 12px calc(10px + var(--safe-bottom)) !important;
  gap: 8px;
  border-top: 1px solid var(--el-border-color-lighter) !important;
  background: rgb(255 255 255 / 98%) !important;
  box-shadow: var(--shadow-mobile-nav) !important;
}
.mobile-app.has-bottom-nav > .mobile-page-actionbar {
  bottom: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom)) !important;
}
.mobile-app > .mobile-page-actionbar > button,
.mobile-app > .mobile-page-actionbar > .el-button {
  flex: 1 1 0 !important;
  min-width: 0;
  min-height: 44px;
  height: 44px;
}
.mobile-app > .mobile-page-actionbar > .is-primary,
.mobile-app > .mobile-page-actionbar > .el-button--primary {
  flex-grow: 1.25 !important;
}
.mobile-content.has-sticky-action { padding-bottom: calc(76px + var(--safe-bottom)); }
.mobile-section + .mobile-section { margin-top: var(--space-4); }
.mobile-section__header { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: var(--space-2); gap: var(--space-2); }
.mobile-section__title { margin: 0; font-size: 16px; font-weight: 650; }
.mobile-section__meta { color: var(--el-text-color-secondary); font-size: 12px; }

.mobile-bottom-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: repeat(var(--mobile-nav-count, 5), minmax(0, 1fr));
  min-height: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom));
  padding: 4px 4px var(--safe-bottom);
  border-top: 1px solid var(--el-border-color-light);
  background: rgb(255 255 255 / 97%);
  box-shadow: var(--shadow-mobile-nav);
}
.mobile-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 52px;
  padding: 3px 4px;
  gap: 2px;
  border: 0;
  border-radius: var(--radius-base);
  color: var(--el-text-color-secondary);
  background: transparent;
}
.mobile-nav-item__icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; font-size: 22px; }
.mobile-nav-item__label { max-width: 100%; overflow: hidden; font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-nav-item.is-active { color: var(--el-color-primary); font-weight: 600; }
.mobile-nav-item.is-active::after { content: ""; position: absolute; top: 1px; left: 50%; width: 18px; height: 2px; border-radius: var(--radius-round); background: var(--el-color-primary); transform: translateX(-50%); }
.mobile-nav-item__badge { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid #fff; border-radius: var(--radius-round); color: #fff; font-size: 9px; line-height: 13px; text-align: center; background: var(--el-color-danger); }

.mobile-sticky-action {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  gap: var(--space-2);
  border-top: 1px solid var(--el-border-color-light);
  background: rgb(255 255 255 / 98%);
  box-shadow: var(--shadow-mobile-nav);
}
.mobile-sticky-action > .el-button { flex: 1 1 0; }

.mobile-card {
  padding: 14px;
  border: 1px solid var(--el-border-color-light);
  border-radius: var(--radius-panel);
  background: var(--el-bg-color);
  box-shadow: var(--shadow-card);
}
.mobile-card + .mobile-card { margin-top: var(--space-3); }
.mobile-card__header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-3); gap: var(--space-3); }
.mobile-card__title { min-width: 0; margin: 0; font-size: 16px; font-weight: 650; line-height: 23px; }
.mobile-card__subtitle { margin-top: 2px; color: var(--el-text-color-secondary); font-size: 12px; line-height: 18px; }
.mobile-card__actions { display: flex; align-items: center; justify-content: flex-end; margin-top: var(--space-3); padding-top: var(--space-3); gap: var(--space-2); border-top: 1px solid var(--el-border-color-lighter); }

.mobile-list { overflow: hidden; border: 1px solid var(--el-border-color-light); border-radius: var(--radius-panel); background: var(--el-bg-color); }
.mobile-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  gap: var(--space-3);
  border-bottom: 1px solid var(--el-border-color-lighter);
  color: inherit;
}
.mobile-list-item:last-child { border-bottom: 0; }
.mobile-list-item:active { background: var(--el-fill-color-light); }
.mobile-list-item__icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-card); color: var(--el-color-primary); background: var(--el-color-primary-light-9); font-size: 20px; }
.mobile-list-item__content { min-width: 0; }
.mobile-list-item__title { color: var(--el-text-color-primary); font-weight: 600; }
.mobile-list-item__description { margin-top: 2px; color: var(--el-text-color-secondary); font-size: 12px; line-height: 18px; }
.mobile-list-item__suffix { display: inline-flex; align-items: center; gap: 5px; color: var(--el-text-color-secondary); }

.mobile-field-list { display: grid; gap: 10px; }
.mobile-field { display: grid; gap: 3px; }
.mobile-field__label { color: var(--el-text-color-secondary); font-size: 12px; line-height: 18px; }
.mobile-field__value { color: var(--el-text-color-primary); overflow-wrap: anywhere; }
.mobile-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }

.mobile-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.mobile-kpi { min-width: 0; padding: 12px; border: 1px solid var(--el-border-color-light); border-radius: var(--radius-card); background: var(--el-bg-color); }
.mobile-kpi__label { color: var(--el-text-color-secondary); font-size: 12px; }
.mobile-kpi__value { margin-top: 4px; color: var(--el-text-color-primary); font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mobile-kpi__meta { margin-top: 2px; color: var(--el-text-color-secondary); font-size: 11px; }

.mobile-filter-chips { display: flex; margin: 0 -14px; padding: 0 14px 2px; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; }
.mobile-filter-chips::-webkit-scrollbar { display: none; }
.mobile-filter-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; flex: 0 0 auto; border: 1px solid var(--el-border-color); border-radius: var(--radius-round); color: var(--el-text-color-regular); background: var(--el-bg-color); }
.mobile-filter-chip.is-active { color: var(--el-color-primary-dark-2); border-color: var(--el-color-primary); background: var(--el-color-primary-light-9); }

.mobile-app .el-button,
.mobile-app .el-input__wrapper,
.mobile-app .el-select__wrapper,
.mobile-app .el-date-editor__wrapper,
.mobile-app .el-cascader__wrapper,
.mobile-app .el-checkbox,
.mobile-app .el-radio,
.mobile-app .el-pagination button,
.mobile-app .el-pager li {
  min-height: var(--touch-target);
}
.mobile-app .el-button { height: var(--touch-target); padding-inline: 16px; }
.mobile-app .el-button.is-circle { width: var(--touch-target); padding: 0; }
.mobile-app .el-input__inner,
.mobile-app .el-date-editor__inner,
.mobile-app .el-cascader__input { height: 40px; font-size: 16px; }
.mobile-app .el-form { gap: var(--space-4); }
.mobile-app .el-form-grid { grid-template-columns: 1fr; }
.mobile-app .el-textarea__inner { min-height: 104px; font-size: 16px; }
.mobile-app .el-form-item__label { font-size: 13px; }
.mobile-app .el-table { display: none; }

.mobile-sheet-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  min-height: 100%;
  overflow: hidden;
  background: var(--color-mask);
}
.mobile-sheet {
  position: relative;
  z-index: var(--z-dialog);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(86%, calc(100dvh - var(--safe-top) - 12px));
  overflow: hidden;
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  background: var(--el-bg-color-overlay);
  box-shadow: 0 -14px 34px rgb(16 24 40 / 18%);
  animation: mobile-sheet-enter var(--motion-slow) var(--ease-enter);
}
.mobile-sheet__handle { width: 38px; height: 4px; margin: 8px auto 4px; border-radius: var(--radius-round); background: #c8d0db; }
.mobile-sheet__header { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 14px; gap: var(--space-3); border-bottom: 1px solid var(--el-border-color-lighter); }
.mobile-sheet__title { font-size: 17px; font-weight: 650; }
.mobile-sheet__body { flex: 1 1 auto; min-height: 0; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.mobile-sheet__footer { display: flex; padding: 10px 14px calc(10px + var(--safe-bottom)); gap: var(--space-2); border-top: 1px solid var(--el-border-color-lighter); background: var(--el-bg-color); }
.mobile-sheet__footer > .el-button { flex: 1 1 0; }

.mobile-fullscreen {
  position: absolute;
  inset: 0;
  z-index: var(--z-dialog);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  background: var(--el-bg-color-page);
  animation: mobile-page-enter var(--motion-slow) var(--ease-enter);
}
.mobile-fullscreen__body { flex: 1 1 auto; min-height: 0; padding: 14px 14px calc(14px + var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.mobile-business-fullscreen__header {
  display: grid;
  grid-template-columns: var(--touch-target) minmax(0, 1fr) var(--touch-target);
  align-items: center;
  min-height: var(--mobile-header-height);
  padding: 0 8px;
  border-bottom: 1px solid var(--el-border-color-lighter);
  background: var(--el-bg-color);
}
.mobile-business-fullscreen__header > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target);
  min-height: var(--touch-target);
  padding: 0;
  border: 0;
  color: var(--el-text-color-primary);
  background: transparent;
}
.mobile-business-fullscreen__header > button svg { width: 18px; height: 18px; }
.mobile-business-fullscreen__header > div { display: grid; min-width: 0; text-align: center; }
.mobile-business-fullscreen__header strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-business-fullscreen__header small { overflow: hidden; color: var(--el-text-color-secondary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-business-fullscreen .mobile-fullscreen__body { padding-bottom: 18px; }
.mobile-business-fullscreen .blueprint-form section { padding: 14px; border-radius: 10px; background: var(--el-bg-color); }
.mobile-business-fullscreen .blueprint-form section > div { grid-template-columns: 1fr; gap: 14px; }
.mobile-business-fullscreen .blueprint-form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  font-size: 16px;
}
.mobile-business-fullscreen .blueprint-links dl { grid-template-columns: 1fr; }
.mobile-fullscreen__footer {
  display: flex;
  flex: 0 0 auto;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  gap: 8px;
  border-top: 1px solid var(--el-border-color-lighter);
  background: rgb(255 255 255 / 98%);
  box-shadow: var(--shadow-mobile-nav);
}
.mobile-fullscreen__footer > .el-button { flex: 1 1 0; min-height: 44px; }
.mobile-fullscreen__footer > .el-button--primary { flex-grow: 1.25; }

@keyframes mobile-sheet-enter { from { transform: translateY(24px); opacity: .85; } }
@keyframes mobile-page-enter { from { transform: translateX(14px); opacity: .9; } }

.mobile-upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.mobile-upload-item { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--el-border-color); border-radius: var(--radius-card); background: var(--el-fill-color-light); }
.mobile-upload-item img { width: 100%; height: 100%; object-fit: cover; }
.mobile-upload-trigger { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; gap: 4px; border: 1px dashed var(--el-border-color-darker); border-radius: inherit; color: var(--el-color-primary); background: var(--el-color-primary-light-9); }
.mobile-upload-trigger__label { color: var(--el-text-color-regular); font-size: 12px; }

.offline-banner { display: flex; align-items: flex-start; padding: 9px 12px; gap: var(--space-2); border-bottom: 1px solid #f3d6a1; color: #8b4a07; background: var(--el-color-warning-light-9); font-size: 12px; }
.upload-queue-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; min-height: 64px; padding: 10px 0; gap: var(--space-3); border-bottom: 1px solid var(--el-border-color-lighter); }
.upload-queue-item:last-child { border-bottom: 0; }
.upload-queue-item__preview { width: 40px; height: 40px; overflow: hidden; border-radius: var(--radius-base); background: var(--el-fill-color); }

@media (max-width: 430px) {
  .mobile-stage { padding: 0; background: var(--el-bg-color-page); }
  .mobile-device { width: 100%; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .mobile-device .mobile-app { min-height: 100dvh; max-height: 100dvh; }
}

@media (max-width: 374px) {
  .mobile-content { padding-inline: 12px; }
  .mobile-kpi-grid,
  .mobile-field-grid { grid-template-columns: 1fr; }
  .mobile-upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-card { padding: 12px; }
}

@media (min-width: 400px) and (max-width: 430px) {
  .mobile-content { padding-inline: 16px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .mobile-stage { padding: 0; }
  .mobile-device { width: 100%; max-width: none; min-height: 100dvh; border: 0; border-radius: 0; }
  .mobile-device .mobile-app { min-height: 100dvh; max-height: 100dvh; }
  .mobile-content { padding-bottom: 16px; }
  .mobile-bottom-nav { position: absolute; top: 0; right: 0; bottom: 0; left: auto; grid-template-columns: 64px; grid-auto-rows: 1fr; width: 64px; min-height: 0; padding: 4px var(--safe-right) 4px 4px; border-top: 0; border-left: 1px solid var(--el-border-color-light); }
  .mobile-app:has(.mobile-bottom-nav) .mobile-content { padding-right: calc(74px + var(--safe-right)); }
  .mobile-sheet { max-height: calc(100dvh - 8px); }
}

/* ===== 进度填报移动端增强样式 ===== */
.mobile-voice-record { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--el-border-color-light); border-radius: var(--radius-base); background: var(--el-fill-color-light); margin-top: 12px; }
.mobile-voice-record.is-disabled { opacity: 0.5; }
.mobile-voice-record button { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border: none; border-radius: 20px; background: var(--el-color-primary); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; }
.mobile-voice-record button:disabled { background: var(--el-text-color-placeholder); cursor: not-allowed; }
.mobile-voice-record button b { font-size: 13px; }
.mobile-voice-record button small { font-size: 11px; opacity: 0.8; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 24px; }
.voice-wave span { width: 3px; height: 8px; background: var(--el-color-primary); border-radius: 2px; animation: voice-bar 0.8s infinite ease-in-out; }
.voice-wave span:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.voice-wave span:nth-child(3) { animation-delay: 0.2s; height: 12px; }
.voice-wave span:nth-child(4) { animation-delay: 0.3s; height: 20px; }
.voice-wave span:nth-child(5) { animation-delay: 0.4s; height: 10px; }
@keyframes voice-bar { 0%,100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }
.voice-duration { font-size: 11px; color: var(--el-text-color-secondary); font-variant-numeric: tabular-nums; }

.mobile-rule-callout.is-danger { border-left-color: var(--el-color-danger); background: var(--el-color-danger-light-9); }
.mobile-rule-callout.is-danger b { color: var(--el-color-danger); }
.mobile-rule-callout.is-danger ul { margin: 6px 0 0; padding-left: 18px; }
.mobile-rule-callout.is-danger ul li { font-size: 12px; color: var(--el-text-color-regular); line-height: 1.6; }
