/* ==========================================================================
   MyBlog 样式表
   主色 #32c8c8（青），中性色灰白 + 白，风格简洁、功能优先。
   全部用 CSS 变量，改配色只要动 :root。
   ========================================================================== */

:root {
    /* ---- 品牌色 ---- */
    --brand: #32c8c8;
    --brand-dark: #23aeae;
    --brand-deep: #17807f;          /* 链接、文字强调（保证对比度） */
    --brand-ink: #0b3d3d;           /* 主色按钮上的文字 */
    --brand-tint: #e9fbfb;          /* 浅色底 */
    --brand-tint-strong: #cff2f2;

    /* ---- 中性色 ---- */
    --bg: #f4f7f8;
    --surface: #ffffff;
    --surface-muted: #fafbfc;
    --text: #1f2a30;
    --text-soft: #4a5a63;
    /* 这几个中性色都按 WCAG AA(4.5:1) 调过，小字也看得清 */
    --muted: #62727b;
    --border: #e3eaec;
    --border-strong: #cfd9dd;

    /* ---- 语义色 ---- */
    --danger: #c93a3a;
    --danger-tint: #fdf1f1;
    --success: #1f7d54;
    --success-tint: #eefaf4;

    /* ---- 形状与阴影 ---- */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 2px rgba(24, 46, 51, 0.04);
    --shadow: 0 2px 10px rgba(24, 46, 51, 0.06);
    --shadow-lg: 0 10px 30px rgba(24, 46, 51, 0.10);

    /* ---- 布局 ---- */
    --container: 1080px;
    --reading: 760px;
}

/* ---------- 基础 ---------- */

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
        "PingFang SC", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    line-height: 1.35;
    font-weight: 700;
}

/* 键盘可达性：统一焦点环 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand-dark);
    outline-offset: 2px;
}

/* ---------- 布局容器 ---------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 28px 20px 56px;
}

.container.narrow {
    max-width: 440px;
}

.container.reading {
    max-width: var(--reading);
}

/* 主内容 + 侧栏 */
.with-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: start;
}

.page-title {
    font-size: 22px;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title::before {
    content: "";
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--brand);
}

/* ---------- 顶部导航 ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav {
    max-width: var(--container);
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.brand::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-tint);
}

.brand:hover {
    text-decoration: none;
    color: var(--brand-deep);
}

.search-form {
    flex: 1 1 240px;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.search-form input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

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

.search-form input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

.search-form button {
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.search-form button:hover {
    background: var(--brand-dark);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    white-space: nowrap;
}

.nav-links a {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
}

.nav-links a:hover {
    background: var(--brand-tint);
    color: var(--brand-deep);
    text-decoration: none;
}

.who {
    color: var(--muted);
    padding-right: 4px;
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-button {
    padding: 7px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-soft);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.link-button:hover {
    background: var(--danger-tint);
    color: var(--danger);
}

/* ---------- 卡片 ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

/* 文章列表项 */
.post-item {
    padding: 20px 22px;
    margin-bottom: 14px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.post-item:hover {
    border-color: var(--brand-tint-strong);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.post-item .post-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.post-item .post-main {
    flex: 1;
    min-width: 0;
}

.post-title-link {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 6px;
    word-break: break-word;
}

.post-title-link:hover {
    color: var(--brand-deep);
    text-decoration: none;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--border-strong);
}

.summary {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.75;
    word-break: break-word;
}

/* 列表缩略图 */
.thumb {
    flex: 0 0 132px;
    width: 132px;
    height: 92px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-muted);
}

/* ---------- 侧栏 ---------- */

.side-card {
    padding: 18px;
    margin-bottom: 16px;
}

.side-card h2 {
    font-size: 14px;
    margin: 0 0 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-card h2::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--brand);
}

.side-card p {
    margin: 0 0 10px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.8;
}

.side-card p:last-child {
    margin-bottom: 0;
}

.side-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-links a {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 14px;
}

.side-links a:hover {
    background: var(--brand-tint);
    color: var(--brand-deep);
    text-decoration: none;
}

/* ---------- 文章详情 ---------- */

.post {
    padding: 30px 32px;
}

.post-title {
    font-size: 28px;
    margin: 0 0 14px;
    word-break: break-word;
}

.post-image {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 18px 0 22px;
}

.post-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 16px;
    line-height: 1.9;
    color: #24313a;
}

/* 标题行 + 右侧操作按钮 */
.post-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.post-head-main {
    min-width: 0;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 13px;
}

.btn-ghost:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
    background: var(--brand-tint);
    text-decoration: none;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-danger:hover {
    background: var(--danger-tint);
    color: var(--danger);
    border-color: #f6d5d5;
}

.edited-mark {
    margin-left: 2px;
}

/* 编辑页：当前配图预览 */
.current-image {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    flex-wrap: wrap;
}

.current-image img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    font-size: 14px;
    color: var(--text-soft);
    cursor: pointer;
}

.checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

/* ---------- 状态徽章 ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.badge.warn {
    background: #fff7e6;
    color: #a86400;
    border: 1px solid #ffe1b0;
}

.badge.ok {
    background: var(--success-tint);
    color: var(--success);
    border: 1px solid #c9ecd9;
}

.badge.danger {
    background: var(--danger-tint);
    color: var(--danger);
    border: 1px solid #f6d5d5;
}

/* 待审评论在详情页里弱化显示 */
.comment.pending {
    background: #fffdf5;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: var(--radius-sm);
}

/* ---------- 审核后台 ---------- */

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: var(--text-soft);
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--brand-deep);
    text-decoration: none;
}

.tab.active {
    color: var(--brand-deep);
    border-bottom-color: var(--brand);
    font-weight: 700;
}

.review-item {
    padding: 16px 18px;
    margin-bottom: 12px;
}

.review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.review-meta .meta {
    margin: 0;
}

.review-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.review-body {
    margin: 10px 0 6px;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.btn-ok {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 16px;
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.btn-ok:hover {
    background: var(--brand-dark);
}

@media (max-width: 720px) {
    .review-head {
        flex-direction: column;
        align-items: stretch;
    }

    .review-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}


/* ---------- 点赞 ---------- */

.like-bar {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.like-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.like-button:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
    background: var(--brand-tint);
}

.like-button.liked {
    border-color: var(--brand);
    background: var(--brand-tint);
    color: var(--brand-deep);
}

.like-count {
    font-weight: 700;
}

/* ---------- 评论 ---------- */

.comments {
    padding: 24px 28px;
}

.comments h2 {
    font-size: 17px;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments h2::before {
    content: "";
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--brand);
}

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

.comment {
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.comment:first-child {
    border-top: none;
    padding-top: 0;
}

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

.comment-head strong {
    font-size: 14px;
    color: var(--text);
}

.comment-head .meta {
    font-size: 12px;
    margin: 0;
}

.comment-body {
    margin: 6px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.75;
}

.comment-form {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-form button[type="submit"] {
    align-self: flex-start;
    min-height: 42px;
    padding: 0 22px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.comment-form button[type="submit"]:hover {
    background: var(--brand-dark);
}

/* ---------- 表单 ---------- */

.stack-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
}

.stack-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 7px;
}

.stack-form > label:not(:first-of-type) {
    margin-top: 18px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-soft);
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: var(--brand);
    background: var(--brand-tint);
}

.stack-form button[type="submit"],
.btn-primary {
    min-height: 44px;
    padding: 0 26px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.stack-form button[type="submit"]:hover,
.btn-primary:hover {
    background: var(--brand-dark);
    box-shadow: 0 4px 14px rgba(50, 200, 200, 0.35);
}

.form-actions {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cancel {
    font-size: 14px;
    color: var(--muted);
}

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

.field-error {
    color: var(--danger);
    font-size: 13px;
    margin: 6px 0 0;
}

.field-hint {
    font-size: 13px;
    color: var(--muted);
    margin: 6px 0 0;
    min-height: 18px;
}

/* 验证码行：输入框 + 发送按钮 */
.code-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.code-row input {
    flex: 1;
    min-width: 0;
}

.secondary-button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--brand-deep);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.secondary-button:hover:not(:disabled) {
    background: var(--brand-tint);
}

.secondary-button:disabled {
    border-color: var(--border);
    color: var(--muted);
    cursor: default;
    background: var(--surface-muted);
}

/* 游客评论的昵称 / 邮箱行 */
.guest-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.guest-row input {
    flex: 1 1 170px;
    min-width: 0;
}

/* ---------- 提示条 ---------- */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid transparent;
}

.alert.success {
    background: var(--success-tint);
    border-color: #c9ecd9;
    color: var(--success);
}

.alert.error {
    background: var(--danger-tint);
    border-color: #f6d5d5;
    color: var(--danger);
}

.empty,
.hint {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.empty {
    padding: 28px 20px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

.hint a {
    color: var(--brand-deep);
    font-weight: 600;
}

/* ---------- 分页 ---------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 26px;
    font-size: 14px;
    color: var(--muted);
}

.pager a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-soft);
}

.pager a:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
    background: var(--brand-tint);
    text-decoration: none;
}

/* ---------- 页脚 ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 22px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.site-footer p {
    margin: 0;
}

.site-footer .dot-sep {
    margin: 0 8px;
    color: var(--border-strong);
}

/* ---------- 返回链接 ---------- */

.back {
    margin-top: 28px;
    font-size: 14px;
}

/* ---------- 认证页辅助 ---------- */

.auth-links {
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.8;
}

.auth-links a {
    color: var(--brand-deep);
    font-weight: 600;
}

/* ---------- 错误页 ---------- */

.error-page {
    text-align: center;
    padding: 40px 16px;
}

.error-code {
    font-size: 56px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -2px;
    color: var(--brand);
    margin: 0 0 16px;
}

.error-text {
    color: var(--muted);
    font-size: 15px;
    margin: 0 0 26px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary:hover {
    text-decoration: none;
}

/* ==========================================================================
   响应式
   ========================================================================== */

/* 平板/手机：侧边导航改为抽屉（默认收起） */
@media (max-width: 1023px) {
    .with-aside {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-col {
        display: block;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 276px;
        max-width: 82vw;
        padding: 18px 16px 28px;
        margin: 0;
        background: var(--surface);
        box-shadow: 6px 0 28px rgba(24, 46, 51, 0.16);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.26s ease;
        z-index: 100;
    }

    .side-col.open {
        transform: translateX(0);
    }

    .sidenav-close {
        display: inline-flex;
    }
}

/* 手机 */
@media (max-width: 720px) {
    body {
        font-size: 15px;
    }

    .container {
        padding: 20px 14px 40px;
    }

    /* 导航换行：第一行品牌 + 操作，第二行搜索占满 */
    .nav {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 14px;
    }

    .brand {
        order: 1;
        font-size: 16px;
    }

    .nav-links {
        order: 2;
        margin-left: auto;
    }

    .who {
        display: none;
    }

    .search-form {
        order: 3;
        flex: 1 1 100%;
    }

    .search-form input,
    .search-form button {
        height: 42px;
    }

    .page-title {
        font-size: 19px;
        margin-bottom: 14px;
    }

    /* 卡片与阅读区 */
    .post-item {
        padding: 16px;
        margin-bottom: 12px;
    }

    .post-item .post-head {
        gap: 12px;
    }

    .thumb {
        flex-basis: 96px;
        width: 96px;
        height: 72px;
    }

    .post-title-link {
        font-size: 16px;
    }

    .post {
        padding: 20px 18px;
    }

    .post-title {
        font-size: 22px;
    }

    .post-content {
        font-size: 16px;
        line-height: 1.85;
    }

    .comments {
        padding: 18px 16px;
    }

    .stack-form {
        padding: 20px 16px;
    }

    /* 触摸目标放大 */
    .stack-form button[type="submit"],
    .comment-form button[type="submit"],
    .secondary-button {
        min-height: 46px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .form-actions .cancel {
        text-align: center;
    }

    /* 验证码行在窄屏改为上下排列 */
    .code-row {
        flex-wrap: wrap;
    }

    .code-row input {
        flex: 1 1 100%;
    }

    .secondary-button {
        flex: 1 1 100%;
    }

    .pager {
        gap: 8px;
        flex-wrap: wrap;
    }

    .like-button {
        width: 100%;
        justify-content: center;
    }

    .site-footer {
        padding: 18px 14px;
        font-size: 12px;
    }
}

/* 超窄屏 */
@media (max-width: 400px) {
    .thumb {
        display: none;
    }

    .post-title {
        font-size: 20px;
    }
}

/* 降低动画（尊重系统设置） */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================================================
   管理后台
   ========================================================================== */

.admin-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #0f3d3d;
    color: #e8f6f6;
}

.admin-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-brand {
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}

.admin-brand:hover {
    text-decoration: none;
    color: var(--brand);
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.admin-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: #b9dede;
    font-size: 14px;
    white-space: nowrap;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
}

.admin-nav a.active {
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 700;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.admin-actions a {
    color: #b9dede;
}

.admin-actions a:hover {
    color: #ffffff;
}

.admin-actions .link-button {
    color: #b9dede;
    padding: 6px 8px;
}

.admin-actions .link-button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 26px 20px 56px;
}

/* 仪表盘统计卡 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    color: var(--text);
}

.stat-card:hover {
    text-decoration: none;
    border-color: var(--brand);
    box-shadow: var(--shadow);
}

.stat-card.highlight {
    border-color: #ffe1b0;
    background: #fffdf5;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--brand-deep);
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
}

/* 仪表盘两栏 */
.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-panel {
    padding: 18px 20px;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head h2 {
    font-size: 15px;
    margin: 0;
}

.panel-head a {
    font-size: 13px;
}

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

.simple-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.simple-list li:first-child {
    border-top: none;
    padding-top: 0;
}

.simple-list a {
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
}

.simple-list a:hover {
    color: var(--brand-deep);
}

.simple-item-main {
    min-width: 0;
}

.simple-item-main p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.simple-item-main strong {
    font-size: 13px;
}

/* 表格 */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 640px;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table th {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-muted);
    white-space: nowrap;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: var(--brand-tint);
}

.admin-table .num {
    text-align: right;
    white-space: nowrap;
    color: var(--text-soft);
}

.admin-table .actions {
    text-align: right;
    white-space: nowrap;
}

.admin-table .actions form {
    display: inline-block;
    margin-left: 6px;
}

.cell-title a {
    color: var(--text);
    font-weight: 600;
    word-break: break-word;
}

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

.cell-title .badge {
    margin-left: 8px;
}

@media (max-width: 980px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .admin-header-inner {
        padding: 8px 14px;
        gap: 10px;
    }

    .admin-nav {
        order: 3;
        flex-basis: 100%;
    }

    .admin-actions {
        margin-left: auto;
    }

    .admin-container {
        padding: 20px 14px 40px;
    }

    .stat-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 22px;
    }
}
/* 页脚备案号 */
.icp-line {
    margin: 6px 0 0;
    font-size: 12px;
}

.icp-line a {
    color: var(--muted);
}

.icp-line a:hover {
    color: var(--brand-deep);
}
/* ==========================================================================
   侧边导航（桌面常驻 / 移动端抽屉）
   ========================================================================== */

.sidenav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 0 12px;
}

.sidenav-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.sidenav-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--text-soft);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.sidenav-close:hover {
    background: var(--brand-tint);
    color: var(--brand-deep);
}

.sidenav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidenav-group {
    margin: 16px 0 6px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.sidenav-group:first-child {
    margin-top: 6px;
}

.sidenav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 14px;
    text-decoration: none;
    /* 变色 + 位移：位移单独用 transform，性能比改 margin 好 */
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.sidenav-link:hover,
.sidenav-link:focus-visible {
    background: var(--brand-tint);
    color: var(--brand-deep);
    transform: translateX(4px);
    text-decoration: none;
}

.sidenav-link.active {
    background: var(--brand-tint);
    color: var(--brand-deep);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--brand);
}

.sidenav-link.active:hover {
    transform: translateX(4px);
}

.sidenav-icon {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
    font-size: 15px;
    opacity: 0.9;
}

.sidenav-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 退出登录是表单里的按钮，视觉上和链接一致 */
.sidenav-logout {
    margin: 2px 0 0;
}

.sidenav-button {
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.sidenav-about {
    margin-top: 22px;
    padding: 16px 12px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
}

.sidenav-about p {
    margin: 0 0 6px;
}

.sidenav-about p:last-child {
    margin-bottom: 0;
}

/* 移动端的浮动开关与遮罩 */
.sidenav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 16px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(50, 200, 200, 0.45);
    z-index: 101;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.sidenav-toggle:hover {
    background: var(--brand-dark);
    transform: translateY(-2px);
}

.sidenav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 61, 61, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
    z-index: 99;
}

.sidenav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 1023px) {
    .sidenav-toggle {
        display: inline-flex;
    }
}

/* 桌面上侧栏常驻，浮动开关和遮罩都不该出现 */
@media (min-width: 1024px) {
    .sidenav-toggle,
    .sidenav-backdrop {
        display: none !important;
    }
}
/* ==========================================================================
   前台整体布局：左侧固定侧栏 + 右侧内容
   （顶部大标题区 + 明确边界的侧栏 + 动效，参考站点的结构）
   ========================================================================== */

.app-body {
    min-height: 100vh;
}

/* ---------- 左侧侧栏 ---------- */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    padding: 18px 14px 22px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    /* 明确边界：右侧一条实线，和内容区彻底分开 */
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 60;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 10px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.app-brand:hover {
    text-decoration: none;
}

.app-brand-mark {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    box-shadow: 0 3px 10px rgba(50, 200, 200, 0.35);
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.app-brand-text strong {
    font-size: 16px;
    letter-spacing: 0.01em;
}

.app-brand-text small {
    font-size: 12px;
    color: var(--muted);
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.app-nav-group {
    margin: 14px 0 6px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.app-nav-group:first-child {
    margin-top: 4px;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    color: var(--text-soft);
    font-size: 14px;
    text-decoration: none;
    /* 位移用 transform，只触发合成层，鼠标快速划过也不掉帧 */
    transition: transform 0.18s ease, background-color 0.18s ease,
                color 0.18s ease, border-left-color 0.18s ease;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
    background: var(--brand-tint);
    color: var(--brand-deep);
    border-left-color: var(--brand);
    transform: translateX(6px);
    text-decoration: none;
}

.app-nav-link.active {
    background: var(--brand-tint);
    color: var(--brand-deep);
    border-left-color: var(--brand);
    font-weight: 700;
}

.app-nav-icon {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
    opacity: 0.9;
}

.app-nav-button {
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.app-sidebar-foot {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ---------- 右侧主区 ---------- */

.app-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 26px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}

.app-sidebar-opener {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 17px;
    cursor: pointer;
}

.app-sidebar-opener:hover {
    border-color: var(--brand);
    color: var(--brand-deep);
}

.app-search {
    flex: 1;
    max-width: 460px;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.app-search input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.app-search input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

.app-search button {
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.app-search button:hover {
    background: var(--brand-dark);
}

.app-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.app-user {
    color: var(--muted);
    max-width: 10em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-link {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
}

.app-topbar-link:hover {
    background: var(--brand-tint);
    color: var(--brand-deep);
    text-decoration: none;
}

.app-topbar-primary {
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 600;
}

.app-topbar-primary:hover {
    background: var(--brand-dark);
    color: var(--brand-ink);
}

.app-content {
    flex: 1;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 26px 26px 52px;
}

.app-content.narrow {
    max-width: 480px;
}

/* ---------- 首页大标题区 ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 38px 34px;
    margin-bottom: 26px;
    border-radius: var(--radius-lg);
    color: #ffffff;
    background: linear-gradient(135deg, #0f3d3d 0%, #17807f 58%, #32c8c8 135%);
}

/* 右上角一个半透明圆做点缀，避免大片纯色显得平 */
.hero::after {
    content: "";
    position: absolute;
    top: -50px;
    right: -40px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
}

.hero-title {
    margin: 0;
    font-size: 30px;
    font-style: oblique;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.hero-sub {
    margin: 8px 0 0;
    font-size: 12px;
    letter-spacing: 0.22em;
    opacity: 0.72;
}

.hero-desc {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.88;
    max-width: 34em;
}

/* ---------- 移动端：侧栏变抽屉 ---------- */

.app-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 61, 61, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
    z-index: 99;
}

.app-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 1023px) {
    .app-sidebar {
        width: 280px;
        max-width: 82vw;
        padding: 16px 12px 22px;
        box-shadow: 6px 0 28px rgba(24, 46, 51, 0.16);
        transform: translateX(-100%);
        transition: transform 0.26s ease;
        z-index: 100;
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .app-sidebar-opener {
        display: inline-flex;
    }

    .app-topbar {
        padding: 10px 14px;
        gap: 10px;
    }

    .app-content {
        padding: 20px 14px 42px;
    }

    .app-user {
        display: none;
    }

    .app-topbar-link {
        padding: 8px 9px;
    }
}

@media (min-width: 1024px) {
    .app-backdrop {
        display: none !important;
    }
}

@media (max-width: 720px) {
    .hero {
        padding: 26px 20px;
        margin-bottom: 20px;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-sub {
        letter-spacing: 0.16em;
        font-size: 11px;
    }

    .hero-desc {
        font-size: 13px;
        margin-top: 12px;
    }

    .app-search input,
    .app-search button {
        height: 40px;
    }
}