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

:root {
    --pink: #ff6b9d;
    --pink-light: #ffd6e7;
    --blue: #4a90d9;
    --blue-light: #d0e4ff;
    --bg: #fff5f8;
    --card-bg: #ffffff;
    --text: #2d2d2d;
    --text-light: #888;
    --shadow: 0 4px 20px rgba(255, 107, 157, 0.15);
    --radius: 16px;
}

body {
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 28px;
    color: var(--pink);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-light);
    font-size: 14px;
}

.clocks {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.clock-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1;
    max-width: 280px;
    transition: transform 0.2s;
}

.clock-card:hover {
    transform: translateY(-2px);
}

.city-flag {
    font-size: 32px;
    margin-bottom: 4px;
}

.clock-card h2 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 2px;
}

.timezone {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.date {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.time {
    font-size: 36px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

#sz-card .time { color: var(--pink); }
#bk-card .time { color: var(--blue); }

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
}

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

.heart-divider {
    font-size: 28px;
    animation: heartbeat 1.5s ease infinite;
}

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

.chat-status {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    text-align: center;
}

.status-bar {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.bar-segment {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.bar-segment.day { background: #fff3cd; color: #856404; }
.bar-segment.night { background: #cce5ff; color: #004085; }
.bar-separator { width: 4px; background: var(--pink-light); }

.chat-advice {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.chat-advice.good { color: #28a745; }
.chat-advice.bad { color: #dc3545; }

.next-window {
    font-size: 13px;
    color: var(--text-light);
}

.calendar-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-header h3 {
    font-size: 18px;
    color: var(--text);
}

.calendar-header button {
    background: none;
    border: 2px solid var(--pink-light);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 18px;
    cursor: pointer;
    color: var(--pink);
    transition: all 0.2s;
}

.calendar-header button:hover {
    background: var(--pink);
    color: white;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-grid .day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
}

.calendar-grid .day:hover {
    background: var(--pink-light);
    transform: scale(1.05);
}

.calendar-grid .day.today {
    background: var(--pink);
    color: white;
    font-weight: 700;
}

.calendar-grid .day.selected {
    outline: 3px solid var(--pink);
    outline-offset: -3px;
}

.calendar-grid .day.has-entry {
    color: var(--pink);
    font-weight: 600;
}

.calendar-grid .day.has-entry::after {
    content: '📝';
    font-size: 10px;
    position: absolute;
    top: 2px;
    right: 2px;
}

.calendar-grid .day.has-photo::after {
    content: '📷';
    font-size: 10px;
    position: absolute;
    top: 2px;
    right: 2px;
}

.calendar-grid .day.empty {
    cursor: default;
}

.calendar-grid .day.empty:hover {
    background: none;
    transform: none;
}

.calendar-grid .day.other-month {
    color: #ddd;
}

.day-detail {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.day-detail-header h3 {
    font-size: 18px;
    color: var(--pink);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--pink-light);
}

.entries {
    margin-bottom: 20px;
}

.entry-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--pink);
}

.entry-card.girlfriend {
    border-left-color: var(--blue);
}

.entry-author {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.entry-card.jacob .entry-author { color: var(--pink); }
.entry-card.girlfriend .entry-author { color: var(--blue); }

.entry-time {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.entry-text {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.entry-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.entry-photos img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.entry-photos img:hover {
    transform: scale(1.05);
}

.new-entry h4 {
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text);
}

textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid var(--pink-light);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

textarea:focus {
    border-color: var(--pink);
}

.entry-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.upload-btn {
    display: inline-block;
    padding: 10px 18px;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: var(--blue);
    color: white;
}

#save-entry {
    padding: 10px 24px;
    background: var(--pink);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#save-entry:hover {
    background: #e55a8a;
    transform: translateY(-1px);
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.upload-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--pink-light);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
}

.image-viewer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .clocks {
        flex-direction: column;
    }
    .heart-divider {
        display: none;
    }
    .clock-card {
        max-width: 100%;
    }
    .time {
        font-size: 28px;
    }
    .entry-actions {
        flex-direction: column;
    }
    .upload-btn, #save-entry {
        width: 100%;
        text-align: center;
    }
}
