/* ========== 基础变量 ========== */
:root {
  --pink: #ff6b9d;
  --rose: #c44569;
  --gold: #ffd700;
  --text: #333;
  --text-light: #444;
  --radius: 24px;
}

/* ========== 重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #efc3de, #c6eef3);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
  padding-bottom: 40px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.container { max-width: 800px; margin: 0 auto; padding: 20px; width: 100%; }

/* ========== Logo ========== */
.header {
  text-align: center;
  padding: 10px 20px 20px;
  animation: fadeInDown .8s ease-out;
}

.logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 25px;
  padding: 30px 50px;
  box-shadow: 0 10px 45px rgba(239, 107, 157, .35), inset 0 1px 0 rgba(255, 255, 255, .8);
  border: 2px solid rgba(255, 255, 255, .6);
  position: relative;
  overflow: hidden;
}

.logo-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent);
  animation: shimmer 3s infinite;
}

.logo-box__text {
  font-size: 48px;
  font-weight: bold;
  white-space: nowrap;
  letter-spacing: 8px;
  background: linear-gradient(135deg, var(--pink), var(--rose), var(--pink), var(--rose));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 8px rgba(196, 69, 105, .3));
  animation: textShine 3s linear infinite;
}

.logo-box__ecg {
  width: 90px;
  height: 55px;
  flex-shrink: 0;
  display: block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.logo-box__ecg--right { animation-delay: .2s; }

/* ========== 进度条 ========== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, .4);
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--pink), var(--rose));
  transition: width .5s ease;
  box-shadow: 0 2px 8px rgba(196, 69, 105, .4);
}

/* ========== 通用卡片 ========== */
.qa-card {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: var(--radius);
  padding: 42px 38px;
  margin-bottom: 28px;
  border: 2px solid rgba(255, 255, 255, .6);
  box-shadow: 0 10px 40px rgba(239, 195, 222, .35);
  animation: fadeInUp .6s ease-out;
}

.qa-card--loading {
  text-align: center;
  padding: 85px 20px;
  margin-top: 20px;
}

/* ========== 问题 ========== */
.qa-card__num {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink), var(--rose));
  color: #fff;
  padding: 11px 22px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(196, 69, 105, .3);
}

.qa-card__text {
  font-size: 21px;
  line-height: 1.7;
  margin-bottom: 34px;
  font-weight: 600;
  color: var(--text-light);
}

.qa-card__opts {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.opt-btn {
  padding: 17px 48px;
  font-size: 18px;
  font-weight: 600;
  border: 2px solid rgba(196, 69, 105, .3);
  background: rgba(255, 255, 255, .95);
  color: var(--rose);
  border-radius: 14px;
  cursor: pointer;
  min-width: 165px;
  transition: all .3s ease;
  outline: none;
  appearance: none;
  box-shadow: 0 4px 14px rgba(239, 195, 222, .35);
}

.opt-btn:active,
.opt-btn.is-selected {
  background: linear-gradient(135deg, var(--pink), var(--rose));
  color: #fff;
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(196, 69, 105, .55);
}

/* ========== 图片选择 ========== */
.sel-title {
  font-size: 23px;
  text-align: center;
  margin-bottom: 34px;
  font-weight: bold;
  color: var(--rose);
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px;
  margin-bottom: 30px;
}

.img-opt {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all .3s ease;
  box-shadow: 0 6px 22px rgba(239, 195, 222, .4);
}

.img-opt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-opt.is-selected {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(196, 69, 105, .2), 0 13px 38px rgba(196, 69, 105, .44);
  transform: scale(1.03);
}

.img-opt.is-selected::after {
  content: '\2713';
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--pink), var(--rose));
  color: #fff;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 3px 11px rgba(196, 69, 105, .45);
  animation: popIn .3s ease-out;
}

.img-opt__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 11px 8px;
  font-size: 14px;
  color: #fff;
  font-weight: 500;
  z-index: 5;
}

.confirm-btn {
  width: 100%;
  padding: 20px;
  font-size: 19px;
  font-weight: bold;
  background: linear-gradient(135deg, var(--pink), var(--rose));
  color: #fff;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  letter-spacing: 1px;
  outline: none;
  appearance: none;
  box-shadow: 0 6px 26px rgba(196, 69, 105, .47);
  transition: all .3s ease;
}

.confirm-btn:active { transform: translateY(-1px); }

/* ========== 加载 ========== */
.spinner {
  width: 72px;
  height: 72px;
  margin: 0 auto 27px;
  border: 5px solid rgba(196, 69, 105, .16);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 19px;
  color: var(--rose);
  font-weight: 500;
}

/* ========== 成功页 ========== */
.success__icon {
  font-size: 56px;
  text-align: center;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}

.success__title {
  font-size: 29px;
  text-align: center;
  margin-bottom: 6px;
  font-weight: bold;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--pink), var(--rose), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.success__sub {
  font-size: 12px;
  text-align: center;
  margin-bottom: 8px;
  color: var(--rose);
  font-weight: 600;
  line-height: 1.5;
}

.success__sub strong {
  font-size: 16px;
  color: var(--pink);
}

.success__warn {
  background: linear-gradient(135deg, rgba(255, 215, 0, .16), rgba(255, 165, 0, .16));
  border-left: 5px solid #ffa500;
  padding: 4px 6px;
  margin-bottom: 10px;
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.75;
  color: #cc7000;
  font-weight: 500;
}

.success__hint {
  text-align: center;
  margin-bottom: 10px;
  font-size: 17px;
  color: #666;
  font-weight: 500;
}

.success__rules {
  list-style: none;
  margin-top: 10px;
}

.success__rules li {
  padding: 4px 8px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, rgba(255, 240, 245, .92), rgba(240, 248, 255, .92));
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.73;
  border-left: 4px solid var(--pink);
  color: var(--text-light);
  box-shadow: 0 3px 13px rgba(239, 195, 222, .27);
}

.success__rules li strong {
  color: var(--rose);
  font-size: 15px;
}

.cta-btn {
  width: 100%;
  padding: 25px;
  font-size: 21px;
  font-weight: bold;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--pink), var(--rose), var(--pink));
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  margin-top: 34px;
  outline: none;
  appearance: none;
  box-shadow: 0 8px 34px rgba(196, 69, 105, .52);
  animation: gradientShift 3s ease infinite, glow 2s ease-in-out infinite;
}

/* ========== 网络异常弹窗 ========== */
.net-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 18, .54);
  backdrop-filter: blur(10px);
}

.net-modal__panel {
  width: min(100%, 320px);
  padding: 32px 24px 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #f4f7ff);
  box-shadow: 0 24px 44px rgba(0, 0, 0, .28);
  text-align: center;
  color: #182135;
  animation: netPop .22s ease;
}

.net-modal__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff9a56, #ff6b6b);
  box-shadow: 0 8px 18px rgba(255, 107, 107, .28);
}

.net-modal__icon svg { width: 28px; height: 28px; }
.net-modal__title { font-size: 18px; font-weight: 800; color: #1a1a2e; }

.net-modal__desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: #667085;
}

.net-modal__button {
  width: 100%;
  margin-top: 22px;
  padding: 14px 0;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(102, 126, 234, .28);
  transition: transform .15s ease;
}

.net-modal__button:active { transform: scale(.96); }

/* ========== 动画 ========== */
@keyframes fadeInDown  { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp    { from { opacity: 0; transform: translateY(30px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer     { 0% { left: -100%; } 50%, 100% { left: 100%; } }
@keyframes textShine   { to { background-position: 200% center; } }
@keyframes heartbeat   { 0%, 100% { transform: scale(1); } 10% { transform: scale(1.08); } 20% { transform: scale(1); } 30% { transform: scale(1.05); } 40% { transform: scale(1); } }
@keyframes popIn       { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes bounce      { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }
@keyframes gradientShift { 0% { background-position: 0 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes glow        { 0%, 100% { box-shadow: 0 8px 34px rgba(196, 69, 105, .52); } 50% { box-shadow: 0 8px 50px rgba(196, 69, 105, .78); } }
@keyframes netPop      { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .logo-box { padding: 25px 35px; gap: 12px; }
  .logo-box__text { font-size: 36px; letter-spacing: 5px; }
  .logo-box__ecg { width: 65px; height: 42px; }
}

@media (max-width: 480px) {
  .container { padding: 14px; }
  .logo-box { padding: 22px 26px; gap: 8px; border-radius: 20px; }
  .logo-box__text { font-size: 28px; letter-spacing: 3px; }
  .logo-box__ecg { width: 50px; height: 32px; }
  .qa-card { padding: 12px; border-radius: 20px; }
  .qa-card__text { font-size: 18px; }
  .opt-btn { padding: 14px 34px; font-size: 16px; min-width: 134px; }
  .sel-title { font-size: 19px; }
  .success__title { font-size: 18px; }
  .cta-btn { font-size: 18px; padding: 21px; }
}

@media (max-width: 320px) {
  .logo-box__text { font-size: 24px; letter-spacing: 2px; }
  .logo-box__ecg { width: 40px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
