/* 小程序样式 1:1 移植（rpx → cqi，750 设计宽） */
.mp-app {
  --mp-primary: #246bfd;
  --mp-primary-dark: #1a56db;
  --mp-primary-light: #eef4ff;
  --mp-primary-border: rgba(36, 107, 253, 0.18);
  --mp-glass-bg: rgba(255, 255, 255, 0.92);
  --mp-glass-border: rgba(15, 23, 42, 0.06);
  --mp-bg-deep: #f4f6fb;
  --mp-bg-mid: #eef1f6;
  --mp-surface: #ffffff;
  --mp-text: #111827;
  --mp-text-secondary: #4b5563;
  --mp-text-muted: #9ca3af;
  --mp-success: #246bfd;
  --mp-shadow-sm: 0 calc(8 * 100cqi / 750) calc(28 * 100cqi / 750) rgba(17, 24, 39, 0.05);
  --mp-shadow-lg: 0 calc(24 * 100cqi / 750) calc(64 * 100cqi / 750) rgba(36, 107, 253, 0.12);
  --mp-radius-sm: calc(20 * 100cqi / 750);
  --mp-radius-md: calc(28 * 100cqi / 750);
  --mp-radius-lg: calc(36 * 100cqi / 750);
  --mp-radius-xl: calc(48 * 100cqi / 750);
  --mp-radius-pill: 999px;
  --mp-btn-height: calc(96 * 100cqi / 750);
  container-type: inline-size;
  container-name: mpapp;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--mp-text);
  background: var(--mp-bg-deep);
}

.mp-app .welcome-screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  animation: mpWelcomeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mp-app .welcome-screen[hidden],
.mp-app .rw-stage.has-pick .welcome-screen,
.mp-app .rw-stage.has-result .welcome-screen {
  display: none !important;
}

@keyframes mpWelcomeIn {
  from { opacity: 0; transform: translateY(calc(32 * 100cqi / 750)); }
  to { opacity: 1; transform: translateY(0); }
}

.mp-app .welcome-body {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(12 * 100cqi / 750) calc(36 * 100cqi / 750) calc(16 * 100cqi / 750);
  box-sizing: border-box;
}

.mp-app .welcome-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: calc(72 * 100cqi / 750);
  min-height: 0;
}

.mp-app .hero-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mp-app .hero-visual {
  position: relative;
  width: calc(236 * 100cqi / 750);
  height: calc(236 * 100cqi / 750);
  margin-bottom: calc(28 * 100cqi / 750);
  animation: mpHeroFloat 4.8s ease-in-out infinite;
}

@keyframes mpHeroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(calc(-10 * 100cqi / 750)); }
}

.mp-app .hero-photo {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: calc(200 * 100cqi / 750);
  height: calc(200 * 100cqi / 750);
  border-radius: calc(48 * 100cqi / 750);
  overflow: hidden;
  background: #fff;
  border: calc(2 * 100cqi / 750) solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 calc(8 * 100cqi / 750) calc(24 * 100cqi / 750) rgba(36, 107, 253, 0.08),
    0 calc(28 * 100cqi / 750) calc(64 * 100cqi / 750) rgba(17, 24, 39, 0.1);
}

.mp-app .hero-photo-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, #e8f1ff 0%, #f4f8ff 38%, #ffffff 72%, #f8fbff 100%);
}

.mp-app .hero-photo-cloud {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 calc(4 * 100cqi / 750) calc(16 * 100cqi / 750) rgba(147, 197, 253, 0.2);
}

.mp-app .hero-photo-cloud--a {
  left: calc(28 * 100cqi / 750);
  top: calc(52 * 100cqi / 750);
  width: calc(72 * 100cqi / 750);
  height: calc(22 * 100cqi / 750);
  opacity: 0.9;
}

.mp-app .hero-photo-cloud--b {
  left: calc(56 * 100cqi / 750);
  top: calc(64 * 100cqi / 750);
  width: calc(46 * 100cqi / 750);
  height: calc(16 * 100cqi / 750);
  opacity: 0.7;
}

.mp-app .hero-photo-sun-glow {
  position: absolute;
  top: calc(28 * 100cqi / 750);
  right: calc(28 * 100cqi / 750);
  width: calc(56 * 100cqi / 750);
  height: calc(56 * 100cqi / 750);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(191, 219, 254, 0.35) 45%, transparent 72%);
}

.mp-app .hero-photo-sun {
  position: absolute;
  top: calc(38 * 100cqi / 750);
  right: calc(38 * 100cqi / 750);
  width: calc(36 * 100cqi / 750);
  height: calc(36 * 100cqi / 750);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff 0%, #e0edff 100%);
  box-shadow: 0 calc(4 * 100cqi / 750) calc(16 * 100cqi / 750) rgba(147, 197, 253, 0.45);
}

.mp-app .hero-photo-hill {
  position: absolute;
  left: -18%;
  right: -18%;
  border-radius: 50% 50% 0 0;
}

.mp-app .hero-photo-hill--back {
  bottom: calc(18 * 100cqi / 750);
  height: calc(88 * 100cqi / 750);
  background: linear-gradient(180deg, #bfdbfe 0%, #93c5fd 100%);
  opacity: 0.75;
}

.mp-app .hero-photo-hill--mid {
  bottom: calc(-6 * 100cqi / 750);
  height: calc(96 * 100cqi / 750);
  background: linear-gradient(180deg, #93c5fd 0%, #60a5fa 100%);
}

.mp-app .hero-photo-hill--front {
  bottom: calc(-28 * 100cqi / 750);
  height: calc(84 * 100cqi / 750);
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
}

.mp-app .hero-float-tag {
  position: absolute;
  right: 0;
  bottom: calc(40 * 100cqi / 750);
  z-index: 2;
  padding: calc(10 * 100cqi / 750) calc(18 * 100cqi / 750);
  border-radius: var(--mp-radius-pill);
  background: linear-gradient(135deg, #4d8fff 0%, #246bfd 55%, #1d4ed8 100%);
  color: #fff;
  font-size: calc(20 * 100cqi / 750);
  font-weight: 700;
  letter-spacing: calc(1 * 100cqi / 750);
  line-height: 1.2;
  box-shadow:
    0 calc(10 * 100cqi / 750) calc(28 * 100cqi / 750) rgba(36, 107, 253, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.mp-app .hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.mp-app .hero-title {
  margin: 0;
  font-size: calc(42 * 100cqi / 750);
  font-weight: 800;
  color: var(--mp-text);
  letter-spacing: calc(1 * 100cqi / 750);
  line-height: 1.2;
  text-align: center;
}

.mp-app .hero-subtitle {
  margin: calc(10 * 100cqi / 750) 0 0;
  font-size: calc(24 * 100cqi / 750);
  color: var(--mp-text-secondary);
  text-align: center;
  line-height: 1.45;
  max-width: calc(560 * 100cqi / 750);
}

.mp-app .action-block {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.mp-app .pick-btn {
  display: flex;
  align-items: center;
  gap: calc(20 * 100cqi / 750);
  flex: 1;
  min-width: 0;
  width: auto;
  padding: calc(20 * 100cqi / 750) calc(22 * 100cqi / 750);
  background: linear-gradient(135deg, #3b82f6 0%, #246bfd 55%, #1d4ed8 100%);
  border-radius: var(--mp-radius-lg);
  box-shadow: var(--mp-shadow-lg);
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.mp-app .pick-btn:hover {
  transform: scale(0.985);
  opacity: 0.96;
}

.mp-app .pick-btn-icon {
  width: calc(72 * 100cqi / 750);
  height: calc(72 * 100cqi / 750);
  border-radius: calc(20 * 100cqi / 750);
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mp-app .pick-btn-icon-plus {
  position: relative;
  width: calc(32 * 100cqi / 750);
  height: calc(32 * 100cqi / 750);
}

.mp-app .pick-btn-icon-plus::before,
.mp-app .pick-btn-icon-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #fff;
  border-radius: calc(4 * 100cqi / 750);
  transform: translate(-50%, -50%);
}

.mp-app .pick-btn-icon-plus::before {
  width: calc(32 * 100cqi / 750);
  height: calc(6 * 100cqi / 750);
}

.mp-app .pick-btn-icon-plus::after {
  width: calc(6 * 100cqi / 750);
  height: calc(32 * 100cqi / 750);
}

.mp-app .pick-btn-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(4 * 100cqi / 750);
}

.mp-app .pick-btn-label {
  font-size: calc(30 * 100cqi / 750);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.mp-app .pick-btn-hint {
  font-size: calc(22 * 100cqi / 750);
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-app .pick-btn-arrow {
  width: calc(18 * 100cqi / 750);
  height: calc(18 * 100cqi / 750);
  border-top: calc(4 * 100cqi / 750) solid rgba(255, 255, 255, 0.9);
  border-right: calc(4 * 100cqi / 750) solid rgba(255, 255, 255, 0.9);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-right: calc(4 * 100cqi / 750);
}

/* loading overlay · 对齐小程序 */
.mp-app .loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
}

.mp-app .loading-overlay[hidden] { display: none !important; }

.mp-app .loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(560 * 100cqi / 750);
  max-width: 86%;
  padding: calc(44 * 100cqi / 750) calc(38 * 100cqi / 750) calc(38 * 100cqi / 750);
  background: #fff;
  border-radius: calc(32 * 100cqi / 750);
  box-shadow: 0 calc(12 * 100cqi / 750) calc(40 * 100cqi / 750) rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
}

.mp-app .loading-spinner {
  width: calc(80 * 100cqi / 750);
  height: calc(80 * 100cqi / 750);
  margin-bottom: calc(28 * 100cqi / 750);
  border-radius: 50%;
  border: calc(5 * 100cqi / 750) solid #e5e7eb;
  border-top-color: #246bfd;
  animation: mpSpin 0.85s linear infinite;
}

@keyframes mpSpin {
  to { transform: rotate(360deg); }
}

.mp-app .loading-text {
  font-size: calc(32 * 100cqi / 750);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: calc(10 * 100cqi / 750);
}

.mp-app .loading-sub {
  font-size: calc(24 * 100cqi / 750);
  color: #64748b;
  margin-bottom: 0;
  min-height: calc(36 * 100cqi / 750);
  text-align: center;
}

/* result dock · 紧凑底栏，不挡预览 */
.mp-app .dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  pointer-events: none;
  padding: 0 calc(16 * 100cqi / 750) calc(22 * 100cqi / 750);
}

.mp-app .dock[hidden] { display: none !important; }

.mp-app .dock-glass {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--mp-glass-border);
  border-radius: calc(28 * 100cqi / 750);
  padding: calc(14 * 100cqi / 750) calc(16 * 100cqi / 750) calc(14 * 100cqi / 750);
  box-shadow: 0 calc(-4 * 100cqi / 750) calc(24 * 100cqi / 750) rgba(17, 24, 39, 0.12);
  backdrop-filter: blur(20px);
}

.mp-app .result-hero {
  display: flex;
  align-items: center;
  gap: calc(12 * 100cqi / 750);
  margin-bottom: calc(12 * 100cqi / 750);
  padding-bottom: 0;
  border-bottom: none;
}

.mp-app .result-hero[hidden] { display: none !important; }

.mp-app .result-check {
  width: calc(40 * 100cqi / 750);
  height: calc(40 * 100cqi / 750);
  border-radius: 50%;
  background: #eef4ff;
  position: relative;
  flex-shrink: 0;
}

.mp-app .result-check::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(12 * 100cqi / 750);
  height: calc(7 * 100cqi / 750);
  border-left: calc(3 * 100cqi / 750) solid var(--mp-success);
  border-bottom: calc(3 * 100cqi / 750) solid var(--mp-success);
  transform: translate(-50%, -58%) rotate(-45deg);
}

.mp-app .result-copy {
  display: flex;
  flex-direction: column;
  gap: calc(2 * 100cqi / 750);
  min-width: 0;
}

.mp-app .result-status-text {
  font-size: calc(26 * 100cqi / 750);
  font-weight: 700;
  color: var(--mp-text);
  line-height: 1.3;
}

.mp-app .result-status-sub {
  font-size: calc(20 * 100cqi / 750);
  color: var(--mp-text-muted);
}

.mp-app .action-row {
  display: flex;
  gap: calc(10 * 100cqi / 750);
}

.mp-app .result-actions-save {
  margin-top: 0;
}

.mp-app .btn-ghost {
  flex: 1;
  min-height: calc(72 * 100cqi / 750);
  height: calc(72 * 100cqi / 750);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--mp-surface);
  border: 1px solid var(--mp-glass-border);
  border-radius: var(--mp-radius-pill);
  color: var(--mp-text-secondary);
  font-size: calc(26 * 100cqi / 750);
  font-weight: 500;
  box-shadow: var(--mp-shadow-sm);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  padding: 0 calc(10 * 100cqi / 750);
}

.mp-app .btn-ghost:hover {
  background: var(--mp-bg-mid);
}

.mp-app .btn-glow {
  flex: 1.35;
  min-height: calc(72 * 100cqi / 750);
  height: calc(72 * 100cqi / 750);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--mp-bg-mid);
  border: 1px solid transparent;
  border-radius: var(--mp-radius-pill);
  color: var(--mp-text-muted);
  font-size: calc(26 * 100cqi / 750);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  padding: 0 calc(12 * 100cqi / 750);
}

.mp-app .btn-glow.ready {
  background: linear-gradient(135deg, #3b82f6 0%, #246bfd 55%, #1d4ed8 100%);
  color: #fff;
  box-shadow: var(--mp-shadow-lg);
}

.mp-app .btn-glow.ready:hover {
  opacity: 0.94;
  transform: scale(0.985);
}

.mp-app .btn-glow[hidden],
.mp-app .btn-ghost[hidden] {
  display: none !important;
}

.mp-app .dock-status {
  margin: 0 0 calc(10 * 100cqi / 750);
  font-size: calc(22 * 100cqi / 750);
  font-weight: 600;
  color: var(--mp-primary);
}

.mp-app .dock-status.is-error {
  color: #dc2626;
}

.mp-app .dock-status[hidden] {
  display: none !important;
}

.mp-app .dock-hint {
  display: none;
}

/* 预览区为底栏留空，避免挡住对比 */
.mp-app .rw-stage.has-result .rw-compare {
  bottom: calc(148 * 100cqi / 750);
}

.mp-app .rw:has(#previewDock:not([hidden])) .rw-stage.has-pick .rw-pick {
  bottom: calc(120 * 100cqi / 750);
}

@media (prefers-reduced-motion: reduce) {
  .mp-app .welcome-screen,
  .mp-app .hero-visual,
  .mp-app .loading-spinner {
    animation: none !important;
  }
}
