/* ============================================================
   AuraAI 网页端样式 - 与小程序保持一致（浅色主题）
   ============================================================ */
:root {
  --primary: #00ccff;
  --primary-dark: #0099cc;
  --bg: #ffffff;
  --card-bg: #f7f7f7;
  --text: #111111;
  --text-secondary: #888888;
  --text-light: #999999;
  --copyright: #cccccc;
  --success: #52c41a;
  --danger: #f5222d;
  --warning: #fa8c16;
  --radius: 12px;
  --pay-container-width: min(92vw, 420px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 60px;
}

/* ---- Header ---- */
.header {
  padding: 2vh 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.brand-logo {
  width: 70vw;
  max-width: 380px;
  filter: brightness(0);
}
.slogan-wrap {
  text-align: center;
  margin: 1.5vh 0 3vh;
}
.main-slogan {
  font-size: clamp(15px, 4.2vw, 20px);
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.4vw;
  line-height: 1.4;
}
.sub-slogan {
  font-size: clamp(11px, 3vw, 14px);
  color: var(--text-secondary);
  margin-top: 0.8vh;
  letter-spacing: 0.2vw;
}

/* ---- Pages ---- */
.page { display: none; padding: 12px 16px; }
.page.active { display: block; }

/* ---- Upload ---- */
.upload-area {
  border: 2px dashed #d0d0d0;
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafafa;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: rgba(0,204,255,0.04);
}
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-text { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.upload-hint { font-size: 12px; color: var(--text-secondary); }

.tool-select {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.tool-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid #e5e5e5;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: all .2s;
}
.tool-option input { display: none; }
.tool-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(0,204,255,0.08);
  color: var(--primary-dark);
}

.tips {
  margin-top: 20px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
}
.tips h3 { font-size: 13px; color: var(--warning); margin-bottom: 8px; }
.tips ul { list-style: none; }
.tips li {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}
.tips li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--primary);
}

.tool-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(0,204,255,0.08), rgba(0,204,255,0.02));
  border: 1px solid rgba(0,204,255,0.2);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all .15s;
}
.tool-entry:active { border-color: var(--primary); background: rgba(0,204,255,0.12); }
.tool-entry > span:first-child { font-size: 15px; font-weight: 700; }
.tool-entry-desc { font-size: 12px; color: var(--text-secondary); flex: 1; }
.tool-entry .arrow { font-size: 22px; color: var(--primary); }

/* ---- Crop ---- */
.crop-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: none;
}
#cropImg {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.crop-frame {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  aspect-ratio: 1;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  pointer-events: none;
  border-radius: 4px;
}
.crop-corner {
  position: absolute;
  width: 16px; height: 16px;
  border-color: rgba(255,255,255,0.95);
  border-style: solid;
}
.crop-corner.tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.crop-corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; }
.crop-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; }
.crop-corner.br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; }
.crop-hint {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.crop-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 36px;
  margin-bottom: 16px;
}

/* ---- Buttons ---- */
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost { background: var(--card-bg); color: var(--text); border: 1px solid #e5e5e5; }
.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 12px;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

/* ---- Loading ---- */
.page-loading { text-align: center; padding-top: 120px; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid #e5e5e5;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
.spinner.small { width: 24px; height: 24px; border-width: 3px; margin: 0 10px 0 0; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 16px; color: var(--text); }
.loading-hint { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

/* ---- Result ---- */
.page-result {
  padding-top: 0;
}
.compare-slider {
  margin-top: -12vh;
}

/* 对比预览窗 10:16 竖向长方形 */
.compare-slider {
  position: relative;
  width: 100%;
  max-width: min(62.5vh, 100%);
  aspect-ratio: 10 / 16;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid #eee;
  touch-action: none;
  user-select: none;
  background: #fff;
}
.compare-img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: auto;
  display: block;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
  user-select: none;
  will-change: left;
}
.compare-top-wrap {
  position: absolute;
  top: 0; left: 0;
  width: 50%; height: 100%;
  overflow: hidden;
  z-index: 2;
  transition: width 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.compare-top-wrap .compare-img {
  top: 0;
  left: 0;
  height: 100%;
  width: auto;
}
.compare-handle {
  position: absolute;
  top: 0; left: 50%;
  width: 2px; height: 100%;
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 10;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 4px rgba(0,204,255,0.8), 0 0 8px rgba(0,204,255,0.4);
  transition: left 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.compare-slider.dragging .compare-handle,
.compare-slider.dragging .compare-top-wrap,
.compare-slider.dragging .compare-img {
  transition: none !important;
}
/* 防下载透明遮罩层 */
.compare-protect {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: transparent;
}
.compare-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
  padding: 0 4px;
  max-width: min(62.5vh, 100%);
  margin-left: auto;
  margin-right: auto;
}

/* ---- Pay buttons ---- */
.pay-float {
  width: var(--pay-container-width);
  margin: 20px auto 0;
  display: flex;
  flex-direction: row;
  gap: 10px;
}
.pay-btn {
  flex: 1;
  aspect-ratio: 1;
  max-width: 120px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all .15s;
}
.pay-btn:active {
  border-color: var(--primary);
  background: rgba(0,204,255,0.08);
  transform: scale(0.96);
}
.pay-line1 { font-size: 13px; font-weight: 600; }
.pay-line2 { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.pay-line3 { font-size: 10px; color: var(--text-light); }
.pay-desc {
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 12px;
  line-height: 1.6;
}

/* ---- Modal ---- */
.modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.modal-mask.active { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.modal h3 { font-size: 17px; margin-bottom: 16px; color: var(--text); }

.pay-methods { display: flex; gap: 10px; margin-bottom: 16px; }
.pay-method {
  flex: 1;
  padding: 16px 8px;
  border-radius: var(--radius);
  border: 1px solid #e5e5e5;
  background: #fafafa;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  transition: all .15s;
}
.pay-method:active { border-color: var(--primary); background: rgba(0,204,255,0.06); }
.pm-icon { font-size: 28px; }

.qr-area img {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  margin: 0 auto 10px;
  display: block;
}
.qr-area p { font-size: 13px; color: var(--text-secondary); }

.pay-status { padding: 20px; color: var(--text-secondary); font-size: 14px; }

.download-hint { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
.download-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.download-links a {
  display: block;
  padding: 12px;
  background: rgba(0,204,255,0.08);
  border: 1px solid rgba(0,204,255,0.3);
  border-radius: var(--radius);
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.download-links a:active { background: rgba(0,204,255,0.15); }

.error-msg { font-size: 14px; color: var(--danger); margin-bottom: 12px; }
.error-tips {
  text-align: left;
  background: rgba(250,140,22,0.08);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}
.error-tips div { font-size: 12px; color: var(--text-secondary); padding: 3px 0; }

/* ---- Copyright ---- */
.copyright {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--copyright);
  padding: 12px;
  background: linear-gradient(transparent, rgba(255,255,255,0.9));
  pointer-events: none;
}

/* ---- PC端适配 ---- */
@media (min-width: 768px) {
  #app { padding-bottom: 50px; }
  .upload-area { padding: 80px 20px; }
}
