/* ============================================
   公共样式 - AI 测肤 H5
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
    'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #fff;
  overflow-x: hidden;
  background: #06081f;
  user-select: none;
  -webkit-user-select: none;
}

body {
  min-height: 100vh;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
}

input {
  font-family: inherit;
  outline: none;
  border: none;
  background: transparent;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* 通用容器 */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* 通用背景渐变 - 深蓝紫科技感 */
.bg-tech {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124, 77, 255, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(64, 156, 255, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, #1a1340 0%, #0d0a2e 40%, #06081f 100%);
}

/* 通用头部返回 */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #000;
  color: #fff;
}

.nav-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
}

.nav-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}

.nav-right {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.toast.show {
  opacity: 1;
}

/* Loading */
.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 31, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  display: none;
}

.loading-mask.show {
  display: flex;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(124, 77, 255, 0.2);
  border-top-color: #7c4dff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: #a0a8d0;
  letter-spacing: 1px;
}

/* 安全底部指示 */
.safe-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  padding: 12px;
}

.safe-badge-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  font-weight: bold;
}

/* 通用按钮 */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c4dff 0%, #4f7cff 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

/* iOS 状态栏占位 */
.status-bar-spacer {
  height: env(safe-area-inset-top, 0);
}
