/* ============================================================
   includes/site.css — 瑞雪春风 2026 新版全站样式
   设计基调：简洁、清新、留白充分；清新绿点缀，白底浅灰背景
   ============================================================ */

:root {
    --bg: #f7faf8;            /* 页面背景：极浅的灰绿 */
    --surface: #ffffff;       /* 卡片/面板底色 */
    --text: #2f3b36;          /* 正文 */
    --text-2: #74807a;        /* 次要文字 */
    --text-3: #9aa5a0;        /* 弱化文字（时间戳等） */
    --line: #e3eae6;          /* 分隔线 / 卡片描边 */
    --accent: #35866b;        /* 主题色：清新绿 */
    --accent-dark: #2a6b56;
    --accent-soft: #e9f4ef;   /* 主题色浅底 */
    --danger: #c0564f;
    --danger-soft: #faeceb;
    --ok-soft: #e9f4ef;
    --radius: 14px;
    --radius-s: 9px;
    --shadow: 0 1px 2px rgba(38, 62, 52, .05);
    --shadow-lift: 0 6px 20px rgba(38, 62, 52, .09);
    --wrap: 980px;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* 吸顶页头补偿：锚点跳转 / scrollIntoView 时目标不被页头遮挡 */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

body {
    background: var(--bg);
    color: var(--text);
    font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

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

button { font: inherit; }

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

/* ---------- 顶栏 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; }
.brand-title { height: 40px; width: auto; }

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}
.site-nav a {
    display: block;
    padding: 6px 13px;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 15px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.site-nav a:hover { color: var(--accent-dark); background: var(--accent-soft); }
.site-nav a.active { color: var(--accent-dark); background: var(--accent-soft); font-weight: 600; }

/* ---------- 主体 ---------- */
.site-main { flex: 1; padding: 34px 0 60px; }

.page-head { margin-bottom: 24px; }
.page-head h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
    line-height: 1.3;
}
.page-head .page-sub { margin-top: 8px; color: var(--text-2); font-size: 14px; padding-left: 18px; }
.page-head-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- 通用卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
}
.card-narrow { max-width: 640px; }

/* 通用空状态（暂无文章/评论/照片/留言…） */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-2);
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 9px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:disabled { background: var(--text-3); cursor: not-allowed; }

/* ---------- 表单 ---------- */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.form-field .label-note { color: var(--text-3); font-weight: 400; }
.form-field input[type="text"],
.form-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    background: #fff;
    font: inherit;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-field input[type="text"]:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field .hint { margin-top: 6px; font-size: 13px; color: var(--text-3); }

/* ---------- 提示条 ---------- */
.msg {
    padding: 10px 16px;
    margin: 0 0 18px;
    border-radius: var(--radius-s);
    font-size: 14px;
}
.msg.ok { background: var(--ok-soft); color: var(--accent-dark); }
.msg.err { background: var(--danger-soft); color: var(--danger); }

.back-link { margin-bottom: 18px; font-size: 14px; }

/* ---------- 首页 ---------- */
.hero { margin-bottom: 36px; }
.hero-media {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    background: var(--surface);
}
.hero-media img { display: block; width: 100%; height: auto; }
.hero-caption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 6px 0;
}
.hero-title { font-size: 17px; font-weight: 600; }
.hero-title img { vertical-align: -3px; margin-left: 6px; }
.hero-welcome { color: var(--text-3); font-size: 14px; letter-spacing: 1px; }

.home-section { margin-top: 40px; }
.home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}
.home-section-head h2 {
    font-size: 20px;
    font-weight: 700;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
    line-height: 1.3;
}
.home-section-head .more { font-size: 14px; color: var(--text-2); }
.home-section-head .more:hover { color: var(--accent-dark); }

/* ---------- 文章列表 ---------- */
.post-list { list-style: none; }
.post-list li { margin-bottom: 12px; }
.post-list a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    box-shadow: var(--shadow);
    color: var(--text);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.post-list a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
    border-color: #d3e2db;
    color: var(--accent-dark);
}
.post-list .post-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}
.post-list .post-date { flex-shrink: 0; font-size: 13px; color: var(--text-3); }

/* ---------- 文章正文 ---------- */
.article-card { padding: 34px 38px; }
.article-card .article-title { font-size: 26px; font-weight: 700; line-height: 1.4; }
.article-card .article-meta { margin: 10px 0 24px; color: var(--text-3); font-size: 13px; }
.article-body { line-height: 1.9; }
.article-body p { margin: 0 0 .9em; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius-s); }

/* ---------- 评论 ---------- */
.comments-section { margin-top: 34px; }
.comments-section > h2 {
    font-size: 20px;
    font-weight: 700;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
    margin-bottom: 18px;
    line-height: 1.3;
}
.comment-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    box-shadow: var(--shadow);
    padding: 14px 18px;
    margin: 12px 0;
}
.comment-item .comment-children { margin: 10px 0 0 22px; }
.comment-item .comment-children .comment-item { background: var(--bg); box-shadow: none; }
.comment-meta { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.comment-nick { font-weight: 600; color: var(--text); }
.comment-loc { color: var(--text-3); }
.comment-time { color: var(--text-3); }
.comment-body { line-height: 1.7; word-break: break-word; }
.comment-imgs { margin: 8px 0; }
.comment-imgs .comment-img {
    max-width: 120px;
    max-height: 120px;
    margin: 0 8px 8px 0;
    vertical-align: top;
    border-radius: 6px;
}
.comment-reply { margin-top: 6px; font-size: 13px; }
.comment-pending {
    color: var(--danger);
    font-size: 12px;
    background: var(--danger-soft);
    border-radius: 4px;
    padding: 1px 6px;
}
.comment-admin-act { margin-left: 10px; }
.comment-admin-del { color: var(--danger) !important; }

.comment-form-card { margin-top: 22px; }
.comment-form-card h3 { font-size: 16px; margin-bottom: 14px; }

/* ---------- 相册 ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
    gap: 18px;
}
.photo-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
}
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.photo-card .photo-thumb { display: block; }
.photo-card .photo-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.photo-card figcaption { padding: 10px 14px 12px; font-size: 14px; }
.photo-card figcaption a { color: var(--text-2); }
.photo-card figcaption a:hover { color: var(--accent-dark); }
.photo-card figcaption img { vertical-align: -4px; margin-left: 4px; }

/* 单图页（时光机） */
.photo-view { text-align: center; }
.photo-view-stage { position: relative; display: inline-block; max-width: 100%; }
.photo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-2);
    user-select: none;
    transition: background .15s, color .15s, border-color .15s;
}
.photo-nav:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.photo-nav-prev { left: 14px; }
.photo-nav-next { right: 14px; }
.photo-view img {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.photo-view figcaption { margin-top: 14px; font-size: 16px; color: var(--text-2); }
.photo-view figcaption img { width: 20px; vertical-align: -4px; margin-left: 6px; border: 0; box-shadow: none; border-radius: 0; }

/* ---------- 标签页（好文欣赏 / 小工具） ---------- */
.tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin-bottom: 16px;
}
.tabbar a {
    display: block;
    padding: 7px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    transition: background .15s, color .15s, border-color .15s;
}
.tabbar a:hover { color: var(--accent-dark); border-color: var(--accent); }
.tabbar a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}
.tab-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
    min-height: 200px;
}

/* ---------- 留言板 ---------- */
.guestbook-list { list-style: none; }
.guestbook-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 22px;
    margin-bottom: 14px;
}
.guestbook-item-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}
.guestbook-item-nickname { font-weight: 600; }
.guestbook-item-time { font-size: 13px; color: var(--text-3); }
.guestbook-item-body { line-height: 1.8; word-break: break-word; }
.guestbook-item-body img.guestbook-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-s);
    margin: 10px 0;
    display: block;
}
.guestbook-item-act { margin-top: 10px; }
.guestbook-item-act button {
    padding: 4px 14px;
    font-size: 13px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    color: var(--text-3);
}
.guestbook-item-act button:hover {
    background: var(--danger-soft);
    border-color: var(--danger-soft);
    color: var(--danger);
}

/* ---------- 页脚 ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 22px 0 26px;
    font-size: 13px;
    color: var(--text-3);
    text-align: center;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--text-3); }
.site-footer a:hover { color: var(--accent-dark); }
.site-footer .beian-logo { width: 16px; vertical-align: -3px; margin-right: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    /* 窄屏页头换行后更高，锚点补偿加大 */
    html { scroll-padding-top: 128px; }
    .site-header-inner { justify-content: center; }
    .site-nav { justify-content: center; }
    .site-main { padding: 22px 0 44px; }
    .wrap { padding: 0 14px; }
    .card, .tab-panel { padding: 20px 16px; }
    .article-card { padding: 22px 18px; }
    .photo-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .post-list a { padding: 13px 16px; }
    .post-list .post-date { display: none; }
    .photo-nav { width: 36px; height: 36px; font-size: 15px; }
    .photo-nav-prev { left: 8px; }
    .photo-nav-next { right: 8px; }
}

@media (max-width: 480px) {
    .photo-grid { grid-template-columns: 1fr; }
}
