* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    min-height: 100vh;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 600;
    margin-bottom: 8px;
}

header p {
    font-size: clamp(12px, 3vw, 14px);
    opacity: 0.9;
}

.nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: clamp(12px, 3vw, 15px);
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.baby-card {
    background: white;
    border-radius: 20px;
    padding: clamp(20px, 5vw, 30px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin-bottom: 30px;
}

.baby-avatar {
    width: clamp(100px, 25vw, 150px);
    height: clamp(100px, 25vw, 150px);
    border-radius: 50%;
    margin: 0 auto 15px;
    overflow: hidden;
    border: 5px solid #ffd9d9;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.2);
}

.baby-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.baby-info h2 {
    font-size: clamp(20px, 5vw, 24px);
    color: #ff6b6b;
    margin-bottom: 8px;
}

.baby-info p {
    color: #666;
    margin-bottom: 5px;
    font-size: clamp(13px, 3vw, 14px);
}

.baby-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(15px, 4vw, 40px);
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    min-width: 60px;
}

.stat-item .number {
    font-size: clamp(20px, 5vw, 28px);
    color: #ff6b6b;
    font-weight: bold;
}

.stat-item .label {
    font-size: clamp(11px, 2.5vw, 12px);
    color: #999;
}

.photo-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: clamp(18px, 4vw, 22px);
    color: #333;
    margin-bottom: 15px;
    padding-left: 12px;
    border-left: 4px solid #ff6b6b;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 15px;
}

.photo-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-5px);
}

.photo-item img {
    width: 100%;
    height: clamp(150px, 40vw, 220px);
    object-fit: cover;
}

.photo-item .photo-desc {
    padding: 12px 15px;
    font-size: clamp(13px, 3vw, 14px);
    color: #666;
}

.diary-section {
    margin-bottom: 30px;
}

.diary-list {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.diary-item {
    padding: 15px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    gap: 15px;
    transition: background 0.3s ease;
}

.diary-item:last-child {
    border-bottom: none;
}

.diary-item:hover {
    background: #fffaf8;
}

.diary-date {
    text-align: center;
    min-width: 60px;
}

.diary-date .day {
    font-size: clamp(22px, 5vw, 28px);
    color: #ff6b6b;
    font-weight: bold;
}

.diary-date .month {
    font-size: clamp(11px, 2.5vw, 12px);
    color: #999;
}

.diary-content h3 {
    font-size: clamp(15px, 3.5vw, 16px);
    margin-bottom: 6px;
    color: #333;
}

.diary-content p {
    font-size: clamp(13px, 3vw, 14px);
    color: #666;
    line-height: 1.6;
}

.timeline-section {
    margin-bottom: 30px;
}

.timeline {
    position: relative;
    padding-left: 25px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #ff6b6b 0%, #ffd9d9 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff6b6b;
    border: 3px solid white;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.timeline-item .timeline-date {
    font-size: clamp(13px, 3vw, 14px);
    color: #ff6b6b;
    margin-bottom: 8px;
}

.timeline-item .timeline-title {
    font-size: clamp(16px, 3.5vw, 18px);
    margin-bottom: 6px;
    color: #333;
}

.timeline-item .timeline-desc {
    font-size: clamp(13px, 3vw, 14px);
    color: #666;
    line-height: 1.6;
}

footer {
    background: #ff6b6b;
    color: white;
    text-align: center;
    padding: 25px 15px;
    margin-top: 30px;
}

footer p {
    font-size: clamp(12px, 3vw, 14px);
    opacity: 0.9;
}

.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.photo-modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 95%;
    max-height: 85vh;
    padding: 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 10px;
}

.modal-close {
    position: absolute;
    top: -45px;
    right: 50%;
    transform: translateX(50%);
    width: 40px;
    height: 40px;
    font-size: 28px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
        padding: 30px 20px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .baby-stats {
        gap: 30px;
    }
}

/* 手机适配 */
@media (max-width: 768px) {
    header {
        padding: 15px 12px;
    }

    .nav-links {
        gap: 6px;
    }

    .nav-links a {
        font-size: 12px;
        padding: 5px 10px;
    }

    .container {
        padding: 15px 12px;
    }

    .baby-card {
        padding: 20px 15px;
        margin-bottom: 25px;
    }

    .baby-stats {
        gap: 12px;
    }

    .stat-item {
        min-width: 55px;
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .photo-item img {
        height: 130px;
    }

    .photo-item .photo-desc {
        padding: 10px;
        font-size: 12px;
    }

    .diary-item {
        flex-direction: column;
        gap: 10px;
    }

    .diary-date {
        text-align: left;
        display: flex;
        gap: 10px;
        align-items: baseline;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline-item::before {
        left: -17px;
        width: 8px;
        height: 8px;
    }

    .timeline-item {
        padding: 12px;
    }

    .modal-content {
        padding: 10px;
        border-radius: 10px;
    }

    .modal-close {
        top: -40px;
        right: 10px;
        transform: none;
    }

    footer {
        padding: 20px 15px;
    }
}

/* 小屏手机适配 */
@media (max-width: 375px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }

    .baby-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-item {
        padding: 5px;
    }
}

/* 横屏手机适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .baby-avatar {
        width: 80px;
        height: 80px;
    }

    .baby-stats {
        margin-top: 10px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .photo-item img {
        height: 120px;
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .photo-item:hover {
        transform: none;
    }

    .nav-links a:hover {
        background: transparent;
    }

    .diary-item:hover {
        background: transparent;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .baby-avatar img,
    .photo-item img {
        image-rendering: -webkit-optimize-contrast;
    }
}