/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "微软雅黑", Arial, sans-serif;
}

/* 动画关键帧定义 */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 页面背景 */
body {
    background: linear-gradient(-45deg, #667eea, #764ba2, #2a5298, #6b46c1);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 飞出图标动画 */
@keyframes flyOut {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* 飞出图标样式 */
.flying-icon {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.flying-icon img {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}



/* 背景装饰元素 */
body::before, body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    z-index: -1;
}

body::before {
    top: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite;
}

body::after {
    bottom: -100px;
    right: -100px;
    width: 200px;
    height: 200px;
    animation: float 6s ease-in-out infinite reverse;
}

/* 主容器 */
.container {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 
                0 0 20px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 500px;
    text-align: center;
    animation: fadeIn 1s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                0 0 30px rgba(255, 255, 255, 0.15);
}

/* 容器装饰 */
.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shimmer 8s infinite linear;
    pointer-events: none;
    z-index: 1;
}

/* 标题样式 */
h1 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    display: inline-block;
    letter-spacing: 1px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    border-radius: 3px;
}

/* 倒计时容器 */
.countdown-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

/* 倒计时项 */
.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: calc(var(--item-index, 0) * 0.2s);
    opacity: 0;
}

.countdown-item:nth-child(1) { --item-index: 1; }
.countdown-item:nth-child(2) { --item-index: 2; }
.countdown-item:nth-child(3) { --item-index: 3; }
.countdown-item:nth-child(4) { --item-index: 4; }

/* 倒计时数字 */
.countdown-item span:first-child {
    font-size: 2.2rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    width: 80px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15),
                inset 0 1px 1px rgba(255, 255, 255, 0.2),
                inset 0 -1px 1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    transition: all 0.3s ease;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.countdown-item span:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, 
                transparent, 
                rgba(255, 255, 255, 0.5), 
                transparent);
}

.countdown-item:hover span:first-child {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2),
                inset 0 1px 1px rgba(255, 255, 255, 0.2),
                inset 0 -1px 1px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.2);
}

/* 倒计时标签 */
.label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
}

.label::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.3s ease;
}

.countdown-item:hover .label::after {
    width: 100%;
}

/* 生日信息卡片 */
.birthday-info {
    margin: 25px 0;
    padding: 18px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: fadeIn 1s ease-out forwards;
    animation-delay: 0.6s;
    opacity: 0;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.birthday-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.birthday-info p {
    position: relative;
    padding-left: 20px;
    margin: 5px 0;
}

.birthday-info p::before {
    content: '🎂';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.9rem;
}

.birthday-info p:last-child::before {
    content: '🎉';
}

/* 生日里程碑列表 */
.birthdays-container {
    margin: 30px 0;
    position: relative;
    animation: fadeIn 1s ease-out forwards;
    animation-delay: 0.7s;
    opacity: 0;
}

.birthdays-container h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.birthdays-container h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), transparent);
}

.birthdays-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    position: relative;
}

/* 自定义滚动条 - 整个容器 */
.container {
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
    scrollbar-width: none; /* 隐藏默认滚动条 (Firefox) */
    -ms-overflow-style: none; /* 隐藏默认滚动条 (IE/Edge) */
}

.container::-webkit-scrollbar {
    display: none; /* 隐藏默认滚动条 (Chrome/Safari) */
}

/* 自定义滚动轮 - 隐藏 */
.custom-scrollbar {
    display: none;
}

.scroll-thumb {
    display: none;
}

/* 恢复生日列表的默认滚动行为 */
.birthdays-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.birthdays-list::-webkit-scrollbar {
    width: 6px;
    display: block;
}

.birthdays-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.birthdays-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.birthday-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.birthday-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #00c6ff, #0072ff);
    opacity: 0.7;
}

.birthday-item:hover {
    transform: translateX(5px);
    background-color: rgba(255, 255, 255, 0.15);
}

.birthday-item.passed {
    background-color: rgba(76, 175, 80, 0.15);
}

.birthday-item.passed::before {
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
}

.birthday-item.special {
    background-color: rgba(255, 193, 7, 0.2);
    animation: pulse 2s infinite;
}

.birthday-item.special::before {
    background: linear-gradient(to bottom, #FFC107, #FF9800);
    width: 5px;
}

.birthday-item.current {
    background-color: rgba(33, 150, 243, 0.25);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.3);
    transform: translateX(5px);
    transition: all 0.5s ease;
}

.birthday-item.current::before {
    background: linear-gradient(to bottom, #2196F3, #03A9F4);
    width: 5px;
}

.age {
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 50px;
}

.date {
    flex-grow: 1;
    text-align: center;
    font-size: 0.9rem;
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    background-color: rgba(76, 175, 80, 0.7);
    color: white;
}

.badge.future {
    background-color: rgba(33, 150, 243, 0.7);
}

.birthday-item.special .badge {
    background-color: rgba(255, 193, 7, 0.8);
    color: #333;
    font-weight: bold;
    padding: 3px 10px;
}

/* 进度容器 */
.progress-container {
    margin-top: 35px;
    position: relative;
    animation: fadeIn 1s ease-out forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

/* 进度标签 */
.progress-label {
    text-align: left;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.progress-label::before {
    content: '📈';
    margin-right: 8px;
    font-size: 1.1rem;
}

/* 进度条 */
.progress-bar {
    height: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    pointer-events: none;
}

/* 进度填充 */
.progress {
    height: 100%;
    background: linear-gradient(90deg, #ff9500, #ff5e3a);
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite linear;
    transform: translateX(-100%);
}

/* 进度百分比 */
#progress-percentage {
    text-align: right;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* 成年前目标样式 */
.goals-container {
    margin: 35px 0;
    position: relative;
    animation: fadeIn 1s ease-out forwards;
    animation-delay: 1s;
    opacity: 0;
}

.goals-container h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.goals-container h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), transparent);
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.goal-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.goal-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #00c6ff, #0072ff);
    opacity: 0.7;
}

.goal-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background-color: rgba(255, 255, 255, 0.15);
}

.goal-icon {
    font-size: 2rem;
    margin-right: 15px;
    background-color: rgba(255, 255, 255, 0.15);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.goal-content {
    flex: 1;
}

.goal-content h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.95);
}

.goal-content p {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.goal-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.goal-progress-bar {
    flex: 1;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    border-radius: 4px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.goal-progress-text {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 60px;
    text-align: right;
}

/* 特殊目标样式 */
.goal-item:nth-child(1) .goal-icon {
    background-color: rgba(255, 193, 7, 0.2);
}

.goal-item:nth-child(1) .goal-progress-fill {
    background: linear-gradient(90deg, #FFC107, #FF9800);
}

.goal-item:nth-child(1)::before {
    background: linear-gradient(to bottom, #FFC107, #FF9800);
}

.goal-item:nth-child(2) .goal-icon {
    background-color: rgba(233, 30, 99, 0.2);
}

.goal-item:nth-child(2) .goal-progress-fill {
    background: linear-gradient(90deg, #E91E63, #C2185B);
}

.goal-item:nth-child(2)::before {
    background: linear-gradient(to bottom, #E91E63, #C2185B);
}

.goal-item:nth-child(3) .goal-icon {
    background-color: rgba(76, 175, 80, 0.2);
}

.goal-item:nth-child(3) .goal-progress-fill {
    background: linear-gradient(90deg, #4CAF50, #2E7D32);
}

.goal-item:nth-child(3)::before {
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
}

.goal-item:nth-child(4) .goal-icon {
    background-color: rgba(156, 39, 176, 0.2);
}

.goal-item:nth-child(4) .goal-progress-fill {
    background: linear-gradient(90deg, #9C27B0, #7B1FA2);
}

.goal-item:nth-child(4)::before {
    background: linear-gradient(to bottom, #9C27B0, #7B1FA2);
}

.goal-item.add-goal {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.goal-item.add-goal::before {
    display: none;
}

.goal-item.add-goal:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.goal-item.add-goal .goal-icon {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 完成状态样式 */
.container.completed {
    animation: pulse 2s infinite;
}

.container.completed .countdown-item span:first-child {
    background: rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: gold;
}

/* 页面加载动画 */
.loaded .container {
    animation: fadeIn 1s ease-out forwards;
}

/* 移动设备适配 */
@media (max-width: 480px) {
    .countdown-item span:first-child {
        font-size: 1.8rem;
        width: 65px;
        height: 60px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .countdown-container {
        margin: 0 -10px 25px;
    }
    
    .countdown-item {
        padding: 0 5px;
    }
    
    .birthday-info {
        padding: 15px;
        font-size: 0.85rem;
    }
    
    .progress-label, #progress-percentage {
        font-size: 0.85rem;
    }
    
    .progress-bar {
        height: 15px;
    }
    
    .container {
        padding: 25px 15px;
    }
    
    .birthdays-list {
        max-height: 180px;
    }
    
    .birthday-item {
        padding: 8px 10px;
    }
    
    .age {
        font-size: 1rem;
        min-width: 40px;
    }
    
    .date {
        font-size: 0.8rem;
    }
    
    .badge {
        padding: 2px 6px;
        font-size: 0.7rem;
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .countdown-item span:first-child {
        font-size: 1.6rem;
        width: 55px;
        height: 55px;
    }
    
    h1 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .label {
        font-size: 0.8rem;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .countdown-item span:first-child {
        background: #f0f0f0;
        color: #333;
    }
}
