/*
Theme Name: Beihai Blog
Theme URI: https://beihai.com
Author: Beihai
Author URI: https://beihai.com
Description: 一个简约现代的浅色WordPress主题，包含固定导航栏、搜索功能、主题切换、现代圆角评论区和带时间问候语的横幅区域。
Version: 1.5.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: beihai-blog
Tags: blog, modern, light, minimalist, responsive, dark-mode
*/

/* ================================
   CSS Variables - Light Mode (Default)
   ================================ */
:root {
    /* Primitives */
    --beihai-rose: #C96B7A;
    --beihai-lilac: #A08BB8;
    --beihai-sky: #5B9CB5;
    --beihai-warm: #E8A04C;
    --beihai-ink: #2D2A26;
    --beihai-paper: #FAF7F4;
    --beihai-paper-2: #F3EFEB;
    --beihai-night: #13121F;
    --beihai-night-2: #1C1B2A;
    --beihai-night-3: #242336;

    /* Semantic tokens */
    --bg-base: var(--beihai-paper);
    --bg-muted: var(--beihai-paper-2);
    --bg-surface: rgba(255, 252, 250, 0.88);
    --bg-glass: rgba(255, 252, 250, 0.72);
    --bg-hover: rgba(160, 139, 184, 0.06);
    --text-primary: var(--beihai-ink);
    --text-secondary: #6B6560;
    --text-light: #9C9590;
    --accent-primary: var(--beihai-rose);
    --accent-primary-hover: #B85A68;
    --accent-primary-muted: rgba(201, 107, 122, 0.08);
    --accent-primary-soft: rgba(201, 107, 122, 0.12);
    --accent-secondary: var(--beihai-sky);
    --accent-tertiary: var(--beihai-lilac);
    --accent-emotion: linear-gradient(135deg, #C96B7A 0%, #A08BB8 50%, #5B9CB5 100%);
    --border-subtle: rgba(45, 42, 38, 0.08);
    --border-emphasis: rgba(201, 107, 122, 0.22);
    --border-lilac: rgba(160, 139, 184, 0.14);
    --shadow-sm: 0 1px 3px rgba(72, 58, 82, 0.05);
    --shadow-md: 0 4px 12px rgba(72, 58, 82, 0.07);
    --shadow-lg: 0 10px 24px rgba(72, 58, 82, 0.09);
    --shadow-accent: 0 8px 24px rgba(201, 107, 122, 0.10);
    --focus-ring: rgba(201, 107, 122, 0.18);

    /* Backward-compatible aliases */
    --primary-color: var(--accent-primary);
    --primary-hover: var(--accent-primary-hover);
    --bg-light: var(--bg-base);
    --bg-white: var(--bg-surface);
    --bg-gray: var(--bg-muted);
    --border-color: var(--border-subtle);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --transition: all 0.3s ease;
    --transition-fast: 0.15s ease;
    --transition-micro: 0.2s ease;
    --header-height: 64px;

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-display: "ZCOOL QingKe HuangYou", var(--font-body);
    --font-signature: "STKaiti", "KaiTi", "楷体", serif;
    --text-base: 1rem;
    --text-sm: 0.9375rem;
    --text-lg: 1.0625rem;
    --leading-body: 1.75;
    --leading-prose: 1.9;
    --leading-tight: 1.35;
    --measure-prose: 38rem;
    --measure-content: 48rem;
    --text-prose: 1.0625rem;
    --space-paragraph: 1.5em;
    --space-block: 2rem;
    --space-section: 2.75rem;
    --space-heading-after: 0.75em;
    --space-heading-before-h2: 2.75em;
    --space-heading-before-h3: 2em;
    --space-heading-before-h4: 1.75em;
    --tracking-tight: -0.01em;
    --tracking-normal: 0;
    --tracking-prose: 0.02em;
    --font-mono: ui-monospace, "Cascadia Code", "Source Han Mono SC", "SF Mono", Menlo, Consolas, monospace;
    --code-bg: var(--bg-muted);
    --code-border: var(--border-subtle);
    --code-text: var(--text-primary);
    --quote-bg: var(--bg-muted);
    --quote-border: var(--border-lilac);
}

/* ================================
   CSS Variables - Dark Mode
   ================================ */
[data-theme="dark"] {
    /* Primitives */
    --beihai-night: #13121F;
    --beihai-night-2: #1C1B2A;
    --beihai-night-3: #242336;

    /* Semantic tokens */
    --bg-base: var(--beihai-night);
    --bg-muted: var(--beihai-night-2);
    --bg-surface: rgba(36, 35, 54, 0.88);
    --bg-glass: rgba(28, 27, 42, 0.72);
    --bg-hover: rgba(181, 163, 204, 0.08);
    --text-primary: #F5F0EB;
    --text-secondary: #B8B0A8;
    --text-light: #8A827A;
    --accent-primary: #E8829B;
    --accent-primary-hover: #F09BB0;
    --accent-primary-muted: rgba(232, 130, 155, 0.1);
    --accent-primary-soft: rgba(232, 130, 155, 0.15);
    --accent-secondary: #7CB4CC;
    --accent-tertiary: #B5A3CC;
    --accent-emotion: linear-gradient(135deg, #E8829B 0%, #B5A3CC 50%, #7CB4CC 100%);
    --border-subtle: rgba(245, 240, 235, 0.08);
    --border-emphasis: rgba(232, 130, 155, 0.18);
    --border-lilac: rgba(181, 163, 204, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.45);
    --shadow-accent: 0 8px 24px rgba(232, 130, 155, 0.12);
    --focus-ring: rgba(232, 130, 155, 0.2);

    /* Backward-compatible aliases */
    --primary-color: var(--accent-primary);
    --primary-hover: var(--accent-primary-hover);
    --bg-light: var(--bg-base);
    --bg-white: var(--bg-surface);
    --bg-gray: var(--bg-muted);
    --border-color: var(--border-subtle);
}

/* ================================
   Reset & Base
   ================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    color: var(--text-primary);
    background-color: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.7s ease, color 0.7s ease;
}

html[data-theme="dark"] body {
    background: linear-gradient(180deg, var(--beihai-night) 0%, #161528 100%);
    background-attachment: fixed;
}

html[data-theme="dark"] body.single-post {
    background: var(--bg-base);
    background-attachment: scroll;
}

body.home,
body.front-page {
    background-color: var(--bg-base);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

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

/* ================================
   Fixed Navigation
   ================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    transition: var(--transition);
}

.home .site-header,
.front-page .site-header {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: transparent;
    box-shadow: none;
}

.home .site-header.scrolled,
.front-page .site-header.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--border-subtle);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .site-header {
    background: var(--bg-glass);
}

html[data-theme="dark"] .home .site-header,
html[data-theme="dark"] .front-page .site-header {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .home .site-header.scrolled,
html[data-theme="dark"] .front-page .site-header.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--border-subtle);
    box-shadow: var(--shadow-md);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* 左侧：站点品牌 */
.header-left {
    flex-shrink: 0;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo img {
    height: 36px;
    width: auto;
}

.site-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: var(--tracking-normal);
    color: var(--text-primary);
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    color: var(--primary-color);
}

/* 中间：主导航 */
.main-navigation {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 0;
    position: relative;
    white-space: nowrap;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: var(--primary-color);
}

.nav-menu a:hover::after,
.nav-menu a:focus::after {
    width: 100%;
}

.nav-menu .current-menu-item a {
    color: var(--primary-color);
}

.nav-menu .current-menu-item a::after {
    width: 100%;
}

/* 右侧：搜索栏 */
.header-right {
    flex-shrink: 0;
}

.header-search {
    display: flex;
    align-items: center;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    padding: 4px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.search-form:focus-within {
    background: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-field {
    width: 200px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--text-primary);
    outline: none;
    transition: width 0.3s ease;
}

.search-field::placeholder {
    color: var(--text-light);
}

.search-field:focus {
    width: 260px;
}

.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: opacity var(--transition-micro), background var(--transition-micro);
}

.search-submit:hover {
    background: var(--primary-hover);
    opacity: 0.92;
}

.search-submit:active {
    opacity: 0.85;
}

/* 移动端搜索按钮 */
.mobile-search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.mobile-search-toggle:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}

/* 移动端搜索面板 */
.mobile-search-panel {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-white);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    gap: 12px;
    align-items: center;
}

.mobile-search-panel.active {
    display: flex;
}

.mobile-search-form {
    display: flex;
    flex: 1;
    gap: 12px;
}

.mobile-search-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.mobile-search-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.mobile-search-submit {
    padding: 12px 24px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition-micro), background var(--transition-micro);
}

.mobile-search-submit:hover {
    background: var(--primary-hover);
    opacity: 0.92;
}

.mobile-search-submit:active {
    opacity: 0.85;
}

.mobile-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-gray);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.mobile-search-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* ================================
   Author Float Widget (Left Side)
   ================================ */
.author-float-widget {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 998;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.author-float-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.author-float-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
}

.author-toggle-icon {
    font-size: 1.125rem;
}

.author-toggle-text {
    writing-mode: horizontal-tb;
}

.author-float-content {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-20px);
    width: 300px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.author-float-widget.active .author-float-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.author-float-widget.active .author-float-toggle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.author-float-header {
    display: flex;
    justify-content: flex-end;
    padding: 12px 12px 0;
}

.author-float-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-gray);
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.author-float-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.author-info {
    padding: 0 24px 24px;
    text-align: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 3px solid var(--bg-white);
    box-shadow: var(--shadow-md);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar-default {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    color: var(--text-light);
}

.author-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.author-bio {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ================================
   Author Signature (随笔栏)
   ================================ */
.author-signature {
    position: relative;
    padding: 16px 20px;
    margin: 0 -8px 20px;
    background: var(--accent-primary-muted);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--accent-primary);
}

.author-signature::before,
.author-signature::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-lilac), transparent);
}

.author-signature::before {
    top: 0;
}

.author-signature::after {
    bottom: 0;
}

[data-theme="dark"] .author-signature {
    background: var(--accent-primary-muted);
}

.signature-quote {
    position: absolute;
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.3;
    line-height: 1;
}

.signature-quote:first-child {
    top: 4px;
    left: 8px;
}

.signature-quote:last-child {
    bottom: 4px;
    right: 8px;
}

.signature-text {
    font-family: var(--font-signature);
    font-size: 0.9375rem;
    font-style: normal;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* ================================
   Theme Toggle Switch (日间/夜间模式)
   ================================ */
.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.theme-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 胶囊轨道开关 */
.theme-toggle {
    position: relative;
    width: 64px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.theme-toggle-track {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--beihai-night-2) 0%, var(--beihai-night) 50%, var(--beihai-night-3) 100%);
    border-radius: var(--radius-full);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* 轨道内的装饰渐变 - 从左到右深夜蓝紫 */
.theme-toggle-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, 
        color-mix(in srgb, var(--beihai-night) 80%, transparent) 0%, 
        color-mix(in srgb, var(--beihai-night-2) 60%, transparent) 50%, 
        color-mix(in srgb, var(--beihai-night-3) 40%, transparent) 100%);
    border-radius: var(--radius-full);
}

/* 圆形滑块 */
.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background: linear-gradient(145deg, #ffffff 0%, var(--beihai-paper) 50%, var(--beihai-paper-2) 100%);
    border-radius: var(--radius-full);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    transform: translateX(0);
    transition: transform 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
                background 0.7s ease,
                box-shadow 0.7s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* 滑块立体感增强 */
.theme-toggle-thumb::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 100%);
    border-radius: var(--radius-full);
    pointer-events: none;
}

/* 滑块图标容器 */
.theme-icon-light,
.theme-icon-dark {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.theme-icon-light {
    color: var(--beihai-warm);
    opacity: 1;
    transform: scale(1);
}

.theme-icon-dark {
    color: var(--accent-secondary);
    opacity: 0;
    transform: scale(0.8);
}

/* 夜间模式激活状态 */
.theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
    transform: translateX(32px);
    background: linear-gradient(145deg, var(--beihai-night-2) 0%, var(--beihai-night) 50%, #0D0C14 100%);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 -2px 4px rgba(255, 255, 255, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-toggle[aria-pressed="true"] .theme-icon-light {
    opacity: 0;
    transform: scale(0.8);
}

.theme-toggle[aria-pressed="true"] .theme-icon-dark {
    opacity: 1;
    transform: scale(1);
}

/* 日间模式下的轨道 - 从右至左暖光渐变 */
.theme-toggle[aria-pressed="false"] .theme-toggle-track {
    background: linear-gradient(to left, #fef3c7 0%, #fde68a 30%, #fcd34d 60%, #fbbf24 100%);
    box-shadow: 
        inset 0 2px 4px rgba(251, 191, 36, 0.3),
        inset 0 -1px 2px rgba(255, 255, 255, 0.5),
        0 0 10px rgba(251, 191, 36, 0.2);
}

.theme-toggle[aria-pressed="false"] .theme-toggle-track::before {
    background: linear-gradient(to left, 
        rgba(254, 243, 199, 0.6) 0%, 
        rgba(252, 211, 77, 0.4) 50%, 
        rgba(251, 191, 36, 0.2) 100%);
}

/* 悬停效果 */
.theme-toggle:hover .theme-toggle-thumb {
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.25),
        0 6px 12px rgba(0, 0, 0, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

/* 点击动画 */
.theme-toggle:active .theme-toggle-thumb {
    transform: translateX(0) scale(0.95);
}

.theme-toggle[aria-pressed="true"]:active .theme-toggle-thumb {
    transform: translateX(32px) scale(0.95);
}

/* ================================
   Hero Banner
   ================================ */
.hero-banner {
    position: relative;
    min-height: 480px;
    margin-top: var(--header-height);
    margin-bottom: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

html[data-theme="dark"] .hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        radial-gradient(1px 1px at 22% 28%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 78% 18%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1px 1px at 55% 72%, rgba(255, 255, 255, 0.3), transparent);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
}

.hero-background::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(
        ellipse 60% 50% at 25% 40%,
        rgba(201, 107, 122, 0.12),
        transparent 70%
    );
}

[data-theme="dark"] .hero-background::before {
    background: radial-gradient(
        ellipse 60% 50% at 25% 40%,
        rgba(181, 163, 204, 0.08),
        transparent 70%
    );
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    background:
        linear-gradient(
            180deg,
            transparent 55%,
            rgba(201, 107, 122, 0.06) 75%,
            rgba(160, 139, 184, 0.04) 88%,
            transparent 100%
        ),
        linear-gradient(
            105deg,
            rgba(45, 42, 38, 0.08) 0%,
            rgba(45, 42, 38, 0.02) 35%,
            rgba(45, 42, 38, 0.18) 58%,
            rgba(250, 247, 244, 0.55) 82%,
            var(--bg-base) 100%
        );
}

[data-theme="dark"] .hero-background::after {
    background:
        linear-gradient(
            180deg,
            transparent 55%,
            rgba(232, 130, 155, 0.05) 75%,
            rgba(181, 163, 204, 0.04) 88%,
            transparent 100%
        ),
        linear-gradient(
            105deg,
            rgba(0, 0, 0, 0.35) 0%,
            rgba(0, 0, 0, 0.12) 35%,
            rgba(0, 0, 0, 0.22) 58%,
            rgba(19, 18, 31, 0.55) 82%,
            var(--bg-base) 100%
        );
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 96px;
    background-color: var(--bg-base);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 96' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,48 C360,64 1080,32 1440,48 L1440,96 L0,96 Z' fill='white'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 96' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,48 C360,64 1080,32 1440,48 L1440,96 L0,96 Z' fill='white'/%3E%3C/svg%3E");
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: bottom;
    mask-position: bottom;
    z-index: 3;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 48px 24px;
    max-width: 800px;
}

@keyframes fadeUpSoft {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-greeting {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    animation: fadeUpSoft 0.9s ease-out both;
    animation-delay: 0.1s;
}

.greeting--morning {
    background: linear-gradient(135deg, rgba(232, 160, 76, 0.28), rgba(252, 211, 77, 0.18));
}

.greeting--afternoon {
    background: linear-gradient(135deg, rgba(91, 156, 181, 0.22), rgba(160, 139, 184, 0.14), rgba(201, 107, 122, 0.16));
}

.greeting--night {
    background: linear-gradient(135deg, rgba(124, 180, 204, 0.2), rgba(201, 107, 122, 0.22));
}

.greeting-icon {
    font-size: 1.125rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: var(--tracking-normal);
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(45, 42, 38, 0.18);
    animation: fadeUpSoft 0.9s ease-out both;
    animation-delay: 0.25s;
}

.hero-byline {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.06em;
    margin-bottom: 20px;
    animation: fadeUpSoft 0.9s ease-out both;
    animation-delay: 0.4s;
}

.hero-description {
    font-size: clamp(0.9375rem, 2vw, 1.125rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    line-height: var(--leading-prose);
    max-width: 28rem;
    margin-inline: auto;
    animation: fadeUpSoft 0.9s ease-out both;
    animation-delay: 0.55s;
}

.hero-enter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: color var(--transition-micro), transform var(--transition-micro);
    animation: fadeUpSoft 0.9s ease-out both;
    animation-delay: 0.7s;
}

.hero-enter:hover {
    color: #ffffff;
    transform: translateY(1px);
}

.hero-enter-icon {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.85;
    transition: transform var(--transition-micro);
}

.hero-enter:hover .hero-enter-icon {
    transform: translateY(2px);
}

@media (prefers-reduced-motion: reduce) {
    .hero-greeting,
    .hero-title,
    .hero-byline,
    .hero-description,
    .hero-enter {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .hero-background {
        will-change: auto;
    }
}

/* ================================
   Main Content
   ================================ */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
    /* 为固定导航栏留出空间（首页除外，因为首页有横幅区域已处理） */
    padding-top: calc(var(--header-height) + 48px);
}

/* 首页不需要额外的顶部间距，因为横幅区域已有 margin-top */
.home .site-main,
.front-page .site-main {
    padding-top: 16px;
}

/* 主内容区域 - 轻微磨砂玻璃效果 */
.content-area {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
}

[data-theme="dark"] .content-area {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
}

/* ================================
   Posts & Articles
   ================================ */
.post-list {
    display: grid;
    gap: 40px;
}

/* 文章卡片 - 磨砂玻璃效果 */
.post-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
}

[data-theme="dark"] .post-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.post-card:hover {
    background: var(--bg-hover), var(--bg-surface);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--border-emphasis);
}

[data-theme="dark"] .post-card:hover {
    background: var(--bg-hover), var(--bg-surface);
    border-color: var(--border-emphasis);
    box-shadow: var(--shadow-md);
}

.post-thumbnail {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.03);
}

.post-content {
    padding: 24px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-title {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: 12px;
}

.post-title a {
    color: var(--text-primary);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    max-width: var(--measure-content);
    color: var(--text-secondary);
    line-height: var(--leading-prose);
    margin-bottom: 16px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--primary-color);
    transition: transform var(--transition-micro), color var(--transition-micro);
}

.read-more:hover {
    transform: translateX(2px);
}

/* ================================
   Single Post
   ================================ */
body.single-post .content-area {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 24px 0 48px;
    max-width: var(--measure-prose);
    margin-inline: auto;
}

body.single-post .site-main {
    padding-top: calc(var(--header-height) + 32px);
}

.single-post .entry-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.single-post .entry-title {
    font-family: var(--font-body);
    font-size: clamp(1.625rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: var(--tracking-prose);
    margin-bottom: 16px;
}

.single-post .entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.single-post .entry-meta a {
    color: var(--text-secondary);
}

.single-post .entry-meta a:hover {
    color: var(--accent-primary);
}

/* Shared prose rhythm for articles and pages */
.entry-content {
    max-width: var(--measure-prose);
    margin-inline: auto;
    font-size: var(--text-prose);
    line-height: var(--leading-prose);
    letter-spacing: var(--tracking-prose);
    color: var(--text-primary);
    text-align: justify;
    text-justify: inter-ideograph;
    hanging-punctuation: allow-end;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-content p {
    margin-bottom: var(--space-paragraph);
}

.entry-content strong {
    font-weight: 600;
}

.entry-content a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: rgba(201, 107, 122, 0.35);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.entry-content a:hover {
    color: var(--accent-primary);
    text-decoration-color: var(--accent-primary);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-bottom: var(--space-heading-after);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
}

.entry-content h2 {
    margin-top: var(--space-heading-before-h2);
    font-size: clamp(1.5rem, 3vw, 1.875rem);
}

.entry-content > h2:first-child {
    margin-top: 0;
}

.entry-content h3 {
    margin-top: var(--space-heading-before-h3);
    font-size: clamp(1.1875rem, 2.5vw, 1.3125rem);
}

.entry-content h4 {
    margin-top: var(--space-heading-before-h4);
    font-size: clamp(1.0625rem, 2vw, 1.1875rem);
}

.entry-content ul,
.entry-content ol {
    margin-bottom: var(--space-paragraph);
    padding-left: 1.5em;
}

.entry-content li {
    margin-bottom: 0.35em;
}

.entry-content li::marker {
    color: var(--text-light);
}

.entry-content hr {
    border: none;
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-section) 0;
}

.entry-content table {
    width: 100%;
    margin: var(--space-block) 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.entry-content th,
.entry-content td {
    padding: 0.625em 0.875em;
    border: 1px solid var(--border-subtle);
    text-align: left;
}

.entry-content th {
    font-weight: 600;
    background: var(--bg-muted);
}

.entry-content figure {
    margin: var(--space-block) 0;
}

.entry-content figcaption {
    margin-top: 0.625em;
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
}

.entry-content img {
    border-radius: var(--radius-sm);
    margin: var(--space-block) 0;
}

.entry-content blockquote {
    margin: var(--space-block) 0;
    padding: 1.25em 1.5em;
    background: var(--quote-bg);
    border-left: 2px solid var(--quote-border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-family: var(--font-body);
    font-size: 0.975em;
    line-height: var(--leading-prose);
    color: var(--text-secondary);
    letter-spacing: var(--tracking-prose);
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content :not(pre) > code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 0.15em 0.45em;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-sm);
    color: var(--code-text);
    word-break: break-word;
}

.entry-content pre,
.entry-content .wp-block-code {
    margin: var(--space-block) 0;
    padding: 1.25em 1.5em;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--code-text);
    tab-size: 4;
}

.entry-content pre code {
    padding: 0;
    background: none;
    border: none;
    font-size: inherit;
}

.single-post .entry-thumbnail {
    margin-bottom: 32px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.single-post .entry-thumbnail img {
    width: 100%;
    height: auto;
}

.single-post .entry-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-subtle);
}

.single-post .post-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
}

.single-post .post-navigation .nav-previous,
.single-post .post-navigation .nav-next {
    padding: 16px 0;
    background: transparent;
    border-radius: 0;
    border-top: 1px solid var(--border-subtle);
    transition: none;
}

.single-post .post-navigation .nav-next {
    text-align: right;
}

.single-post .post-navigation .nav-previous:hover,
.single-post .post-navigation .nav-next:hover {
    background: transparent;
}

.single-post .post-navigation .nav-subtitle {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.single-post .post-navigation .nav-title {
    font-weight: 500;
    color: var(--text-primary);
}

/* ================================
   Pagination
   ================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.pagination a,
.pagination .current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.pagination a {
    color: var(--text-secondary);
    background: var(--bg-gray);
}

.pagination a:hover {
    color: var(--primary-color);
    background: var(--accent-primary-soft);
}

.pagination .current {
    color: #ffffff;
    background: var(--accent-primary);
}

/* ================================
   Footer
   ================================ */
.site-footer {
    position: relative;
    background: var(--bg-muted);
    border-top: 1px solid var(--border-subtle);
    padding: 48px 24px 24px;
    margin-top: 64px;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -32px;
    left: 0;
    right: 0;
    height: 32px;
    background-color: var(--bg-base);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,16 C480,32 960,0 1440,16 L1440,0 L0,0 Z' fill='white'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,16 C480,32 960,0 1440,16 L1440,0 L0,0 Z' fill='white'/%3E%3C/svg%3E");
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    pointer-events: none;
}

html[data-theme="dark"] .site-footer {
    background: linear-gradient(180deg, var(--beihai-night-2) 0%, #161528 100%);
    border-top: 1px solid var(--border-subtle);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* 左侧：归档菜单 */
.footer-archives .footer-menu {
    list-style: none;
    padding: 0;
}

.footer-archives .footer-menu li {
    margin-bottom: 10px;
}

.footer-archives .footer-menu a {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: var(--transition);
    position: relative;
    padding-left: 16px;
}

.footer-archives .footer-menu a::before {
    content: '📁';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.75rem;
    opacity: 0.6;
}

.footer-archives .footer-menu a:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* 中间：备案信息区域 */
.footer-icp .icp-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer-icp .icp-content p {
    margin-bottom: 8px;
}

.footer-icp .icp-content a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-icp .icp-content a:hover {
    color: var(--primary-color);
}

/* 右侧：站外链接 + 社交链接 */
.footer-links .footer-menu {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.footer-links .footer-menu li {
    margin-bottom: 10px;
}

.footer-links .footer-menu a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: var(--transition);
}

.footer-links .footer-menu a::before {
    content: '↗';
    font-size: 0.75rem;
    opacity: 0.6;
    transition: var(--transition);
}

.footer-links .footer-menu a:hover {
    color: var(--primary-color);
}

.footer-links .footer-menu a:hover::before {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* 社交链接区域 */
.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-gray);
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.social-link.github:hover {
    background: #24292e;
    color: #ffffff;
}

.social-link.twitter:hover {
    background: #1da1f2;
    color: #ffffff;
}

.social-link.weibo:hover {
    background: #e6162d;
    color: #ffffff;
}

.social-link.rss:hover {
    background: #ff6600;
    color: #ffffff;
}

/* 通用页脚widget标题 */
.footer-widget h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ================================
   Responsive - Large Desktop
   ================================ */
@media (max-width: 1200px) {
    .author-float-widget {
        left: 16px;
    }
}

/* ================================
   Responsive - Tablet
   ================================ */
@media (max-width: 1024px) {
    :root {
        --header-height: 60px;
    }

    .header-container {
        padding: 0 20px;
    }

    .search-field {
        width: 160px;
    }

    .search-field:focus {
        width: 200px;
    }

    .nav-menu {
        gap: 24px;
    }

    .author-float-widget {
        left: 12px;
    }

    .author-float-content {
        width: 280px;
    }
}

/* ================================
   Responsive - Mobile
   ================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .header-container {
        padding: 0 16px;
        gap: 12px;
    }

    /* 隐藏桌面搜索，显示移动端搜索按钮 */
    .header-search .search-form {
        display: none;
    }

    .mobile-search-toggle {
        display: flex;
    }

    /* 移动端导航菜单 */
    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        flex: 0 0 auto;
        gap: 8px;
    }

    .main-navigation .nav-menu {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 16px;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        z-index: 998;
    }

    .main-navigation .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 12px 0;
        font-size: 1rem;
    }

    .nav-menu a::after {
        display: none;
    }

    /* 移动端作者悬浮框调整 - 移至左下角 */
    .author-float-widget {
        left: 16px;
        top: auto;
        bottom: 24px;
        transform: none;
    }

    .author-float-toggle {
        padding: 10px 14px;
        font-size: 0.8125rem;
    }

    .author-float-toggle:hover {
        transform: translateY(-4px);
    }

    .author-toggle-text {
        display: none;
    }

    .author-float-content {
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(-20px);
        width: 280px;
    }

    .author-float-widget.active .author-float-content {
        transform: translateY(-56px);
    }

    /* 主题切换开关在移动端缩小 */
    .theme-toggle {
        width: 56px;
        height: 28px;
    }

    .theme-toggle-thumb {
        width: 22px;
        height: 22px;
        top: 3px;
        left: 3px;
    }

    .theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
        transform: translateX(28px);
    }

    /* 横幅区域调整 */
    .hero-banner {
        min-height: 360px;
    }

    .hero-content {
        padding: 32px 20px;
    }

    /* 内容区域调整 */
    .site-main {
        padding: 32px 16px;
        /* 平板端为固定导航栏留出空间 */
        padding-top: calc(var(--header-height) + 32px);
    }

    /* 首页不需要额外的顶部间距 */
    .home .site-main,
    .front-page .site-main {
        padding-top: 16px;
    }

    .hero-banner::after {
        height: 72px;
    }

    .content-area {
        padding: 24px;
        border-radius: var(--radius-md);
    }

    .post-content {
        padding: 20px;
    }

    /* 分页调整 */
    .pagination {
        gap: 6px;
    }

    .pagination a,
    .pagination .current {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.875rem;
    }

    /* 单篇文章导航调整 */
    .single-post .post-navigation {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .single-post .post-navigation .nav-next {
        text-align: left;
    }

    .single-post .entry-content,
    .entry-content {
        font-size: 1rem;
        text-align: left;
    }

    /* 页脚调整 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-widget h3 {
        margin-bottom: 12px;
    }

    .social-links {
        padding-top: 12px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ================================
   Responsive - Small Mobile
   ================================ */
@media (max-width: 480px) {
    :root {
        --header-height: 52px;
    }

    .header-container {
        padding: 0 12px;
    }

    .site-title {
        font-size: 1.125rem;
    }

    .site-logo img {
        height: 32px;
    }

    .hero-banner {
        min-height: 300px;
    }

    .hero-banner::after {
        height: 64px;
    }

    .hero-greeting {
        font-size: 0.875rem;
        padding: 7px 14px;
        margin-bottom: 16px;
    }

    .hero-byline {
        margin-bottom: 16px;
    }

    .hero-description {
        padding: 0 12px;
    }

    .hero-enter {
        margin-top: 22px;
        font-size: 0.875rem;
    }

    .site-main {
        padding: 24px 12px;
        /* 手机端为固定导航栏留出空间 */
        padding-top: calc(var(--header-height) + 24px);
    }

    /* 首页不需要额外的顶部间距 */
    .home .site-main,
    .front-page .site-main {
        padding-top: 16px;
    }

    .content-area {
        padding: 20px;
    }

    .post-content {
        padding: 16px;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 12px;
    }

    .author-float-widget {
        left: 12px;
        bottom: 16px;
    }

    .author-float-content {
        width: calc(100vw - 24px);
        max-width: 300px;
    }

    .mobile-search-panel {
        padding: 12px 16px;
    }

    .mobile-search-form {
        flex-direction: column;
    }

    .mobile-search-submit {
        width: 100%;
    }
}

/* ================================
   Responsive - Very Small Mobile
   ================================ */
@media (max-width: 360px) {
    .site-title {
        font-size: 1rem;
    }

    .site-logo img {
        height: 28px;
    }

    .hero-banner {
        min-height: 260px;
    }

    .hero-banner::after {
        height: 40px;
    }

    .content-area {
        padding: 16px;
    }
}

/* ================================
   High DPI Displays
   ================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .site-logo img,
    .author-avatar img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ================================
   Comments Area - 评论区现代圆角风格
   ================================ */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* 评论列表 */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list ol {
    list-style: none;
    padding-left: 24px;
}

/* 单个评论 - 现代磨砂玻璃卡片 */
.modern-comment {
    margin-bottom: 20px;
}

.comment-body {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

[data-theme="dark"] .comment-body {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.comment-body:hover {
    background: var(--bg-hover), var(--bg-surface);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .comment-body:hover {
    background: var(--bg-hover), var(--bg-surface);
}

/* 评论作者头像 */
.comment-author-avatar {
    flex-shrink: 0;
}

.comment-author-avatar img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    border: 3px solid var(--bg-white);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .comment-author-avatar img {
    border-color: var(--border-subtle);
}

/* 评论内容包装器 */
.comment-content-wrapper {
    flex: 1;
    min-width: 0;
}

/* 评论头部信息 */
.comment-meta {
    margin-bottom: 12px;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-author-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.comment-author-name a {
    color: inherit;
}

.comment-author-name a:hover {
    color: var(--primary-color);
}

/* 作者徽章 */
.author-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: var(--accent-emotion);
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 评论内容区域 */
.comment-content {
    position: relative;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    padding: 16px 16px 40px 16px;
    margin-bottom: 8px;
}

[data-theme="dark"] .comment-content {
    background: var(--bg-muted);
}

.comment-content p {
    margin: 0 0 12px 0;
    line-height: 1.7;
    color: var(--text-secondary);
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* 等待审核提示 */
.comment-awaiting-moderation {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(251, 191, 36, 0.15);
    border-left: 3px solid #f59e0b;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: #b45309;
}

[data-theme="dark"] .comment-awaiting-moderation {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

/* 评论底部元信息 - 日期时间在右下角 */
.comment-footer-meta {
    position: absolute;
    bottom: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
}

/* 回复和编辑链接 */
.reply-btn-wrapper a,
.edit-link a {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.reply-btn-wrapper a:hover,
.edit-link a:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* 评论分页导航 */
.comment-navigation {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.comment-navigation .nav-links {
    display: flex;
    gap: 12px;
}

.comment-navigation a {
    padding: 8px 16px;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.comment-navigation a:hover {
    background: var(--primary-color);
    color: #ffffff;
}

/* 评论关闭提示 */
.no-comments {
    text-align: center;
    padding: 24px;
    color: var(--text-light);
    font-style: italic;
}

/* ================================
   Comment Form - 评论表单现代风格
   ================================ */
.comment-respond {
    margin-top: 40px;
    padding: 28px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .comment-respond {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.comment-reply-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cancel-reply-link a {
    font-size: 0.8125rem;
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-gray);
    transition: var(--transition);
}

.cancel-reply-link a:hover {
    background: #ef4444;
    color: #ffffff;
}

/* 表单字段 */
.comment-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.comment-form .required {
    color: #ef4444;
}

/* 表单行布局 */
.comment-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .comment-form-row {
        grid-template-columns: 1fr;
    }
}

/* 表单输入框 */
.comment-form-field input,
.comment-form-comment textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

[data-theme="dark"] .comment-form-field input,
[data-theme="dark"] .comment-form-comment textarea {
    background: var(--bg-glass);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.comment-form-field input:focus,
.comment-form-comment textarea:focus {
    border-color: var(--primary-color);
    background: var(--bg-surface);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

[data-theme="dark"] .comment-form-field input:focus,
[data-theme="dark"] .comment-form-comment textarea:focus {
    background: var(--bg-surface);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.comment-form-field input::placeholder,
.comment-form-comment textarea::placeholder {
    color: var(--text-light);
}

/* 评论文本框 */
.comment-form-comment {
    position: relative;
    margin-bottom: 16px;
}

.comment-form-comment textarea {
    min-height: 120px;
    resize: vertical;
    padding-bottom: 56px; /* 为提交按钮预留空间 */
}

/* 提交按钮 - 嵌于文本框内 */
.form-submit-wrapper {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 10;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: opacity var(--transition-micro), background var(--transition-micro);
    box-shadow: var(--shadow-sm);
}

.submit-btn:hover {
    background: var(--accent-primary-hover);
    opacity: 0.92;
}

.submit-btn:active {
    opacity: 0.88;
}

/* 评论表单说明文字 */
.comment-notes {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.email-notes {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ================================
   Comments Responsive - 评论区自适应
   ================================ */

/* 大桌面端 - 1200px以上 */
@media (min-width: 1200px) {
    .comments-area {
        margin-top: 56px;
        padding-top: 40px;
    }

    .comments-title {
        font-size: 1.375rem;
    }

    .comment-list ol {
        padding-left: 32px;
    }

    .comment-body {
        padding: 24px;
        gap: 20px;
    }

    .comment-author-avatar img {
        width: 64px;
        height: 64px;
    }

    .comment-respond {
        padding: 32px;
    }
}

/* 平板端 - 768px到1024px */
@media (max-width: 1024px) {
    .comments-area {
        margin-top: 40px;
        padding-top: 28px;
    }

    .comment-body {
        padding: 18px;
        gap: 14px;
    }

    .comment-author-avatar img {
        width: 52px;
        height: 52px;
    }

    .comment-content {
        padding: 14px 14px 38px 14px;
    }

    .comment-respond {
        padding: 24px;
    }
}

/* 手机横屏 - 480px到768px */
@media (max-width: 768px) {
    .comments-area {
        margin-top: 32px;
        padding-top: 24px;
    }

    .comments-title {
        font-size: 1.125rem;
        margin-bottom: 20px;
    }

    /* 评论卡片适配 */
    .comment-body {
        padding: 16px;
        gap: 12px;
        border-radius: var(--radius-lg);
    }

    .comment-author-avatar img {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }

    .comment-author-name {
        font-size: 0.9375rem;
    }

    .author-badge {
        font-size: 0.625rem;
        padding: 2px 8px;
    }

    .comment-content {
        padding: 12px 12px 52px 12px;
        border-radius: var(--radius-md);
    }

    .comment-content p {
        font-size: 0.9375rem;
        line-height: 1.6;
    }

    /* 移动端底部元信息换行显示 */
    .comment-footer-meta {
        bottom: 10px;
        right: 12px;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
        max-width: calc(100% - 24px);
    }

    .comment-time {
        font-size: 0.6875rem;
        order: 3;
        width: 100%;
        text-align: right;
    }

    .reply-btn-wrapper a,
    .edit-link a {
        font-size: 0.6875rem;
        padding: 3px 8px;
    }

    /* 嵌套评论缩进减小 */
    .comment-list ol {
        padding-left: 16px;
    }

    /* 评论表单适配 */
    .comment-respond {
        padding: 20px;
        border-radius: var(--radius-lg);
    }

    .comment-reply-title {
        font-size: 1rem;
    }

    /* 表单字段已改为单列（原有样式） */

    .comment-form-comment textarea {
        min-height: 100px;
        padding-bottom: 64px;
    }

    /* 移动端提交按钮调整 */
    .form-submit-wrapper {
        bottom: 12px;
        right: 12px;
    }

    .submit-btn {
        padding: 10px 18px;
        font-size: 0.875rem;
    }

    /* 分页导航适配 */
    .comment-navigation {
        margin: 24px 0;
    }

    .comment-navigation a {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
}

/* 小屏手机 - 480px以下 */
@media (max-width: 480px) {
    .comments-area {
        margin-top: 28px;
        padding-top: 20px;
    }

    .comments-title {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    /* 评论卡片紧凑布局 */
    .comment-body {
        padding: 12px;
        gap: 10px;
        flex-direction: column;
    }

    .comment-author-avatar {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .comment-author-avatar img {
        width: 40px;
        height: 40px;
    }

    /* 将作者信息放在头像旁边 */
    .comment-meta {
        margin-bottom: 0;
    }

    .comment-content-wrapper {
        width: 100%;
    }

    .comment-content {
        padding: 12px 12px 48px 12px;
        margin-bottom: 0;
    }

    .comment-content p {
        font-size: 0.875rem;
    }

    /* 进一步减小嵌套缩进 */
    .comment-list ol {
        padding-left: 12px;
    }

    /* 表单紧凑 */
    .comment-respond {
        padding: 16px;
    }

    .comment-form-field input,
    .comment-form-comment textarea {
        padding: 12px 14px;
        font-size: 0.875rem;
    }

    .submit-btn {
        padding: 8px 16px;
        font-size: 0.8125rem;
    }

    /* 取消回复链接位置调整 */
    .comment-reply-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cancel-reply-link {
        align-self: flex-end;
    }
}

/* 超小屏 - 360px以下 */
@media (max-width: 360px) {
    .site-main {
        padding: 16px 10px;
        /* 超小屏为固定导航栏留出空间 */
        padding-top: calc(var(--header-height) + 16px);
    }

    /* 首页不需要额外的顶部间距 */
    .home .site-main,
    .front-page .site-main {
        padding-top: 16px;
    }

    .comment-body {
        padding: 10px;
    }

    .comment-author-avatar img {
        width: 36px;
        height: 36px;
    }

    .comment-footer-meta {
        gap: 6px;
    }

    .reply-btn-wrapper a,
    .edit-link a {
        font-size: 0.625rem;
        padding: 2px 6px;
    }

    .comment-respond {
        padding: 14px;
    }
}

/* 评论区域触控优化 */
@media (hover: none) and (pointer: coarse) {
    .comment-body:hover {
        background: var(--bg-glass);
    }

    [data-theme="dark"] .comment-body:hover {
        background: var(--bg-glass);
    }

    .submit-btn:hover {
        opacity: 0.92;
    }

    .submit-btn:active {
        opacity: 0.88;
    }
}

/* ================================
   Print Styles
   ================================ */
@media print {
    .site-header,
    .author-float-widget,
    .hero-banner,
    .site-footer,
    .comments-area {
        display: none;
    }

    .site-main {
        padding: 0;
        max-width: 100%;
    }

    .content-area {
        box-shadow: none;
        border: none;
    }
}
