:root {
    --canvas: #cfc3a1;
    --paper: rgba(245, 240, 223, 0.96);
    --paper-solid: #fffdf4;
    --ink: #39372f;
    --muted: #746f60;
    --line: #b7aa83;
    --pink: #6f7350;
    --pink-soft: #e8dfc5;
    --pink-deep: #4d5238;
    --accent-dark: #4d5238;
    --blue: #9a6548;
    --blue-soft: #eee6cf;
    --yellow: #d2c49c;
    --shadow: rgba(75, 65, 41, 0.14);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    background: var(--canvas);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle, rgba(87, 78, 53, 0.14) 1px, transparent 1.5px) 0 0 / 18px 18px,
        linear-gradient(180deg, #f5f0df 0, #e8dfc5 300px);
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    font-size: 14px;
    line-height: 1.75;
}

a {
    color: var(--pink-deep);
    text-decoration: none;
}

a:hover {
    color: var(--pink);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    height: 58px;
    border-bottom: 1px solid rgba(135, 124, 91, 0.8);
    background: rgba(245, 240, 223, 0.93);
    box-shadow: 0 2px 12px rgba(75, 65, 41, 0.08);
    backdrop-filter: blur(12px);
}

.topbar-inner {
    width: min(1020px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.15;
}

.brand:hover {
    color: var(--ink);
}

.brand small {
    display: block;
    margin-top: 3px;
    color: #8d8777;
    font-family: Verdana, sans-serif;
    font-size: 8px;
    font-weight: normal;
    letter-spacing: 0.22em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #5f6344;
    border-radius: 10px 10px 10px 3px;
    color: #fff;
    background: linear-gradient(145deg, #858968, #626649);
    box-shadow: 2px 3px 0 #d2c49c;
    font-family: "SimSun", serif;
    font-size: 19px;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.top-links a {
    padding: 6px 11px;
    border-radius: 15px;
    color: var(--muted);
}

.top-links a:hover,
.top-links a.active {
    color: var(--pink-deep);
    background: var(--pink-soft);
}

.page-shell {
    width: min(1020px, calc(100% - 32px));
    margin: 22px auto 54px;
}

.profile-card {
    overflow: hidden;
    border: 1px solid #948967;
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 8px 28px var(--shadow);
}

.cover {
    position: relative;
    height: 224px;
    overflow: hidden;
    background:
        linear-gradient(0deg, rgba(40, 39, 30, 0.34), transparent 52%),
        radial-gradient(circle at 16% 22%, rgba(255,255,255,.8) 0 18px, transparent 19px),
        radial-gradient(circle at 20% 22%, rgba(255,255,255,.72) 0 28px, transparent 29px),
        radial-gradient(circle at 82% 29%, rgba(255,255,255,.65) 0 22px, transparent 23px),
        linear-gradient(135deg, #adb08a 0%, #7f8461 55%, #555a43 100%);
    background-position: center;
    background-size: cover;
}

.cover::before {
    content: "";
    position: absolute;
    top: -75px;
    right: -35px;
    width: 270px;
    height: 270px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(255,255,255,.08), 0 0 0 58px rgba(255,255,255,.06);
}

.cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 28px 100%;
    pointer-events: none;
}

.cover-note {
    position: absolute;
    z-index: 1;
    top: 20px;
    right: 24px;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 12px;
    color: rgba(83, 86, 99, 0.68);
    background: rgba(255,255,255,.45);
    font-family: Verdana, sans-serif;
    font-size: 9px;
    letter-spacing: .12em;
}

.identity {
    position: absolute;
    z-index: 2;
    left: 28px;
    bottom: 23px;
    display: flex;
    align-items: flex-end;
    gap: 17px;
    color: white;
    text-shadow: 0 1px 4px rgba(72, 63, 69, 0.35);
}

.avatar,
.avatar-placeholder {
    width: 98px;
    height: 98px;
    flex: 0 0 auto;
    border: 4px solid rgba(255,255,255,.93);
    border-radius: 50%;
    background: #77795d;
    object-fit: cover;
    box-shadow: 0 3px 12px rgba(84, 62, 70, 0.2);
}

.avatar-placeholder {
    display: grid;
    place-items: center;
    font-family: "SimSun", serif;
    font-size: 38px;
}

.identity h1 {
    margin: 2px 0 0;
    font-size: 25px;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.identity p {
    max-width: 600px;
    margin: 2px 0 5px;
    color: rgba(255,255,255,.95);
    font-size: 12px;
}

.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 9px;
    color: #6d6870;
    background: rgba(255,255,255,.8);
    text-shadow: none;
    font-family: Verdana, sans-serif;
    font-size: 8px;
    letter-spacing: .08em;
}

.online-badge i,
.status-dot {
    width: 6px;
    height: 6px;
    display: inline-block;
    border-radius: 50%;
    background: #85c79b;
    box-shadow: 0 0 0 2px rgba(133,199,155,.2);
}

.status-dot {
    margin-right: 7px;
    vertical-align: 1px;
}

.profile-nav {
    height: 51px;
    padding-left: 26px;
    display: flex;
    align-items: stretch;
    gap: 4px;
    background: rgba(255,255,255,.98);
}

.tab-button {
    min-width: 78px;
    padding: 0 17px;
    border: 0;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
}

.tab-button:hover,
.tab-button.active {
    color: var(--pink-deep);
    border-bottom-color: var(--pink);
}

.content-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 18px;
    align-items: start;
}

.feed-heading {
    min-height: 50px;
    margin-bottom: 10px;
    padding: 0 4px;
    display: flex;
    align-items: end;
    justify-content: space-between;
}

.feed-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 19px;
    line-height: 1.4;
}

.eyebrow {
    color: var(--pink);
    font-family: Verdana, sans-serif;
    font-size: 8px;
    letter-spacing: .16em;
}

.feed-heading-note {
    color: var(--muted);
    font-family: "SimSun", serif;
    font-size: 12px;
}

.panel,
.feed-item,
.article-paper,
.admin-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 3px 14px var(--shadow);
}

.section-heading {
    margin: 0;
    padding: 10px 13px 9px;
    border-bottom: 1px solid var(--line);
    color: var(--accent-dark);
    background: linear-gradient(90deg, var(--pink-soft), rgba(245,240,223,.75));
    font-size: 13px;
}

.section-heading::before {
    content: "◆";
    margin-right: 7px;
    color: var(--pink);
    font-size: 8px;
}

.feed {
    display: grid;
    gap: 11px;
}

.feed-item {
    position: relative;
    overflow: hidden;
    padding: 16px 18px 14px 20px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.feed-item::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: linear-gradient(var(--pink), #a9aa83);
}

.feed-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 22px rgba(86, 68, 75, 0.11);
}

.feed-meta {
    margin-bottom: 7px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 11px;
}

.tag {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid #a99b73;
    border-radius: 10px;
    color: var(--pink-deep);
    background: var(--pink-soft);
    line-height: 1.55;
}

.feed-title {
    margin: 3px 0 8px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.5;
}

.feed-title a {
    color: inherit;
}

.feed-title a:hover {
    color: var(--pink-deep);
}

.feed-content {
    margin: 0;
    color: #514e43;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.post-media-image,
.article-media-image,
.article-media-video {
    width: 100%;
    display: block;
    margin-top: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #171717;
}

.post-media-image,
.article-media-image {
    max-height: 620px;
    object-fit: contain;
}

.article-media-video {
    max-height: 72vh;
}

.media-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: #eee6d0;
    font-size: 11px;
}

.feed-content.clamped {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.feed-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #c8bd9c;
    color: var(--muted);
    font-size: 11px;
}

.sidebar {
    display: grid;
    gap: 12px;
}

.panel {
    overflow: hidden;
}

.panel-body {
    padding: 12px 13px;
}

.profile-facts {
    margin: 0;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 7px;
    font-size: 12px;
}

.profile-facts dt {
    color: var(--muted);
}

.profile-facts dd {
    margin: 0;
}

.mini-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.mini-links button {
    padding: 5px 4px;
    border: 1px solid #c8bd9c;
    border-radius: 6px;
    color: var(--muted);
    background: #eee6d0;
    font-size: 11px;
}

.mini-links button:first-child {
    grid-column: 1 / -1;
}

.mini-links button:hover {
    border-color: #8d916c;
    color: var(--pink-deep);
    background: var(--pink-soft);
}

.notice {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.8;
}

.signature-panel {
    position: relative;
}

.signature-text {
    position: relative;
    margin: 0;
    padding: 14px 16px 14px 31px;
    color: #5d5a4f;
    font-family: "Songti SC", "SimSun", serif;
    font-size: 12px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.signature-text::before {
    content: "“";
    position: absolute;
    top: 8px;
    left: 12px;
    color: #9a6548;
    font-size: 26px;
    line-height: 1;
}

.empty-state,
.loading-state {
    padding: 42px 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(245,240,223,.75);
    text-align: center;
}

.empty-state::before,
.loading-state::before {
    content: "◇";
    display: block;
    margin-bottom: 5px;
    color: var(--rust, #9a6548);
}

.site-footer {
    padding: 22px 20px 30px;
    color: #6d6859;
    text-align: center;
    font-family: "SimSun", serif;
    font-size: 11px;
}

.site-footer span {
    color: var(--accent-dark);
    font-family: "Microsoft YaHei", sans-serif;
    font-weight: bold;
    letter-spacing: .12em;
}

.site-footer p {
    margin: 4px 0 0;
}

.article-shell {
    width: min(800px, calc(100% - 32px));
    margin: 24px auto 46px;
}

.back-link {
    display: inline-block;
    margin: 0 0 11px 3px;
    color: var(--muted);
    font-size: 12px;
}

.article-paper {
    position: relative;
    overflow: hidden;
    padding: 38px 44px 48px;
}

.article-paper::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--pink), #b7aa83 55%, #9a6548);
}

.article-title {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 27px;
    line-height: 1.45;
}

.article-meta {
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--line);
    color: var(--muted);
    font-size: 11px;
}

.article-content {
    margin-top: 25px;
    color: var(--ink);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: "Songti SC", "SimSun", serif;
    font-size: 16px;
    line-height: 2;
}

.button {
    min-height: 35px;
    padding: 5px 15px;
    border: 1px solid #777a56;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(#7f8461, #666b4b);
    box-shadow: 0 2px 4px rgba(75,65,41,.14);
}

.button:hover {
    background: var(--pink-deep);
}

.button.secondary {
    border-color: var(--line);
    color: var(--ink);
    background: #e5dcc0;
    box-shadow: none;
}

.button.danger {
    border-color: #c96969;
    background: #d87979;
}

.button.small {
    min-height: 28px;
    padding: 2px 10px;
    font-size: 11px;
}

.field {
    display: grid;
    gap: 5px;
}

.field label {
    color: #5d5a4f;
    font-size: 12px;
}

.input {
    width: 100%;
    min-height: 37px;
    padding: 7px 10px;
    border: 1px solid #a99e7d;
    border-radius: 7px;
    outline: none;
    color: var(--ink);
    background: #fffdf4;
}

.input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(111,115,80,.12);
}

textarea.input {
    min-height: 130px;
    resize: vertical;
}

.form-stack {
    display: grid;
    gap: 13px;
}

.message {
    min-height: 22px;
    margin: 0;
    color: #9a6548;
    font-size: 12px;
}

@media (max-width: 720px) {
    .page-shell,
    .topbar-inner {
        width: min(100% - 22px, 1020px);
    }

    .cover {
        height: 205px;
    }

    .cover-note {
        display: none;
    }

    .identity {
        left: 18px;
        bottom: 17px;
    }

    .avatar,
    .avatar-placeholder {
        width: 78px;
        height: 78px;
        border-width: 3px;
    }

    .identity h1 {
        font-size: 20px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-row: 1;
        grid-template-columns: 1fr 1fr;
    }

    .sidebar .panel:last-child {
        display: none;
    }

    .profile-nav {
        padding-left: 8px;
    }

    .tab-button {
        min-width: auto;
        padding: 0 16px;
    }

    .article-paper {
        padding: 30px 22px 36px;
    }
}

@media (max-width: 480px) {
    .topbar {
        height: 54px;
    }

    .brand {
        font-size: 13px;
    }

    .brand-mark {
        width: 31px;
        height: 31px;
    }

    .top-links {
        gap: 0;
    }

    .top-links a {
        padding: 5px 8px;
    }

    .top-links a:nth-child(2) {
        display: none;
    }

    .cover {
        height: 190px;
    }

    .identity {
        align-items: center;
        gap: 12px;
    }

    .identity p {
        max-width: 205px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .feed-heading-note {
        display: none;
    }

    .feed-item {
        padding-right: 14px;
    }
}
