/* 家庭生活记录 - 主样式文件 */
:root {
    --primary-color: #e07a5f;      /* 暖橙 */
    --secondary-color: #81b29a;    /* 柔绿 */
    --accent-color: #f2cc8f;       /* 奶油黄 */
    --light-color: #fdf6f0;        /* 米白 */
    --dark-color: #3d405b;         /* 靛蓝灰 */
    --text-color: #4a4a4a;

    --gradient-primary: linear-gradient(135deg, #f6a07a 0%, #e07a5f 100%);
    --gradient-secondary: linear-gradient(135deg, #a8d5c0 0%, #81b29a 100%);
    --gradient-warm: linear-gradient(135deg, #f2cc8f 0%, #e07a5f 100%);

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --shadow-xl: 0 15px 35px rgba(0,0,0,0.16);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-normal: all 0.3s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: var(--light-color);
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* ========== 导航栏 ========== */
.navbar {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 0.9rem 0;
    transition: var(--transition-normal);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary-color) !important;
}

.navbar-brand i { margin-right: 6px; }

.navbar-brand span { color: var(--secondary-color); }

.navbar .nav-link {
    color: var(--dark-color) !important;
    font-weight: 600;
    margin: 0 4px;
    transition: var(--transition-normal);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary-color) !important;
}

/* ========== Hero ========== */
.hero {
    background: var(--gradient-warm);
    color: #fff;
    text-align: center;
    padding: 150px 0 70px;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.hero p {
    font-size: 1.25rem;
    max-width: 680px;
    margin: 0 auto 2rem;
    opacity: 0.96;
}

.hero .btn {
    margin: 0 8px;
}

/* ========== 通用区块 ========== */
section { padding: 70px 0; }

.section-title {
    text-align: center;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 0.6rem;
}

.section-description {
    text-align: center;
    color: #7a7a7a;
    max-width: 640px;
    margin: 0 auto 3rem;
}

/* ========== 按钮 ========== */
.btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 30px;
    padding: 12px 28px;
    font-weight: 600;
    transition: var(--transition-normal);
}

.btn-primary:hover {
    background: #d16849;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-light {
    border-radius: 30px;
    padding: 12px 28px;
    font-weight: 600;
}

.btn-secondary {
    background: var(--secondary-color);
    border: none;
    border-radius: 30px;
    padding: 12px 28px;
    font-weight: 600;
}

.btn-secondary:hover { background: #6fa088; }

/* ========== 卡片网格 ========== */
.cards-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.moment-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem 1.6rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border-top: 4px solid var(--accent-color);
}

.moment-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.moment-card .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.moment-card .moment-date {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.moment-card h4 {
    color: var(--dark-color);
    font-weight: 700;
    margin: 0.4rem 0 0.6rem;
}

.moment-card p { color: #6a6a6a; margin: 0; }

.moment-card .badge {
    background: var(--secondary-color);
    border-radius: 20px;
    font-weight: 500;
    margin-top: 1rem;
}

/* ========== 相册 ========== */
.gallery-grid {
    display: grid;
    gap: 1.4rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.photo-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    /* 用 padding-top 百分比撑出 4:3 比例，兼容不支持 aspect-ratio 的老内核(如 360 极速版) */
    height: 0;
    padding-top: 75%; /* 3 / 4 = 75%，强制横向 4:3 */
    aspect-ratio: 4 / 3; /* 现代浏览器增强，与上面比例一致 */
    transition: var(--transition-normal);
}

.photo-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.photo-card:hover img { transform: scale(1.08); }

.photo-card .photo-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 16px 14px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
}

.photo-card .photo-overlay h5 {
    margin: 0 0 2px;
    font-weight: 700;
    font-size: 1.05rem;
}

.photo-card .photo-overlay small { opacity: 0.9; }

/* ========== 时间线 ========== */
.timeline {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding-left: 10px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-color);
}

.timeline-item {
    position: relative;
    padding: 0 0 2.2rem 60px;
}

.timeline-item .dot {
    position: absolute;
    left: 10px;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    box-shadow: 0 0 0 4px rgba(224,122,95,0.2);
}

.timeline-item .tl-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow-sm);
}

.timeline-item .tl-date {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.88rem;
}

.timeline-item h4 {
    color: var(--dark-color);
    margin: 0.3rem 0 0.4rem;
    font-weight: 700;
}

.timeline-item p { margin: 0; color: #6a6a6a; }

/* ========== 页头(非首页) ========== */
.page-header {
    background: var(--gradient-secondary);
    color: #fff;
    text-align: center;
    padding: 130px 0 60px;
}

.page-header h1 { font-weight: 800; margin-bottom: 0.6rem; }
.page-header p { opacity: 0.95; margin: 0; }

/* ========== 表单 ========== */
.form-control {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 2px solid #eee;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(224,122,95,0.15);
}

.form-label { font-weight: 600; color: var(--dark-color); }

/* ========== 寄语卡片 ========== */
.quote-card {
    background: #fff;
    border-left: 4px solid var(--secondary-color);
    border-radius: var(--radius-md);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.quote-card .q-name { font-weight: 700; color: var(--dark-color); }
.quote-card .q-relation { color: var(--secondary-color); font-size: 0.85rem; }

/* ========== 页脚 ========== */
.footer {
    background: var(--dark-color);
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 0;
}

.footer h5 { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.footer p { color: rgba(255,255,255,0.75); }

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a {
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    transition: var(--transition-normal);
}
.footer-links a:hover { color: var(--accent-color); }

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    margin-right: 10px;
    transition: var(--transition-normal);
}
.footer-social a:hover { background: var(--primary-color); transform: translateY(-3px); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 1rem;
    padding-top: 1rem;
    text-align: center;
    color: rgba(255,255,255,0.65);
}

/* ========== 返回顶部 ========== */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 999;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: #d16849; color: #fff; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .hero { padding: 120px 0 50px; }
    .hero h1 { font-size: 2.1rem; }
    .hero p { font-size: 1.05rem; }
    section { padding: 50px 0; }
    .page-header { padding: 110px 0 45px; }
    .footer h5 { margin-top: 1rem; }
}
