:root {
    --bg: #f6f4ef;
    --text: #1f2d3d;
    --muted: #5f6b7a;
    --brand: #db8d67;
    --surface: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(246, 244, 239, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(31, 45, 61, 0.08);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.brand {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 22px;
}

.nav a {
    color: var(--muted);
}

.hero {
    min-height: 62vh;
    background-position: center;
    background-size: cover;
    display: grid;
    align-items: center;
}

.hero-inner {
    padding: 64px 0;
}

.hero-copy {
    max-width: 620px;
    color: #fff;
}

.eyebrow {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 12px;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    margin: 0;
}

.hero-copy h1 {
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.08;
    margin-bottom: 18px;
}

.sub {
    font-size: 18px;
    max-width: 560px;
    line-height: 1.65;
}

.section-gap {
    padding: 56px 0;
}

.featured-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    background: var(--surface);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 44px rgba(25, 31, 38, 0.08);
}

.featured-card img,
.post-card img,
.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    padding: 34px;
}

.chip {
    color: var(--brand);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.featured-content h2 {
    font-size: 42px;
    line-height: 1.2;
    margin-bottom: 14px;
}

.featured-content p {
    color: var(--muted);
    line-height: 1.7;
}

.read-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--brand);
    font-weight: 600;
}

.section-head {
    margin-bottom: 18px;
}

.section-head h2 {
    font-size: 40px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.post-card {
    background: var(--surface);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(25, 31, 38, 0.06);
}

.post-card img {
    height: 220px;
}

.post-card-body {
    padding: 20px;
}

.post-card h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.post-card p {
    color: var(--muted);
    line-height: 1.6;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.gallery-item {
    margin: 0;
    background: var(--surface);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(25, 31, 38, 0.06);
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.gallery-date {
    padding: 14px 16px;
    color: var(--muted);
    font-size: 14px;
}

.detail-hero {
    position: relative;
    height: 62vh;
}

.detail-hero .overlay {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: end;
    background: linear-gradient(180deg, rgba(10, 16, 22, 0.2), rgba(10, 16, 22, 0.72));
    color: #fff;
}

.detail-hero .container {
    padding-bottom: 42px;
}

.detail-hero h1 {
    font-size: clamp(34px, 6vw, 58px);
}

.detail-content {
    background: var(--surface);
    margin-top: -24px;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 16px 36px rgba(25, 31, 38, 0.08);
}

.lead {
    font-size: 20px;
    color: var(--text);
    margin-top: 0;
}

.body-text {
    color: #273444;
    line-height: 1.85;
}

.empty-hint {
    color: var(--muted);
}

.comments-block {
    padding-top: 12px;
}

.comment-form {
    background: var(--surface);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 12px 24px rgba(25, 31, 38, 0.06);
}

.comment-form label {
    display: block;
    margin: 8px 0;
    font-weight: 600;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    margin-bottom: 10px;
}

.comment-form button {
    border: 0;
    background: var(--brand);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.comment-list {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.comment-item {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 22px rgba(25, 31, 38, 0.05);
}

.comment-item p {
    margin-bottom: 0;
    line-height: 1.7;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.clip-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.clip-logout {
    color: var(--muted);
    font-weight: 600;
}

.clip-editor-form {
    background: var(--surface);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 12px 24px rgba(25, 31, 38, 0.06);
}

.clip-editor-form textarea {
    width: 100%;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    padding: 12px;
    font: inherit;
    margin-bottom: 12px;
    resize: vertical;
}

.about-wrap,
.private-message-wrap {
    padding-top: 30px;
}

.about-intro {
    margin-top: 0;
    color: var(--muted);
    font-size: 18px;
}

.about-content {
    background: var(--surface);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 12px 24px rgba(25, 31, 38, 0.06);
}

.flash-wrap {
    margin-top: 18px;
}

.flash-message {
    background: #e8f8ef;
    border: 1px solid #b9e9cb;
    color: #1f6d42;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
}

.site-footer {
    margin-top: 60px;
    padding: 28px 0 48px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 980px) {
    .featured-card {
        grid-template-columns: 1fr;
    }

    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .nav {
        display: none;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .featured-content h2,
    .section-head h2 {
        font-size: 32px;
    }
}

/* Family members — 400×300 nodes + SVG lines */
.family-page .family-lead {
    margin: 10px 0 0;
    color: var(--muted);
    max-width: 720px;
    line-height: 1.6;
}

.family-diagram {
    position: relative;
    margin-top: 12px;
    overflow: auto;
    max-height: 78vh;
    padding: 0 0 8px;
}

.family-lines-svg {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

.family-line {
    stroke-width: 2.25;
    stroke-linecap: round;
}

.family-line--spouse {
    stroke: #d40000;
    stroke-width: 4.25;
}

.family-line--child {
    stroke: #2f9d6b;
    stroke-width: 4;
}

.family-generations {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 16px 8px 32px;
}

.family-generation-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    gap: 40px 48px;
    padding: 32px 0;
    border-bottom: 1px solid rgba(31, 45, 61, 0.07);
    min-width: max-content;
}

.family-generation-row:last-child {
    border-bottom: none;
    padding-bottom: 8px;
}

.family-node-wrap {
    scroll-margin-top: 88px;
    flex: 0 0 auto;
}

/* 固定比例 300:300；不自动缩小，超出容器通过滚动查看 */
.family-node {
    box-sizing: border-box;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(31, 45, 61, 0.1);
    box-shadow: 0 14px 36px rgba(25, 31, 38, 0.1);
}

.family-node-photo {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e6e2;
    padding: 8px;
    box-sizing: border-box;
}

.family-node-photo img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.family-node-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(145deg, rgba(219, 141, 103, 0.28), rgba(31, 45, 61, 0.1));
}

.family-node-name {
    flex: 0 0 auto;
    min-height: 52px;
    max-height: 72px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    border-top: 1px solid rgba(31, 45, 61, 0.08);
}

.family-node-name-text {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    word-break: break-word;
}

.family-node-name-id {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.family-node-details {
    margin-top: 10px;
    max-width: 300px;
    font-size: 13px;
    color: var(--muted);
}

.family-node-details summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 600;
}

.family-node-details-body {
    margin-top: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 10px;
    border: 1px solid rgba(31, 45, 61, 0.06);
    line-height: 1.55;
}

.family-node-details-body p {
    margin: 0 0 8px;
}

.family-node-details-body p:last-child {
    margin-bottom: 0;
}

.family-node-details-body a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.family-mini-meta {
    color: var(--text);
    font-weight: 500;
}

.family-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.family-legend-swatch {
    display: inline-block;
    width: 28px;
    height: 3px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

.family-legend-swatch--spouse {
    background: #d40000;
    height: 5px;
}

.family-legend-swatch--child {
    background: #2f9d6b;
}
