/* 全局重置 + 基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", sans-serif;
}

body {
    transform: translate3d(3%, -4%, 0);
  color: #333;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

.page-bg {
  position: fixed;
  inset: 0;
  background: url('../images/bg.jpg') center center / cover no-repeat fixed;
  opacity: 0.6;
  filter: blur(0.2px);
  z-index: -1;
  pointer-events: none;
}

.page-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.35), transparent 40%),
              radial-gradient(circle at 80% 30%, rgba(107,114,255,0.25), transparent 45%),
              linear-gradient(120deg, rgba(0,0,0,0.1), rgba(255,255,255,0.08));
  mix-blend-mode: screen;
  pointer-events: none;
  animation: glowShift 16s ease-in-out infinite alternate;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
  background: #6b72ff;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}
/* 深色主题切换 */
body.dark-theme {
  background-color: #222;
  color: #fff;
}

/* 暗色主题下的导航栏 */
body.dark-theme .navbar {
  background: rgba(40, 40, 40, 0.8);
}

body.dark-theme .navbar .logo {
  color: #fff;
}

body.dark-theme .navbar nav a {
  color: #fff;
}

body.dark-theme .search-icon {
  color: #fff;
}

/* 头部导航 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  position: fixed;
  width: 100%;
  z-index: 999;
}
.navbar.shrink {
  padding: 0.65rem 1.5rem;
  background: rgba(255,255,255,0.65);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.navbar .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #666;
}
.navbar nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}
.navbar nav a {
  text-decoration: none;
  color: #333;
  padding: 0.3rem 0;
  transition: color 0.3s;
}
.navbar nav a:hover {
  color: #6b72ff;
}
.navbar nav a:focus-visible {
  outline: 2px solid #6b72ff;
  outline-offset: 2px;
}
.navbar nav a.active {
  color: #6b72ff;
  font-weight: 600;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.search-icon, .icon {
  text-decoration: none;
  color: #333;
  cursor: pointer;
  transition: color 0.3s;
}
.search-icon:hover, .icon:hover {
  color: #6b72ff;
}
.avatar:focus-visible,
.icon:focus-visible,
.search-icon:focus-visible {
  outline: 2px solid #6b72ff;
  outline-offset: 2px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* 主题切换按钮 */
.theme-switch {
  display: inline-block;
}
.theme-switch input {
  display: none;
}
.toggle-slider {
  width: 30px;
  height: 16px;
  background-color: #ccc;
  border-radius: 16px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s;
}
.toggle-slider::before {
  content: "";
  width: 12px;
  height: 12px;
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
}
.theme-switch input:checked + .toggle-slider {
  background-color: #6b72ff;
}
.theme-switch input:checked + .toggle-slider::before {
  transform: translateX(14px);
}

/* 主体英雄区 */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
}
.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: #333;
}
.hero-text h2 {
  font-size: 2.5rem;
  color: #333;
}
.name {
  color: #6b72ff;
}
.hero-text p {
  font-size: 1.2rem;
  margin: 1rem 0;
  color: #666;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.primary-btn, .ghost-btn {
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(107, 114, 255, 0.25);
}

.primary-btn {
  background: linear-gradient(135deg, #6b72ff, #9a7bff);
  color: #fff;
}

.ghost-btn {
  background: rgba(255,255,255,0.7);
  color: #333;
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.primary-btn:hover, .ghost-btn:hover {
  transform: translateY(-2px) scale(1.01);
}

.primary-btn:active, .ghost-btn:active {
  transform: translateY(0);
}
.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1.5rem;
  margin-top: 1.5rem;
}

/* 社交图标样式 */
.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.social-icons a:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* 哔哩哔哩 */
.social-icons a.bilibili {
  background-color: #FB7299;
}
.social-icons a.bilibili:hover {
  background-color: #ff8ab0;
}

/* GitHub */
.social-icons a.github {
  background-color: #333;
}
.social-icons a.github:hover {
  background-color: #555;
}

/* Gitee */
.social-icons a.gitee {
  background-color: #C71D23;
}
.social-icons a.gitee:hover {
  background-color: #e32c32;
}

/* 网易云 */
.social-icons a.netease {
  background-color: #E30000;
}
.social-icons a.netease:hover {
  background-color: #ff1a1a;
}

/* 背景图 + 圆形头像装饰 */
.hero-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.avatar-circle {
  position: absolute;
  right: 10%;
  top: 20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 5px solid #fff;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3;
  cursor: pointer;
}

/* 确保旋转效果优先于其他可能的transform样式 */
.avatar-circle:hover {
  transform: rotate(360deg) !important;
}

/* 博客区域样式 - 添加时间轴 */
.blog-section {
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: relative;
  z-index: 1;
  display: flex;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

.info-section {
  max-width: 1100px;
  margin: 0 auto 2rem auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.info-section h3 {
  margin-bottom: 0.75rem;
  color: #333;
}

.friend-links {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.friend-links a {
  color: #6b72ff;
  text-decoration: none;
}

.friend-links a:hover {
  text-decoration: underline;
}

body.dark-theme .friend-links a {
  color: #8a90ff;
}

body.dark-theme .info-section {
  background: rgba(40,40,40,0.8);
}

body.dark-theme .info-section h3 {
  color: #fff;
}

.timeline {
  position: relative;
  width: 120px;
  flex-shrink: 0;
  margin-right: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 60px;
  width: 3px;
  background: linear-gradient(to bottom, rgba(107,114,255,0.9), transparent);
  z-index: 1;
  box-shadow: 0 0 16px rgba(107,114,255,0.35);
}

.timeline-marker {
  position: absolute;
  left: 55px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #6b72ff;
  border: 2px solid #fff;
  z-index: 2;
  box-shadow: 0 0 0 3px rgba(107, 114, 255, 0.35), 0 0 12px rgba(107,114,255,0.4);
}

.timeline-date {
  position: absolute;
  left: 0;
  width: 50px;
  text-align: right;
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

body.dark-theme .timeline-date {
  color: #aaa;
}

.blog-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.blog-post {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px) saturate(120%);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  position: relative;
}

.blog-post:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
  border-color: rgba(107,114,255,0.35);
}

.blog-post:focus-visible {
  outline: 2px solid #6b72ff;
  outline-offset: 2px;
}

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

.post-title {
  font-size: 1.5rem;
  color: #333;
  margin: 0;
}

.post-content {
  color: #444;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* 暗色主题下的博客样式 */
body.dark-theme .blog-post {
  background: rgba(40, 40, 40, 0.8);
}

body.dark-theme .post-title {
  color: #fff;
}

body.dark-theme .post-content {
  color: #ddd;
}

/* 页脚 - 移动到hero-section内 */
.hero-section .footer {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #999;
  z-index: 2;
  transition: all 0.5s ease;
}

.hero-section .footer.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.scroll-down {
  display: block;
  margin-top: 0.5rem;
  color: #999;
  text-decoration: none;
  transition: color 0.3s;
  cursor: pointer;
  font-size: 1.5rem;
}
.scroll-down:hover {
  color: #6b72ff;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.7);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 900px;
  border-radius: 8px;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

body.dark-theme .modal-content {
  background-color: #333;
  color: #fff;
}

.modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  right: 15px;
  top: 10px;
  z-index: 1001;
  background: transparent;
  border: none;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

body.dark-theme .close:hover,
body.dark-theme .close:focus {
  color: #fff;
}

.article-content {
  padding: 20px;
  line-height: 1.6;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: #6b72ff;
}

body.dark-theme .article-content h1,
body.dark-theme .article-content h2,
body.dark-theme .article-content h3 {
  color: #8a90ff;
}

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

.article-content code {
  background-color: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

body.dark-theme .article-content code {
  background-color: #444;
}

.article-content pre {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
  overflow: auto;
  margin-bottom: 1em;
}

body.dark-theme .article-content pre {
  background-color: #444;
}

.article-content pre code {
  background: none;
  padding: 0;
}

.article-content blockquote {
  border-left: 4px solid #6b72ff;
  padding-left: 1em;
  margin-left: 0;
  color: #666;
}

body.dark-theme .article-content blockquote {
  border-left-color: #8a90ff;
  color: #ccc;
}

.article-content a {
  color: #6b72ff;
  text-decoration: underline;
}

body.dark-theme .article-content a {
  color: #8a90ff;
}

.loading, .error {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
  }
  .hero-text h1 {
    font-size: 2rem;
  }
  .hero-text h2 {
    font-size: 1.8rem;
  }
  .hero-actions {
    flex-direction: column;
  }
  .primary-btn, .ghost-btn {
    width: 100%;
  }
  .avatar-circle {
    width: 120px;
    height: 120px;
  }
  .social-icons {
    gap: 1rem;
  }
  .social-icons a {
    width: 45px;
    height: 45px;
  }
  
  .blog-section {
    flex-direction: column;
    padding: 3rem 1rem;
  }
  
  .timeline {
    width: 100%;
    height: 60px;
    margin-right: 0;
    margin-bottom: 20px;
  }
  
  .timeline::before {
    left: 0;
    right: 0;
    top: 30px;
    height: 2px;
    width: 100%;
    background: linear-gradient(to right, #6b72ff, transparent);
  }
  
  .timeline-marker {
    top: 26px;
    left: auto;
  }
  
  .timeline-date {
    top: 42px;
    left: auto;
    text-align: center;
    width: 100%;
  }
  
  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 15px;
  }
}