/* =========================================================
   暖光 warmglow 主题样式（原创实现）
   ========================================================= */

:root {
    --bg: #f5f2ec;
    --card: #ffffff;
    --ink: #443d34;
    --muted: #8d8378;
    --line: #eae3d8;
    --chip-bg: rgba(255, 253, 250, 0.82);
    --accent: #d9814f;
    --accent-deep: #b96a3e;
    --accent-soft: rgba(217, 129, 79, 0.12);
    --shadow: 0 6px 24px rgba(122, 100, 76, 0.08);
    --shadow-hover: 0 12px 32px rgba(122, 100, 76, 0.14);
    --radius: 16px;
    --radius-sm: 10px;
    --nav-h: 64px;
    --max-w: 1080px;
}

html[data-theme="dark"] {
    --bg: #171411;
    --card: #211d18;
    --ink: #e8e1d5;
    --muted: #a1968a;
    --line: #322c25;
    --chip-bg: rgba(38, 33, 28, 0.8);
    --accent: #e09668;
    --accent-deep: #eaa87d;
    --accent-soft: rgba(224, 150, 104, 0.14);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

/* hidden 属性优先级最高，防止被 display:flex 等类样式覆盖导致遮罩常显 */
[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-deep);
}

button {
    font-family: inherit;
}

.clearfix {
    clear: both;
}

.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ============ 顶部导航 ============ */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--chip-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card);
    box-shadow: var(--shadow);
}

.nav-name {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: block;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
}

.nav-item > a:hover,
.nav-item > a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.nav-sub {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 140px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 110;
}

.nav-item:hover .nav-sub,
.nav-item:focus-within .nav-sub {
    display: block;
}

.nav-sub a {
    display: block;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.nav-sub a:hover {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.nav-search {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 4px 2px 12px;
    transition: border-color 0.2s ease, width 0.25s ease;
    width: 150px;
}

.nav-search:focus-within {
    border-color: var(--accent);
}

.nav-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
}

.nav-search-input::placeholder {
    color: var(--muted);
}

.nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.nav-search-btn:hover {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-icon-btn:hover {
    color: var(--accent-deep);
    border-color: var(--accent);
}

html[data-theme="light"] .icon-sun,
html[data-theme="dark"] .icon-moon {
    display: none;
}

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    padding: 8px;
}

.nav-burger span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-burger.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-burger.is-open span:nth-child(2) {
    opacity: 0;
}

.nav-burger.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ============ 主体 ============ */
.site-main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* ============ 首页问候区 ============ */
.hero {
    position: relative;
    margin: 8px 0 34px;
    border-radius: 24px;
    overflow: hidden;
    text-align: center;
    padding: 64px 20px 54px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 420px at 12% -8%, rgba(232, 168, 124, 0.34), transparent 62%),
        radial-gradient(1000px 460px at 88% 0%, rgba(244, 203, 148, 0.26), transparent 58%),
        radial-gradient(900px 520px at 50% 118%, rgba(214, 158, 118, 0.22), transparent 60%),
        linear-gradient(168deg, #f0e3cf 0%, #e6d3b8 52%, #dcbfa0 100%);
}

html[data-theme="dark"] .hero-bg {
    background:
        radial-gradient(1200px 420px at 12% -8%, rgba(224, 150, 104, 0.16), transparent 62%),
        radial-gradient(1000px 460px at 88% 0%, rgba(196, 132, 84, 0.14), transparent 58%),
        radial-gradient(900px 520px at 50% 118%, rgba(120, 84, 58, 0.18), transparent 60%),
        linear-gradient(168deg, #241e18 0%, #2c231b 52%, #332820 100%);
}

.hero-bg.has-image {
    background-size: cover;
    background-position: center;
}

.hero-bg.has-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(28, 22, 16, 0.16), rgba(28, 22, 16, 0.42));
}

html[data-theme="dark"] .hero-bg.has-image::after {
    background: linear-gradient(180deg, rgba(18, 14, 11, 0.34), rgba(18, 14, 11, 0.58));
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-avatar {
    width: 108px;
    height: 108px;
    margin: 0 auto 18px;
    border-radius: 50%;
    padding: 4px;
    background: rgba(255, 253, 250, 0.72);
    box-shadow: 0 10px 30px rgba(122, 92, 60, 0.22);
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.hero-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 999px;
    background: var(--chip-bg);
    border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 12.5px;
    color: #6f6050;
}

html[data-theme="dark"] .chip {
    color: #cabcae;
}

.chip-weather {
    color: var(--accent-deep);
}

.hero-name {
    margin: 0 0 8px;
    font-size: clamp(30px, 5vw, 42px);
    font-weight: 800;
    letter-spacing: 1px;
    color: #3e332a;
}

html[data-theme="dark"] .hero-name,
.hero-bg.has-image ~ .hero-inner .hero-name {
    color: var(--ink);
}

.hero-bg.has-image ~ .hero-inner .hero-name,
.hero-bg.has-image ~ .hero-inner .hero-greet,
.hero-bg.has-image ~ .hero-inner .hero-bio,
.hero-bg.has-image ~ .hero-inner .stat-item {
    color: #f7f2ea;
}

.hero-bg.has-image ~ .hero-inner .hero-greet,
.hero-bg.has-image ~ .hero-inner .hero-bio {
    text-shadow: 0 1px 8px rgba(20, 14, 8, 0.45);
}

.hero-greet {
    margin: 0 auto 6px;
    max-width: 620px;
    font-size: 17px;
    font-weight: 600;
    color: #55483a;
    min-height: 1.7em;
}

html[data-theme="dark"] .hero-greet {
    color: #d9cec0;
}

.hero-greet::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    background: var(--accent);
    vertical-align: -2px;
    animation: wg-cursor 0.9s steps(2) infinite;
}

@keyframes wg-cursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-bio {
    margin: 0 auto 22px;
    font-size: 13.5px;
    color: #7b6c5b;
}

html[data-theme="dark"] .hero-bio {
    color: #a99c8e;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--chip-bg);
    border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

a.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--accent-deep);
}

.stat-item strong {
    font-size: 19px;
    font-weight: 800;
    color: var(--accent-deep);
}

.stat-item span {
    font-size: 12.5px;
    color: #6f6050;
}

html[data-theme="dark"] .stat-item span {
    color: #b3a696;
}

/* ============ 通用栏目 ============ */
.home-section {
    margin-bottom: 40px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1px;
    position: relative;
    padding-left: 14px;
}

.section-head h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 18px;
    border-radius: 3px;
    background: var(--accent);
}

.more-link {
    font-size: 13px;
    color: var(--accent-deep);
}

.more-link:hover {
    text-decoration: underline;
}

/* ============ 碎碎念 ============ */
.moments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.moment-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 14px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.moment-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.moment-content {
    font-size: 13.5px;
    color: var(--ink);
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.moment-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.moment-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.moment-name {
    color: var(--accent-deep);
}

.moment-time {
    margin-left: auto;
}

/* ============ 文章卡片 ============ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.post-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.post-card.is-featured {
    grid-column: span 2;
    flex-direction: row;
}

.post-cover {
    position: relative;
    display: block;
    overflow: hidden;
    flex-shrink: 0;
}

.post-card:not(.is-featured) .post-cover {
    aspect-ratio: 16 / 9;
}

.post-card.is-featured .post-cover {
    width: 46%;
    min-height: 220px;
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.post-card:hover .post-cover img {
    transform: scale(1.05);
}

.post-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 3px 10px rgba(217, 129, 79, 0.4);
}

.post-badge-inline {
    position: static;
    display: inline-block;
    vertical-align: 4px;
    margin-left: 8px;
}

.post-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.post-card.is-featured .post-body {
    justify-content: center;
    padding: 26px 28px;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
}

.post-meta time {
    color: var(--accent-deep);
    font-weight: 600;
}

.dot {
    opacity: 0.5;
}

.post-sort {
    margin-left: auto;
}

.post-sort-link {
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 12px;
}

.post-sort-link:hover {
    color: var(--accent-deep);
    border-color: var(--accent);
}

.post-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
}

.post-card.is-featured .post-title {
    font-size: 21px;
}

.post-title a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-card.is-featured .post-title a {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-excerpt {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pagenavi {
    margin-top: 30px;
    text-align: center;
    font-size: 13.5px;
}

.pagenavi a,
.pagenavi span {
    display: inline-block;
    margin: 0 3px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--ink);
}

.pagenavi a:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-deep);
}

.empty-tip {
    text-align: center;
    color: var(--muted);
    padding: 60px 0;
    font-size: 14px;
}

/* ============ 入场动画 ============ */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ============ 文章页 ============ */
.article {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 34px 38px 40px;
    margin-top: 6px;
}

.article-masthead {
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 26px;
}

.article-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--accent-deep);
    margin-bottom: 10px;
}

.article-sort {
    color: var(--accent-deep);
    background: var(--accent-soft);
    padding: 2px 11px;
    border-radius: 999px;
}

.page-label {
    color: var(--accent-deep);
    background: var(--accent-soft);
    padding: 2px 11px;
    border-radius: 999px;
}

.article-title {
    margin: 0 0 14px;
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 800;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: var(--muted);
}

.edit-link {
    margin-left: auto;
    color: var(--accent-deep);
    border: 1px solid var(--accent);
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 12px;
}

.edit-link:hover {
    background: var(--accent-soft);
}

.article-cover {
    margin-bottom: 26px;
    border-radius: var(--radius);
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    display: block;
}

/* ---- 正文排版 ---- */
.article-content {
    font-size: 15.5px;
    color: var(--ink);
    word-wrap: break-word;
}

.article-content p {
    margin: 0 0 1.1em;
    line-height: 1.9;
}

.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
    margin: 1.6em 0 0.8em;
    font-weight: 700;
    line-height: 1.4;
}

.article-content h1 { font-size: 1.6em; }
.article-content h2 { font-size: 1.4em; border-left: 4px solid var(--accent); padding-left: 12px; }
.article-content h3 { font-size: 1.2em; }
.article-content h4 { font-size: 1.05em; }
.article-content h5, .article-content h6 { font-size: 1em; color: var(--muted); }

.article-content a {
    color: var(--accent-deep);
    border-bottom: 1px dashed var(--accent);
}

.article-content a:hover {
    border-bottom-style: solid;
}

.article-content ul, .article-content ol {
    padding-left: 1.6em;
    margin: 0 0 1.1em;
}

.article-content li {
    margin-bottom: 0.4em;
}

.article-content blockquote {
    margin: 1.2em 0;
    padding: 12px 18px;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--ink);
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content img {
    border-radius: var(--radius-sm);
    display: block;
    margin: 1em auto;
    cursor: zoom-in;
}

.article-content hr {
    border: 0;
    height: 1px;
    background: var(--line);
    margin: 2em 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 14px;
}

.article-content th, .article-content td {
    border: 1px solid var(--line);
    padding: 9px 12px;
    text-align: left;
}

.article-content th {
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 700;
}

.article-content pre,
.article-content code {
    font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.article-content code {
    background: var(--accent-soft);
    color: var(--accent-deep);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.88em;
}

.article-content pre {
    background: #2b2520;
    color: #e8dfd2;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    overflow: auto;
    font-size: 13.5px;
    line-height: 1.65;
    margin: 1.2em 0;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.article-content mark {
    background: rgba(244, 203, 148, 0.55);
    color: inherit;
    padding: 0 3px;
    border-radius: 3px;
}

/* ---- 文末 ---- */
.article-end {
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 12.5px;
}

.tag:hover {
    background: var(--accent);
    color: #fff;
}

.author-card {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--accent-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 22px;
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card);
    box-shadow: var(--shadow);
}

.author-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-deep);
}

.author-bio {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
}

/* ---- 相邻文章 ---- */
.neighbor-nav {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.neighbor-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.neighbor-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.neighbor-item.is-next {
    text-align: right;
}

.neighbor-item.is-empty {
    visibility: hidden;
}

.neighbor-dir {
    font-size: 12px;
    color: var(--accent-deep);
    font-weight: 700;
}

.neighbor-title {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- 评论 ---- */
.comments-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 12.5px;
}

.comment-form-wrap {
    margin-top: 30px;
}

.comment-form-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px 24px;
}

.comment-textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--ink);
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-textarea:focus {
    border-color: var(--accent);
}

.comment-fields {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.comment-fields input {
    flex: 1;
    min-width: 150px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--ink);
    padding: 10px 13px;
    font-size: 13.5px;
    outline: none;
}

.comment-fields input:focus {
    border-color: var(--accent);
}

.comment-captcha {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.comment-captcha input {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--ink);
    padding: 10px 13px;
    font-size: 13.5px;
    outline: none;
    width: 130px;
}

.comment-captcha img {
    border-radius: 6px;
    cursor: pointer;
    height: 38px;
}

.comment-submit-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    display: inline-block;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    padding: 9px 24px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-deep);
    box-shadow: 0 5px 16px rgba(217, 129, 79, 0.35);
    transform: translateY(-1px);
}

.btn-ghost {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    padding: 9px 22px;
    font-size: 13.5px;
    cursor: pointer;
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent-deep);
}

.btn-block {
    width: 100%;
}

.comments-list {
    margin-top: 34px;
}

.comment {
    margin-bottom: 18px;
}

.comment-main {
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-box {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.comment-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--accent-deep);
}

.comment-time {
    font-size: 12px;
    color: var(--muted);
}

.comment-content {
    font-size: 14px;
    word-break: break-word;
}

.comment-content p {
    margin: 0 0 0.5em;
}

.comment-content img {
    max-width: 200px;
    border-radius: 8px;
}

.comment-actions {
    margin-top: 6px;
}

.com-reply {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
    padding: 2px 0;
}

.com-reply:hover {
    color: var(--accent-deep);
}

.comment-children {
    margin-left: 30px;
    margin-top: 14px;
    padding-left: 16px;
    border-left: 2px dashed var(--line);
}

.comment-pagenavi {
    text-align: center;
    font-size: 13px;
    margin-top: 16px;
}

.comment-login-tip {
    color: var(--muted);
    font-size: 14px;
}

/* ============ 页脚 ============ */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--card);
    padding: 34px 20px 30px;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.footer-brand-text {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.footer-name {
    font-weight: 700;
    font-size: 15px;
}

.footer-sub {
    font-size: 12px;
    color: var(--muted);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 14px;
    font-size: 13px;
}

.footer-links a {
    color: var(--muted);
}

.footer-links a:hover {
    color: var(--accent-deep);
}

.footer-copy {
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.footer-copy a {
    color: var(--muted);
}

.footer-copy a:hover {
    color: var(--accent-deep);
}

.copy-sep {
    opacity: 0.4;
}

/* ============ 登录弹窗 ============ */
.auth-mask {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(28, 20, 14, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 310;
    width: calc(100% - 40px);
    max-width: 380px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(30, 20, 10, 0.3);
    padding: 30px 30px 26px;
}

.auth-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.auth-close:hover {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.auth-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
}

.auth-sub {
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
}

.auth-form input:focus {
    border-color: var(--accent);
}

.auth-captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-captcha-row input {
    flex: 1;
}

.auth-captcha {
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
}

.auth-switch {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
    font-size: 13px;
}

.auth-switch a {
    color: var(--accent-deep);
}

/* ============ 灯箱 ============ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(20, 14, 9, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

/* ============ 返回顶部 ============ */
.back-top {
    position: fixed;
    right: 26px;
    bottom: 30px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--accent-deep);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.back-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-top:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ============ 404 / 密码页 ============ */
.notfound-card {
    text-align: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 48px 44px;
    max-width: 420px;
    width: 100%;
}

.notfound-code {
    margin: 0 0 6px;
    font-size: 68px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
    letter-spacing: 4px;
    opacity: 0.85;
}

.notfound-msg {
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 14.5px;
}

.pwd-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.pwd-form input {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink);
    padding: 11px 18px;
    font-size: 14px;
    outline: none;
    text-align: center;
}

.pwd-form input:focus {
    border-color: var(--accent);
}

.pwd-back {
    font-size: 13px;
    color: var(--muted);
}

.pwd-back:hover {
    color: var(--accent-deep);
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
    .moments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-burger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background: var(--card);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-hover);
        padding: 12px 16px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-item > a {
        padding: 11px 14px;
        border-radius: var(--radius-sm);
    }

    .nav-sub {
        position: static;
        transform: none;
        display: block;
        border: 0;
        box-shadow: none;
        background: var(--bg);
        margin: 4px 0 6px 14px;
        padding: 4px;
    }

    .nav-actions {
        margin: 10px 0 0;
        justify-content: space-between;
    }

    .nav-search {
        flex: 1;
    }

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

    .post-card.is-featured {
        grid-column: span 1;
        flex-direction: column;
    }

    .post-card.is-featured .post-cover {
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 0;
    }

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

    .hero {
        padding: 48px 16px 42px;
    }

    .article {
        padding: 24px 18px 30px;
    }

    .neighbor-nav {
        grid-template-columns: 1fr;
    }

    .neighbor-item.is-empty {
        display: none;
    }

    .comment-children {
        margin-left: 14px;
    }
}

@media (max-width: 480px) {
    .nav-name {
        display: none;
    }

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

    .stat-item {
        padding: 6px 13px;
    }
}
