/* ====== 全局暗色主题变量 ====== */
:root {
    --primary-color: #4f8cff;
    --secondary-color: #181a20;
    --background-color: #101114;
    --card-bg: #181a20;
    --card-shadow: 0 4px 24px rgba(0,0,0,0.5);
    --text-color: #f5f6fa;
    --text-secondary: #b0b3b8;
    --border-radius: 18px;
    --tag-bg: #23262f;
    --tag-color: #b0b3b8;
    --tag-border: #33364a;
    --nav-bg: #181a20;
    --footer-bg: #181a20;
    --btn-bg: #23262f;
    --btn-hover: #4f8cff;
    --btn-color: #f5f6fa;
    --bg-primary: #1a1b1e;
    --bg-secondary: #23262f;
    --text-primary: #ffffff;
    --accent-color: #1db954;
    --header-bg: rgba(35, 38, 47, 0.95);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f2f5;
    --text-primary: #1a1b1e;
    --text-secondary: #65676b;
    --header-bg: rgba(240, 242, 245, 0.95);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

header {
    background-color: var(--header-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: var(--bg-secondary);
    color: var(--accent-color);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
}

.tech-tag {
    display: inline-block;
    padding: 0.3em 0.8em;
    margin: 0.2em;
    background-color: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
}

h1, h2, h3 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.7rem;
}

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

a:hover {
    text-decoration: underline;
}

.skills-list {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
}

@media (max-width: 768px) {
    nav {
        justify-content: center;
    }
    
    .hero {
        padding: 1rem;
    }
    
    .profile-pic {
        width: 150px;
        height: 150px;
    }
}

/* ====== 卡片式布局 ====== */
.card, .experience-item, .education-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem 2rem 1.5rem 2rem;
    margin-bottom: 2.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover, .experience-item:hover, .education-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}

/* ====== 标签样式 ====== */
.tech-tags, .skills-list ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1rem 0 0 0;
}
.tech-tag, .skills-list li, .filter-btn {
    background: var(--tag-bg);
    color: var(--tag-color);
    border: 1px solid var(--tag-border);
    border-radius: 999px;
    padding: 0.3rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0.2rem 0;
    transition: background 0.2s, color 0.2s;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--btn-hover);
    color: #fff;
    border-color: var(--btn-hover);
}

/* ====== 标题与文本 ====== */
h1 {
    font-size: 2.2rem;
}
h2 {
    font-size: 1.4rem;
}
h3 {
    font-size: 1.1rem;
}
p, span, li {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ====== 个人头像 ====== */
.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--btn-hover);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ====== 响应式 ====== */
@media (max-width: 900px) {
    main {
        padding: 0 1rem;
    }
    .card, .experience-item, .education-item {
        padding: 1.2rem 1rem 1rem 1rem;
    }
}
@media (max-width: 600px) {
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    .profile-pic {
        width: 120px;
        height: 120px;
    }
}

/* ====== 其他细节优化 ====== */
::-webkit-scrollbar {
    width: 8px;
    background: #23262f;
}
::-webkit-scrollbar-thumb {
    background: #23262f;
    border-radius: 8px;
}

a.read-more, a.see-more {
    color: var(--btn-hover);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
a.read-more:hover, a.see-more:hover {
    color: #fff;
    background: var(--btn-hover);
    border-radius: 999px;
    padding: 0.2rem 1rem;
}

/* ====== 博客页面、教育、经历等细节可后续细化 ====== */

/* 主页样式 */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
}

/* 关于页面的图片样式 */
.profile-pic {
    width: 400px;       /* 设置宽度 */
    height: auto;       /* 高度自动保持比例 */

}
/* About页面基础样式 */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.intro-section {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 4rem;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #000;
}

/* 经历部分样式 */
.experience-section {
    max-width: 800px;
    margin: 2rem auto;
}

.experience-item {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.experience-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.experience-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.experience-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.experience-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.experience-role {
    font-weight: 600;
    color: #555;
}

.experience-date {
    color: #777;
}

.experience-details p {
    margin: 0.8rem 0;
    line-height: 1.6;
    color: #444;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background: #e0e0e0;
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .experience-item {
        padding: 1rem;
    }

    .experience-header h2 {
        font-size: 1.3rem;
    }
}

/* 教育经历样式 */
.education-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.education-item {
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 5px;
}

.education-item h3 {
    margin: 0 0 0.5rem;
}

.institution {
    font-weight: 500;
    margin: 0 0 0.3rem;
}

.year {
    color: #666;
    margin: 0;
}

/* 教育页面样式 */
.education-timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
}

.education-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--primary-color);
}

.education-item {
    position: relative;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.education-header {
    margin-bottom: 1rem;
}

.education-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: #666;
}

/* 博客页面样式 */
/* 博客页面样式 */

/* ====== 纵向时间线样式（Education & Experience） ====== */
.timeline-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0 3rem 0;
}
.timeline {
    position: relative;
    margin: 3rem auto 0 auto;
    padding-left: 0;
    max-width: 700px;
}
.timeline:before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--btn-hover);
    border-radius: 2px;
    z-index: 0;
}
.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3.5rem;
    position: relative;
}
.timeline-dot {
    width: 20px;
    height: 20px;
    background: var(--background-color);
    border: 4px solid var(--btn-hover);
    border-radius: 50%;
    position: relative;
    left: 20px;
    top: 0.2rem;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--card-bg);
}
.timeline-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem 2rem;
    margin-left: 60px;
    min-width: 0;
    flex: 1;
    position: relative;
}
.timeline-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    margin-bottom: 0.2rem;
}
.timeline-title, .timeline-title-row h2 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    margin: 0;
}
.timeline-date {
    color: var(--btn-hover);
    font-size: 1rem;
    font-weight: 600;
    justify-self: end;
    text-align: right;
    min-width: 120px;
    margin-left: 1.5rem;
}
.timeline-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}
.timeline-degree {
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.timeline-courses {
    color: var(--text-secondary);
    font-size: 0.98rem;
    margin-top: 0.2rem;
}
.timeline-desc {
    margin: 0.7rem 0 0 0;
    padding-left: 1.2rem;
    color: var(--text-secondary);
    font-size: 1.02rem;
}
@media (max-width: 700px) {
    .timeline-section { padding: 0.5rem 0 2rem 0; }
    .timeline { max-width: 98vw; padding-left: 0; }
    .timeline:before { left: 18px; }
    .timeline-item { align-items: flex-start; }
    .timeline-dot {
        left: 0;
        margin-left: 0.5rem;
        top: 1.1rem;
    }
    .timeline-content {
        margin-left: 40px;
        padding: 1rem 0.7rem;
        min-width: 0;
    }
    .timeline-header {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .timeline-date {
        justify-self: start;
        text-align: left;
        margin-left: 0;
        margin-top: 0.2rem;
        min-width: unset;
        font-size: 0.98rem;
    }
}

/* ====== 技能标签优化 ====== */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem; /* 每组之间的竖直间距 */
}
.skills-list > div {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.7em 0.7em; /* 行间距0.7em，列间距0.7em，保证竖直间距统一 */
    margin-bottom: 0 !important;
}
.tech-tag {
    display: inline-block;
    background: #e0e0e0;
    color: #222;
    border-radius: 2em;
    padding: 0.4em 1.2em;
    font-size: 0.8rem;
    margin: 0;
    white-space: nowrap;      /* 保证整个标签不被拆分 */
    word-break: keep-all;     /* 防止长单词断开 */
    box-sizing: border-box;
    vertical-align: middle;
    transition: background 0.2s;
}

/* ====== 移动端抽屉菜单样式 ====== */
.menu-btn,
.mobile-menu,
.menu-mask {
  display: none;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .mobile-menu,
  .menu-mask { display: none; }
  .mobile-menu.active { display: flex; }
  .menu-mask.active { display: block; }
  .close-btn {
    background: none; border: none; font-size: 2rem; color: var(--text-primary);
    align-self: flex-end; margin-bottom: 2rem; cursor: pointer;
  }
  .mobile-menu a, .mobile-menu button {
    margin: 1rem 0;
    font-size: 1.2rem;
    color: var(--text-primary);
    background: none;
    border: none;
    text-align: left;
  }
  .mobile-menu {
    display: none;
    position: fixed;
    top: 2.5rem;
    right: 1.5rem;
    width: 85vw;
    max-width: 320px;
    background: var(--bg-primary);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    border-radius: 14px;
    z-index: 2000;
    flex-direction: column;
    align-items: stretch;
    padding: 1.2rem 0.5rem;
    animation: slideIn 0.3s;
  }
  .mobile-menu.active { display: flex; }
  .mobile-menu a, .mobile-menu button {
    display: block;
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1.15rem;
    color: var(--text-primary);
    background: none;
    border: none;
    text-align: left;
    border-radius: 0;
    margin: 0;
    font-weight: 500;
    transition: background 0.18s;
  }
  .mobile-menu a:hover, .mobile-menu button:hover {
    background: var(--bg-secondary);
  }
  .mobile-menu a:not(:last-child), .mobile-menu button:not(:last-child) {
    border-bottom: 1px solid var(--bg-secondary);
  }
  .close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-primary);
    align-self: flex-end;
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
    cursor: pointer;
  }
}
@keyframes slideIn {
  from { right: -100vw; }
  to { right: 0; }
}

.card, .timeline-content, .project-card {
    color: var(--text-primary);
}

.card h1, .card h2, .card h3, .project-card h1, .project-card h2, .project-card h3, .timeline-content h1, .timeline-content h2, .timeline-content h3 {
    color: #fff !important;
}

/* 若 about 页面有自定义深色模块类名，也可加上 */
.about-section h1, .about-section h2, .about-section h3 {
    color: #fff !important;
}

@media (max-width: 700px) {
  .about-sidebar nav {
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
  }
  .about-sidebar {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1.2rem;
  }
  .about-nav-link {
    font-size: 1rem;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--text-primary);
    transition: color 0.2s;
  }
  .about-nav-link.active, .about-nav-link:hover {
    background: none;
    color: var(--btn-hover);
    text-decoration: underline;
  }
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 1.2rem;
    position: relative;
}
.nav-logo {
    display: flex;
    align-items: center;
    margin-right: 1.2rem;
    padding: 0;
}
.nav-logo img {
    height: 38px;
    width: auto;
    display: block;
}
.nav-links {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.menu-btn {
    font-size: 2.1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: none;
    margin-left: auto;
}
@media (max-width: 700px) {
    .main-nav {
        padding: 0 0.7rem;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
    }
    .nav-logo {
        margin-right: 0;
        flex: 0 0 auto;
    }
    .nav-logo img {
        height: 30px;
    }
    .nav-links {
        display: none;
    }
    .menu-btn {
        display: block;
        font-size: 2.1rem;
        margin-left: 0;
        flex: 0 0 auto;
    }
}