/* 页面公有格式 */
:root {
    --color-primary: #2c3e66;
    --page-background: linear-gradient(120deg, #d4e6f1, #e8daef);
    --navbar-background: rgba(122, 181, 224, 0.72);
    --surface: rgba(255, 255, 255, 0.65);
    --surface-hover: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --text-primary: #334155;
    --text-heading: #1e293b;
    --text-link: #2c3e66;
    --text-muted: #6c757d;
    --text-secondary: #4b5563;
    --accent: #4a90e2;
    --accent-strong: #0033cc;
    --border: rgba(255, 255, 255, 0.3);
    --subtle-border: rgba(15, 23, 42, 0.08);
    --hover-background: rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-raised: 0 16px 32px rgba(0, 0, 0, 0.12);
    --avatar-border: #e6f0ff;
    --scroll-thumb: rgba(44, 62, 102, 0.35);
}

:root[data-theme="dark"] {
    --color-primary: #c5d9ff;
    --page-background: linear-gradient(120deg, #0d1728, #211b32);
    --navbar-background: rgba(15, 39, 68, 0.9);
    --surface: rgba(20, 32, 52, 0.78);
    --surface-hover: rgba(31, 48, 76, 0.94);
    --surface-solid: rgba(28, 44, 70, 0.96);
    --text-primary: #dbe6f3;
    --text-heading: #f2f6fc;
    --text-link: #c5d9ff;
    --text-muted: #a9b8ca;
    --text-secondary: #bdc9d8;
    --accent: #7eb6ff;
    --accent-strong: #9fc8ff;
    --border: rgba(148, 163, 184, 0.18);
    --subtle-border: rgba(203, 213, 225, 0.13);
    --hover-background: rgba(255, 255, 255, 0.09);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.24);
    --shadow-raised: 0 16px 32px rgba(0, 0, 0, 0.34);
    --avatar-border: rgba(159, 200, 255, 0.5);
    --scroll-thumb: rgba(197, 217, 255, 0.4);
}

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

body {
    font-family: sans-serif;
    background: var(--page-background);
    padding-top: 60px;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-wrap: break-word;
    transition: background 0.3s ease, color 0.3s ease;
}

/* 顶部导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--navbar-background);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
    transition: background-color 0.3s ease;
}

.navbar a {
    color: var(--text-link);
    text-decoration: none;
    display: inline-block;
    position: relative;
    padding: 16px 24px;
    transition: all 0.2s ease;
    margin-right: 8px;
    background-color: transparent;
    border-radius: 0;
}

.navbar a:hover {
    transform: scale(1.05);
    background-color: var(--hover-background);
}

.navbar a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--accent-strong);
    transition: all 0.25s ease-out;
}

.navbar a:hover::before {
    width: calc(100% - 12px);
}

.left-group, .right-group {
    display: flex;
    align-items: center;
}

.theme-toggle {
    width: 40px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    margin-right: 6px;
    padding: 0;
    color: var(--text-link);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px) scale(1.04);
    background: var(--surface-hover);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14);
}

.theme-toggle:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.left-group a:last-child,
.right-group a:last-child {
    margin-right: 0;
}

/* 文章列表通用样式（首页和文章页都可能用到） */
.post-list {
    list-style: none;
    padding: 0;
}
.post-list li {
    background-color: var(--surface-solid);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 30px;
    transition: all 0.25s ease;
}

.post-list li:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.post-list h3 {
    margin-bottom: 8px;
}

.post-list h3 a {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-link);
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: transform 0.2s ease;
}

.post-list h3 a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 30%;
    height: 2px;
    background: linear-gradient(90deg, #a0c4ff, rgba(203, 213, 224, 0));
    border-radius: 2px;
    transition: width 0.3s ease, background 0.2s ease;
}

.post-list h3 a:hover::after {
    width: 100%;
    background: linear-gradient(90deg, var(--accent), #c084fc);
}

.post-list h3 a:hover {
    transform: translateX(6px);
}

.post-list .date{
    margin-bottom: 12px;
}

.post-list p{
    margin-top: 8px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 页脚样式 */
.site-footer {
    text-align: center;
    padding: 30px 20px 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background-color: transparent;
    border-top: 1px solid var(--subtle-border);
    margin-top: 40px;
}
.site-footer a {
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.2s;
}
.site-footer a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cc-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cc-logo a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.cc-logo img {
    display: block;
    width: 80px;
    height: 15px;
    flex: 0 0 auto;
}
.police-filing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.police-filing img {
    display: block;
    width: 18px;
    height: 20px;
    object-fit: contain;
    flex: 0 0 auto;
}
/* 图片样式 */
figure {
    display: block;
    max-width: 100%;
    text-align: center;
    margin: 20px auto;
}

figure img,
.content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

figcaption {
    font-size: 12px;       /* 小字 */
    color: var(--text-muted);
    margin-top: 6px;       /* 与图片的间距 */
}

@media (max-width: 768px) {
    body {
        padding-top: 52px;
    }

    .navbar {
        padding: 0 8px;
    }

    .navbar a {
        padding: 14px 12px;
        margin-right: 0;
        font-size: 0.95rem;
    }

    .theme-toggle {
        width: 34px;
        height: 32px;
        margin-right: 2px;
        font-size: 0.9rem;
    }

    .post-list li {
        padding: 16px;
        margin-bottom: 18px;
        border-radius: 12px;
    }

    .post-list h3 a {
        font-size: 1.15rem;
    }

    .site-footer {
        padding: 24px 12px 18px;
        margin-top: 28px;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
}

@media (hover: none) {
    .navbar a:hover,
    .theme-toggle:hover,
    .post-list li:hover,
    .post-list h3 a:hover {
        transform: none;
    }
}
