/* 基础重置和变量 */
:root {
    --color-cream: #FFFEF7;
    --color-soft-blue: #E3F2FD;
    --color-soft-pink: #FFF0F5;
    --color-text-primary: #2C3E50;
    --color-text-secondary: #5A6C7D;
    --color-button-bg: #B8D4E8;
    --color-button-hover: #9BC4DB;
    --color-card-bg: rgba(255, 255, 255, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-soft-blue) 50%, var(--color-soft-pink) 100%);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* 微信浏览器适配 */
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

#app {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* 页面基础样式 */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-out;
}

.page.active {
    opacity: 1;
    pointer-events: all;
    z-index: 1;
}

.page-content {
    width: 100%;
    max-width: 600px;
    padding: 2rem 1.5rem;
    text-align: center;
}

/* 微信安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .page-content {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-delay {
    animation: fadeIn 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.6s ease-out 0.4s forwards;
    opacity: 0;
}

/* 标题样式 */
.title {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.main-text {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.hint-text {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    opacity: 0.7;
    margin-top: 1.5rem;
}

/* 按钮样式 */
.btn-primary {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-primary);
    background: var(--color-button-bg);
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(184, 212, 232, 0.4);
    margin: 0.5rem;
}

.btn-primary:hover {
    background: var(--color-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 212, 232, 0.6);
}

.btn-primary:active {
    transform: scale(0.95);
}

/* 次要按钮 */
.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(184, 212, 232, 0.5);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--color-button-bg);
}

/* 计时器样式 */
.timer-container {
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(227, 242, 253, 0.7));
    border-radius: 1rem;
    border: 1px solid rgba(184, 212, 232, 0.3);
    box-shadow: 0 4px 15px rgba(184, 212, 232, 0.2);
    max-width: 400px;
}

.timer-title {
    text-align: center;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.timer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.timer-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1;
    font-family: 'Arial', sans-serif;
}

.timer-label {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    margin-top: 0.3rem;
    font-weight: 500;
}

.timer-separator {
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    font-weight: 300;
    margin-bottom: 1.5rem;
}

.timer-milliseconds {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    opacity: 0.7;
}

.timer-milliseconds span {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* 唯美的返回按钮 - 固定在底部 */
.btn-back-beautiful {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 2rem;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    border: 1px solid rgba(184, 212, 232, 0.4);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(184, 212, 232, 0.3), 
                0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* iPhone X 等设备的安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .btn-back-beautiful {
        bottom: calc(2rem + env(safe-area-inset-bottom));
    }
}

.btn-back-beautiful::before {
    content: '←';
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-back-beautiful:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.95));
    box-shadow: 0 6px 24px rgba(184, 212, 232, 0.4), 
                0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(-50%) translateY(-2px);
}

.btn-back-beautiful:hover::before {
    transform: translateX(-3px);
}

.btn-back-beautiful:active {
    transform: translateX(-50%) scale(0.95);
}

/* 第三页：生日祝福页 */
.birthday-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
}

.blessing-content {
    text-align: left;
    padding: 1.5rem;
    background: var(--color-card-bg);
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.blessing-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.blessing-content p:last-child {
    margin-bottom: 0;
}

.signature {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-style: italic;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

/* 第四页：惊喜铺垫页 */
.hotpot-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 第五页和第七页：惊喜页面 */
.surprise-number {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    background: linear-gradient(135deg, var(--color-soft-blue), var(--color-soft-pink));
    border-radius: 2rem;
    margin-bottom: 1rem;
}

.restaurant-card {
    background: var(--color-card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.restaurant-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.restaurant-desc {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.final-wish {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-top: 1.5rem;
    line-height: 1.8;
    font-style: italic;
}

/* 第六页：过渡页 */
.transition-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: twinkle 1.5s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.transition-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.transition-text {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
}

.qr-code-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.qr-code-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-text {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--color-text-primary);
}

/* 照片墙样式 */
.photo-wall {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 2rem 0;
    padding: 0.5rem;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.wall-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 照片微微摆动动画 */
@keyframes gentleSwing1 {
    0%, 100% {
        transform: rotate(0deg) translateY(0);
    }
    25% {
        transform: rotate(1.5deg) translateY(-3px);
    }
    75% {
        transform: rotate(-1.5deg) translateY(3px);
    }
}

@keyframes gentleSwing2 {
    0%, 100% {
        transform: rotate(0deg) translateY(0);
    }
    25% {
        transform: rotate(-1.2deg) translateY(2px);
    }
    75% {
        transform: rotate(1.2deg) translateY(-2px);
    }
}

@keyframes gentleSwing3 {
    0%, 100% {
        transform: rotate(0deg) translateY(0);
    }
    33% {
        transform: rotate(1deg) translateY(-2px);
    }
    66% {
        transform: rotate(-1deg) translateY(2px);
    }
}

.photo-anim-1 {
    animation: gentleSwing1 4s ease-in-out infinite;
}

.photo-anim-2 {
    animation: gentleSwing2 4.5s ease-in-out infinite 0.5s;
}

.photo-anim-3 {
    animation: gentleSwing3 5s ease-in-out infinite 1s;
}

.photo-anim-4 {
    animation: gentleSwing1 4.2s ease-in-out infinite 0.3s;
}

.photo-anim-5 {
    animation: gentleSwing2 4.8s ease-in-out infinite 0.7s;
}

.photo-anim-6 {
    animation: gentleSwing3 5.2s ease-in-out infinite 1.2s;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .title {
        font-size: 1.5rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .birthday-title {
        font-size: 1.5rem;
    }
    
    .photo-wall {
        gap: 0.3rem;
    }
}

@media (min-width: 768px) {
    .page-content {
        padding: 3rem 2rem;
    }
    
    .title {
        font-size: 2.25rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .birthday-title {
        font-size: 2.5rem;
    }
}
