/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF6B6B;
    --primary-light: #FFE0E0;
    --primary-dark: #E85555;
    --bg: #FFF9F5;
    --card-bg: #FFFFFF;
    --text: #333333;
    --text-light: #888888;
    --text-muted: #AAAAAA;
    --border: #F0E8E2;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --max-width: 680px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ===== Login Screen ===== */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF5F5 0%, #FFF0E6 50%, #FFF5F5 100%);
}

.login-container {
    text-align: center;
    padding: 40px 32px;
    max-width: 380px;
    width: 100%;
}

.login-logo {
    font-size: 64px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 40px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#password-input {
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
}

#password-input:focus {
    border-color: var(--primary);
}

.login-btn {
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover { background: var(--primary-dark); }

.login-error {
    margin-top: 12px;
    font-size: 14px;
    color: var(--primary);
    min-height: 20px;
}

/* ===== Main Header ===== */
.main-header {
    background: white;
    text-align: center;
    padding: 28px 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== Month Filter ===== */
.month-filter {
    display: flex;
    gap: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 85px;
    z-index: 9;
}

.month-filter::-webkit-scrollbar { display: none; }

.month-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.month-btn:hover { color: var(--text); }

.month-btn.active {
    color: white;
    background: var(--primary);
}

/* ===== Stats Bar ===== */
.stats-bar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 20px 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Report List ===== */
.report-list {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 8px 16px 40px;
}

/* ===== Report Card ===== */
.report-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 18px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-date {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.card-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-body {
    padding: 12px 20px;
}

.card-content {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-images {
    display: flex;
    gap: 4px;
    padding: 0 20px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.card-images::-webkit-scrollbar { display: none; }

.card-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--border);
}

.card-images-more {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.card-footer {
    padding: 0 20px 16px;
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Detail Screen ===== */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
}

.detail-nav { display: flex; gap: 4px; }

.nav-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
    color: var(--text-light);
    background: var(--bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-btn:hover { background: var(--border); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }

.detail-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px 60px;
}

.detail-date-section {
    text-align: center;
    padding: 28px 0 20px;
}

.detail-date {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.detail-author {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.detail-status {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px 0 20px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-light);
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.detail-text {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text);
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    white-space: pre-wrap;
    word-break: keep-all;
}

/* ===== Detail Video ===== */
.detail-video {
    margin-top: 20px;
    border-radius: var(--radius);
    overflow: hidden;
}

.detail-video video {
    width: 100%;
    display: block;
    border-radius: var(--radius);
    background: #000;
}

/* ===== Detail Gallery ===== */
.detail-gallery {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border-radius: var(--radius);
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    background: var(--border);
    transition: opacity 0.15s;
}

.gallery-img:hover { opacity: 0.85; }

/* ===== Comments ===== */
.detail-comments {
    margin-top: 24px;
}

.comments-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.comment {
    padding: 14px 18px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.comment-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

.comment-text {
    font-size: 14px;
    color: var(--text);
    margin-top: 6px;
    line-height: 1.6;
}

.comment-video, .comment-gallery { margin-top: 10px; }
.comment-img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: pointer; background: var(--border); }

.comment-reply {
    margin-left: 20px;
    border-left: 2px solid var(--primary-light);
    padding-left: 14px;
}

/* ===== Image Viewer ===== */
.image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    overflow: hidden;
    touch-action: pan-y;
}

.viewer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 32px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 101;
    transition: background 0.2s;
}

.viewer-nav:hover { background: rgba(255, 255, 255, 0.2); }
.viewer-prev-btn { left: 12px; }
.viewer-next-btn { right: 12px; }

.viewer-track {
    position: absolute;
    top: 0;
    left: -100%;
    width: 300%;
    height: 100%;
    display: flex;
    will-change: transform;
    transform: translateX(0);
}

.viewer-track.animate {
    transition: transform 0.3s ease-out;
}

.viewer-slide {
    flex: 0 0 33.3333%;
    width: 33.3333%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-slide-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.viewer-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .login-title { font-size: 20px; }
    .header-title { font-size: 17px; }
    .detail-gallery { grid-template-columns: repeat(2, 1fr); }
    .card-thumb { width: 64px; height: 64px; }
    .card-images-more { width: 64px; height: 64px; }
}

/* ===== 2026-11 개편: 어린이집 탭 · 앨범 · 로그아웃 · 더 보기 ===== */
.main-header { position: relative; }
.logout-btn {
    position: absolute; top: 16px; right: 16px;
    font: inherit; font-size: 12px; color: var(--text-light);
    background: transparent; border: 1px solid var(--border); border-radius: 999px;
    padding: 4px 10px; cursor: pointer;
}
.center-tabs {
    display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 0;
    max-width: var(--max-width); margin: 0 auto; scrollbar-width: none;
}
.center-tabs::-webkit-scrollbar { display: none; }
.center-btn {
    flex: 0 0 auto; font: inherit; font-size: 15px; font-weight: 600;
    padding: 8px 16px; border-radius: 999px; cursor: pointer;
    border: 1.5px solid var(--primary); background: var(--card-bg); color: var(--primary);
}
.center-btn.active { background: var(--primary); color: #fff; }
.center-chip, .album-chip {
    font-size: 11px; padding: 1px 8px; border-radius: 999px;
    background: var(--primary-light); color: var(--primary-dark);
}
.album-chip { background: #E6F0FF; color: #3D6FB8; }
.card-title, .detail-title { font-weight: 700; margin-bottom: 4px; }
.detail-title { font-size: 18px; margin: 12px 0 4px; }
.comment-teacher .comment-author { color: var(--primary-dark); }
.list-more { text-align: center; padding: 8px 16px 32px; }
.more-btn {
    font: inherit; padding: 10px 24px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
}
.viewer-download {
    position: absolute; top: 20px; left: 20px; z-index: 3;
    color: #fff; font-size: 14px; text-decoration: none;
    background: rgba(255,255,255,0.15); padding: 6px 12px; border-radius: 999px;
}

/* ===== 추억 틀어놓기 ===== */
.show-open-btn {
    margin-top: 12px; font: inherit; font-size: 15px; font-weight: 700;
    padding: 10px 20px; border-radius: 999px; border: none; cursor: pointer;
    background: var(--primary); color: #fff; box-shadow: var(--shadow);
}
.show-settings {
    position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.show-settings-box {
    width: 100%; max-width: 420px; background: var(--card-bg); color: var(--text);
    border-radius: var(--radius); padding: 24px 20px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.show-settings-box h2 { font-size: 20px; margin-bottom: 16px; }
.show-settings-box fieldset { border: none; margin-bottom: 16px; }
.show-settings-box legend { font-size: 14px; color: var(--text-light); margin-bottom: 8px; }
.show-options { display: flex; flex-wrap: wrap; gap: 8px; }
.show-chip input { position: absolute; opacity: 0; pointer-events: none; }
.show-chip span {
    display: inline-flex; flex-direction: column; align-items: center; line-height: 1.3;
    padding: 8px 14px; border-radius: 12px; cursor: pointer;
    border: 1.5px solid var(--border); background: var(--bg); font-weight: 600;
}
.show-chip small { font-size: 11px; font-weight: 400; color: var(--text-light); }
.show-chip input:checked + span { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.show-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.show-music-toggle { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 4px 0 12px; cursor: pointer; }
.show-music-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.show-count { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.show-actions { display: flex; gap: 8px; justify-content: flex-end; }
.show-btn {
    font: inherit; padding: 10px 20px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
}
.show-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.show-btn:disabled { opacity: .5; cursor: not-allowed; }

.show-player { position: fixed; inset: 0; z-index: 60; background: #000; overflow: hidden; cursor: none; }
.show-player.controls-on { cursor: default; }
.show-stage { position: absolute; inset: 0; }
.show-slide {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    transition: transform var(--dur, 1s) ease, opacity var(--dur, 1s) ease;
}
.show-bg {
    position: absolute; inset: -40px; background-size: cover; background-position: center;
    filter: blur(28px) brightness(.55); transform: scale(1.1);
}
.show-img { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 60px rgba(0,0,0,.5); }
.show-slide.enter.from-left { transform: translateX(-100%); }
.show-slide.enter.from-right { transform: translateX(100%); }
.show-slide.enter.from-top { transform: translateY(-100%); }
.show-slide.enter.from-bottom { transform: translateY(100%); }
.show-slide.enter.fade { opacity: 0; }
.show-slide.enter.zoom { opacity: 0; transform: scale(1.15); }
@media (prefers-reduced-motion: reduce) {
    .show-slide { transition: opacity .6s ease; transform: none !important; }
    .show-slide.enter { opacity: 0; }
}
.show-caption {
    position: absolute; left: 0; right: 0; bottom: 28px; text-align: center;
    color: rgba(255,255,255,.9); font-size: 15px; text-shadow: 0 1px 6px rgba(0,0,0,.8); pointer-events: none;
}
.show-credit {
    position: absolute; left: 12px; bottom: 6px; font-size: 11px;
    color: rgba(255,255,255,.55); pointer-events: none;
}
.show-controls {
    position: absolute; top: 16px; right: 16px; display: flex; gap: 8px;
    opacity: 0; transition: opacity .3s; pointer-events: none;
}
.show-player.controls-on .show-controls { opacity: 1; pointer-events: auto; }
.show-ctl {
    width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,.18); color: #fff; font-size: 16px;
    backdrop-filter: blur(6px);
}
.show-ctl:hover { background: rgba(255,255,255,.3); }
.show-ctl.off { opacity: .45; text-decoration: line-through; }

/* 본문·댓글 속 링크 */
.detail-text a, .comment-text a {
    color: #2b6cb0;
    text-decoration: underline;
    word-break: break-all;
}
