:root {
    --bg: #fff7e8;
    --paper: #fffdf8;
    --ink: #2d2a32;
    --muted: #746b7c;
    --line: #eadcc9;
    --accent: #ff9fb2;
    --accent-2: #7bdff2;
    --accent-3: #f6d365;
    --danger: #ff6b6b;
    --shadow: 0 16px 40px rgba(78, 54, 36, .12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
            radial-gradient(circle at 8% 12%, rgba(255, 159, 178, .18), transparent 26%),
            radial-gradient(circle at 88% 6%, rgba(123, 223, 242, .20), transparent 24%),
            linear-gradient(180deg, #fff7e8 0%, #fffdf8 100%);
    min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px clamp(18px, 5vw, 76px);
    backdrop-filter: blur(18px);
    background: rgba(255, 247, 232, .78);
    border-bottom: 2px solid rgba(234, 220, 201, .62);
}

.brand {
    font-weight: 900;
    font-size: 1.18rem;
    letter-spacing: .03em;
}

.site-header nav {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.site-header nav a, .link-button {
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,.58);
    border: 1px solid rgba(234, 220, 201, .75);
    font-weight: 700;
}

.link-button {
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.narrow { width: min(860px, calc(100% - 32px)); }
.wide-container { width: min(1280px, calc(100% - 32px)); }


.top-timeline {
    margin: 24px 0 30px;
    padding: 14px 16px 16px;
    border: 2px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 253, 248, .86);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.timeline-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--muted);
    font-weight: 900;
}

.timeline-heading strong {
    color: var(--ink);
    font-size: 1.05rem;
}

.timeline-track {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 1fr);
    gap: 0;
    overflow-x: auto;
    padding: 18px 4px 4px;
    scrollbar-width: thin;
}

.timeline-track::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 25px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2));
}

.timeline-dot {
    position: relative;
    min-height: 76px;
    padding: 20px 8px 0;
    text-align: center;
}

.timeline-dot .dot {
    position: absolute;
    top: 0;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translateX(-50%);
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
    box-shadow: 3px 3px 0 var(--accent);
    z-index: 1;
}

.timeline-dot time {
    display: block;
    margin-bottom: 4px;
    color: #d86f82;
    font-weight: 900;
    font-size: .8rem;
}

.timeline-dot em {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--ink);
    font-style: normal;
    font-weight: 800;
    line-height: 1.3;
    font-size: .9rem;
}

.timeline-dot:hover em { color: #d86f82; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
    gap: 24px;
    align-items: center;
    padding: clamp(26px, 5vw, 52px);
    border: 3px solid var(--ink);
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255, 242, 222, .92));
    box-shadow: var(--shadow), 6px 6px 0 #2d2a32;
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: "✦ ✧ ✦";
    position: absolute;
    right: 28px;
    top: 24px;
    color: var(--accent);
    font-size: 1.6rem;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .18em;
    font-weight: 900;
    font-size: .78rem;
}

.hero h1, .page-title h1, .article-card h1, .admin-top h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.12;
    letter-spacing: 0;
}

.hero p, .page-title p, .summary { color: var(--muted); line-height: 1.8; }

.hero-card, .post-card, .article-card, .comments-card, .login-card, .admin-table-wrap, .admin-comment, .empty-state {
    background: var(--paper);
    border: 2px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 24px;
    text-align: center;
    border-color: var(--ink);
    box-shadow: 6px 6px 0 var(--accent-2);
}

.mascot { font-size: 4.5rem; margin-bottom: 12px; }

.button, .small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    font-weight: 900;
    padding: 12px 20px;
    box-shadow: 4px 4px 0 var(--accent);
}

.button:hover, .small-button:hover { transform: translateY(-1px); }
.button.wide { width: 100%; }

.small-button {
    padding: 8px 13px;
    font-size: .9rem;
    box-shadow: 3px 3px 0 var(--accent-3);
}

.small-button.danger { background: var(--danger); box-shadow: 3px 3px 0 #ffd2d2; }

.section-title, .admin-top, .page-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin: 34px 0 18px;
}

.section-title h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2rem); }
.section-title span { color: var(--muted); font-weight: 800; }

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.post-card {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.post-card:hover { transform: translateY(-4px) rotate(-.3deg); }

.cover {
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(118px, 13vw, 150px);
    background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.card-body {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    padding: 15px 18px 18px;
}
.post-date { color: var(--muted); font-size: .88rem; font-weight: 800; }
.post-card h3 {
    font-size: 1.08rem;
    line-height: 1.35;
    margin: 6px 0 8px;
}
.post-card p {
    color: var(--muted);
    line-height: 1.55;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.read-more { color: #d86f82; font-weight: 900; }

.page-title { display: block; text-align: center; }
.page-title h1 { font-size: clamp(2rem, 5vw, 3.8rem); }

.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(var(--accent), var(--accent-2));
}

.timeline-year h2 { font-size: 2.2rem; margin: 28px 0 12px; }
.timeline-item {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 18px;
    margin: 14px 0;
    padding: 18px;
    background: rgba(255,255,255,.75);
    border: 2px dashed var(--line);
    border-radius: 22px;
}
.timeline-item time { font-weight: 900; color: #d86f82; }
.timeline-item h3 { margin: 0 0 8px; }
.timeline-item p { margin: 0; color: var(--muted); }

.article-card { padding: clamp(20px, 4vw, 42px); }
.article-cover {
    width: 100%;
    height: clamp(180px, 34vw, 320px);
    object-fit: contain;
    background: linear-gradient(135deg, rgba(123, 223, 242, .2), rgba(246, 211, 101, .18));
    border-radius: 18px;
    margin-bottom: 20px;
    border: 2px solid var(--line);
}
.article-card h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.18;
}

.markdown-body {
    margin-top: 28px;
    font-size: 1.05rem;
    line-height: 1.9;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.5em;
    margin-bottom: .55em;
    line-height: 1.3;
    letter-spacing: 0;
}
.markdown-body h1 { font-size: 1.8rem; }
.markdown-body h2 { font-size: 1.45rem; }
.markdown-body h3 { font-size: 1.22rem; }
.markdown-body p { margin: 1em 0; }
.markdown-body a { color: #d86f82; font-weight: 800; text-decoration: underline; }
.markdown-body img { border-radius: 20px; border: 2px solid var(--line); box-shadow: var(--shadow); margin: 18px auto; }
.markdown-body blockquote { margin: 20px 0; padding: 14px 18px; background: #fff4c9; border-left: 6px solid var(--accent-3); border-radius: 14px; }
.markdown-body code { background: #f4ecdf; padding: 2px 6px; border-radius: 7px; }
.markdown-body pre { overflow-x: auto; padding: 18px; border-radius: 18px; background: #2d2a32; color: white; }
.markdown-body pre code { background: transparent; padding: 0; }

.comments-card { padding: 28px; margin-top: 24px; }
.hint { color: var(--muted); font-size: .92rem; }
.comment-form label, .editor-form label, .login-card label { display: block; font-weight: 800; margin: 14px 0; }
input, textarea {
    width: 100%;
    margin-top: 7px;
    padding: 13px 14px;
    border-radius: 18px;
    border: 2px solid var(--line);
    background: white;
    color: var(--ink);
    font: inherit;
    outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 159, 178, .18); }
.form-row { display: grid; gap: 18px; }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkbox-label { display: flex !important; gap: 10px; align-items: center; }
.checkbox-label input { width: auto; margin: 0; }
.field-error { display: block; margin-top: 6px; color: var(--danger); font-size: .85rem; }

.comment-list { margin-top: 24px; display: grid; gap: 14px; }
.comment { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 16px; border-radius: 22px; background: #fff7e8; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: white; border: 2px solid var(--line); }
.comment p { margin: 6px 0 0; color: var(--muted); line-height: 1.7; }

.alert { padding: 12px 16px; border-radius: 18px; margin: 14px 0; font-weight: 800; }
.alert.success { background: #e4f9e8; color: #237a3b; }
.alert.danger { background: #ffe2e2; color: #ad2e2e; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 34px; text-align: center; }
.login-card h1 { margin: 0; }
.login-card p { color: var(--muted); }

.admin-container { padding-top: 32px; }
.admin-header { background: rgba(255, 253, 248, .86); }
.inline-form, .actions form { display: inline; margin: 0; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th, .admin-table td { padding: 16px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { color: var(--muted); font-size: .9rem; }
.badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-weight: 900; font-size: .82rem; background: #eee; }
.badge.ok { background: #e4f9e8; color: #237a3b; }
.badge.muted { background: #eee8df; color: var(--muted); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.empty-cell { text-align: center !important; color: var(--muted); }
.editor-form { background: var(--paper); border: 2px solid var(--line); border-radius: 28px; padding: 24px; box-shadow: var(--shadow); }
.editor-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.EasyMDEContainer { margin-top: 7px; }
.EasyMDEContainer .CodeMirror, .editor-toolbar { border-color: var(--line); }
.EasyMDEContainer .CodeMirror { border-radius: 0 0 18px 18px; }
.editor-toolbar { border-radius: 18px 18px 0 0; background: #fffaf0; }

.comment-admin-list { display: grid; gap: 16px; }
.admin-comment { padding: 18px; display: flex; justify-content: space-between; gap: 18px; }
.admin-comment p { margin: 6px 0; }

.empty-state { text-align: center; padding: 44px 24px; }
.empty-state div { font-size: 4rem; }
.site-footer {
    color: var(--muted);
    padding: 26px 16px 36px;
    border-top: 1px solid rgba(234, 220, 201, .7);
}

.footer-info {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px 18px;
    flex-wrap: wrap;
    text-align: center;
    font-weight: 800;
}

.footer-info strong { color: var(--ink); }

@media (max-width: 760px) {
    .site-header { position: static; align-items: flex-start; flex-direction: column; gap: 12px; }
    .hero {
        grid-template-columns: 1fr;
        border-radius: 22px;
        box-shadow: var(--shadow), 5px 5px 0 #2d2a32;
    }
    .hero-card { text-align: left; }
    .form-row.two { grid-template-columns: 1fr; }
    .section-title, .admin-top { align-items: flex-start; flex-direction: column; }
    .timeline-item { grid-template-columns: 1fr; }
    .admin-comment { flex-direction: column; }
    .post-grid { grid-template-columns: 1fr; }
    .cover { height: 132px; }
    .footer-info { justify-content: flex-start; text-align: left; }
}


@media (max-width: 720px) {
    .timeline-track {
        grid-auto-columns: minmax(170px, 72vw);
    }
}
