/* ========================================
   第一夜 - 溫柔傳遞思念
   深藍 + 金色手機版自適應風格
   ======================================== */

/* ---- 基础重置 ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    color: #F2F5F9;
    background: #0B1220;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- 动画 ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpToast {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideDownToast {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

@keyframes progressIndeterminate {
    0%   { transform: translateX(-100%); width: 40%; }
    50%  { width: 60%; }
    100% { transform: translateX(260%); width: 40%; }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out both;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out both;
}

.animate-progress-indeterminate {
    animation: progressIndeterminate 1.5s ease-in-out infinite;
    position: relative;
}

/* ---- 表单输入框 ---- */
.memorial-input {
    background: #FAFBFC;
    border: 1.5px solid #E8EDF3;
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    outline: none;
}

.memorial-input::placeholder {
    color: #9EB0CB;
}

.memorial-input:focus {
    background: #FFFFFF;
    border-color: #D99A45;
    box-shadow: 0 0 0 3px rgba(217, 154, 69, 0.12);
}

/* ---- 照片上傳區域 ---- */
.photo-upload-zone {
    background: #FAFBFC;
    border: 2px dashed #D8DFE9;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.photo-upload-zone:hover {
    background: #FDF9F3;
    border-color: #D99A45;
}

.photo-upload-zone.drag-over {
    background: #FBF3E6;
    border-color: #D99A45;
    box-shadow: 0 0 0 4px rgba(217, 154, 69, 0.1);
    transform: scale(1.01);
}

/* ---- 方案選項 ---- */
.plan-option {
    transition: all 0.2s ease;
}

.plan-option:hover {
    border-color: #D99A45;
}

/* ---- 方案卡片 ---- */
.plan-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* ---- Toast 通知 ---- */
.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 380px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    animation: slideUpToast 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) both;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.toast-hide {
    animation: slideDownToast 0.25s ease-in both;
}

.toast-success {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.toast-error {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #FCA5A5;
    color: #991B1B;
}

.toast-info {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #93C5FD;
    color: #1E40AF;
}

.toast-warning {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #FDE68A;
    color: #92400E;
}

/* ---- 按钮通用 ---- */
.btn-primary {
    background: linear-gradient(135deg, #D99A45, #C58A3E);
    color: #FFFFFF;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(217, 154, 69, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(217, 154, 69, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(217, 154, 69, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- 進度條 ---- */
.progress-bar {
    height: 8px;
    background: #E8EDF3;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #D99A45, #C58A3E);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    animation: pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ---- 玻璃卡片（兼容旧页面） ---- */
.glass-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ---- 狀態標籤 ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-pending,
.status-pending-payment {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.badge-paid,
.status-paid {
    background: #EFF6FF;
    color: #3B82F6;
    border: 1px solid #BFDBFE;
}

.badge-processing,
.status-processing {
    background: #FFF7ED;
    color: #F59E0B;
    border: 1px solid #FDE68A;
}

.status-processing::before {
    animation: pulse 1.5s ease-in-out infinite;
}

.badge-completed,
.status-completed {
    background: #ECFDF5;
    color: #10B981;
    border: 1px solid #A7F3D0;
}

.status-cancelled,
.status-refunded {
    background: #F3F4F6;
    color: #9CA3AF;
    border: 1px solid #E5E7EB;
}

/* ---- 滚动条美化 ---- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(217, 154, 69, 0.25) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(217, 154, 69, 0.25);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(217, 154, 69, 0.45);
}

/* ---- 文字行数限制 ---- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- 选中文字颜色 ---- */
::selection {
    background: rgba(217, 154, 69, 0.25);
    color: #F2F5F9;
}

/* ---- 全局 Loading 遮罩 ---- */
.global-loading {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(11, 18, 32, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* ---- 响应式容器 ---- */
@media (max-width: 640px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 641px) {
    body {
        background: linear-gradient(180deg, #0B1220 0%, #0F1829 100%);
    }
}

/* ---- 安全区域 ---- */
.safe-bottom {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}
