/* 前台 - 行動裝置 / App 內嵌優先 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft JhengHei", sans-serif; background: #fff; color: #333; overflow-x: hidden; }
body.app-body { padding-bottom: env(safe-area-inset-bottom, 0); }

/* 頂部列 */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1rem; padding-top: max(0.5rem, env(safe-area-inset-top)); min-height: 44px; background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 10; }
.app-header-login { font-size: 0.95rem; color: #e91e8c; text-decoration: none; }
.app-header-login:active { opacity: 0.8; }
.app-header-back { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: #e91e8c; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.app-header-back:active { opacity: 0.8; }
.app-header-back .icon-back { display: block; width: 24px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e91e8c' stroke-width='2.5'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E") center/contain no-repeat; }
.app-header-title { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; font-size: 1.1rem; font-weight: 700; color: #000; }
.app-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.app-header-icon { width: 36px; height: 36px; padding: 0; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #333; }
.app-header-icon .icon-qr, .app-header-icon .icon-person, .app-header-icon .icon-heart-outline { width: 22px; height: 22px; }

/* 圖示（簡易 CSS 繪製） */
.icon-qr { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='4' height='4'/%3E%3Crect x='10' y='14' width='4' height='4'/%3E%3Crect x='17' y='14' width='4' height='4'/%3E%3C/svg%3E") center/contain no-repeat; display: inline-block; }
.icon-person { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='3'/%3E%3Cpath d='M5 20v-2a5 5 0 0110 0v2'/%3E%3C/svg%3E") center/contain no-repeat; display: inline-block; }
.icon-heart-outline { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 00-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 00-7.8 7.8l1 1 8.8 8.8 8.8-8.8 1-1a5.5 5.5 0 000-7.8z'/%3E%3C/svg%3E") center/contain no-repeat; display: inline-block; }
.icon-heart-outline.filled { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e91e8c' stroke='%23e91e8c' stroke-width='2'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 00-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 00-7.8 7.8l1 1 8.8 8.8 8.8-8.8 1-1a5.5 5.5 0 000-7.8z'/%3E%3C/svg%3E") center/contain no-repeat; }
.icon-arrow { display: inline-block; width: 14px; height: 14px; margin-left: 2px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355aaff' stroke-width='2'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") center/contain no-repeat; vertical-align: middle; }

/* 橫向分類篩選 */
.filter-bar { background: #fff; border-bottom: 1px solid #eee; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.filter-bar-inner { display: flex; gap: 0.5rem; padding: 0.6rem 1rem; min-width: min-content; }
.filter-chip { flex-shrink: 0; padding: 0.4rem 0.9rem; border-radius: 20px; border: 1px solid #ddd; background: #fff; color: #333; text-decoration: none; font-size: 0.9rem; }
.filter-chip:active { opacity: 0.9; }
.filter-chip.active { background: #e91e8c; border-color: #e91e8c; color: #fff; }

/* 主內容 */
.app-main { padding: 0 1rem 1rem; padding-bottom: calc(60px + env(safe-area-inset-bottom) + 1rem); max-width: 600px; margin: 0 auto; }
.app-main-spacer { height: 0.5rem; }

/* 首頁區塊：標題 + 查看更多 */
.home-section { margin-bottom: 1.25rem; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.home-section-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #000; }
.home-section-more { font-size: 0.9rem; color: #55aaff; text-decoration: none; display: flex; align-items: center; }
.home-section-more:active { opacity: 0.8; }

/* 兩欄婚紗格線（首頁區塊用） */
.dress-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.dress-card { display: block; position: relative; border-radius: 8px; overflow: hidden; background: #f5f5f5; text-decoration: none; color: inherit; aspect-ratio: 3/4; transition: transform 0.12s ease-out; }
.dress-card:active { opacity: 0.95; transform: scale(0.97); }
.dress-card-fav { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dress-card-fav .icon-heart-outline { width: 22px; height: 22px; transition: transform 0.2s ease; }
.dress-card-fav:active .icon-heart-outline { transform: scale(1.15); }
.dress-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dress-card-img--empty { display: flex; align-items: center; justify-content: center; color: #999; font-size: 0.85rem; }

/* 愛心飛入動畫 */
.fav-fly-heart { position: fixed; z-index: 9999; width: 36px; height: 36px; margin-left: -18px; margin-top: -18px; pointer-events: none; animation: fav-fly 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fav-fly-heart::before { content: ''; display: block; width: 100%; height: 100%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e91e8c'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 00-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 00-7.8 7.8l1 1 8.8 8.8 8.8-8.8 1-1a5.5 5.5 0 000-7.8z'/%3E%3C/svg%3E") center/contain no-repeat; }
@keyframes fav-fly {
  0% { left: var(--fav-x0); top: var(--fav-y0); transform: scale(1.6); opacity: 1; }
  100% { left: var(--fav-x1); top: var(--fav-y1); transform: scale(0.5); opacity: 0.85; }
}

/* 底部導覽 */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #eee; display: flex; justify-content: space-around; align-items: center; padding: 0.4rem 0; padding-bottom: max(0.4rem, env(safe-area-inset-bottom)); z-index: 20; }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.35rem 0.5rem; text-decoration: none; color: #888; font-size: 0.7rem; min-width: 0; flex: 1; }
.bottom-nav-item:active { color: #333; }
.bottom-nav-item.active { color: #e91e8c; }
.bottom-nav-icon { width: 24px; height: 24px; margin-bottom: 2px; }
.bottom-nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.icon-home { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3Cpath d='M9 22V12h6v10'/%3E%3C/svg%3E") center/contain no-repeat; display: block; }
.icon-calendar { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat; display: block; }
.icon-dress { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2C10 2 8 3 7 5L2 10v2h2l2 10h8l2-10h2v-2l-5-5c-1-2-2-3-4-3zm0 2c1 0 2 1 3 2l3 3h-2l-2 8H8L6 9H4l3-3c1-1 1.5-2 3-2z'/%3E%3C/svg%3E") center/contain no-repeat; display: block; }
.icon-list { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E") center/contain no-repeat; display: block; }
.bottom-nav-item.active .icon-dress { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e91e8c'%3E%3Cpath d='M12 2C10 2 8 3 7 5L2 10v2h2l2 10h8l2-10h2v-2l-5-5c-1-2-2-3-4-3zm0 2c1 0 2 1 3 2l3 3h-2l-2 8H8L6 9H4l3-3c1-1 1.5-2 3-2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.bottom-nav--dark { background: #000; border-top-color: #222; }
.bottom-nav--dark .bottom-nav-item { color: #888; }
.bottom-nav--dark .bottom-nav-item.active { color: #e91e8c; }
.bottom-nav--dark .bottom-nav-item.active .icon-dress { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e91e8c'%3E%3Cpath d='M12 2C10 2 8 3 7 5L2 10v2h2l2 10h8l2-10h2v-2l-5-5c-1-2-2-3-4-3zm0 2c1 0 2 1 3 2l3 3h-2l-2 8H8L6 9H4l3-3c1-1 1.5-2 3-2z'/%3E%3C/svg%3E") center/contain no-repeat; }

.empty-msg { text-align: center; padding: 2rem 1rem; color: #888; }
.empty-msg.small { padding: 1rem; font-size: 0.9rem; }

/* 表單與按鈕（我的/登入/註冊） */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-weight: 500; font-size: 0.9rem; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"] { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem; }
.btn { display: inline-block; padding: 0.6rem 1rem; border: none; border-radius: 8px; font-size: 0.95rem; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: #e91e8c; color: #fff; }
.btn-primary:hover, .btn-primary:active { opacity: 0.9; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-block { display: block; width: 100%; margin-bottom: 0.5rem; }
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-success { background: #d4edda; color: #155724; }

/* 我的頁 */
.profile-main { padding-bottom: calc(60px + env(safe-area-inset-bottom) + 1rem); }
.profile-section { background: #fff; margin-bottom: 1rem; padding: 1rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.profile-section-title { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; color: #333; }
.profile-guest-hint { color: #666; font-size: 0.9rem; margin-bottom: 1rem; }
.profile-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-head { text-align: center; padding: 1.5rem 1rem; }
.profile-avatar-wrap { margin-bottom: 0.5rem; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: inline-block; }
.profile-avatar-placeholder { background: #e91e8c; color: #fff; font-size: 1.5rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.profile-name { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.25rem; }
.profile-type-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.8rem; background: #f0f0f0; color: #555; }
.profile-menu { list-style: none; margin: 0; padding: 0; }
.profile-menu-item { display: block; padding: 0.75rem 0; border-bottom: 1px solid #eee; color: #333; text-decoration: none; font-size: 0.95rem; }
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:active { background: #f8f9fa; }

/* 簽約用戶：婚期與服務人員 */
.profile-info-list { margin: 0; padding: 0; border-radius: 10px; overflow: hidden; background: #f8f9fa; border: 1px solid #eee; }
.profile-info-list .info-row { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1rem; border-bottom: 1px solid #eee; gap: 0.75rem; min-height: 48px; }
.profile-info-list .info-row:last-child { border-bottom: none; }
.profile-info-list .info-label { font-size: 0.9rem; color: #666; font-weight: 500; }
.profile-info-list .info-value { font-size: 1rem; color: #1a1a2e; font-weight: 600; text-align: right; }
.profile-contracted-empty { margin: 0; font-size: 0.9rem; color: #888; padding: 0.5rem 0; }

/* 合約與方案：點擊展開 */
.profile-package-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0.75rem 0; background: none; border: none; border-bottom: 1px solid #eee; font-size: 1rem; font-weight: 600; color: #333; cursor: pointer; text-align: left; }
.profile-package-trigger:active { opacity: 0.85; }
.profile-package-trigger-hint { font-size: 0.85rem; font-weight: 400; color: #888; }
.profile-package-detail { margin-top: 0.75rem; }
.profile-package-card { background: linear-gradient(135deg, #f8f4f8 0%, #fff 100%); border: 1px solid #eee; border-radius: 10px; padding: 1rem 1.25rem; }
.profile-package-name { font-size: 1rem; font-weight: 600; color: #333; margin-bottom: 0.35rem; }
.profile-package-price { font-size: 1.25rem; font-weight: 700; color: #e91e8c; margin-bottom: 0.5rem; }
.profile-package-intro { font-size: 0.9rem; color: #555; line-height: 1.6; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #eee; }

/* 我的試穿圖：生成圖片瀏覽 + 對應禮服標註 */
.profile-tryon-gallery { }
.profile-tryon-hint { font-size: 0.9rem; color: #666; margin: 0 0 1rem; line-height: 1.5; }
.profile-tryon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.profile-tryon-card { background: #f8f9fa; border-radius: 10px; overflow: hidden; border: 1px solid #eee; }
.profile-tryon-card-link { display: block; aspect-ratio: 3/4; overflow: hidden; }
.profile-tryon-card-img { width: 100%; height: 100%; object-fit: cover; display: block; vertical-align: top; }
.profile-tryon-card-info { padding: 0.6rem 0.75rem; }
.profile-tryon-card-label { font-size: 0.75rem; color: #888; display: block; margin-bottom: 0.25rem; }
.profile-tryon-card-dress { font-size: 0.9rem; font-weight: 600; color: #e91e8c; text-decoration: none; }
.profile-tryon-card-dress:active { opacity: 0.85; }
.profile-tryon-card-dress-text { font-size: 0.9rem; color: #333; }
.profile-tryon-card-original { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.35rem; font-size: 0.8rem; color: #666; text-decoration: none; }
.profile-tryon-card-original:active { color: #e91e8c; }
.profile-tryon-card-original-img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; }
.profile-tryon-card-date { padding: 0 0.75rem 0.6rem; font-size: 0.75rem; color: #999; }

/* 試穿圖 Lightbox 檢視大圖 */
.profile-lightbox { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 2rem; box-sizing: border-box; }
.profile-lightbox[hidden] { display: none !important; }
.profile-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); cursor: pointer; }
.profile-lightbox-content { position: relative; z-index: 1; max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; }
.profile-lightbox-img { max-width: 100%; max-height: calc(100vh - 4rem); width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.profile-lightbox-close { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2; width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(255,255,255,0.2); color: #fff; font-size: 1.75rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; -webkit-tap-highlight-color: transparent; }
.profile-lightbox-close:hover { background: rgba(255,255,255,0.3); }
.profile-lightbox-close:active { background: rgba(255,255,255,0.4); }

/* 登入/註冊頁 */
.auth-main { padding: 1rem; padding-bottom: calc(60px + env(safe-area-inset-bottom) + 1rem); }
.auth-card { max-width: 400px; margin: 0 auto; background: #fff; padding: 1.5rem; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.auth-title { margin: 0 0 1rem; font-size: 1.2rem; font-weight: 600; text-align: center; }
.auth-link { text-align: center; margin-top: 1rem; font-size: 0.9rem; }
.auth-link a { color: #e91e8c; text-decoration: none; }
.auth-link a:active { opacity: 0.8; }
.auth-social { margin-bottom: 0.75rem; }
.auth-divider { text-align: center; margin: 0.75rem 0; color: #999; font-size: 0.9rem; }
.btn-google {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: #fff; color: #333; border: 1px solid #dadce0;
    font-size: 0.95rem;
}
.btn-google:hover, .btn-google:active { background: #f8f9fa; border-color: #dadce0; }
.btn-google-icon {
    width: 20px; height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%234285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="%2334A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="%23FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"/><path fill="%23EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/></svg>') center/contain no-repeat;
}

/* ----- 以下為分類頁、詳情頁共用 ----- */
.section-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.75rem; color: #333; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.cat-card { display: block; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-decoration: none; color: inherit; }
.cat-card:active { opacity: 0.95; }
.cat-card-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cat-card-body { padding: 0.65rem; text-align: center; font-weight: 500; font-size: 0.95rem; }
.cat-card-count { font-size: 0.8rem; color: #888; font-weight: 400; }

.dress-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.dress-card-with-body { position: relative; display: block; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-decoration: none; color: inherit; transition: transform 0.12s ease-out; }
.dress-card-with-body:active { opacity: 0.95; transform: scale(0.97); }
.dress-card-with-body .dress-card-fav { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dress-card-with-body .dress-card-fav .icon-heart-outline { width: 22px; height: 22px; transition: transform 0.2s ease; }
.dress-card-with-body .dress-card-fav:active .icon-heart-outline { transform: scale(1.15); }
.dress-card-with-body .dress-card-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; transition: transform 0.2s ease; }
.dress-card-with-body:active .dress-card-img { transform: scale(1.02); }
.dress-card-with-body .dress-card-body { padding: 0.65rem; }
.dress-card-title { font-weight: 600; font-size: 0.95rem; margin: 0 0 0.25rem; }
.dress-card-meta { font-size: 0.8rem; color: #888; }

.dress-detail { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 1rem; }
.dress-detail-mainimg { width: 100%; display: block; }
.dress-detail-body { padding: 1rem; }
.dress-detail-title { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.5rem; }
.dress-detail-desc { font-size: 0.95rem; line-height: 1.6; color: #555; margin: 0.75rem 0; white-space: pre-wrap; }
.dress-detail-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; }
.dress-detail-tags span { background: #eee; color: #555; padding: 0.25rem 0.6rem; border-radius: 20px; font-size: 0.85rem; }
.dress-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 1rem; }
.dress-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.back-link { display: inline-block; margin-bottom: 1rem; color: #1a1a2e; text-decoration: none; font-size: 0.9rem; }
.back-link:hover { text-decoration: underline; }

/* ========== 婚紗詳情標準範本（白底、統一頁首頁腳） ========== */
body.dress-page { background: #fff; color: #333; padding-bottom: 0; }
.dress-page .dress-page-spacer { height: calc(60px + env(safe-area-inset-bottom) + 1rem); }

.dress-header { position: fixed; top: 0; left: 0; right: 0; z-index: 30; padding: max(env(safe-area-inset-top), 0.5rem) 0.75rem; min-height: 44px; display: flex; align-items: center; background: #fff; border-bottom: 1px solid #eee; }
.dress-back { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: #e91e8c; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.dress-back:active { opacity: 0.8; }
.icon-back { display: block; width: 24px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e91e8c' stroke-width='2.5'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E") center/contain no-repeat; }

.dress-carousel-wrap { position: relative; width: 100%; padding-top: 44px; background: #fafafa; }
.dress-carousel { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.dress-carousel::-webkit-scrollbar { display: none; }
.dress-carousel-slide { flex: 0 0 100%; width: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.dress-carousel-slide img { width: 100%; display: block; vertical-align: top; object-fit: cover; min-height: 60vh; max-height: 85vh; }
.dress-carousel-placeholder { width: 100%; min-height: 60vh; max-height: 85vh; background: #eee; display: flex; align-items: center; justify-content: center; color: #999; font-size: 0.95rem; }

.dress-actions { position: absolute; top: 50%; right: 0.5rem; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 0.5rem; }
.dress-action-btn { display: flex; flex-direction: column; align-items: center; padding: 0.4rem 0.35rem; background: rgba(255,255,255,0.9); border: 1px solid #eee; border-radius: 8px; color: #333; font-size: 0.7rem; cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.dress-action-btn:active { background: #fff; }
/* 僅白紗禮服顯示試穿按鈕，非白紗用 CSS 隱藏 */
.dress-action-tryon--hidden { display: none !important; }
.dress-action-icon { width: 24px; height: 24px; margin-bottom: 2px; }
.dress-actions .dress-action-icon { width: 24px; height: 24px; display: block; }
.dress-actions .icon-heart-outline { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 00-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 00-7.8 7.8l1 1 8.8 8.8 8.8-8.8 1-1a5.5 5.5 0 000-7.8z'/%3E%3C/svg%3E") center/contain no-repeat; }
.dress-actions .icon-heart-outline.filled { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e91e8c' stroke='%23e91e8c' stroke-width='2'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 00-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 00-7.8 7.8l1 1 8.8 8.8 8.8-8.8 1-1a5.5 5.5 0 000-7.8z'/%3E%3C/svg%3E") center/contain no-repeat; }
.dress-actions .icon-share { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.6 13.5l6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E") center/contain no-repeat; }
.dress-actions .icon-sparkle { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z'/%3E%3Cpath d='M5 19l1.2 1.6 1.8-2.4-1.2-1.6zM19 19l-1.2 1.6-1.8-2.4 1.2-1.6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.dress-actions .icon-inquire { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3M12 17h.01'/%3E%3C/svg%3E") center/contain no-repeat; }

.dress-info-bar { background: #fff; padding: 0.6rem 1rem; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.25rem; }
.dress-info-code { font-size: 1rem; font-weight: 600; color: #333; }
.dress-info-id { font-size: 0.9rem; color: #888; }

.dress-dots { display: flex; justify-content: center; gap: 0.35rem; padding: 0.5rem; background: #fff; }
.dress-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,0.2); transition: transform 0.2s, background 0.2s; }
.dress-dot.active { background: #333; transform: scale(1.2); }

.dress-detail-section { background: #f8f9fa; color: #333; padding: 1rem; margin: 0; border-top: 1px solid #eee; }
.dress-detail-section .dress-detail-desc { font-size: 0.9rem; line-height: 1.6; margin: 0 0 0.75rem; color: #555; white-space: pre-wrap; }
.dress-detail-section .dress-detail-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; }
.dress-detail-section .dress-detail-tags span { background: #eee; color: #555; padding: 0.25rem 0.6rem; border-radius: 20px; font-size: 0.85rem; }

.dress-toast { position: fixed; bottom: calc(60px + env(safe-area-inset-bottom) + 1rem); left: 50%; transform: translateX(-50%) translateY(10px); background: rgba(0,0,0,0.75); color: #fff; padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.9rem; z-index: 9999; opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.dress-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 試穿模態：角色設定 */
.tryon-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000; display: none; align-items: flex-end; justify-content: center; padding: 0; }
.tryon-overlay.is-open { display: flex; }
.tryon-modal { background: #fff; width: 100%; max-width: 480px; height: 90vh; max-height: 90vh; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.tryon-header { display: flex; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid #eee; min-height: 48px; }
.tryon-back { background: none; border: none; color: #e91e8c; font-size: 0.95rem; cursor: pointer; padding: 0.35rem 0; -webkit-tap-highlight-color: transparent; }
.tryon-title { margin: 0 auto; font-size: 1.1rem; font-weight: 700; color: #333; }
.tryon-body { padding: 1rem; overflow-y: auto; flex: 1; min-height: 0; }
.tryon-notice { background: #f8f4f8; border-radius: 10px; padding: 1rem; margin-bottom: 1.25rem; font-size: 0.9rem; color: #555; line-height: 1.6; }
.tryon-notice p { margin: 0 0 0.5rem; }
.tryon-notice p:last-child { margin-bottom: 0; }
.tryon-notice strong { color: #333; }
.tryon-notice-action a { color: #e91e8c; text-decoration: none; }
.tryon-notice-action a:active { opacity: 0.85; }
.tryon-group { margin-bottom: 1.25rem; }
.tryon-group-label { display: block; font-size: 0.95rem; font-weight: 600; color: #333; margin-bottom: 0.5rem; }
.tryon-options { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tryon-option { margin: 0; cursor: pointer; }
.tryon-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.tryon-option-circle { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; border: 2px solid #ddd; background: #fafafa; font-size: 0.8rem; color: #333; text-align: center; padding: 0.25rem; transition: border-color 0.2s, background 0.2s; }
.tryon-option input:checked + .tryon-option-circle { border-color: #e91e8c; background: #fff5f9; color: #c41a6e; }
.tryon-option:active .tryon-option-circle { background: #f0f0f0; }
.tryon-option input:checked + .tryon-option-circle { background: #fff5f9; }
.tryon-options-gender .tryon-option-circle { width: 72px; height: 72px; font-size: 0.9rem; }
.tryon-gender-female { background: #fff5f9; }
.tryon-gender-male { background: #e8f4fc; }
.tryon-option-locked { cursor: default; pointer-events: none; }
.tryon-option-circle.tryon-locked { background: #eee; color: #999; border-style: dashed; font-size: 0.75rem; }
.tryon-footer { display: flex; gap: 0.75rem; padding: 1rem; border-top: 1px solid #eee; background: #fff; flex-shrink: 0; }
.tryon-btn { flex: 1; padding: 0.75rem 1rem; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; border: 1px solid #ddd; background: #fff; color: #666; }
.tryon-btn-next { background: #e91e8c; border-color: #e91e8c; color: #fff; }
.tryon-btn-next:disabled { background: #ddd; border-color: #ddd; color: #999; cursor: not-allowed; }
.tryon-btn:active:not(:disabled) { opacity: 0.9; }

.tryon-step-hidden { display: none !important; }
.tryon-file-hidden { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.tryon-photo-hint { font-size: 0.9rem; color: #555; margin: 0 0 1rem; line-height: 1.5; }
.tryon-photo-actions { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tryon-photo-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.75rem 1.25rem; border-radius: 10px; border: 2px solid #e91e8c; background: #fff; color: #e91e8c; font-size: 1rem; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tryon-photo-btn:active { background: #fff5f9; }
.tryon-photo-btn-icon { font-size: 1.2rem; }
.tryon-photo-preview-wrap { text-align: center; margin-top: 1rem; }
.tryon-photo-preview { max-width: 100%; max-height: 200px; width: auto; height: auto; border-radius: 10px; border: 1px solid #eee; display: block; margin: 0 auto 0.5rem; }
.tryon-photo-remove { background: none; border: none; color: #888; font-size: 0.9rem; cursor: pointer; padding: 0.35rem 0; -webkit-tap-highlight-color: transparent; }
.tryon-photo-remove:active { color: #666; }

.tryon-dress-thumb-wrap { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; padding: 0.5rem; background: #f8f8f8; border-radius: 10px; }
.tryon-dress-thumb-label { font-size: 0.85rem; color: #666; flex-shrink: 0; }
.tryon-dress-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }

.tryon-prompt-preview-wrap { margin-top: 1rem; padding: 0.6rem; background: #f5f5f5; border-radius: 8px; border: 1px solid #eee; }
.tryon-prompt-preview-label { font-size: 0.8rem; color: #666; display: block; margin-bottom: 0.35rem; }
.tryon-prompt-preview { font-size: 0.75rem; line-height: 1.4; color: #333; margin: 0; white-space: pre-wrap; word-break: break-all; font-family: inherit; }

.tryon-prompt-toggle { margin-top: 0.75rem; padding: 0.4rem 0; background: none; border: none; font-size: 0.9rem; color: #e91e8c; cursor: pointer; -webkit-tap-highlight-color: transparent; text-decoration: underline; }
.tryon-prompt-toggle:hover { color: #c41a6e; }
.tryon-prompt-sent-wrap { margin-top: 0.5rem; padding: 0.6rem; background: #f0f8ff; border-radius: 8px; border: 1px solid #ddd; text-align: left; }
.tryon-prompt-sent-label { font-size: 0.8rem; color: #555; display: block; margin-bottom: 0.35rem; }
.tryon-prompt-sent { font-size: 0.75rem; line-height: 1.4; color: #333; margin: 0; white-space: pre-wrap; word-break: break-all; font-family: inherit; }

.tryon-loading { text-align: center; padding: 2rem 1rem; }
.tryon-loading-spinner { width: 48px; height: 48px; margin: 0 auto 1rem; border: 3px solid #eee; border-top-color: #e91e8c; border-radius: 50%; animation: tryon-spin 0.8s linear infinite; }
@keyframes tryon-spin { to { transform: rotate(360deg); } }
.tryon-loading-text { margin: 0; color: #666; font-size: 0.95rem; }
.tryon-result { text-align: center; padding: 1rem 0; }
.tryon-result-title { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 600; color: #333; }
.tryon-result-image { max-width: 100%; max-height: 50vh; width: auto; height: auto; border-radius: 10px; border: 1px solid #eee; display: block; margin: 0 auto 1rem; }
.tryon-result-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.tryon-btn-primary { background: #e91e8c; border-color: #e91e8c; color: #fff; }
.tryon-btn-secondary { background: #fff; border-color: #ddd; color: #666; }
