/* ===== 重置 & 字体 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
}

/* ===== 毛玻璃薄雾风格 (蓝紫调) ===== */
body {
  min-height: 100vh;
  background: linear-gradient(145deg, #e9efff 0%, #d9e2fa 50%, #cbd5f0 100%);
  color: #2d3a4f;
  transition: background 0.4s, color 0.3s;
}

/* 深色模式 (深灰紫) */
body.theme-dark {
  background: linear-gradient(145deg, #1f2336 0%, #2b2f44 50%, #1e2232 100%);
  color: #e2e6f0;
}

/* 主容器 */
.wrapper {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem 1.5rem;
  position: relative;
  z-index: 2;
}

/* ===== 顶部栏 ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0 0.8rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo img {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.05));
}

/* 主题切换按钮 — 毛玻璃圆钮 */
.theme-toggle button {
  width: 52px;
  height: 52px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #3a4a62;
  box-shadow: 0 8px 20px rgba(120, 140, 200, 0.2);
  transition: 0.2s;
}

body.theme-dark .theme-toggle button {
  background: rgba(25, 30, 45, 0.5);
  border-color: rgba(255,255,255,0.15);
  color: #dfe7ff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.theme-toggle button:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,0.5);
}

/* ===== 个人资料卡片 (毛玻璃) ===== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 48px;
  padding: 1rem 2rem 1rem 1.5rem;
  margin: 1rem 0 2rem;
  box-shadow: 0 20px 40px rgba(140, 160, 220, 0.15);
}

body.theme-dark .profile-card {
  background: rgba(25, 30, 45, 0.4);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.avatar {
  display: flex;
  align-items: center;
}

.avatar img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.7);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

body.theme-dark .avatar img {
  border-color: rgba(200,220,255,0.3);
}

.profile-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.profile-text .name {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.2;
  text-shadow: 0 2px 5px rgba(255,255,255,0.3);
}

.profile-text .motto {
  font-size: 1.2rem;
  opacity: 0.9;
  font-style: italic;
  margin-top: 0.2rem;
  word-break: break-word;
}

/* ===== 网站展示区域 ===== */
.section-title {
  font-size: 1.9rem;
  font-weight: 500;
  margin: 1.8rem 0 1rem 0.3rem;
  display: inline-block;
  padding: 0.2rem 1.5rem 0.2rem 1rem;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border-radius: 40px;
  border: 1px solid rgba(255,255,255,0.4);
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.site-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 32px;
  padding: 1.2rem 1rem;
  transition: all 0.25s ease;
  box-shadow: 0 10px 20px rgba(140, 160, 220, 0.1);
}

body.theme-dark .site-card {
  background: rgba(25, 30, 45, 0.3);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.site-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 20px 30px rgba(120, 140, 200, 0.15);
}

body.theme-dark .site-card:hover {
  background: rgba(40, 45, 65, 0.4);
  border-color: rgba(255,255,255,0.2);
}

.site-name {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.site-desc {
  font-size: 0.9rem;
  opacity: 0.8;
  word-break: break-word;
  line-height: 1.4;
}

.site-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* ===== 联系方式 ===== */
.contact-area {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 2.5rem 0 1.5rem;
  justify-content: center;
}

.contact-item {
  flex: 1 1 220px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 80px;
  padding: 1rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.2rem;
  transition: 0.2s;
  box-shadow: 0 8px 18px rgba(140, 160, 220, 0.1);
}

body.theme-dark .contact-item {
  background: rgba(25, 30, 45, 0.35);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 18px rgba(0,0,0,0.3);
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.02);
  border-color: rgba(255,255,255,0.8);
}

.contact-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  justify-content: center;
  font-weight: 500;
}

.contact-emoji {
  font-size: 1.9rem;
  filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.1));
}

/* ===== 版权 ===== */
.footer {
  text-align: center;
  margin-top: 3rem;
  padding: 1.5rem 0.5rem 0.5rem;
  font-size: 1rem;
  border-top: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(4px);
}

body.theme-dark .footer {
  border-top-color: rgba(255,255,255,0.1);
}

/* ===== 返回顶部按钮 (毛玻璃，默认隐藏) ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  z-index: 99;
  box-shadow: 0 10px 25px rgba(140, 160, 220, 0.2);
  color: #3a4a62;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.2s;
  opacity: 0;
  visibility: hidden;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

body.theme-dark .back-to-top {
  background: rgba(20, 25, 40, 0.5);
  border-color: rgba(255,255,255,0.15);
  color: #dfe7ff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.back-to-top:hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.45);
}

body.theme-dark .back-to-top:hover {
  background: rgba(40, 45, 65, 0.6);
}

/* ===== 博客模式附加样式 ===== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.post-card {
  background: var(--card-bg, rgba(255,255,255,0.2));
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color, rgba(255,255,255,0.4));
  border-radius: 32px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 10px 20px rgba(140, 160, 220, 0.1);
}

body.theme-dark .post-card {
  background: rgba(25,30,45,0.3);
  border-color: rgba(255,255,255,0.1);
}

.post-title {
  font-size: 24px;
  margin-bottom: 10px;
}
.post-title a {
  color: inherit;
  text-decoration: none;
}
.post-meta {
  opacity: 0.8;
  font-size: 14px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255,255,255,0.3);
}
.post-content, .post-excerpt {
  line-height: 1.7;
}
.pagination {
  text-align: center;
  margin: 40px 0;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 4px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 30px;
  color: inherit;
  text-decoration: none;
}
.pagination .current {
  background: rgba(255,255,255,0.4);
  border-color: rgba(255,255,255,0.8);
}

/* ===== 移动端优化 ===== */
@media (max-width: 640px) {
  .wrapper {
    padding: 0.5rem 1rem 1rem;
  }

  .profile-card {
    gap: 1.2rem;
    padding: 0.8rem 1.2rem 0.8rem 0.8rem;
    border-radius: 40px;
  }

  .avatar img {
    width: 80px;
    height: 80px;
  }

  .profile-text .name {
    font-size: 1.7rem;
  }

  .profile-text .motto {
    font-size: 1rem;
  }

  .sites-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
  }

  .site-card {
    padding: 0.9rem 0.8rem;
  }

  .site-name {
    font-size: 1.2rem;
  }

  .site-desc {
    font-size: 0.8rem;
  }

  .contact-item {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border-radius: 60px;
  }

  .back-to-top {
    width: 52px;
    height: 52px;
    font-size: 2rem;
    bottom: 1rem;
    right: 1rem;
  }

  .logo img {
    height: 40px;
  }

  .section-title {
    font-size: 1.6rem;
    margin: 1.5rem 0 0.8rem;
  }
}

@media (max-width: 400px) {
  .sites-grid {
    grid-template-columns: 1fr 1fr;
  }
}