/* ========================================
   谦野个人博客 - 全局样式
   ======================================== */

:root {
    /* 半透明深色主题 - 磨砂玻璃效果 */
    --primary-color: #64b5f6;
    --secondary-color: #81c784;
    --accent-color: #ba68c8;
    --bg-color: rgba(0, 0, 0, 0.5);
    --card-bg: rgba(20, 25, 35, 0.5);
    --text-primary: #e8eaf0;
    --text-secondary: #a0a8b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 32px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 36px -6px rgba(0, 0, 0, 0.6);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Lato, Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    /* 全局动画变量 */
    --anim-fast: 200ms;
    --anim-medium: 400ms;
    --anim-slow: 700ms;
    --anim-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --menu-anim-duration: 400ms;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    background-image: url('../images/XZQ.bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-primary);
    line-height: 1.8;
    transition: all 0.3s ease;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    /* 使页脚默认贴底 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* 页面进入动画 */
    animation: pageFadeIn var(--anim-slow) ease-out both;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: -1;
    pointer-events: none;
}

/* ========================================
   导航栏样式
   ======================================== */

.navbar {
    background: transparent;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(15, 20, 30, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.logo:hover {
    transform: scale(1.08) rotate(-2deg);
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

/* 确保桌面端导航菜单始终显示 */
@media (min-width: 769px) {
    .nav-menu {
        display: flex !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding: 0 !important;
        box-shadow: none !important;
        z-index: auto !important;
        transform: none !important;
        transition: none !important;
        overflow: visible !important;
    }

    .nav-menu li {
        margin: 0 !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .nav-link {
        font-size: 1rem !important;
        font-weight: 600 !important;
        padding: 0.5rem 0 !important;
        display: block !important;
        text-align: center !important;
        color: var(--text-secondary) !important;
        text-decoration: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        overflow: visible !important;
        min-width: auto !important;
        box-sizing: border-box !important;
    }

    .nav-link::before {
        display: none !important;
    }

    .nav-link:hover {
        color: var(--primary-color) !important;
        border-color: transparent !important;
        background: transparent !important;
        transform: translateY(-2px) !important;
        box-shadow: none !important;
    }

    .nav-link:hover::before {
        display: none !important;
    }

    .nav-link:active {
        transform: translateY(-1px) !important;
    }
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-link:hover::after {
    width: 100%;
}


.mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    position: relative;
    z-index: 1102;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(100, 181, 246, 0.15);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.2);
}

.mobile-toggle:active {
    transform: scale(0.98);
    background: rgba(100, 181, 246, 0.25);
}

/* ========================================
   主容器样式
   ======================================== */

.container {
    max-width: 1200px;
    margin: 6rem auto 2rem;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* ========================================
   全屏打字机效果
   ======================================== */

.fullscreen-typing {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: transparent;
}

.typing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
}

.typing-text {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(92, 173, 219, 0.3);
    letter-spacing: 2px;
    min-height: 5rem;
    display: inline-block;
}

.typing-cursor {
    font-size: 4rem;
    font-weight: 300;
    color: white;
    animation: blink 1s infinite;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* 已移除滚动提示样式 */

/* 页面淡入动画 */
@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 内容区域样式调整 */
.content-section {
    margin-top: 0;
    padding-top: 3rem;
    min-height: 100vh;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   公告栏
   ======================================== */

.announcement {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.announcement h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   卡片样式
   ======================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
    box-sizing: border-box;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(100, 181, 246, 0.15);
    color: var(--primary-color);
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(100, 181, 246, 0.3);
    font-weight: 500;
}

.tag:hover {
    transform: translateY(-2px);
    background: var(--primary-color);
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.5);
}

/* ========================================
   侧边栏
   ======================================== */

.sidebar {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0.8;
}

.sidebar:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* （已移除未使用的统计模块样式：.stats/.stat-item/.stat-number/.stat-label） */

/* ========================================
   文章内容样式
   ======================================== */

.article-content {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.article-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
}

.article-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--secondary-color);
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content code {
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.article-content pre {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1rem 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.article-content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 1rem 0;
}

/* ========================================
   标签云
   ======================================== */

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem;
}

.tag-cloud-item {
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tag-cloud-item:nth-child(4n+1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2rem;
}

.tag-cloud-item:nth-child(4n+2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-size: 1rem;
}

.tag-cloud-item:nth-child(4n+3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 1.1rem;
}

.tag-cloud-item:nth-child(4n) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    font-size: 0.95rem;
}

.tag-cloud-item:hover {
    transform: scale(1.1);
}

/* ========================================
   归档时间线
   ======================================== */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-1);
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.4rem;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--card-bg);
}

.timeline-date {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ========================================
   页脚
   ======================================== */

.footer {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 2rem 0;
    text-align: center;
    /* 贴底布局：占据剩余空间 */
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* ========================================
   按钮样式
   ======================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   响应式设计
   ======================================== */

/* 手机端样式 (最大宽度 768px) */
@media (max-width: 768px) {

    /* 确保所有元素不会溢出 */
    * {
        max-width: 100%;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* 强制单列布局 */
    .home-layout,
    .article-layout {
        display: block !important;
    }

    .home-layout>div,
    .article-layout>div,
    .home-layout>aside,
    .article-layout>aside {
        width: 100% !important;
        float: none !important;
        display: block !important;
    }

    /* 导航栏优化 */
    .nav-container {
        padding: 0.8rem 1rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .nav-menu {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 20, 30, 0.85);
        -webkit-backdrop-filter: blur(25px);
        backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0;
        box-shadow: none;
        z-index: 1000;
        transform: translateX(-100%);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow: hidden;
        box-sizing: border-box;
    }

    .nav-menu.active {
        display: flex !important;
        transform: translateX(0) !important;
        animation: overlayFadeIn var(--menu-anim-duration) var(--anim-ease) both;
    }

    .nav-menu li {
        margin: 0.8rem 0;
        width: auto;
        box-sizing: border-box;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-menu.active li {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .nav-menu li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-menu li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-menu li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-menu li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-menu li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .nav-menu li:nth-child(6) {
        transition-delay: 0.35s;
    }

    .nav-link {
        font-size: 1.4rem;
        font-weight: 600;
        padding: 1rem 2rem;
        display: block !important;
        text-align: center;
        color: var(--text-primary) !important;
        text-decoration: none;
        border: none;
        border-radius: 8px;
        background: transparent;
        transition: color 0.2s ease, transform 0.2s ease;
        position: relative;
        overflow: visible;
        min-width: auto;
        box-sizing: border-box;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .nav-link::before {
        display: none;
        content: none;
    }

    .nav-link:hover {
        color: var(--primary-color);
        background: transparent;
        border-color: transparent;
        transform: translateY(-2px);
        box-shadow: none;
    }

    .nav-link:active {
        transform: translateY(-1px);
        background: transparent;
        border-color: transparent;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1102;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .mobile-toggle.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
    }


    .mobile-toggle:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    /* 容器和布局优化 */
    .container {
        margin-top: 4.5rem;
        padding: 0 1rem;
    }

    /* 首页布局 */
    .home-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .home-layout aside {
        order: -1;
        width: 100%;
        box-sizing: border-box;
    }

    .home-layout>div:first-child {
        width: 100%;
        box-sizing: border-box;
    }

    /* 打字机效果优化 */
    .typing-text {
        font-size: 1.8rem;
        min-height: 2.5rem;
        text-align: center;
        padding: 0 1rem;
    }

    .typing-cursor {
        font-size: 1.8rem;
    }

    /* 滚动提示在移动端已移除 */

    /* 卡片和网格优化 */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        margin-bottom: 2rem;
        width: 100%;
        box-sizing: border-box;
    }

    .card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    /* 侧边栏优化 */
    .sidebar {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .sidebar h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    /* 文章内容优化 */
    .article-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .article-content {
        padding: 1.5rem;
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .article-content h2 {
        font-size: 1.4rem;
    }

    .article-content h3 {
        font-size: 1.2rem;
    }

    /* 公告栏优化 */
    .announcement {
        padding: 1rem;
        margin-bottom: 1.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .announcement p {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
        line-height: 1.6;
        font-size: 0.9rem;
    }

    .announcement h3 {
        font-size: 1rem;
    }

    /* 纪念日卡片优化 */
    .anniversary-avatars {
        gap: 0.8rem;
        margin-bottom: 1.2rem;
    }

    .avatar-circle {
        width: 60px;
        height: 60px;
    }

    .heart-icon {
        font-size: 1.5rem;
    }

    .anniversary-time-inline {
        font-size: 0.8rem;
        padding: 0.8rem 0.4rem;
        gap: 0.2rem;
    }

    .anniversary-time-inline .time-number {
        font-size: 1rem;
    }

    /* 按钮优化 */
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    /* 页脚优化 */
    .footer {
        padding: 1.5rem 0;
    }

    .footer-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

    /* 回到顶部按钮优化 */
    #scroll-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    /* 菜单关闭时的淡出动画（保持显示以执行动画） */
    .nav-menu.closing {
        display: flex !important;
        animation: overlayFadeOut var(--menu-anim-duration) var(--anim-ease) both;
        pointer-events: none;
    }
}

/* 平板端样式 (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {

    /* 导航栏 */
    .nav-container {
        padding: 1rem 1.5rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .nav-menu {
        gap: 1.5rem;
    }

    .nav-link {
        font-size: 0.95rem;
    }

    /* 容器 */
    .container {
        margin-top: 5.5rem;
        padding: 0 1.5rem;
    }

    /* 首页布局 */
    .home-layout {
        grid-template-columns: 1fr 320px;
        gap: 1.8rem;
    }

    /* 打字机效果 */
    .typing-text {
        font-size: 3rem;
        min-height: 4rem;
    }

    .typing-cursor {
        font-size: 3rem;
    }

    /* 卡片网格 */
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.8rem;
    }

    /* 侧边栏 */
    .sidebar {
        padding: 1.6rem;
    }

    /* 文章内容 */
    .article-title {
        font-size: 2.2rem;
    }

    .article-content {
        padding: 1.8rem;
    }

    /* 纪念日卡片 */
    .anniversary-avatars {
        gap: 1rem;
    }

    .avatar-circle {
        width: 70px;
        height: 70px;
    }

    .heart-icon {
        font-size: 1.8rem;
    }
}

/* 中等屏幕优化 (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {

    /* 更精细的手机端调整 */
    .container {
        padding: 0 1.2rem;
    }

    .typing-text {
        font-size: 2.2rem;
    }

    .typing-cursor {
        font-size: 2.2rem;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .card {
        padding: 1.6rem;
    }

    .sidebar {
        padding: 1.6rem;
    }
}

/* 小屏幕手机优化 (最大宽度 480px) */
@media (max-width: 480px) {

    /* 超小屏幕优化 */
    .container {
        padding: 0 0.8rem;
    }

    .nav-container {
        padding: 0.6rem 0.8rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .typing-text {
        font-size: 1.6rem;
        min-height: 2rem;
        padding: 0 0.5rem;
    }

    .typing-cursor {
        font-size: 1.6rem;
    }

    /* 滚动提示在超小屏已移除 */

    .article-title {
        font-size: 1.4rem;
        line-height: 1.2;
    }

    .article-content {
        padding: 1.2rem;
        font-size: 0.9rem;
    }

    .card {
        padding: 1.2rem;
    }

    .sidebar {
        padding: 1.2rem;
    }

    .announcement {
        padding: 1rem;
    }

    .anniversary-avatars {
        gap: 0.6rem;
    }

    .avatar-circle {
        width: 50px;
        height: 50px;
    }

    .heart-icon {
        font-size: 1.2rem;
    }

    .anniversary-time-inline {
        font-size: 0.75rem;
        padding: 0.6rem 0.3rem;
    }

    .anniversary-time-inline .time-number {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    #scroll-top {
        bottom: 0.8rem;
        right: 0.8rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {

    /* 增加触摸目标大小 */
    .nav-link {
        padding: 1.2rem 0;
        min-height: 44px;
    }

    .mobile-toggle {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .btn {
        min-height: 44px;
        padding: 0.8rem 1.5rem;
    }

    .tag {
        min-height: 32px;
        padding: 0.5rem 1rem;
    }

    /* 优化卡片悬停效果 */
    .card:hover {
        transform: none;
    }

    .card:active {
        transform: scale(0.98);
    }

    /* 优化按钮交互 */
    .btn:active {
        transform: scale(0.95);
    }

    .tag:active {
        transform: scale(0.95);
    }

    /* 移动端菜单按钮触摸优化 */
    .mobile-toggle:hover {
        transform: none;
    }

    .mobile-toggle:active {
        transform: scale(0.95);
        background: var(--primary-color);
        color: white;
        box-shadow: 0 2px 8px rgba(100, 181, 246, 0.4);
    }

    /* 触摸设备菜单项优化 */
    .nav-link:hover {
        transform: none;
    }

    .nav-link:active {
        transform: scale(0.95);
        background: transparent;
        border-color: transparent;
    }

}

/* 图片响应式优化 */
.article-content img,
.card img,
.avatar-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 代码块响应式优化 */
.article-content pre {
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .article-content pre {
        font-size: 0.8rem;
        padding: 0.8rem;
    }

    .article-content code {
        font-size: 0.8rem;
        padding: 0.15rem 0.4rem;
    }
}

/* 表格响应式优化 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

.article-content table th,
.article-content table td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

@media (max-width: 768px) {
    .article-content table {
        font-size: 0.85rem;
    }

    .article-content table th,
    .article-content table td {
        padding: 0.3rem;
    }
}

/* 表单响应式优化 */
input,
textarea,
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
}

@media (max-width: 768px) {

    input,
    textarea,
    select {
        font-size: 16px;
        /* 防止iOS缩放 */
        padding: 1rem;
    }
}

/* ========================================
   性能优化和用户体验改进
   ======================================== */

/* 减少动画在低性能设备上的使用 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --text-secondary: #ffffff;
    }

    .card {
        border: 2px solid var(--border-color);
    }

    .nav-link::after {
        height: 4px;
    }
}

/* 暗色模式优化 */
@media (prefers-color-scheme: dark) {
    /* 已经是暗色主题，无需额外调整 */
}

/* 打印样式优化 */
@media print {

    .navbar,
    .mobile-toggle,
    #scroll-top,
    .footer {
        display: none !important;
    }

    .container {
        margin-top: 0;
        padding: 0;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .card,
    .sidebar,
    .announcement {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }

    .article-content {
        background: white !important;
    }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .fullscreen-typing {
        height: auto;
        min-height: 100vh;
        padding: 2rem 0;
    }

    .typing-text {
        font-size: 2rem;
        min-height: auto;
    }

    .typing-cursor {
        font-size: 2rem;
    }

    /* 横屏下滚动提示已移除 */
}

/* 超宽屏幕优化 */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .nav-container {
        max-width: 1400px;
    }

    .footer-content {
        max-width: 1400px;
    }

    .home-layout {
        grid-template-columns: 1fr 400px;
        gap: 3rem;
    }
}

/* 加载状态优化 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 焦点可访问性 */
/* 鼠标/触摸点击不显示外框，仅保留键盘导航的可见焦点 */
.nav-link:focus {
    outline: none;
}

.btn:focus,
.tag:focus,
.mobile-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.nav-link:focus-visible {
    outline: none;
}

.nav-link:focus-visible::after {
    width: 100%;
}

/* 选择文本样式 */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   移动端布局修复
   ======================================== */

/* 确保移动端完全单列布局 */
@media (max-width: 768px) {

    /* 重置所有可能的布局问题 */
    .container,
    .home-layout,
    .article-layout,
    .grid,
    .card,
    .sidebar {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 确保没有元素超出视口 */
    body,
    html {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    /* 强制侧边栏在移动端显示为块级元素 */
    .home-layout aside,
    .article-layout aside {
        display: block !important;
        width: 100% !important;
        margin: 0 0 2rem 0 !important;
        order: -1 !important;
    }

    /* 确保主内容区域也是100%宽度 */
    .home-layout>div:first-child,
    .article-layout>div:first-child {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ========================================
   纪念日组件样式
   ======================================== */

.anniversary-card {
    background: rgba(20, 25, 35, 0.5) !important;
    border: 2px solid rgba(100, 181, 246, 0.3) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.anniversary-avatars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 16px rgba(100, 181, 246, 0.5);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
}

.avatar-circle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 24px rgba(100, 181, 246, 0.7);
}

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

.heart-icon {
    font-size: 2rem;
    animation: heartbeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(255, 0, 0, 0.3));
    z-index: 10;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.2);
    }

    20%,
    40% {
        transform: scale(1);
    }
}

.anniversary-time {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
    margin-top: 1rem;
}

.time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 60px;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.time-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.time-icon {
    font-size: 1.2rem;
}

.time-number {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.time-unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* 横向倒计时样式 */
.anniversary-time-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-top: 1rem;
    font-size: 0.9rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.anniversary-time-inline .time-number {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.anniversary-time-inline .time-icon {
    font-size: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.anniversary-time-inline .time-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.anniversary-time-inline .time-quote {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ========================================
   动画效果
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 通用动画工具类 */
.anim-fade-in {
    animation: fadeIn 0.6s ease-out both;
}

.anim-slide-up {
    animation: slideInUp 0.5s var(--anim-ease) both;
}

.anim-scale-in {
    animation: scaleIn 0.35s var(--anim-ease) both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(16px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.98);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 导航覆盖层淡入/淡出 */
@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ========================================
   响应式布局修复
   ======================================== */

/* 文章页面布局修复 */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .article-layout aside {
        order: -1;
        /* 在移动端将侧边栏移到顶部 */
    }
}

/* 平板端响应式 */
@media (max-width: 1024px) and (min-width: 769px) {
    .article-layout {
        grid-template-columns: 1fr 280px;
        gap: 1.5rem;
    }
}

/* 防止侧边栏重叠 */
.sidebar {
    position: relative !important;
    top: auto !important;
    z-index: 1;
}

/* 确保内容区域不重叠 */
.article-content {
    position: relative;
    z-index: 2;
}

/* 首页布局响应式 */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .home-layout aside {
        order: -1;
        /* 在移动端将侧边栏移到顶部 */
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .home-layout {
        grid-template-columns: 1fr 320px;
        gap: 1.5rem;
    }
}

/* 文章内下载链接（文本样式，适配主题） */
.article-content .download-btn {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding: 0.1rem 0;
    transition: all 0.3s ease;
}

.article-content .download-btn::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.article-content .download-btn:hover {
    color: var(--secondary-color);
    transform: translateY(-1px);
    text-shadow: 0 0 8px rgba(129, 199, 132, 0.35);
}

.article-content .download-btn:hover::after {
    background: var(--secondary-color);
    transform: scaleX(1);
}

.article-content .download-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}