/* ===================================
   计时器模块 - Q萌卡通风格
   =================================== */

/* 计时器容器 */
.timer-container {
    max-width: 420px;
    margin: 0 auto 28px;
    overflow: hidden;
    position: relative;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 24px rgba(255, 142, 199, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.03);
    border: 2px solid rgba(255, 142, 199, 0.1);
    user-select: none;
    -webkit-user-select: none;
}

/* 滑动轨道 */
.timer-track {
    display: flex;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

/* 单张计时卡片 */
.timer-card {
    min-width: 100%;
    padding: 26px 20px 14px;
    text-align: center;
    box-sizing: border-box;
}

.timer-card-emoji {
    font-size: 2.2rem;
    margin-bottom: 2px;
    animation: timerBounce 2s ease infinite;
}

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

.timer-card-title {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 1.15rem;
    color: #5a3e6f;
    margin-bottom: 4px;
}

.timer-card-direction {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 0.78rem;
    color: #b8a0c8;
    margin-bottom: 10px;
}

/* 数字区域 */
.timer-card-digits {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.timer-digit-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-digit {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: #ec4899;
    min-width: 52px;
    background: linear-gradient(135deg, rgba(255, 142, 199, 0.08), rgba(167, 139, 250, 0.08));
    border-radius: 14px;
    padding: 6px 10px;
    line-height: 1.2;
    border: 1.5px solid rgba(255, 142, 199, 0.1);
}

.timer-digit-sep {
    font-size: 1.6rem;
    color: #d5b3ff;
    align-self: center;
    padding-bottom: 16px;
    animation: timerBlink 1s step-end infinite;
}

@keyframes timerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.timer-digit-label {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 0.7rem;
    color: #b8a0c8;
    margin-top: 3px;
}

/* 仅天数的大号数字（生日/纪念日） */
.timer-days-only {
    min-width: 120px;
}
.timer-digit-big {
    font-size: 2.6rem;
    min-width: 100px;
    padding: 10px 20px;
}

.timer-card-date {
    font-size: 0.78rem;
    color: #cbb8d7;
    margin-top: 4px;
}

/* 指示圆点 */
.timer-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 6px 0 14px;
}

.timer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e8d5f0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.timer-dot.active {
    background: linear-gradient(135deg, #ff8ec7, #a78bfa);
    transform: scale(1.4);
    box-shadow: 0 0 6px rgba(255, 142, 199, 0.4);
}

/* 添加按钮 */
.timer-add-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 142, 199, 0.2);
    background: rgba(255, 255, 255, 0.8);
    color: #ec4899;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}
.timer-add-btn:hover {
    background: linear-gradient(135deg, #ff8ec7, #a78bfa);
    color: #fff;
    border-color: transparent;
    transform: rotate(90deg) scale(1.1);
}

/* "未见面" 按钮 */
.timer-notmet-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 14px;
    font-size: 0.78rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 142, 199, 0.2);
    background: rgba(255, 255, 255, 0.6);
    color: #ec4899;
    cursor: pointer;
    transition: all 0.2s;
}
.timer-notmet-btn:hover {
    background: #ff8ec7;
    color: #fff;
}

/* 添加纪念日面板 */
.timer-add-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.timer-add-panel.active {
    opacity: 1;
}
.timer-add-form {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.timer-add-panel.active .timer-add-form {
    transform: translateY(0);
}
.timer-add-form h3 {
    margin: 0 0 16px;
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    color: #5a3e6f;
    text-align: center;
}
.timer-add-form .form-group {
    margin-bottom: 12px;
}
.timer-add-form label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}
.timer-add-form input,
.timer-add-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid rgba(255, 142, 199, 0.2);
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.timer-add-form input:focus,
.timer-add-form select:focus {
    border-color: #ff8ec7;
}
.timer-add-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.timer-add-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.timer-add-actions .btn-cancel {
    background: #f0e0f6;
    color: #5a3e6f;
}
.timer-add-actions .btn-save {
    background: linear-gradient(135deg, #ff8ec7, #a78bfa);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 142, 199, 0.3);
}
.timer-add-actions .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 142, 199, 0.4);
}

/* 响应式 */
@media (max-width: 480px) {
    .timer-container {
        margin: 0 12px 24px;
        border-radius: 20px;
    }
    .timer-card {
        padding: 20px 14px 10px;
    }
    .timer-digit {
        font-size: 1.5rem;
        min-width: 42px;
        padding: 4px 6px;
    }
    .timer-card-digits {
        gap: 5px;
    }
    .timer-digit-sep {
        font-size: 1.2rem;
    }
}

/* ===== 生日当天庆祝样式 ===== */
.timer-card.birthday-today {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.timer-card.birthday-today::before {
    content: '🎉🎊🎈🎁';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    letter-spacing: 6px;
    opacity: 0.45;
    animation: bdConfetti 3s ease-in-out infinite;
    pointer-events: none;
}

.timer-card.birthday-today .timer-card-emoji {
    animation: bdBounce 1s ease infinite;
    font-size: 2.8rem;
    margin-bottom: 6px;
    margin-top: 8px;
}

.timer-card.birthday-today .timer-card-title {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

/* 生日当天隐藏方向标签 */
.timer-card.birthday-today .timer-card-direction {
    display: none;
}

/* 庆祝文本 */
.birthday-celebration {
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff8ec7, #f472b6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 10px 0 8px;
    animation: bdTextPulse 2s ease-in-out infinite;
}

@keyframes bdBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.1); }
}

@keyframes bdConfetti {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.7; transform: translateX(-50%) translateY(-3px); }
}

@keyframes bdTextPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
