:root {
    --primary-gradient: linear-gradient(135deg, #FF69B4, #9370DB);    /* 原有粉紫渐变 */
    --deep-gradient: linear-gradient(135deg, #FF1493, #8A2BE2);       /* 深色粉紫渐变 */
    --envelope-color: #F5DEB3;                                        /* 浅粉红信封色 */
    --envelope-shadow: #FFB6C1;                                       /* 信封阴影色 */
    --background-color: #FFE4E1;                                      /* 淡粉色背景 */
    --text-color: #4A4A4A;                                           /* 深灰文本色 */
    --card-bg: rgba(255, 255, 255, 0.95);                           /* 半透明白色卡片背景 */
    --letter-color: #FFFFFF;                                         /* 纯白信纸颜色 */
    --highlight-gradient: var(--deep-gradient);                      /* 重点内容使用深色渐变 */
}

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

body {
    margin: 0;
    padding: 0;
    background: var(--primary-gradient);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Enhanced Envelope Styles */
#envelope-section {
    position: fixed;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background-color);
    z-index: 10;
    transition: transform 0.8s ease-in-out;
    perspective: 1000px;
}

.envelope-container {
    width: 300px;
    height: 200px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.envelope {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.envelope-flap {
    position: absolute;
    width: 100%;
    height: 50%;
    top: 0;
    transform-origin: top;
    transition: transform 0.6s ease;
    z-index: 3;
}

.envelope-flap-inner {
    width: 100%;
    height: 100%;
    background: var(--envelope-color);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.envelope-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--envelope-color);
    transform: translateZ(1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--envelope-shadow);
    transform: translateZ(-1px);
    border-radius: 4px;
}

.envelope.open {
    transform: rotateX(15deg);
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
}

.envelope-content {
    position: absolute;
    width: 90%;
    height: 90%;
    left: 5%;
    top: 5%;
    background: white;
    transform: translateY(0) translateZ(0);
    transition: all 0.6s ease;
    z-index: 2;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.envelope.open .envelope-content {
    transform: translateY(-120%) translateZ(20px);
}

.letter {
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.envelope.open .letter {
    opacity: 1;
}

.letter-title {
    font-size: 1.8rem;
    background: var(--deep-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s ease;
}

.letter-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-item {
    font-size: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.content-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

/* Enhanced Summary Section */
#summary-section {
    position: relative;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    padding: 20px;
    display: none;
}

#summary-section.active {
    opacity: 1;
    display: block;
}

.summary-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

.summary-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: var(--deep-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(-20px);
    animation: titleFadeIn 1s ease-out forwards;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.8rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.stat-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
}

.stat-number {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.stat-detail {
    font-size: 1.1rem;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    width: 100%;
}

.action-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 80%;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn.accept {
    background: var(--deep-gradient);
    box-shadow: 0 4px 15px rgba(147, 112, 219, 0.3);
}

.action-btn.decline {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn.accept:hover {
    box-shadow: 0 6px 20px rgba(147, 112, 219, 0.4);
}

.action-btn.decline:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.date-input {
    padding: 8px 12px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--card-bg);
    font-size: 1rem;
    color: var(--text-color);
    width: 100%;
    max-width: 200px;
    transition: all 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: #FF69B4;
    box-shadow: 0 0 8px rgba(255, 105, 180, 0.3);
}

.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(300deg);
}

.date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Animations */
@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Optimization */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .envelope-container {
        width: 280px;
        height: 180px;
    }
    
    .letter-title {
        font-size: 1.5rem;
    }
    
    .content-item {
        font-size: 1rem;
    }
    
    .summary-title {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

.hidden {
    display: none;
}