/**
 * 血糖记录平台 - 样式文件
 * 浪漫温馨风格，柔和粉紫色调
 */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #ffd1dc 0%, #ffe5ec 25%, #fff0f5 50%, #f8e1f4 75%, #ffd1dc 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 漂浮心形背景 */
.floating-hearts {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.heart {
    position: absolute;
    font-size: 20px;
    animation: float 6s ease-in-out infinite;
    opacity: 0.3;
}

.heart:nth-child(1) { left: 10%; animation-delay: 0s; font-size: 25px; }
.heart:nth-child(2) { left: 25%; animation-delay: 1s; font-size: 18px; }
.heart:nth-child(3) { left: 40%; animation-delay: 2s; font-size: 22px; }
.heart:nth-child(4) { left: 55%; animation-delay: 3s; font-size: 16px; }
.heart:nth-child(5) { left: 70%; animation-delay: 4s; font-size: 28px; }
.heart:nth-child(6) { left: 85%; animation-delay: 5s; font-size: 20px; }
.heart:nth-child(7) { left: 15%; animation-delay: 6s; font-size: 24px; }
.heart:nth-child(8) { left: 60%; animation-delay: 7s; font-size: 19px; }

.heart::before {
    content: '💕';
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* 主容器 */
.container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(255, 105, 135, 0.2);
    max-width: 420px;
    width: 100%;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 时间问候区 */
.time-section {
    text-align: center;
    margin-bottom: 35px;
}

.emoji-bounce {
    font-size: 50px;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

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

.greeting {
    font-size: 28px;
    font-weight: 500;
    color: #d63384;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(214, 51, 132, 0.2);
}

.current-time {
    font-size: 16px;
    color: #6c757d;
    font-weight: 300;
}

/* 输入区 */
.input-section {
    margin-bottom: 30px;
}

.form-title {
    text-align: center;
    font-size: 18px;
    color: #495057;
    margin-bottom: 20px;
    font-weight: 400;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.input-wrapper input {
    width: 100%;
    height: 60px;
    border: 2px solid #ffc0cb;
    border-radius: 15px;
    font-size: 32px;
    text-align: center;
    color: #d63384;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    outline: none;
    padding-right: 80px;
}

.input-wrapper input:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
}

.input-wrapper input::placeholder {
    color: #ffb6c1;
    font-size: 24px;
}

.unit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 14px;
    font-weight: 300;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    height: 55px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 50%, #ffc0cb 100%);
    background-size: 200% 200%;
    color: white;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 105, 180, 0.4);
    background-position: 100% 0;
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn svg {
    fill: white;
}

/* 成功消息 */
.success-message {
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.success-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: pulse 1s ease-in-out infinite;
}

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

.success-message p {
    font-size: 24px;
    color: #d63384;
    font-weight: 500;
    margin-bottom: 10px;
}

.success-text {
    font-size: 16px !important;
    color: #6c757d !important;
    font-weight: 300 !important;
}

.continue-btn {
    display: block;
    width: 100%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background: linear-gradient(135deg, #ffc0cb 0%, #ffe5ec 100%);
    color: #d63384;
    text-decoration: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.continue-btn:hover {
    background: linear-gradient(135deg, #ff69b4 0%, #ffc0cb 100%);
    color: white;
}

/* 温馨提示 */
.tips {
    text-align: center;
    padding: 15px;
    background: rgba(255, 192, 203, 0.1);
    border-radius: 12px;
    border: 1px dashed #ffb6c1;
}

.tips p {
    font-size: 14px;
    color: #6c757d;
    font-weight: 300;
    line-height: 1.6;
}

/* 音乐播放器 */
.music-player {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.music-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ffc0cb;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.2);
}

.music-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.3);
    background: white;
}

.music-btn.playing {
    background: linear-gradient(135deg, #ffd1dc, #ffe5ec);
    border-color: #ff69b4;
    animation: musicPulse 2s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 5px 15px rgba(255, 105, 180, 0.2); }
    50% { box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4); }
}

.music-icon {
    font-size: 20px;
}

.music-text {
    font-size: 14px;
    color: #d63384;
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .greeting {
        font-size: 24px;
    }

    .input-wrapper input {
        font-size: 28px;
        height: 55px;
    }

    .submit-btn {
        height: 50px;
        font-size: 16px;
    }

    .music-player {
        top: 15px;
        right: 15px;
    }

    .music-btn {
        padding: 10px 16px;
    }

    .music-text {
        display: none; /* 手机端只显示图标 */
    }
}
