@import "./styles.css";


/* ===== 浅色主题变量 ===== */
:root {
    --h-title-color: #5a5fe0;
    --h-text-color: #1a1a3a;
    --h-soft-bg: rgba(255, 255, 255, 0.45);
    --h-soft-border: rgba(255, 255, 255, 0.65);
    --h-nav-bg: rgba(255, 255, 255, 0.35);
    --h-shadow: 0 10px 30px rgba(73, 84, 190, 0.22);
    --h-glow: 0 0 20px rgba(106, 111, 242, 0.3);
    --h-accent: #ff7eb3;
    --h-accent-2: #7ec8ff;
    --h-bg-gradient-1: rgba(255, 168, 218, 0.4);
    --h-bg-gradient-2: rgba(170, 191, 255, 0.45);
    --h-bg-gradient-3: rgba(203, 182, 255, 0.4);
    --h-bg-gradient-4: rgba(255, 200, 220, 0.3);
    --h-bg-gradient-main: linear-gradient(135deg, #f6f7ff 0%, #e9efff 45%, #fdf1fb 100%);
}

/* ===== 暗色主题变量 ===== */
[data-theme="dark"] {
    --h-title-color: #a8acff;
    --h-text-color: #d8d8f0;
    --h-soft-bg: rgba(15, 15, 30, 0.6);
    --h-soft-border: rgba(80, 80, 140, 0.4);
    --h-nav-bg: rgba(10, 10, 25, 0.65);
    --h-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    --h-glow: 0 0 20px rgba(106, 111, 242, 0.35);
    --h-accent: #ff9cc8;
    --h-accent-2: #8ed0ff;
    --h-bg-gradient-1: rgba(80, 40, 100, 0.35);
    --h-bg-gradient-2: rgba(40, 70, 130, 0.4);
    --h-bg-gradient-3: rgba(60, 50, 120, 0.35);
    --h-bg-gradient-4: rgba(100, 60, 110, 0.25);
    --h-bg-gradient-main: linear-gradient(135deg, #0a0a18 0%, #121228 45%, #181025 100%);
}

/* ===== 主题切换按钮样式 ===== */
.theme-toggle {
    background: linear-gradient(135deg, var(--h-accent), var(--h-accent-2));
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--h-glow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 30px rgba(255, 126, 179, 0.5);
}

.theme-toggle i {
    font-size: 1.3rem;
    color: white;
    transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* ===== 页面加载动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(106, 111, 242, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(106, 111, 242, 0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

/* ===== 基础样式优化 ===== */
* {
    scroll-behavior: smooth;
}

body {
    color: var(--h-text-color);
    background:
        radial-gradient(circle at 15% 20%, var(--h-bg-gradient-1), transparent 35%),
        radial-gradient(circle at 82% 28%, var(--h-bg-gradient-2), transparent 35%),
        radial-gradient(circle at 78% 82%, var(--h-bg-gradient-3), transparent 36%),
        radial-gradient(circle at 25% 75%, var(--h-bg-gradient-4), transparent 30%),
        var(--h-bg-gradient-main);
    background-size: 200% 200%;
    min-height: 100vh;
    animation: gradientShift 15s ease infinite;
    transition: all 0.3s ease;
}

/* ===== 暗色主题下的其他样式调整 ===== */
[data-theme="dark"] .header {
    background: var(--h-nav-bg);
    border-bottom-color: rgba(60, 60, 100, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .header.scrolled {
    background: rgba(10, 10, 20, 0.85);
}

[data-theme="dark"] .header .navbar-brand {
    color: #d0d0ff !important;
}

[data-theme="dark"] .main-body a {
    color: #b0b0ff;
}

[data-theme="dark"] .main-body a:hover {
    color: #e8e8ff;
}

[data-theme="dark"] .main-body blockquote {
    background: rgba(106, 111, 242, 0.12);
    color: #d8d8f0;
}

[data-theme="dark"] .main-body code {
    color: #c8c8ff;
    background: rgba(100, 120, 200, 0.25);
    border-color: rgba(100, 120, 200, 0.4);
}

[data-theme="dark"] .main-body pre {
    background: linear-gradient(135deg, #0d0d1d, #181830);
    border-color: rgba(80, 80, 160, 0.35);
}

/* 暗色主题下的代码块头部 */
[data-theme="dark"] .main-body .code-block-header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(80, 80, 160, 0.3);
}

[data-theme="dark"] .main-body .code-language {
    color: #81818a;
}

[data-theme="dark"] .main-body .copy-btn {
    background: rgba(106, 111, 242, 0.15);
    border-color: rgba(106, 111, 242, 0.25);
    color: #81818a;
}

[data-theme="dark"] .main-body .copy-btn:hover {
    background: rgba(106, 111, 242, 0.25);
    border-color: rgba(106, 111, 242, 0.4);
    color: #d8d8f0;
}

[data-theme="dark"] .main-body .copy-btn.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

[data-theme="dark"] .main-body ul li:hover {
    color: #e8e8ff;
}

[data-theme="dark"] .main-body img + em {
    color: #a0a2cc;
}

[data-theme="dark"] .main-body h1,
[data-theme="dark"] .main-body h2,
[data-theme="dark"] .main-body h3,
[data-theme="dark"] .main-body h4,
[data-theme="dark"] .main-body h5,
[data-theme="dark"] .main-body h6 {
    color: #d8d8f0;
}

[data-theme="dark"] .main-body li {
    color: #d8d8f0;
}

[data-theme="dark"] .main-body p {
    color: #d8d8f0;
}

[data-theme="dark"] .navbar-nav .nav-link {
    color: #d0d0f0 !important;
}

[data-theme="dark"] .navbar-nav .nav-link:hover {
    color: #e8e8ff !important;
}

[data-theme="dark"] .navbar-nav .nav-link.active {
    color: #ff9cc8 !important;
}

.header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    background: var(--h-nav-bg);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    box-shadow: 0 8px 32px rgba(106, 111, 242, 0.2);
    z-index: 10000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 20px rgba(106, 111, 242, 0.15);
}

/* 暗色主题下的导航栏滚动状态 */
[data-theme="dark"] .header.scrolled {
    background: rgba(10, 10, 20, 0.85) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 浅色主题下的导航栏滚动状态 */
:root .header.scrolled {
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 20px rgba(106, 111, 242, 0.15);
}

.header .navbar-brand {
    color: #3a3d8f !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    position: relative;
    transition: all 0.3s ease;
}

.header .navbar-brand:hover {
    color: #8f4de4 !important;
    text-shadow: 0 0 20px rgba(143, 77, 228, 0.4);
}

.header .nav-link {
    color: #3a3d8f !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
}

/* 导航链接下划线动画 */
.header .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6a6ff2, #ff7eb3);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.header .nav-link:hover::after,
.header .nav-link.active::after {
    width: 70%;
}

.header .nav-link:hover,
.header .nav-link:focus,
.header .nav-link.active {
    color: #8f4de4 !important;
    transform: translateY(-2px);
}

.bg-bottom {
    background: linear-gradient(120deg, rgba(106, 111, 242, 0.88), rgba(150, 109, 255, 0.88));
}

.top-section {
    position: relative;
    padding: 10rem 0;
    background-position: center;
    background-size: cover;
    height: 28rem;
    overflow: hidden;
}

.top-section h2 {
    font-weight: 400;
    text-shadow: 0 5px 20px rgba(43, 39, 118, 0.35);
    animation: fadeInUp 1s ease-out;
    background: linear-gradient(135deg, #fff 0%, #f0f0ff 50%, #ffe0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-section .top-section-content {
    position: relative;
    z-index: 1;
}

.top-section:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(130deg, rgba(60, 68, 148, 0.42), rgba(178, 97, 208, 0.38));
}

.top-section:after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    top: -120px;
    right: 8%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
    z-index: 0;
}

section header h2{
    font-family: "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
    color: var(--h-title-color);
    font-size: 2.1rem;
    line-height: 3.6rem;
    position: relative;
    display: inline-block;
}

/* 标题装饰效果 */
section header h2::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(120deg, rgba(106, 111, 242, 0.3), rgba(255, 126, 179, 0.3));
    border-radius: 4px;
    z-index: -1;
    transform: scaleX(0.9);
    transition: all 0.3s ease;
}

section header h2:hover::after {
    transform: scaleX(1);
    height: 10px;
}

/* 图标动画 */
section header h2 i {
    display: inline-block;
    transition: all 0.3s ease;
}

section header h2:hover i {
    transform: scale(1.2) rotate(10deg);
    color: var(--h-accent);
}

section .main-body{
    font-size: 1.12rem;
    font-weight: 400;
    line-height: 2.05rem;
    color: #30325a;
}


section {
    margin: 1.5rem auto;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

/* 错开各section的动画时间 */
section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }

section .container {
    background: var(--h-soft-bg);
    border: 1px solid var(--h-soft-border);
    border-radius: 24px;
    box-shadow: var(--h-shadow);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    padding: 2rem 2.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

/* 卡片悬浮效果 */
section .container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

section .container:hover::before {
    left: 100%;
}

section .container:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(73, 84, 190, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.6);
}

.main-body h2,
.main-body h3,
.main-body h4 {
    color: #5159c4;
    margin-top: 1.35rem;
    position: relative;
    display: inline-block;
}

/* 标题前装饰 */
.main-body h3::before {
    content: '✦';
    margin-right: 8px;
    color: var(--h-accent);
    font-size: 0.8em;
    opacity: 0.8;
}

.main-body a {
    color: #6f53e6;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    padding: 0 2px;
    transition: all 0.3s ease;
}

/* 链接下划线动画效果 */
.main-body a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6a6ff2, #ff7eb3);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.main-body a:hover {
    color: #934df3;
}

.main-body a:hover::before {
    width: 100%;
}

/* 列表项美化 */
.main-body ul li {
    position: relative;
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.main-body ul li:hover {
    transform: translateX(5px);
    color: #4a4d9c;
}

/* 引用块样式 */
.main-body blockquote {
    background: rgba(106, 111, 242, 0.08);
    border-left: 4px solid var(--h-title-color);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #4a4d9c;
}

.main-body hr {
    border-color: rgba(130, 137, 240, 0.32);
}

.main-body code {
    color: #5d3fc6;
    background: rgba(143, 160, 255, 0.2);
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9em;
    border: 1px solid rgba(143, 160, 255, 0.3);
    transition: all 0.2s ease;
}

.main-body code:hover {
    background: rgba(143, 160, 255, 0.3);
    transform: scale(1.05);
}

.bg-gradient-primary-to-secondary-light {
    background: transparent !important;
}

.bg-gradient-primary-to-secondary-gray {
    background: transparent !important;
}

.bg-gradient-primary-to-secondary-dark {
    background: transparent !important;
}

/* ===== Footer 美化 ===== */
footer.bg-bottom {
    background: linear-gradient(120deg, rgba(106, 111, 242, 0.9), rgba(150, 109, 255, 0.9), rgba(255, 126, 179, 0.85)) !important;
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    position: relative;
    overflow: hidden;
}

footer.bg-bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

footer a {
    position: relative;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}



.on-top {
    position: relative;
    z-index: 10000;
}

.top-bg {
    background-position: center;
    background-size: fill;
    width: 100%;
    height: 100%;
}

.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}


#avatar {
    position: relative;
    height: 0;
    top:min(-65px,max(-100px,calc(-1*100vw/12)));
    max-width: 55em;
    margin: 0 1.5rem 0 0;
    float: right;
    z-index: 9000;
}

#avatar img {
    height: max(130px,min(200px,calc(100vw/6)));
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.85);
    box-shadow: 
        0 10px 30px rgba(84, 92, 200, 0.35),
        0 0 0 4px rgba(255, 255, 255, 0.3),
        var(--h-glow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float 4s ease-in-out infinite;
    object-fit: cover;
}

#avatar img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 
        0 15px 40px rgba(84, 92, 200, 0.45),
        0 0 0 6px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(106, 111, 242, 0.4);
}

/* ===== Markdown 图片样式 ===== */
.main-body img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(73, 84, 190, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.6);
    margin: 1rem 0;
}

.main-body img:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 15px 40px rgba(73, 84, 190, 0.3);
    border-color: rgba(255, 255, 255, 0.9);
}

/* 图片标题/说明 */
.main-body img + em {
    display: block;
    text-align: center;
    color: #6a6b9c;
    font-size: 0.95rem;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* ===== 文章卡片样式（自动应用到文章列表） ===== */
.main-body h3 + p,
.main-body h3 + ul {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    margin: 0.8rem 0 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(73, 84, 190, 0.1);
    transition: all 0.3s ease;
}

.main-body h3 + p:hover,
.main-body h3 + ul:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(73, 84, 190, 0.15);
    background: rgba(255, 255, 255, 0.4);
}

/* ===== 友链卡片样式 ===== */
.main-body ul li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.main-body ul li a::after {
    content: '↗';
    font-size: 0.8em;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s ease;
}

.main-body ul li a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* ===== 选中文字样式 ===== */
::selection {
    background: rgba(106, 111, 242, 0.3);
    color: #24244a;
    text-shadow: none;
}

::-moz-selection {
    background: rgba(106, 111, 242, 0.3);
    color: #24244a;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(233, 239, 255, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(106, 111, 242, 0.6), rgba(255, 126, 179, 0.6));
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(106, 111, 242, 0.8), rgba(255, 126, 179, 0.8));
    background-clip: content-box;
}

/* ===== 暗色主题下的额外样式 ===== */
[data-theme="dark"] .main-body h3 + p,
[data-theme="dark"] .main-body h3 + ul {
    background: rgba(20, 20, 45, 0.5);
    border-color: rgba(80, 80, 140, 0.35);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .main-body h3 + p:hover,
[data-theme="dark"] .main-body h3 + ul:hover {
    background: rgba(30, 30, 55, 0.6);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* 暗色主题下的导航下划线 */
[data-theme="dark"] .navbar-nav .nav-link::after {
    background: linear-gradient(90deg, var(--h-accent), var(--h-accent-2));
}

/* 暗色主题下的分隔线 */
[data-theme="dark"] .main-body hr {
    background: linear-gradient(90deg, transparent, var(--h-soft-border), transparent);
}

[data-theme="dark"]::selection {
    background: rgba(106, 111, 242, 0.3);
    color: #d8d8f0;
}

[data-theme="dark"]::-moz-selection {
    background: rgba(106, 111, 242, 0.3);
    color: #d8d8f0;
}

[data-theme="dark"]::-webkit-scrollbar-track {
    background: rgba(15, 15, 30, 0.6);
}

[data-theme="dark"] .top-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .top-section {
    position: relative;
}

[data-theme="dark"] .top-section h2 {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .footer .text-white-50 {
    color: #c8c8ff !important;
}

[data-theme="dark"] .footer a {
    color: #e0e0ff !important;
}

[data-theme="dark"] .footer a:hover {
    color: #e8e8ff !important;
}

[data-theme="dark"] .footer .text-white-50 {
    color: #b8b8d8 !important;
}

[data-theme="dark"] .footer a {
    color: #d0d0f0 !important;
}

/* ===== 页面卡片样式优化 ===== */
.main-body {
    line-height: 1.7;
}

.main-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--h-title-color);
    font-weight: 600;
}

.main-body h4 {
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    color: var(--h-text-color);
    font-weight: 500;
}

/* 体验/论文/奖项 卡片样式 */
.main-body h3 + p,
.main-body h3 + ul {
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--h-soft-border);
    background: var(--h-soft-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(106, 111, 242, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.main-body h3 + p:hover,
.main-body h3 + ul:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(106, 111, 242, 0.12);
}

/* 列表项优化 */
.main-body li {
    margin: 0.4rem 0;
    padding-left: 0.5rem;
}

/* 分隔线样式 */
.main-body hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--h-soft-border), transparent);
    margin: 2rem 0;
}

/* 页面标题图标动画 */
.header i,
section i {
    transition: transform 0.3s ease;
}

.header i:hover,
section i:hover {
    transform: rotate(10deg) scale(1.1);
}

/* 导航栏更多优化 */
.navbar-nav .nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--h-accent), var(--h-accent-2));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* 响应式优化 */
@media screen and (max-width: 991px) {
    #avatar {
        margin: 0;
        float: none;
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.7rem 1rem;
    }
}

@media screen and (max-width: 768px) {
    section h2 {
        font-size: 1.5rem;
    }
    
    .main-body h3 + p,
    .main-body h3 + ul {
        padding: 1rem;
    }
}

@media screen and (max-width: 576px) {
    .top-section {
        height: 22rem;
        padding: 8rem 0;
    }
    
    .top-section h2 {
        font-size: 1.8rem !important;
    }
    
    section header h2 {
        font-size: 1.5rem;
        line-height: 2.5rem;
    }
}

/* ===== 表格美化 ===== */
.main-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(73, 84, 190, 0.1);
    background: rgba(255, 255, 255, 0.4);
}

.main-body table thead {
    background: linear-gradient(135deg, rgba(106, 111, 242, 0.15), rgba(255, 126, 179, 0.15));
}

.main-body table th {
    padding: 1rem;
    font-weight: 600;
    color: #3a3d8f;
    text-align: left;
    border-bottom: 2px solid rgba(106, 111, 242, 0.2);
}

.main-body table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(106, 111, 242, 0.1);
    color: #30325a;
}

.main-body table tbody tr {
    transition: all 0.2s ease;
}

.main-body table tbody tr:hover {
    background: rgba(106, 111, 242, 0.08);
}

.main-body table tbody tr:last-child td {
    border-bottom: none;
}

/* 暗色主题表格 */
[data-theme="dark"] .main-body table {
    background: rgba(15, 15, 35, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .main-body table thead {
    background: linear-gradient(135deg, rgba(106, 111, 242, 0.2), rgba(255, 126, 179, 0.2));
}

[data-theme="dark"] .main-body table th {
    color: #d0d0f0;
    border-bottom-color: rgba(106, 111, 242, 0.25);
}

[data-theme="dark"] .main-body table td {
    color: #d0d0f0;
    border-bottom-color: rgba(106, 111, 242, 0.12);
}

[data-theme="dark"] .main-body table tbody tr:hover {
    background: rgba(106, 111, 242, 0.12);
}

/* ===== 代码块美化 ===== */
.main-body pre {
    background: linear-gradient(135deg, #1e1e2e, #2d2d44);
    border-radius: 12px;
    padding: 1.2rem;
    overflow-x: auto;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1.2rem 0;
    position: relative;
}

/* 代码块头部容器 */
.main-body .code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px 12px 0 0;
    margin: -1.2rem -1.2rem 1rem -1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 代码语言标签 */
.main-body .code-language {
    font-size: 0.85rem;
    color: #a1a1aa;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 复制按钮 */
.main-body .copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(106, 111, 242, 0.2);
    border: 1px solid rgba(106, 111, 242, 0.3);
    border-radius: 6px;
    color: #a1a1aa;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.main-body .copy-btn:hover {
    background: rgba(106, 111, 242, 0.3);
    border-color: rgba(106, 111, 242, 0.5);
    color: #e4e4e7;
}

.main-body .copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.main-body .copy-btn i {
    font-size: 0.9rem;
}

.main-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #e4e4e7;
    font-family: 'Fira Code', 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 代码块滚动条 */
.main-body pre::-webkit-scrollbar {
    height: 8px;
}

.main-body pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.main-body pre::-webkit-scrollbar-thumb {
    background: rgba(106, 111, 242, 0.5);
    border-radius: 4px;
}

/* ===== 博客列表特色样式 ===== */
.main-body h4 {
    color: #5159c4;
    margin-top: 1.5rem;
    padding-left: 0.8rem;
    border-left: 3px solid var(--h-accent);
    transition: all 0.3s ease;
}

.main-body h4:hover {
    border-left-width: 5px;
    padding-left: 1rem;
    color: var(--h-accent);
}

/* 步骤编号样式 */
.main-body h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 标签样式 */
.main-body strong {
    color: #6a6ff2;
    font-weight: 600;
}

/* 成功/错误标记 */
.main-body li:has(✅)::marker,
.main-body li:has(❌)::marker {
    color: transparent;
}

/* 分隔线美化 */
.main-body hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(106, 111, 242, 0.4), rgba(255, 126, 179, 0.4), transparent);
    margin: 2rem 0;
}

/* 引用块中的链接 */
.main-body blockquote a {
    color: #6a6ff2;
}

/* 文章卡片特殊效果 - 最新博客 */
.main-body h3:first-of-type + p {
    background: linear-gradient(135deg, rgba(106, 111, 242, 0.1), rgba(255, 126, 179, 0.1));
    border: 2px solid rgba(106, 111, 242, 0.3);
    position: relative;
    overflow: hidden;
}

.main-body h3:first-of-type + p::before {
    content: '🔥';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    animation: float 2s ease-in-out infinite;
}

/* ===== 打印优化 ===== */
@media print {
    .header,
    footer {
        display: none;
    }
    
    body {
        background: white;
    }
    
    section .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== 滚动指示器 ===== */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    pointer-events: none;
}

.scroll-indicator span {
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
    transform: rotate(45deg);
    animation: scrollBounce 1.5s ease-in-out infinite;
}

.scroll-indicator span:nth-child(2) { animation-delay: 0.15s; }
.scroll-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes scrollBounce {
    0%, 100% { opacity: 0.3; transform: rotate(45deg) translate(0, 0); }
    50% { opacity: 1; transform: rotate(45deg) translate(-4px, -4px); }
}

/* ===== 阅读进度条 ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #6a6ff2, #ff7eb3, #7ec8ff);
    z-index: 10001;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6a6ff2, #ff7eb3);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(106, 111, 242, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(106, 111, 242, 0.55);
}

.back-to-top:active {
    transform: scale(0.95);
}

[data-theme="dark"] .back-to-top {
    background: linear-gradient(135deg, var(--h-accent), var(--h-accent-2));
}

/* ===== 经历时间轴 ===== */
.timeline {
    position: relative;
    padding-left: 2.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #6a6ff2, #ff7eb3, #7ec8ff);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: calc(-2.5rem + 6px);
    top: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a6ff2, #ff7eb3);
    box-shadow: 0 0 12px rgba(106, 111, 242, 0.5);
    border: 3px solid var(--h-soft-bg);
    z-index: 1;
    flex-shrink: 0;
}

.timeline-body {
    flex: 1;
    background: var(--h-soft-bg);
    border: 1px solid var(--h-soft-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(73, 84, 190, 0.1);
    transition: all 0.3s ease;
}

.timeline-body:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(73, 84, 190, 0.18);
}

.timeline-body h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

.timeline-body h3::before {
    display: none;
}

[data-theme="dark"] .timeline::before {
    background: linear-gradient(180deg, var(--h-accent), var(--h-accent-2), #7ec8ff);
}

[data-theme="dark"] .timeline-dot {
    background: linear-gradient(135deg, var(--h-accent), var(--h-accent-2));
}

[data-theme="dark"] .timeline-body {
    background: rgba(20, 20, 45, 0.5);
    border-color: rgba(80, 80, 140, 0.35);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .timeline-body:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ===== 文章卡片网格 ===== */
.blog-controls { margin: 1.5rem 0; }
.blog-controls input { width: 100%; max-width: 32rem; padding: .7rem 1rem; border: 1px solid var(--h-soft-border); border-radius: 12px; background: var(--h-soft-bg); color: inherit; }
.blog-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.blog-tags button { padding: .35rem .8rem; border: 1px solid var(--h-soft-border); border-radius: 999px; background: var(--h-soft-bg); color: inherit; cursor: pointer; }
.blog-tags button[aria-pressed="true"] { background: #5264b8; color: white; }
.blog-status { margin-top: .7rem; }
.article-card[hidden] { display: none; }
.card-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.article-card {
    background: var(--h-soft-bg);
    border: 1px solid var(--h-soft-border);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(73, 84, 190, 0.08);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: row;
    overflow: hidden;
    padding: 0;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(73, 84, 190, 0.18);
}

.article-card .card-image {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 4 / 3;
}

.article-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px 0 0 20px;
    margin: 0;
    border: none;
    box-shadow: none;
    display: block;
}

.article-card .card-image img:hover {
    transform: none;
}

.article-card .card-body {
    flex: 1;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 0.3rem;
}

.article-card .card-body h4 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.4;
    border-left: none;
    padding-left: 0;
}

.article-card .card-body h4:hover {
    border-left-width: 0;
    padding-left: 0;
}

.article-card .card-body p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #666;
}

[data-theme="dark"] .article-card .card-body p {
    color: #a0a2b8;
}

.article-card .card-body strong {
    color: var(--h-accent);
}

.article-card .card-body h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    border-left: none;
    padding-left: 0;
}

.article-card .card-body h4:hover {
    border-left-width: 0;
    padding-left: 0;
}

.article-card .card-body p {
    margin: 0.2rem 0;
}

.article-card .card-body strong {
    color: var(--h-accent);
}

/* 无图片的卡片 */
.article-card:not(:has(.card-image)) {
    padding: 1.5rem;
}

[data-theme="dark"] .article-card {
    background: rgba(20, 20, 45, 0.5);
    border-color: rgba(80, 80, 140, 0.35);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .article-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

/* ===== 响应式：卡片网格 ===== */
@media screen and (max-width: 768px) {
    .article-card {
        flex-direction: column;
    }

    .article-card .card-image {
        width: 100%;
        aspect-ratio: 4 / 3;
        max-height: 240px;
    }

    .article-card .card-image img {
        border-radius: 20px 20px 0 0;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline-dot {
        left: calc(-2rem + 5px);
        width: 14px;
        height: 14px;
    }

    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
    }
}

/* ===== 暗色导航栏（最高优先级，确保子页面也生效） ===== */
html[data-theme="dark"] .header {
    background: rgba(10, 10, 25, 0.65) !important;
    border-bottom-color: rgba(60, 60, 100, 0.5) !important;
}

html[data-theme="dark"] .header .navbar-brand {
    color: #d0d0ff !important;
}

html[data-theme="dark"] .navbar-nav .nav-link {
    color: #d0d0f0 !important;
}

html[data-theme="dark"] .navbar-nav .nav-link:hover {
    color: #e8e8ff !important;
}

html[data-theme="dark"] .navbar-nav .nav-link.active {
    color: #ff9cc8 !important;
}

html[data-theme="dark"] .navbar-nav .nav-link::after {
    background: linear-gradient(90deg, var(--h-accent), var(--h-accent-2));
}

html[data-theme="dark"] .header.scrolled {
    background: rgba(10, 10, 20, 0.85) !important;
}

html[data-theme="dark"] .header .navbar-toggler {
    color: #d0d0f0;
    border-color: rgba(208, 208, 240, 0.3);
}

/* ===== 响应式视频与 HTML 博客 ===== */
.video-block {
    width: 100%;
    margin: 1.5rem 0;
}

.local-video {
    display: block;
    width: 100%;
    max-height: 75vh;
    border: 2px solid var(--h-soft-border);
    border-radius: 16px;
    background: #090914;
    box-shadow: 0 10px 30px rgba(73, 84, 190, 0.22);
}

.video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 2px solid var(--h-soft-border);
    border-radius: 16px;
    background: #090914;
    box-shadow: 0 10px 30px rgba(73, 84, 190, 0.22);
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-block figcaption {
    margin-top: 0.65rem;
    color: #6a6b9c;
    font-size: 0.9rem;
    text-align: center;
}

[data-theme="dark"] .video-block figcaption {
    color: #a0a2cc;
}

.html-blog > h1 {
    display: block;
    margin-bottom: 1.5rem;
    color: var(--h-title-color);
}

.article-meta {
    color: var(--h-accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-error {
    padding: 2rem;
    border: 1px solid var(--h-soft-border);
    border-radius: 16px;
    background: var(--h-soft-bg);
    text-align: center;
}

@media screen and (max-width: 576px) {
    .local-video,
    .video-embed {
        border-radius: 12px;
    }
}
