:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #1f2329;
    --muted: #8a919f;
    --border: #e9ebf0;
    --accent: #3b6df6;
    --accent-soft: #eef3ff;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(20, 30, 50, .06), 0 8px 24px rgba(20, 30, 50, .04);
    --maxw: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(160deg, #e8f0ff 0%, #f3f7ff 45%, #ffffff 100%);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.brand {
    font-weight: 700;
    font-size: 19px;
    color: var(--text);
    letter-spacing: .3px;
}
.brand span { color: var(--accent); }
.site-header nav { display: flex; gap: 26px; }
.site-header nav a {
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    display: inline-block;
    transition: color .15s ease, transform .15s ease;
}
.site-header nav a:hover {
    color: var(--accent);
    text-decoration: none;
    transform: scale(1.12);
}
.site-header nav a.active { color: var(--accent); text-decoration: none; }

/* ---------- Profile (mengxiblog-style landing) ---------- */
.profile {
    padding: 72px 0 8px;
    text-align: center;
}
.profile .avatar {
    width: 96px; height: 96px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f9bff, #3b6df6);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 40px; font-weight: 700;
    box-shadow: var(--shadow);
}
.profile-name {
    font-size: 30px;
    margin: 0 0 12px;
    letter-spacing: .3px;
}
.profile-meta {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14.5px;
    margin-bottom: 26px;
}
.profile-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    transition: color .15s ease;
}
.profile-meta .meta-item:hover {
    color: var(--accent);
    text-decoration: none;
}
.profile-meta .meta-item svg { flex: none; }
.profile-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    transition: transform .12s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(59,109,246,.35); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* ---------- About text (prose) ---------- */
.about-text {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    color: #3a3f47;
    font-size: 16px;
    line-height: 1.9;
}

/* ---------- Website list ---------- */
.site-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.site-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.site-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(20,30,50,.08);
}
.site-card-name { font-weight: 700; font-size: 16px; color: var(--text); }
.site-card-desc { color: var(--muted); font-size: 14px; margin: 6px 0 10px; line-height: 1.6; }
.site-card-url { color: var(--accent); font-size: 13px; }

@media (max-width: 640px) {
    .site-list { grid-template-columns: 1fr; }
}

/* ---------- Cards / sections ---------- */
.section { margin: 48px 0; }
.section-title {
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 18px;
    font-weight: 700;
}
.intro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.intro-grid .card h3 { margin: 0 0 8px; font-size: 16px; }
.intro-grid .card p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Recent posts list (homepage = links only, NO article body) ---------- */
.recent li {
    list-style: none;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
}
.recent { padding: 0; margin: 0; }
.recent li:last-child { border-bottom: none; }
.recent .r-title { font-weight: 600; color: var(--text); }
.recent .r-title:hover { color: var(--accent); text-decoration: none; }
.recent .r-date { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- Blog list ---------- */
.post-list { display: grid; gap: 18px; }
.post-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    transition: transform .12s ease, box-shadow .2s ease;
}
.post-item:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20,30,50,.08); }
.post-item h2 { margin: 0 0 8px; font-size: 20px; }
.post-item h2 a { color: var(--text); }
.post-item h2 a:hover { color: var(--accent); text-decoration: none; }
.post-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; }
.badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.post-item .excerpt { color: #51565f; margin: 0 0 12px; }
.post-item .read-more { font-weight: 600; font-size: 14px; }

/* ---------- Single post ---------- */
.post-header { padding: 40px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.post-header h1 { font-size: 30px; margin: 0 0 12px; }
.post-body { font-size: 16.5px; }
.post-body h3 { margin-top: 30px; }
.post-body p { margin: 16px 0; }
.post-body img { max-width: 100%; border-radius: 10px; }
.post-body code {
    background: #f0f2f5; padding: 2px 6px; border-radius: 6px; font-size: 14px;
}
.tags { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; }
.tags .tag { background: var(--bg); border: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 3px 12px; border-radius: 999px; }
.back-link { display: inline-block; margin: 36px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- About ---------- */
.about-wrap { padding: 30px 0; }
.about-wrap h1 { font-size: 28px; }
.prose p { color: #3a3f47; }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 64px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 28px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text);
}
.site-footer .muted { color: var(--muted); margin: 6px 0 0; }

.muted { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .hero { padding: 56px 0 40px; }
    .hero h1 { font-size: 27px; }
    .intro-grid { grid-template-columns: 1fr; }
    .site-header nav { gap: 16px; }
}

/* ---------- Admin ---------- */
.admin-wrap { max-width: 940px; margin: 32px auto; padding: 0 20px; }
.login-box { max-width: 360px; margin: 90px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.login-box h1 { font-size: 20px; margin: 0 0 6px; text-align: center; }
.login-box .hint { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input, select.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text); box-sizing: border-box; }
textarea.input { min-height: 170px; resize: vertical; line-height: 1.6; }
.btn-admin { background: var(--accent); color: #fff; border: none; padding: 10px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn-admin:hover { opacity: .92; }
.btn-ghost-a { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 9px 16px; border-radius: 10px; font-weight: 500; font-size: 14px; cursor: pointer; }
.admin-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 26px; }
.admin-nav a { background: var(--surface); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--text); }
.admin-nav a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.admin-nav a.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .n { font-size: 26px; font-weight: 700; }
.stat-card .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
table.visits { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.visits th, table.visits td { text-align: left; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
table.visits th { background: var(--bg); color: var(--muted); font-weight: 600; }
table.visits tr:last-child td { border-bottom: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.photo-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.photo-item img { width: 100%; height: 150px; object-fit: cover; display: block; }
.photo-item .cap { padding: 8px 10px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.alert { background: #fff4f4; border: 1px solid #f3c2c2; color: #a33; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.alert.ok { background: #eefaf0; border: 1px solid #bfe6c8; color: #1f7a36; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.section-h { font-size: 16px; margin: 26px 0 12px; }
@media (max-width: 640px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } .row-2 { grid-template-columns: 1fr; } }
