/*
Theme Name: Zimu Timeline (CN Optimized)
Theme URI: https://liuqian.de
Author: AI Assistant
Author URI: https://liuqian.de
Description: 柔和现代的时间线主题，去外部前端 CDN，适配中国大陆网络环境。
Version: 1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zimu-timeline
*/

:root {
    --bg-page: #f2f5f7;
    --bg-card: #ffffffcc;
    --text-main: #25313e;
    --text-muted: #6d7c8e;
    --line-soft: #d8e0e7;
    --brand: #6f90ad;
    --brand-deep: #547591;
    --shadow-soft: 0 12px 30px -18px rgba(61, 89, 112, 0.38);
    --radius-lg: 22px;
    --radius-md: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

.zimu-body {
    font-family: "LXGW WenKai", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 15% 20%, #d7e5f033 0, transparent 32%),
        radial-gradient(circle at 85% 12%, #f5d8d333 0, transparent 30%),
        var(--bg-page);
    line-height: 1.75;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, 100% - 2.4rem);
    margin-inline: auto;
}

.hero {
    position: relative;
    min-height: 62vh;
    overflow: hidden;
    color: #edf5fb;
    background: linear-gradient(150deg, #5b7f9e 0%, #3f5f77 55%, #2f4558 100%);
}

.hero-bg-image,
.hero-gradient,
.hero-noise {
    position: absolute;
    inset: 0;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    transform: scale(1.03);
    animation: heroFloat 18s ease-in-out infinite;
}

.hero-gradient {
    background:
        linear-gradient(to bottom, rgba(16, 31, 46, 0.15), rgba(16, 31, 46, 0.72)),
        radial-gradient(circle at 30% 20%, rgba(201, 227, 245, 0.28), transparent 40%);
}

.hero-noise {
    opacity: 0.08;
    background-image: linear-gradient(135deg, #ffffff 1px, transparent 1px);
    background-size: 4px 4px;
}

.hero-inner {
    position: relative;
    z-index: 2;
    min-height: 62vh;
    padding: 6.5rem 0 4.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-avatar-wrap {
    margin-bottom: 1.2rem;
}

.hero-avatar {
    width: 124px;
    height: 124px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.46);
    box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.56);
}

.hero-title {
    margin: 0;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.6rem);
    letter-spacing: 0.02em;
}

.hero-title a {
    transition: opacity 0.25s ease;
}

.hero-title a:hover {
    opacity: 0.88;
}

.hero-subtitle {
    max-width: 760px;
    margin-top: 0.8rem;
    margin-bottom: 0;
    color: #dce7f2;
    font-size: clamp(1.02rem, 2.2vw, 1.32rem);
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
    background: rgba(245, 248, 251, 0.9);
    border-bottom: 1px solid #d6e0e8;
}

.nav-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-link {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2b4156;
}

.desktop-nav {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 1.2rem;
}

.menu-list a,
.menu-link {
    color: #41566b;
    font-size: 0.95rem;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    transition: all 0.22s ease;
}

.menu-list a:hover,
.menu-link:hover {
    background: #e8f0f6;
    color: #2d4760;
}

.menu-link-muted {
    color: #7f90a1;
}

.mobile-nav-btn {
    border: 0;
    width: 40px;
    height: 40px;
    display: none;
    background: #eaf1f6;
    border-radius: 11px;
    cursor: pointer;
    padding: 8px;
}

.mobile-nav-btn span {
    display: block;
    height: 2px;
    background: #385269;
    margin: 5px 0;
}

.mobile-nav-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
    border-top: 1px solid transparent;
    background: rgba(247, 250, 252, 0.95);
}

.mobile-nav-panel.is-open {
    max-height: 260px;
    border-top-color: #d7e1ea;
}

.mobile-nav-inner {
    padding: 0.75rem 0 1rem;
}

.mobile-menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-menu-list li + li {
    margin-top: 0.35rem;
}

.mobile-menu-list a,
.mobile-menu-link {
    display: block;
    padding: 0.7rem 0.4rem;
    color: #40566c;
}

.main-content {
    padding: 2.6rem 0 1.4rem;
}

.single-main {
    padding: 2.1rem 0 1.8rem;
}

.single-article {
    background: var(--bg-card);
    border: 1px solid #dce6ee;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.3rem 1.3rem 1.6rem;
}

.single-header {
    border-bottom: 1px solid #d8e2ea;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
}

.single-kicker {
    margin: 0;
    font-size: 0.86rem;
    color: #6c7d8f;
}

.single-title {
    margin: 0.35rem 0 0.4rem;
    font-size: clamp(1.62rem, 2.8vw, 2.2rem);
    line-height: 1.35;
    color: #22364a;
}

.single-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: #637587;
    font-size: 0.9rem;
}

.single-cover-wrap {
    margin: 1rem 0 1.2rem;
}

.single-cover-image {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: var(--radius-md);
    display: block;
}

.single-content {
    color: #2e4256;
    font-size: 1rem;
}

.single-content > *:first-child {
    margin-top: 0;
}

.single-content a {
    color: var(--brand-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.single-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 10px;
}

.single-content figure,
.single-content .wp-block-image,
.single-content .wp-caption,
.single-content .alignnone,
.single-content .aligncenter,
.single-content .alignleft,
.single-content .alignright {
    max-width: 100% !important;
}

.single-content .wp-caption,
.single-content .wp-block-image {
    margin-left: 0;
    margin-right: 0;
}

.single-content .wp-caption img,
.single-content .wp-block-image img,
.single-content p > img {
    width: auto;
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

.single-content h2,
.single-content h3,
.single-content h4 {
    color: #274058;
    line-height: 1.45;
}

.single-content blockquote {
    margin: 1rem 0;
    padding: 0.65rem 1rem;
    border-left: 3px solid #b8cad8;
    background: #f3f8fc;
    color: #4f6378;
}

.single-content pre {
    overflow-x: auto;
    background: #1f2d3a;
    color: #e3edf6;
    border-radius: 10px;
    padding: 0.9rem;
}

.single-page-links {
    margin-top: 1.1rem;
    color: #617486;
}

.single-footer {
    margin-top: 1.2rem;
    border-top: 1px solid #d8e2ea;
    padding-top: 1rem;
}

.single-tags a {
    display: inline-block;
    margin-right: 0.4rem;
    margin-bottom: 0.35rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    background: #ebf3f9;
    color: #4a637b;
    font-size: 0.82rem;
}

.single-nav {
    margin-top: 0.9rem;
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
}

.single-nav-prev,
.single-nav-next {
    flex: 1 1 0;
    min-width: 0;
}

.single-nav-prev a,
.single-nav-next a {
    display: block;
    border: 1px solid #d5e1ea;
    background: #f7fafd;
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.single-nav a {
    color: #3b5873;
}

.single-nav-next {
    text-align: right;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 4px;
    width: 2px;
    height: calc(100% - 48px);
    background:
        linear-gradient(to bottom, #d2dce5, #d2dce599 80%, transparent);
}

.timeline-item {
    --accent-color: var(--brand);
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item-left {
    flex-direction: row;
}

.timeline-item-right {
    flex-direction: row-reverse;
}

.timeline-spacer,
.timeline-card {
    width: calc(50% - 2.4rem);
}

.timeline-dot {
    width: 58px;
    min-width: 58px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10px;
    position: relative;
    z-index: 2;
}

.timeline-dot span {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.79rem;
    font-weight: 700;
    box-shadow: 0 8px 18px -10px rgba(44, 66, 84, 0.55);
    border: 2px solid #f2f5f7;
}

.timeline-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid #dce6ee;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 36px -20px rgba(49, 76, 98, 0.45);
}

.timeline-cover {
    display: block;
    background: #d9e5ef;
    min-height: 200px;
    max-height: 300px;
    overflow: hidden;
}

.timeline-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s ease;
}

.timeline-card:hover .timeline-cover-image {
    transform: scale(1.04);
}

.timeline-card-body {
    padding: 1.15rem 1.25rem 1.35rem;
}

.timeline-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.timeline-date {
    padding: 0.22rem 0.62rem;
    border-radius: 999px;
    background: #edf3f8;
    color: #4f687f;
    font-size: 0.77rem;
    font-weight: 700;
}

.timeline-age {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.timeline-title {
    margin: 0 0 0.6rem;
    font-size: clamp(1.16rem, 2vw, 1.42rem);
    line-height: 1.45;
}

.timeline-title a {
    transition: color 0.2s ease;
}

.timeline-title a:hover {
    color: var(--brand-deep);
}

.timeline-excerpt {
    font-size: 0.95rem;
    color: #4b5f72;
}

.timeline-excerpt p {
    margin: 0;
}

.timeline-readmore {
    margin-top: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--brand-deep);
    font-weight: 700;
    font-size: 0.9rem;
}

.timeline-readmore span {
    transition: transform 0.2s ease;
}

.timeline-readmore:hover span {
    transform: translateX(3px);
}

.pagination-wrap {
    margin-top: 1.1rem;
    padding: 1rem 0;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.nav-links .page-numbers {
    min-width: 2.3rem;
    padding: 0.44rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #cfdae4;
    background: #fff;
    color: #43586d;
    text-align: center;
    font-size: 0.9rem;
}

.nav-links .current {
    background: #dce9f3;
    border-color: #bed0df;
    color: #2e455b;
    font-weight: 700;
}

.empty-state {
    margin: 1.6rem auto;
    padding: 2rem;
    text-align: center;
    border-radius: var(--radius-md);
    border: 1px solid #d6e1ea;
    background: #f7fafc;
    color: #5f7183;
}

.site-footer {
    margin-top: 2rem;
    padding: 2.2rem 0;
    background: linear-gradient(120deg, #f0f5f8, #e8eff4);
    border-top: 1px solid #d4dfe8;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-title {
    margin: 0;
    color: #2f4458;
    font-weight: 700;
}

.footer-subtitle {
    margin: 0.35rem 0 0;
    color: #6c7c8d;
    font-size: 0.88rem;
}

.beian-link {
    color: #607487;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.beian-link:hover {
    color: #41596f;
}

.footer-links {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.footer-links a {
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    border: 1px solid #cfdae4;
    color: #41576c;
    font-size: 0.88rem;
}

.footer-links a:hover {
    background: #dfeaf3;
}

@keyframes heroFloat {
    0%,
    100% {
        transform: scale(1.03) translateY(0);
    }
    50% {
        transform: scale(1.06) translateY(-6px);
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 54vh;
    }

    .hero-inner {
        min-height: 54vh;
        padding: 5.8rem 0 3.5rem;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-nav-btn {
        display: inline-block;
    }

    .timeline::before {
        left: 27px;
        transform: none;
    }

    .timeline-item,
    .timeline-item-left,
    .timeline-item-right {
        flex-direction: row;
        gap: 0.7rem;
    }

    .timeline-spacer {
        display: none;
    }

    .timeline-dot {
        width: 54px;
        min-width: 54px;
        justify-content: flex-start;
    }

    .timeline-card {
        width: calc(100% - 54px);
    }

    .timeline-cover {
        min-height: 180px;
    }

    .single-article {
        padding: 1rem;
    }

    .single-content .wp-caption,
    .single-content .wp-block-image,
    .single-content .alignnone,
    .single-content .aligncenter,
    .single-content .alignleft,
    .single-content .alignright {
        width: 100% !important;
        max-width: 100% !important;
    }

    .single-content img {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }

    .single-nav {
        flex-wrap: wrap;
    }

    .single-nav-prev,
    .single-nav-next {
        flex: 1 1 100%;
        text-align: left;
    }

    .footer-inner {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .container {
        width: min(1120px, 100% - 1.4rem);
    }

    .hero-avatar {
        width: 102px;
        height: 102px;
    }

    .timeline-card-body {
        padding: 1rem 1rem 1.2rem;
    }

    .timeline::before {
        left: 24px;
    }
}
