/* ============================================================
   简约大气 · Minimal & Elegant — emlog 前端模板样式
   设计原则：留白、克制的配色、清晰的字阶、精致细节
   ============================================================ */

:root {
    /* 基础色板 */
    --bg: #FAFAF8;
    --surface: #FFFFFF;
    --text: #23262B;
    --text-2: #555A61;
    --muted: #8A8F98;
    --line: #E9E7E0;
    --line-strong: #D8D5CC;

    /* 主强调色：克制的深青绿，简洁大气 */
    --accent: #2F5D50;
    --accent-strong: #244A40;
    --accent-soft: #EEF3F1;

    /* 置顶/强调标记 */
    --flag: #B08D57;

    /* 尺寸与圆角 */
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(24, 30, 27, .03), 0 10px 30px rgba(24, 30, 27, .05);
    --shadow-hover: 0 2px 4px rgba(24, 30, 27, .05), 0 16px 44px rgba(24, 30, 27, .09);

    --container: 1120px;
    --gutter: 24px;

    /* 字体 */
    --font-serif: "Georgia", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
    --font-sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--accent-strong); }

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

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- 顶部导航 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 250, 248, .92);
    -webkit-backdrop-filter: saturate(1.4) blur(8px);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}
.site-brand {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--text);
    white-space: nowrap;
    line-height: 1.2;
}
.site-brand:hover { color: var(--accent); }
.site-brand em { font-style: normal; color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav .nav-item { position: relative; }
.site-nav .nav-link {
    display: block;
    padding: 8px 14px;
    color: var(--text-2);
    font-size: 14.5px;
    border-radius: 8px;
    line-height: 1.4;
}
.site-nav .nav-link:hover,
.site-nav .nav-item.active > .nav-link { color: var(--accent); background: var(--accent-soft); }
.site-nav .has-down { position: relative; }
.site-nav .has-down::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    width: 5px; height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: .7;
}
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 150px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.nav-item:hover .nav-dropdown { display: block; }
.nav-dropdown .nav-link { padding: 7px 12px; border-radius: 6px; }

/* 移动端导航按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px;
    padding: 8px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- 内容布局 ---------- */
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    padding-top: 36px;
    padding-bottom: 56px;
}
.main-col { min-width: 0; }

/* ---------- 文章卡片（列表） ---------- */
.post-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 28px;
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
}
.post-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.post-cover img { display: block; width: 100%; }
.post-body { padding: 26px 30px 22px; }
.post-head { margin-bottom: 10px; }
.post-title {
    font-family: var(--font-serif);
    font-size: 22px;
    line-height: 1.45;
    font-weight: 700;
    margin: 0 0 6px;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }
.post-flag { margin-left: 8px; }
.post-flag .flag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--flag);
    padding: 1px 8px;
    border-radius: 20px;
    vertical-align: 3px;
    letter-spacing: .06em;
}
.post-excerpt { color: var(--text-2); margin: 0 0 14px; font-size: 14.5px; }
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px dashed var(--line);
    padding-top: 14px;
    margin-top: 2px;
}
.post-meta a { color: var(--muted); }
.post-meta a:hover { color: var(--accent); }
.post-meta .dot { opacity: .6; }
.post-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-chip {
    display: inline-block;
    font-size: 12px;
    color: var(--text-2);
    background: var(--accent-soft);
    border: 1px solid transparent;
    padding: 1px 10px;
    border-radius: 20px;
    line-height: 1.7;
}
.tag-chip:hover { color: var(--accent); border-color: var(--accent); }
.post-meta-right { margin-left: auto; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0 8px;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: all .15s ease;
}
.pagination a:hover { color: var(--accent); border-color: var(--accent); }
.pagination .current, .pagination .active { color: #fff; background: var(--accent); border-color: var(--accent); }
.pagination .page-num-current { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- 文章详情 ---------- */
.post-page {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 46px 34px;
}
.post-page .post-title { font-size: 28px; margin-bottom: 8px; }
.post-page .post-meta { border-top: none; padding-top: 0; margin-bottom: 20px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.post-content { font-size: 15.5px; color: var(--text); }
.post-content p { margin: 0 0 1.2em; }
.post-content h2, .post-content h3, .post-content h4 {
    font-family: var(--font-serif);
    color: var(--text);
    line-height: 1.4;
    margin: 1.6em 0 .7em;
}
.post-content h2 { font-size: 23px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.post-content h3 { font-size: 19px; }
.post-content h4 { font-size: 16.5px; }
.post-content ul, .post-content ol { padding-left: 1.6em; margin: 0 0 1.2em; }
.post-content li { margin-bottom: .35em; }
.post-content blockquote {
    margin: 1.4em 0;
    padding: .8em 1.2em;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    color: var(--text-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content code {
    font-family: var(--font-mono);
    font-size: .9em;
    background: #F2F0EA;
    padding: 2px 6px;
    border-radius: 4px;
}
.post-content pre {
    background: #F6F5F1;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0 0 1.2em;
    font-size: 13.5px;
    line-height: 1.7;
}
.post-content pre code { background: none; padding: 0; }
.post-content img { border-radius: var(--radius-sm); }
.post-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.post-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 14px; }
.post-content th, .post-content td { border: 1px solid var(--line); padding: 8px 12px; }
.post-content th { background: var(--accent-soft); }

.post-tags-row { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-tags-row .label { color: var(--muted); font-size: 13px; }

/* 上一篇/下一篇 */
.post-neighbor {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}
.post-neighbor a { color: var(--text-2); max-width: 46%; }
.post-neighbor a:hover { color: var(--accent); }
.post-neighbor .dir { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.post-neighbor .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ---------- 评论 ---------- */
.comments-section { margin-top: 30px; }
.comments-title {
    font-family: var(--font-serif);
    font-size: 18px;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.comment-item { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.comment-item:last-child { border-bottom: none; }
.comment-main { display: flex; gap: 14px; }
.comment-avatar { flex: 0 0 44px; }
.comment-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); }
.comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.comment-author { font-weight: 600; color: var(--text); font-size: 14.5px; }
.comment-time { color: var(--muted); font-size: 12px; }
.comment-content { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.comment-reply { margin-top: 8px; }
.comment-reply .com-reply { font-size: 13px; color: var(--muted); cursor: pointer; }
.comment-reply .com-reply:hover { color: var(--accent); }
.comment-children { margin-left: 58px; margin-top: 0; }

/* 评论表单 */
.comment-form-wrap { margin-top: 26px; }
.comment-form-wrap h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.commentform textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    background: var(--surface);
    resize: vertical;
    outline: none;
    transition: border-color .15s ease;
}
.commentform textarea:focus { border-color: var(--accent); }
.comment-info-fields { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.comment-info-fields input {
    flex: 1 1 200px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    outline: none;
}
.comment-info-fields input:focus { border-color: var(--accent); }
.comment-submit-row { margin-top: 14px; display: flex; justify-content: flex-end; }
.btn-submit {
    display: inline-block;
    padding: 9px 26px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s ease;
}
.btn-submit:hover { background: var(--accent-strong); color: #fff; }

/* ---------- 侧边栏 ---------- */
.side-col { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    margin-bottom: 24px;
}
.widget-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 8px;
}
.widget-title::before {
    content: "";
    width: 4px; height: 16px;
    background: var(--accent);
    border-radius: 2px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.widget li:last-child { border-bottom: none; }
.widget li a { color: var(--text-2); font-size: 14px; display: block; }
.widget li a:hover { color: var(--accent); }

/* 博主卡片 */
.widget-blogger { text-align: center; padding-top: 26px; }
.widget-blogger .avatar {
    width: 74px; height: 74px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--accent-soft);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    margin-bottom: 12px;
}
.widget-blogger .name { font-family: var(--font-serif); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.widget-blogger .descript { color: var(--muted); font-size: 13px; line-height: 1.7; }

/* 搜索 */
.widget-search form { display: flex; gap: 8px; }
.widget-search input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    color: var(--text);
}
.widget-search input[type="search"]:focus { border-color: var(--accent); }
.widget-search input[type="submit"] {
    padding: 9px 16px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}
.widget-search input[type="submit"]:hover { background: var(--accent-strong); }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    display: inline-block;
    padding: 3px 12px;
    font-size: 13px;
    color: var(--text-2);
    background: var(--accent-soft);
    border-radius: 20px;
    line-height: 1.7;
}
.tag-cloud a:hover { color: var(--accent); }

/* 分类 */
.widget .sub-cats { padding-left: 16px; }
.widget .sub-cats a { color: var(--muted); font-size: 13px; }

/* 时间/计数 */
.w-item-meta { color: var(--muted); font-size: 12px; }

/* 归档下拉 */
.widget select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    outline: none;
}

/* ---------- 页脚 ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 30px 0 34px;
    margin-top: 20px;
}
.footer-inner { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--accent); }
.footer-inner .icp { display: block; }

/* ---------- 独立页面 ---------- */
.page-title {
    font-family: var(--font-serif);
    font-size: 26px;
    margin: 0 0 8px;
}

/* ---------- 404 ---------- */
.notfound {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
}
.notfound .code { font-family: var(--font-serif); font-size: 90px; color: var(--line-strong); line-height: 1; margin-bottom: 8px; }
.notfound .msg { font-size: 18px; color: var(--text-2); margin-bottom: 24px; }
.notfound .btn-submit { text-decoration: none; }

/* 空内容 */
.empty-tip { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .content-layout { grid-template-columns: 1fr; gap: 0; }
    .side-col { margin-top: 8px; }
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        position: absolute;
        top: 64px; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        padding: 12px;
    }
    .site-nav.open { display: flex; }
    .site-nav .nav-item { width: 100%; }
    .site-nav .nav-link { padding: 10px 14px; }
    .nav-dropdown { position: static; box-shadow: none; padding-left: 18px; }
    .nav-item:hover .nav-dropdown { display: none; }
    .site-nav.open .nav-item:hover .nav-dropdown { display: block; }
    .post-body { padding: 20px 20px 18px; }
    .post-page { padding: 26px 22px 22px; }
    .post-page .post-title { font-size: 23px; }
    .comment-children { margin-left: 20px; }
    .post-neighbor { flex-direction: column; gap: 10px; }
    .post-neighbor a { max-width: 100%; }
    .site-brand { font-size: 19px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .post-meta { gap: 8px; }
}
