/* 家庭相册 — 橙粉渐变主题，响应式 */

:root {
    --c-coral: #ff7b6b;
    --c-peach: #ffb89a;
    --c-apricot: #ffd4a8;
    --c-rose: #ff8fb8;
    --c-magenta: #e85d9a;
    --c-deep: #3d2a34;
    --c-text: #4a3540;
    --c-muted: #8a6f7a;
    --c-card: rgba(255, 255, 255, 0.92);
    --c-line: rgba(232, 93, 154, 0.2);
    --shadow: 0 12px 40px rgba(232, 93, 154, 0.18);
    --radius: 18px;
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.family-site {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--c-text);
    background: linear-gradient(145deg, #fff5f0 0%, #ffe8f2 35%, #fff0e8 70%, #ffeef5 100%);
    background-attachment: fixed;
}

.site-top {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(90deg, rgba(255, 123, 107, 0.95), rgba(255, 143, 184, 0.95));
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 24px rgba(232, 93, 154, 0.25);
}

.top-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.main-nav {
    display: flex;
    gap: 0.35rem;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.user-name {
    color: #fff;
    font-size: 0.88rem;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-primary {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    background: linear-gradient(135deg, var(--c-coral), var(--c-magenta));
    color: #fff !important;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.btn-primary.small {
    padding: 0.4rem 0.95rem;
    font-size: 0.9rem;
}

.btn-text {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    font-size: 1.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    cursor: pointer;
}

.hero-banner {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    margin-top: 0.5rem;
}

.hero-img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
    box-shadow: var(--shadow);
}

.hero-placeholder {
    width: 100%;
    height: 180px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, var(--c-peach), var(--c-rose), var(--c-apricot));
    box-shadow: var(--shadow);
}

.hero-gradient {
    display: none;
}

.layout-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 4.5rem;
}

.side-card {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--c-line);
}

.side-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--c-magenta);
}

.side-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-links a {
    display: block;
    padding: 0.4rem 0;
    color: var(--c-text);
    text-decoration: none;
    border-bottom: 1px dashed var(--c-line);
}

.side-links li:last-child a {
    border-bottom: none;
}

.side-links a:hover {
    color: var(--c-magenta);
}

.back-top {
    width: 100%;
    margin-top: 1rem;
    padding: 0.65rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--c-rose), var(--c-magenta));
    box-shadow: 0 6px 20px rgba(232, 93, 154, 0.35);
}

.main-content {
    min-width: 0;
}

.page-title {
    margin: 0 0 1rem;
    font-size: 1.65rem;
    color: var(--c-deep);
    background: linear-gradient(90deg, var(--c-coral), var(--c-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.post-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    display: block;
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--c-line);
    box-shadow: 0 6px 24px rgba(255, 139, 168, 0.12);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.post-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: var(--c-deep);
}

.post-card .excerpt {
    margin: 0;
    color: var(--c-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.post-card .meta {
    margin-top: 0.65rem;
    font-size: 0.8rem;
    color: var(--c-rose);
}

.article-page {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    border: 1px solid var(--c-line);
    box-shadow: var(--shadow);
}

.article-page h1 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: var(--c-deep);
}

.article-body {
    line-height: 1.75;
    white-space: pre-wrap;
    margin-bottom: 1.5rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.gallery a,
.gallery img {
    display: block;
    width: 100%;
    border-radius: 12px;
    aspect-ratio: 1;
    object-fit: cover;
}

.upload-box {
    margin-top: 1.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(255, 184, 154, 0.25), rgba(255, 143, 184, 0.2));
    border: 1px dashed var(--c-rose);
}

.upload-box h3 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    color: var(--c-magenta);
}

.form-row {
    margin-bottom: 0.85rem;
}

.form-row label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--c-muted);
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row textarea,
.form-row select {
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--c-line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
}

.form-row textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 2px solid var(--c-rose);
    background: #fff;
    color: var(--c-magenta);
    cursor: pointer;
    font-weight: 600;
}

.login-panel {
    max-width: 420px;
    margin: 2rem auto;
    background: var(--c-card);
    padding: 2rem 1.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--c-line);
}

.login-panel h1 {
    margin: 0 0 0.25rem;
    text-align: center;
    color: var(--c-deep);
}

.login-panel .sub {
    text-align: center;
    color: var(--c-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-panel .sub a {
    color: var(--c-magenta);
}

.msg-error {
    background: rgba(255, 123, 107, 0.15);
    color: #c0392b;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.site-footer {
    margin-top: 2rem;
    background: linear-gradient(180deg, rgba(61, 42, 52, 0.94), #2d1f26);
    color: rgba(255, 255, 255, 0.85);
    padding: 2rem 1rem 1.5rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-section h4 {
    margin: 0 0 0.65rem;
    color: var(--c-peach);
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.9;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1rem;
    text-align: center;
    font-size: 0.82rem;
}

.footer-copyright p {
    margin: 0 0 0.5rem;
}

.footer-icp a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
}

.police-icon {
    vertical-align: middle;
    margin-right: 4px;
}

.rich-content,
.thread-body {
    line-height: 1.75;
    word-break: break-word;
}

.rich-content img,
.thread-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.rich-content table,
.thread-body table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.icp-separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

@media (max-width: 860px) {
    .layout-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        order: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        align-items: start;
    }

    .back-top {
        margin-top: 0;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        width: 100%;
        order: 10;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 12px;
        padding: 0.5rem;
    }

    .main-nav.is-open {
        display: flex;
    }

    .user-area {
        width: 100%;
        justify-content: flex-end;
        order: 5;
    }

    .top-inner {
        flex-wrap: wrap;
    }
}

@media (max-width: 520px) {
    .sidebar {
        grid-template-columns: 1fr;
    }

    .hero-img {
        max-height: 160px;
    }

    .page-title {
        font-size: 1.35rem;
    }
}
