/* ===== 基础重置 ===== */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #fef6f9;
    color: #2c2c2c;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 顶部导航栏（干净小巧） ===== */
.top-nav {
    background: rgba(255,255,255,0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(232, 67, 147, 0.08);
    position: sticky;
    top: 0;
    z-index: 200;
}
.top-nav .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e84393;
    text-decoration: none;
}

/* 汉堡按钮 */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 300;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #e84393;
    border-radius: 2px;
    transition: all 0.3s;
}

/* 全屏覆盖菜单 */
.nav-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 250;
    display: none;
    justify-content: center;
    align-items: center;
}
.nav-overlay.active {
    display: flex;
}
.nav-menu {
    background: #fff;
    border-radius: 32px;
    padding: 40px 30px;
    width: 85%;
    max-width: 360px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    text-align: center;
    animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
    from { opacity:0; transform: scale(0.9); }
    to { opacity:1; transform: scale(1); }
}
.nav-menu a {
    display: block;
    padding: 14px 10px;
    color: #e84393;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 16px;
    margin-bottom: 6px;
    transition: background 0.2s;
}
.nav-menu a:hover {
    background: #fef0f5;
}
.nav-menu .btn-login {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 30px;
    background: #e84393;
    color: #fff;
    border-radius: 100px;
    font-weight: 600;
}
.nav-menu .btn-login:hover {
    background: #c2185b;
}
/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    max-width: 800px;
    margin: 20px auto;
    padding: 0 16px;
    width: 100%;
}

/* ===== 情侣头部（头像并排，计时器中间） ===== */
/* ===== 情侣头部（彻底防溢出） ===== */
.couple-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 32px;
    padding: 15px 8px;
    margin-bottom: 24px;
    box-shadow: 0 6px 20px rgba(232, 67, 147, 0.06);
    flex-wrap: nowrap;
    overflow: hidden;
}
.person {
    flex: 1 1 0;          /* 三等分宽度 */
    min-width: 0;         /* 允许收缩 */
    text-align: center;
}
.avatar {
    width: 70px;
    height: 70px;
    max-width: 100%;      /* 保证不超出容器 */
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(232, 67, 147, 0.18);
}
.person h3 {
    margin-top: 5px;
    font-size: 0.75rem;
    color: #e84393;
    font-weight: 600;
    word-break: break-all; /* 极长昵称换行 */
    line-height: 1.2;
}
.timer-box {
    flex: 1 1 0;          /* 三等分宽度 */
    min-width: 0;
    text-align: center;
    background: #fef0f5;
    border-radius: 20px;
    padding: 10px 6px;
    overflow-wrap: break-word;
}
.timer-box .label {
    font-size: 0.7rem;
    color: #e84393;
    opacity: 0.8;
    margin-bottom: 3px;
}
.timer-box .time {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e84393;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

/* 手机端再缩小 */
@media (max-width: 480px) {
    .avatar {
        width: 55px;
        height: 55px;
    }
    .timer-box .time {
        font-size: 0.75rem;
    }
    .person h3 {
        font-size: 0.65rem;
    }
}

/* ===== 通用卡片 ===== */
.card {
    background: #fff;
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: 0 6px 20px rgba(232, 67, 147, 0.05);
}

/* ===== 日记/相册网格 ===== */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.diary-card, .photo-card {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(232, 67, 147, 0.06);
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.diary-card:active, .photo-card:active { transform: scale(0.98); }
.diary-card img, .photo-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.card-body {
    padding: 16px 18px;
}
.card-body h4 {
    font-size: 1.05rem;
    color: #e84393;
    margin-bottom: 4px;
}
.card-body .meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}
.card-body p {
    font-size: 0.9rem;
    color: #555;
}

/* ===== 日记详情 ===== */
.diary-detail h2 { color:#e84393; margin-bottom:8px; }
.diary-detail img { width:100%; border-radius:20px; margin:16px 0; }
.diary-content { font-size:1.05rem; line-height:1.8; color:#444; white-space:pre-wrap; }
/* ===== 纪念日 ===== */
.item-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0; border-bottom: 1px solid #f5e0e8;
}
.item-row:last-child { border-bottom: none; }
.badge {
    background: #e84393; color:#fff; padding:4px 12px;
    border-radius:100px; font-size:0.8rem; margin-left:8px;
}

/* ===== 愿望清单 ===== */
.wish-item {
    display: flex; align-items: center; gap:12px;
    padding:12px 0; border-bottom:1px solid #f5e0e8;
}
.wish-item:last-child { border-bottom: none; }
.wish-item input[type="checkbox"] { width:20px; height:20px; accent-color:#e84393; }

/* ===== 留言板 ===== */
.msg-form input, .msg-form textarea {
    width:100%; padding:14px; border:1.5px solid #f3d4e0;
    border-radius:16px; margin-bottom:12px; font-size:1rem;
    background:#fff9fb; outline:none;
}
.msg-form input:focus, .msg-form textarea:focus { border-color:#e84393; }
.message-item {
    display: flex; gap:12px; padding:16px 0; border-bottom:1px solid #f5e0e8;
}
.message-item:last-child { border-bottom: none; }
.msg-avatar {
    width:42px; height:42px; border-radius:50%; object-fit:cover;
    border:2px solid #f3d4e0; flex-shrink:0;
}
.msg-body .name { font-weight:600; color:#e84393; margin-bottom:4px; }
.msg-body .text { color:#555; line-height:1.5; }
.msg-body .time { font-size:0.8rem; color:#aaa; margin-top:4px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block; padding: 11px 24px;
    background: #e84393; color:#fff; border-radius:100px;
    text-decoration:none; font-weight:600; font-size:0.9rem;
    border:none; cursor:pointer; transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(232,67,147,0.2);
}
.btn:active { transform: scale(0.96); }
.btn-outline {
    background: transparent; border:2px solid #e84393; color:#e84393;
}
.btn-outline:hover { background:#e84393; color:#fff; }
.pagination { display:flex; justify-content:center; gap:16px; margin-top:24px; }

/* ===== 底部 ===== */
.footer {
    text-align:center; padding:20px; background:#fff;
    color:#999; font-size:0.85rem; border-top:1px solid #f5e0e8;
    margin-top:20px;
}

/* ===== 响应式（手机优化） ===== */
@media (max-width: 480px) {
    .couple-header {
        gap: 8px;
        padding: 16px 8px;
    }
    .avatar {
        width: 64px; height: 64px;
    }
    .timer-box {
        min-width: 90px;
        padding: 10px 12px;
    }
    .timer-box .time {
        font-size: 1rem;
    }
    .person h3 {
        font-size: 0.75rem;
    }
    .grid-list {
        grid-template-columns: 1fr;
    }
}