
/* 彻底锁死任何浏览器的边缘滑动切页与退出手势 */
html, body, .app-shell, .page, .wb-container {
  overscroll-behavior-x: none !important;
}

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-header-top: calc(12px + var(--safe-top));
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  color: #1c1c1e;
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

img, svg {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: auto;
}

[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* ========== 纯白背景 + 蓝光晕登录门禁 (层级: 500) ========== */
.auth-gate-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 500;
  display: none;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}
.auth-gate-mask.show {
  display: flex !important;
  pointer-events: auto !important;
  animation: authFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.auth-gate-card {
  width: 100%;
  max-width: 375px;
  min-height: 480px;
  background: transparent;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-glow-top {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(176,204,232,0.45) 0%, rgba(245,248,252,0) 70%);
  pointer-events: none;
}

.auth-glow-bottom {
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(136,171,218,0.3) 0%, rgba(221,232,244,0) 70%);
  pointer-events: none;
}

.auth-content-box {
  width: 280px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.auth-subtitle {
  font-size: 8px;
  color: rgba(136,171,218,0.7);
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.auth-title {
  font-size: 24px;
  font-weight: 300;
  color: #6a8aa8;
  letter-spacing: 6px;
  text-indent: 6px;
}

.auth-divider {
  width: 40px;
  height: 1px;
  background: rgba(136,171,218,0.3);
  margin: 12px auto 24px;
}

.auth-inputs-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.auth-inputs-wrap input {
  width: 100%;
  height: 44px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,1);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 13px;
  color: #6a8aa8;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: all 0.2s ease;
  -webkit-user-select: text;
  user-select: text;
}
.auth-inputs-wrap input::placeholder {
  color: rgba(106, 138, 168, 0.5);
}
.auth-inputs-wrap input:focus {
  background: rgba(255,255,255,0.9);
  border-color: rgba(176,204,232,0.8);
  box-shadow: 0 0 10px rgba(136,171,218,0.15);
}

.auth-submit-btn {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #b0cce8, #88abda);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  letter-spacing: 4px;
  text-indent: 4px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(136,171,218,0.25);
  transition: all 0.2s ease;
}
.auth-submit-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}
.auth-submit-btn:disabled {
  opacity: 0.6;
  transform: none;
}

.auth-switch-text {
  margin-top: 18px;
  font-size: 13px;
  color: rgba(106, 138, 168, 0.75);
  letter-spacing: 0.5px;
  line-height: 1.5;
}
.auth-switch-text span {
  color: #6a8aa8;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-switch-text span:active {
  opacity: 0.5;
}

.auth-hidden {
  display: none !important;
  pointer-events: none !important;
}

/* ========== 全屏壁纸层 (层级: 0) ========== */
.home-bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
}

/* ========== 主容器 (层级: 1) ========== */
.app-shell { 
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 430px; 
  height: 100%;
  display: flex; 
  flex-direction: column; 
  overflow: hidden;
  background: transparent;
  z-index: 1;
}

.page-container { 
  flex: 1; 
  width: 100%;
  height: 100%;
  overflow: hidden; 
  padding: 0; 
  display: flex; 
  flex-direction: column; 
  position: relative;
  z-index: 1;
}

/* 桌面 Page 视口层 */
.page { 
  display: none; 
  flex-direction: column; 
  width: 100%;
  height: 100%; 
  overflow: hidden; 
  padding: 0; 
  position: relative; 
  box-sizing: border-box;
}
.page.active { display: flex; }

/* ========== 桌面双屏左右平移滑轨 ========== */
.desktop-slider-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.desktop-slider {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.desktop-screen {
  width: 50%;
  height: 100%;
  overflow-y: auto;
  padding: calc(12px + var(--safe-top)) 16px var(--safe-bottom);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

/* 桌面指示圆点 */
.desktop-pagination {
  position: absolute;
  bottom: calc(100% + 2px) !important;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 2;
  pointer-events: auto;
  white-space: nowrap;
}
.desktop-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
  cursor: pointer;
}
.desktop-dot.active {
  width: 14px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.7);
}

/* 头像展示区布局 */
.couple-section {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 4px 0;
  flex-shrink: 0;
}

.couple-left {
  flex: 5;
  min-width: 0;
  padding-top: 20px; 
}

.couple-right {
  flex: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* 底部栏定位 */
.tab-bar {
  position: fixed;
  bottom: max(8px, calc(12px + var(--safe-bottom)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 380px;
  width: calc(100% - 32px);
}

.page-title { font-size:28px; font-weight:700; letter-spacing:-.5px; padding:8px 0; }

/* ======================================================== */
/* 1. 高定柔和冰蓝碎花框弹出提示 (层级: 900 最高通知层)      */
/* ======================================================== */
.toast-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 340px;
  height: 85px;
  max-width: calc(100vw - 32px);
  padding: 0 35px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  background-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 8px 18px rgba(136, 171, 218, 0.25));
  color: #334e68;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 2px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "SF Pro Text", "PingFang SC", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 340px 85px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 340 85' width='340' height='85'%3E%3Cdefs%3E%3Cpattern id='d' x='0' y='0' width='4.5' height='4.5' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='2' cy='2' r='0.7' fill='%2388abda' opacity='0.3'/%3E%3C/pattern%3E%3C/defs%3E%3Crect x='10' y='8' width='320' height='69' rx='5' ry='5' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.9' opacity='0.98'/%3E%3Crect x='14' y='12' width='312' height='61' rx='3.5' ry='3.5' fill='none' stroke='%2388abda' stroke-width='0.6' stroke-dasharray='3,3' opacity='0.7'/%3E%3Crect x='16' y='14' width='28' height='42' fill='url(%23d)'/%3E%3Crect x='282' y='32' width='40' height='36' fill='url(%23d)'/%3E%3Cg transform='translate(20,56) rotate(-90)'%3E%3Cline x1='0' y1='0' x2='38' y2='0' stroke='%236a8ca8' stroke-width='1' opacity='0.6'/%3E%3Cline x1='0' y1='2' x2='38' y2='2' stroke='%236a8ca8' stroke-width='1.6' opacity='0.6'/%3E%3Cline x1='0' y1='5' x2='38' y2='5' stroke='%236a8ca8' stroke-width='0.6' opacity='0.4'/%3E%3Cline x1='0' y1='7' x2='38' y2='7' stroke='%236a8ca8' stroke-width='1.2' opacity='0.6'/%3E%3Cline x1='0' y1='10' x2='38' y2='10' stroke='%236a8ca8' stroke-width='0.6' opacity='0.4'/%3E%3Ctext x='0' y='16' font-size='5' font-family='monospace' letter-spacing='1' fill='%236a8ca8' opacity='0.7'%3ENiveousmoon%3C/text%3E%3C/g%3E%3Cpath d='M22 8 Q80 2 140 8 Q180 14 220 8' fill='none' stroke='%2388abda' stroke-width='0.8' opacity='0.8'/%3E%3Cg transform='translate(24,7)'%3E%3Cpath d='M0 -5 C-3.5 -8 -8 -3.5 -5 0 C-8 3.5 -3.5 8 0 5 C3.5 8 8 3.5 5 0 C8 -3.5 3.5 -8 0 -5 Z' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='1.8' fill='%2388abda'/%3E%3Ccircle cx='0' cy='0' r='0.8' fill='%23ffffff'/%3E%3C/g%3E%3Cg transform='translate(36,12)'%3E%3Cpath d='M0 -4.5 C-3 -7 -7 -3 -4.5 0 C-7 3 -3 7 0 4.5 C3 7 7 3 4.5 0 C7 -3 3 -7 0 -4.5 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.4' fill='%23ffffff'/%3E%3C/g%3E%3Cg transform='translate(16,15)'%3E%3Ccircle cx='0' cy='0' r='3' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.2' fill='%2388abda'/%3E%3C/g%3E%3Ccircle cx='45' cy='6' r='2.2' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cpath d='M28 2 Q32 -2 36 3 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cpath d='M12 8 Q16 4 20 8 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cg transform='translate(70,7)'%3E%3Cpath d='M0 -4 C-2.5 -6.5 -6.5 -2.5 -4 0 C-6.5 2.5 -2.5 6.5 0 4 C2.5 6.5 6.5 2.5 4 0 C6.5 -2.5 2.5 -6.5 0 -4 Z' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.3' fill='%2388abda'/%3E%3C/g%3E%3Ccircle cx='82' cy='11' r='2.4' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cg transform='translate(105,8)'%3E%3Ccircle cx='0' cy='0' r='3.2' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.2' fill='%2388abda'/%3E%3C/g%3E%3Cpath d='M96 8 Q100 4 104 8 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.5'/%3E%3Cg transform='translate(135,7)'%3E%3Cpath d='M0 -4 C-2.5 -6 -6 -2.5 -4 0 C-6 2.5 -2.5 6 0 4 C2.5 6 6 2.5 4 0 C6 -2.5 2.5 -6 0 -4 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.2' fill='%23ffffff'/%3E%3C/g%3E%3Ccircle cx='147' cy='11' r='2' fill='%23ffffff' stroke='%2388abda' stroke-width='0.6'/%3E%3Cpath d='M190 77 Q240 82 280 77 Q310 72 328 77' fill='none' stroke='%2388abda' stroke-width='0.8' opacity='0.8'/%3E%3Cg transform='translate(210,77)'%3E%3Ccircle cx='0' cy='0' r='3' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.2' fill='%2388abda'/%3E%3C/g%3E%3Ccircle cx='222' cy='74' r='2' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cg transform='translate(250,78)'%3E%3Cpath d='M0 -4.5 C-3 -7 -7 -3 -4.5 0 C-7 3 -3 7 0 4.5 C3 7 7 3 4.5 0 C7 -3 3 -7 0 -4.5 Z' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.4' fill='%2388abda'/%3E%3C/g%3E%3Cpath d='M260 78 Q264 82 268 77 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.5'/%3E%3Cg transform='translate(295,76)'%3E%3Cpath d='M0 -5 C-3.5 -8 -8 -3.5 -5 0 C-8 3.5 -3.5 8 0 5 C3.5 8 8 3.5 5 0 C8 -3.5 3.5 -8 0 -5 Z' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='1.6' fill='%2388abda'/%3E%3Ccircle cx='0' cy='0' r='0.7' fill='%23ffffff'/%3E%3C/g%3E%3Cg transform='translate(308,71)'%3E%3Cpath d='M0 -4.5 C-3 -7 -7 -3 -4.5 0 C-7 3 -3 7 0 4.5 C3 7 7 3 4.5 0 C7 -3 3 -7 0 -4.5 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.3' fill='%23ffffff'/%3E%3C/g%3E%3Cg transform='translate(319,74)'%3E%3Ccircle cx='0' cy='0' r='3' fill='%23ffffff' stroke='%236a8ca8' stroke-width='0.7'/%3E%3Ccircle cx='0' cy='0' r='1.2' fill='%2388abda'/%3E%3C/g%3E%3Cg transform='translate(328,62)'%3E%3Ccircle cx='0' cy='0' r='2.6' fill='%23ffffff' stroke='%2388abda' stroke-width='0.6'/%3E%3Ccircle cx='0' cy='0' r='0.9' fill='%23eaf3fa'/%3E%3C/g%3E%3Ccircle cx='285' cy='79' r='2' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cpath d='M302 81 Q307 85 312 80 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cpath d='M165 14 Q170 10 173 15 Q168 18 165 14 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.5'/%3E%3Cpath d='M185 71 Q190 67 194 72 Q189 75 185 71 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.5'/%3E%3Cpath d='M320 20 Q320 23.5 323.5 23.5 Q320 23.5 320 27 Q320 23.5 316.5 23.5 Q320 23.5 320 20 Z' fill='%236a8ca8' opacity='0.6'/%3E%3Cpath d='M260 14 Q260 16.5 262.5 16.5 Q260 16.5 260 19 Q260 16.5 257.5 16.5 Q260 16.5 260 14 Z' fill='%2388abda' opacity='0.8'/%3E%3Cpath d='M170 73 Q170 75.5 172.5 75.5 Q170 75.5 170 78 Q170 75.5 167.5 75.5 Q170 75.5 170 73 Z' fill='%2388abda' opacity='0.8'/%3E%3C/svg%3E");
}

.toast-message.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ======================================================== */
/* 2. 高定柔和冰蓝照片操作卡片 (层级: 600)                  */
/* ======================================================== */
.photo-action-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 340px;
  height: 110px;
  max-width: calc(100vw - 32px);
  padding: 10px 24px;
  border-radius: 0 !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  background-color: transparent !important;
  box-shadow: none !important;
  filter: drop-shadow(0 10px 24px rgba(136, 171, 218, 0.28));
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 340 110' width='340' height='110'%3E%3Cdefs%3E%3Cpattern id='d2' x='0' y='0' width='4' height='4' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='1.5' cy='1.5' r='0.8' fill='%231a1c22' opacity='0.15'/%3E%3C/pattern%3E%3Cpattern id='bd2' x='0' y='0' width='4' height='4' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='1.5' cy='1.5' r='0.8' fill='%2388abda' opacity='0.35'/%3E%3C/pattern%3E%3C/defs%3E%3Crect x='10' y='8' width='320' height='94' fill='%23ffffff' stroke='%231a1c22' stroke-width='1.2'/%3E%3Crect x='13' y='11' width='314' height='88' fill='none' stroke='%2388abda' stroke-width='0.6' stroke-dasharray='3,2'/%3E%3Crect x='14' y='12' width='28' height='58' fill='url(%23d2)'/%3E%3Crect x='280' y='45' width='44' height='50' fill='url(%23bd2)'/%3E%3Cg transform='translate(18, 76) rotate(-90)'%3E%3Cline x1='0' y1='0' x2='50' y2='0' stroke='%231a1c22' stroke-width='1.2'/%3E%3Cline x1='0' y1='2' x2='50' y2='2' stroke='%231a1c22' stroke-width='2'/%3E%3Cline x1='0' y1='5' x2='50' y2='5' stroke='%231a1c22' stroke-width='0.8'/%3E%3Cline x1='0' y1='7' x2='50' y2='7' stroke='%231a1c22' stroke-width='1.5'/%3E%3Cline x1='0' y1='10' x2='50' y2='10' stroke='%231a1c22' stroke-width='0.8'/%3E%3Ctext x='0' y='16' font-size='5' font-family='monospace' letter-spacing='1' fill='%231a1c22'%3ENiveousmoon%3C/text%3E%3C/g%3E%3Cpath d='M20 8 Q80 2 140 8 Q180 14 220 8' fill='none' stroke='%2388abda' stroke-width='1'/%3E%3Cg transform='translate(24, 7)'%3E%3Cpath d='M0 -5 C-3.5 -8 -8 -3.5 -5 0 C-8 3.5 -3.5 8 0 5 C3.5 8 8 3.5 5 0 C8 -3.5 3.5 -8 0 -5 Z' fill='%23ffffff' stroke='%231a1c22' stroke-width='1'/%3E%3Ccircle cx='0' cy='0' r='1.8' fill='%2388abda'/%3E%3Ccircle cx='0' cy='0' r='0.8' fill='%23ffffff'/%3E%3C/g%3E%3Cg transform='translate(35, 12)'%3E%3Cpath d='M0 -4.5 C-3 -7 -7 -3 -4.5 0 C-7 3 -3 7 0 4.5 C3 7 7 3 4.5 0 C7 -3 3 -7 0 -4.5 Z' fill='%23e8f2fa' stroke='%2388abda' stroke-width='0.9'/%3E%3Ccircle cx='0' cy='0' r='1.5' fill='%23ffffff'/%3E%3C/g%3E%3Cg transform='translate(16, 14)'%3E%3Ccircle cx='0' cy='0' r='3.2' fill='%23ffffff' stroke='%231a1c22' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='1.3' fill='%2388abda'/%3E%3C/g%3E%3Ccircle cx='43' cy='6' r='2.2' fill='%23e8f2fa' stroke='%2388abda' stroke-width='0.7'/%3E%3Cpath d='M28 2 Q32 -2 36 3 Z' fill='%23e8f2fa' stroke='%2388abda' stroke-width='0.7'/%3E%3Cpath d='M12 8 Q16 4 20 8 Z' fill='%23e8f2fa' stroke='%2388abda' stroke-width='0.7'/%3E%3Cg transform='translate(70, 7)'%3E%3Cpath d='M0 -4 C-2.5 -6.5 -6.5 -2.5 -4 0 C-6.5 2.5 -2.5 6.5 0 4 C2.5 6.5 6.5 2.5 4 0 C6.5 -2.5 2.5 -6.5 0 -4 Z' fill='%23ffffff' stroke='%231a1c22' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='1.4' fill='%2388abda'/%3E%3C/g%3E%3Ccircle cx='82' cy='11' r='2.6' fill='%23e8f2fa' stroke='%2388abda' stroke-width='0.7'/%3E%3Cg transform='translate(105, 8)'%3E%3Ccircle cx='0' cy='0' r='3.5' fill='%23ffffff' stroke='%231a1c22' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='1.3' fill='%2388abda'/%3E%3C/g%3E%3Cpath d='M96 8 Q100 4 104 8 Z' fill='%23e8f2fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cg transform='translate(135, 7)'%3E%3Cpath d='M0 -4 C-2.5 -6 -6 -2.5 -4 0 C-6 2.5 -2.5 6 0 4 C2.5 6 6 2.5 4 0 C6 -2.5 2.5 -6 0 -4 Z' fill='%23eaf3fa' stroke='%2388abda' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='1.3' fill='%23ffffff'/%3E%3C/g%3E%3Ccircle cx='147' cy='11' r='2.2' fill='%23ffffff' stroke='%2388abda' stroke-width='0.7'/%3E%3Cpath d='M190 102 Q240 107 280 102 Q310 97 328 102' fill='none' stroke='%2388abda' stroke-width='1'/%3E%3Cg transform='translate(210, 102)'%3E%3Ccircle cx='0' cy='0' r='3.2' fill='%23ffffff' stroke='%231a1c22' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='1.3' fill='%2388abda'/%3E%3C/g%3E%3Ccircle cx='222' cy='99' r='2.2' fill='%23e8f2fa' stroke='%2388abda' stroke-width='0.7'/%3E%3Cg transform='translate(250, 103)'%3E%3Cpath d='M0 -4.5 C-3 -7 -7 -3 -4.5 0 C-7 3 -3 7 0 4.5 C3 7 7 3 4.5 0 C7 -3 3 -7 0 -4.5 Z' fill='%23ffffff' stroke='%231a1c22' stroke-width='0.8'/%3E%3Ccircle cx='0' cy='0' r='1.5' fill='%2388abda'/%3E%3C/g%3E%3Cpath d='M260 103 Q264 107 268 102 Z' fill='%23e8f2fa' stroke='%2388abda' stroke-width='0.6'/%3E%3Cg transform='translate(295, 101)'%3E%3Cpath d='M0 -5 C-3.5 -8 -8 -3.5 -5 0 C-8 3.5 -3.5 8 0 5 C3.5 8 8 3.5 5 0 C8 -3.5 3.5 -8 0 -5 Z' fill='%23ffffff' stroke='%231a1c22' stroke-width='1'/%3E%3Ccircle cx='0' cy='0' r='1.8' fill='%2388abda'/%3E%3Ccircle cx='0' cy='0' r='0.8' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E");
}

.photo-action-card.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.photo-action-card button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: #334e68;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 2px;
  border-bottom: 1px dashed rgba(136, 171, 218, 0.45);
  transition: all 0.15s ease;
}
.photo-action-card button:last-child {
  border-bottom: none;
  color: #c95353;
}
.photo-action-card button:active {
  background: rgba(136, 171, 218, 0.08);
  border-radius: 6px;
  opacity: 0.8;
}

.photo-action-mask {
  position: fixed;
  inset: 0;
  background: transparent !important;
  z-index: 580;
  display: none;
  pointer-events: none !important;
}
.photo-action-mask.show { 
  display: block !important;
  pointer-events: auto !important;
}

/* ======================================================== */
/* 3. 全局高定「双选确认弹窗」 (层级: 850 穿透门禁)          */
/* ======================================================== */
.app-dialog-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-dialog-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.app-dialog-card {
  width: 300px;
  max-width: calc(100vw - 48px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-dialog-mask.show .app-dialog-card {
  transform: scale(1);
}

.app-dialog-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #18191c;
  letter-spacing: 0.5px;
}

.app-dialog-desc {
  font-size: 12.5px;
  color: #5c6470;
  line-height: 1.55;
}

.app-dialog-btns {
  width: 100%;
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.app-dialog-btn {
  flex: 1;
  height: 38px;
  border-radius: 19px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.app-dialog-btn.cancel {
  background: #f1f3f5;
  color: #5c6470;
  border: 1px solid rgba(0,0,0,0.06);
}
.app-dialog-btn.cancel:active { background: #e2e6ea; }

.app-dialog-btn.confirm {
  background: #18191c;
  color: #ffffff;
  border: none;
  box-shadow: 0 3px 10px rgba(24, 25, 28, 0.2);
}
.app-dialog-btn.confirm:active { background: #000000; }

.app-dialog-btn.danger {
  background: #e03131;
  color: #ffffff;
  border: none;
  box-shadow: 0 3px 10px rgba(224, 49, 49, 0.25);
}
.app-dialog-btn.danger:active { background: #c92a2a; }

/* ========== 图片裁剪 (层级: 700) ========== */
.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0,0,0,0.9);
  display: none;
  pointer-events: none !important;
  flex-direction: column;
}
.crop-overlay.show {
  display: flex !important;
  pointer-events: auto !important;
}

.crop-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + var(--safe-top)) 16px 12px;
  flex-shrink: 0;
}
.crop-header span { font-size: 16px; font-weight: 600; color: #fff; }

.crop-cancel, .crop-confirm {
  padding: 8px 18px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.crop-cancel { background: rgba(255,255,255,0.15); color: #fff; }
.crop-confirm { background: #fff; color: #111; }
.crop-cancel:active, .crop-confirm:active { opacity: 0.7; }

.crop-toolbar {
  display: flex; justify-content: center; gap: 8px;
  padding: 0 16px 8px; flex-shrink: 0;
}
.crop-ratio-btn {
  padding: 5px 14px; border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 6px; background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.crop-ratio-btn.active {
  background: rgba(255,255,255,0.9); color: #111; border-color: rgba(255,255,255,0.9);
}
.crop-ratio-btn:active { opacity: 0.7; }

.crop-workspace {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow: hidden;
}
.crop-workspace canvas {
  max-width: 100%; max-height: 100%; touch-action: none;
}

/* ========== 独立 App 页面通用骨架 ========== */
.app-page {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  height: 100vh;
  background: #ffffff;
  z-index: 10 !important;
  display: none;
  flex-direction: column;
  padding: 0;
}
.app-page.active {
  display: flex;
  animation: slideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.app-header {
  padding: var(--app-header-top) 16px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #3c3c43;
  display: flex;
  align-items: center;
  padding: 4px;
  margin-left: -4px;
  flex-shrink: 0;
}
.icon-back-btn:active { opacity: 0.5; }
.icon-back-btn svg {
  width: 28px; height: 28px;
  stroke: currentColor; stroke-width: 2.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

.app-title {
  font-size: 25px;
  font-weight: 600;
  color: #1c1c1e;
  line-height: 1;
}

.app-content { 
  flex: 1; 
  overflow-y: auto; 
  padding: 0 16px calc(20px + var(--safe-bottom)); 
  -webkit-overflow-scrolling: touch; 
}

/* 世界书全屏专属沉浸内边距 */
.app-page[data-page="worldbook"] .app-content {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  padding-top: 0 !important;
}

.wb-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 10px;
  box-sizing: border-box;
  padding-top: calc(10px + var(--safe-top)) !important;
  padding-bottom: calc(12px + var(--safe-bottom)) !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}
