* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2d3436;
    --secondary: #636e72;
    --accent: #fd79a8;
    --bg-start: #f8f9fa;
    --bg-end: #e9ecef;
}

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, #ffeef8 0%, #fff5f9 50%, #ffe8f0 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

/* 星空背景 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: starsAppear 2s ease-out forwards;
}

@keyframes starsAppear {
    to {
        opacity: 1;
    }
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(253, 121, 168, 0.3);
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
    box-shadow: 
        100px 200px rgba(253, 121, 168, 0.2),
        300px 100px rgba(253, 121, 168, 0.3),
        500px 300px rgba(253, 121, 168, 0.2),
        700px 150px rgba(253, 121, 168, 0.3),
        200px 400px rgba(253, 121, 168, 0.2),
        600px 450px rgba(253, 121, 168, 0.3),
        800px 250px rgba(253, 121, 168, 0.2),
        400px 350px rgba(253, 121, 168, 0.3);
}

.stars::after {
    animation-delay: 1.5s;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

.container {
    position: relative;
    width: 100%;
    max-width: 480px;
    z-index: 10;
}

/* 卡片样式 */
.card {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px 32px;
    box-shadow: 0 8px 32px rgba(45, 52, 54, 0.08);
    text-align: center;
    position: relative;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent,
        var(--accent) 20%,
        var(--accent) 80%,
        transparent
    );
}

/* 卡片四角装饰 */
.corner-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.15;
}

.corner-decoration::before,
.corner-decoration::after {
    content: '';
    position: absolute;
    background: var(--accent);
}

.top-left {
    top: 16px;
    left: 16px;
}

.top-left::before {
    width: 2px;
    height: 20px;
    top: 0;
    left: 0;
}

.top-left::after {
    width: 20px;
    height: 2px;
    top: 0;
    left: 0;
}

.top-right {
    top: 16px;
    right: 16px;
}

.top-right::before {
    width: 2px;
    height: 20px;
    top: 0;
    right: 0;
}

.top-right::after {
    width: 20px;
    height: 2px;
    top: 0;
    right: 0;
}

.bottom-left {
    bottom: 16px;
    left: 16px;
}

.bottom-left::before {
    width: 2px;
    height: 20px;
    bottom: 0;
    left: 0;
}

.bottom-left::after {
    width: 20px;
    height: 2px;
    bottom: 0;
    left: 0;
}

.bottom-right {
    bottom: 16px;
    right: 16px;
}

.bottom-right::before {
    width: 2px;
    height: 20px;
    bottom: 0;
    right: 0;
}

.bottom-right::after {
    width: 20px;
    height: 2px;
    bottom: 0;
    right: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.date {
    display: inline-block;
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 16px;
    padding: 6px 16px;
    border: 1.5px solid var(--accent);
    border-radius: 20px;
    background: rgba(253, 121, 168, 0.05);
}

.title {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 0 auto 32px;
    border-radius: 2px;
}

.divider.small {
    width: 40px;
    margin: 16px auto 24px;
}

.wish-text {
    margin: 32px 0;
    line-height: 2;
}

.wish-text p {
    font-size: 16px;
    color: var(--secondary);
    margin: 12px 0;
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
    position: relative;
    padding-left: 24px;
}

.wish-text p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.6;
}

.wish-text p:nth-child(1) {
    animation-delay: 0.3s;
}

.wish-text p:nth-child(2) {
    animation-delay: 0.5s;
}

.wish-text p:nth-child(3) {
    animation-delay: 0.7s;
}

.wish-text p:nth-child(4) {
    animation-delay: 0.9s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 36px;
    font-size: 15px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(253, 121, 168, 0.25);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn svg {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover svg {
    transform: rotate(90deg);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 121, 168, 0.35);
}

.btn:active {
    transform: translateY(0);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background: #ffffff;
    margin: 10% auto;
    padding: 0;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(45, 52, 54, 0.15);
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(253, 121, 168, 0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-inner {
    padding: 48px 32px;
    position: relative;
}

/* 心形装饰 */
.heart-decoration {
    display: inline-block;
    margin-bottom: 16px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.1);
    }
    20% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.1);
    }
    40% {
        transform: scale(1);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--secondary);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close:hover {
    background: rgba(253, 121, 168, 0.1);
    color: var(--accent);
    transform: rotate(90deg);
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
}

.modal-content h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    animation: underlineGrow 0.6s ease-out 0.3s forwards;
}

@keyframes underlineGrow {
    to {
        width: 100%;
    }
}

.wish-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    margin: 8px 0;
}

.wish-scroll::-webkit-scrollbar {
    width: 4px;
}

.wish-scroll::-webkit-scrollbar-track {
    background: rgba(253, 121, 168, 0.1);
    border-radius: 2px;
}

.wish-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.wish-scroll::-webkit-scrollbar-thumb:hover {
    background: #f06292;
}

.special-wish {
    font-size: 16px;
    line-height: 2;
    color: var(--secondary);
    margin: 0;
    animation: fadeInText 0.8s ease-out 0.4s both;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 签名 */
.signature {
    margin-top: 24px;
    font-size: 14px;
    color: var(--secondary);
    opacity: 0.7;
    font-style: italic;
    text-align: right;
    animation: fadeIn 1s ease-out 0.8s both;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .card {
        padding: 40px 24px;
        border-radius: 20px;
    }

    .title {
        font-size: 28px;
    }

    .wish-text p {
        font-size: 15px;
    }

    .btn {
        padding: 12px 32px;
        font-size: 14px;
    }

    .modal-content {
        width: 92%;
        margin: 20% auto;
    }

    .modal-inner {
        padding: 40px 24px;
    }

    .modal-content h2 {
        font-size: 22px;
    }

    .special-wish {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 32px 20px;
    }

    .title {
        font-size: 24px;
    }

    .date {
        font-size: 12px;
    }

    .wish-text p {
        font-size: 14px;
    }

    .modal-inner {
        padding: 32px 20px;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .special-wish {
        font-size: 14px;
        line-height: 1.9;
    }
}
