/* ============================================
   Theme A: "Claude Warmth" — 温暖两栏风格
   Claude warm terracotta palette + two-column layout
   ============================================ */

:root {
  --claude-bg: #FAF9F7;
  --claude-text: #3D3929;
  --claude-accent: #C2714F;
  --claude-secondary: #8C8577;
  --claude-sidebar-bg: transparent;
  --claude-card-shadow: rgba(194, 113, 79, 0.15);
  --claude-border: rgba(194, 113, 79, 0.2);
  --claude-social-bg: #FFFFFF;
  --claude-social-text: #8B7355;
  --claude-footer-border: rgba(194, 113, 79, 0.15);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --claude-bg: #1A1917;
    --claude-text: #D1CEC7;
    --claude-accent: #E28A67;
    --claude-secondary: #9B9488;
    --claude-sidebar-bg: transparent;
    --claude-card-shadow: rgba(0, 0, 0, 0.3);
    --claude-border: rgba(226, 138, 103, 0.2);
    --claude-social-bg: #22211E;
    --claude-social-text: #D1CEC7;
    --claude-footer-border: rgba(226, 138, 103, 0.15);
  }
}

/* 手动切换支持 */
[data-theme="dark"] {
  --claude-bg: #1A1917;
  --claude-text: #D1CEC7;
  --claude-accent: #E28A67;
  --claude-secondary: #9B9488;
  --claude-sidebar-bg: transparent;
  --claude-card-shadow: rgba(0, 0, 0, 0.3);
  --claude-border: rgba(226, 138, 103, 0.2);
  --claude-social-bg: #22211E;
  --claude-social-text: #D1CEC7;
  --claude-footer-border: rgba(226, 138, 103, 0.15);
}

/* 强制浅色模式变量 */
[data-theme="light"] {
  --claude-bg: #FAF9F7;
  --claude-text: #3D3929;
  --claude-accent: #C2714F;
  --claude-secondary: #8C8577;
  --claude-sidebar-bg: transparent;
  --claude-card-shadow: rgba(194, 113, 79, 0.15);
  --claude-border: rgba(194, 113, 79, 0.2);
  --claude-social-bg: #FFFFFF;
  --claude-social-text: #8B7355;
  --claude-footer-border: rgba(194, 113, 79, 0.15);
}

body.theme-claude {
  background-color: var(--claude-bg);
  color: var(--claude-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Top Navigation Bar --- */
body.theme-claude .top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--claude-bg);
  border-bottom: 1px solid var(--claude-footer-border);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: all 0.3s ease;
}

body.theme-claude .nav-container {
  max-width: 1120px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  box-sizing: border-box;
}

body.theme-claude .nav-left a {
  font-weight: 600;
  font-size: 18px;
  color: var(--claude-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

body.theme-claude .nav-left a:hover {
  color: var(--claude-accent);
}

body.theme-claude .nav-right .theme-toggle {
  background: none;
  border: none;
  color: var(--claude-text);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

body.theme-claude .nav-right .theme-toggle:hover {
  background-color: var(--claude-border);
  color: var(--claude-accent);
}

/* --- Theme Switcher --- */
body.theme-claude .theme-switcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  gap: 8px;
  background: #FFFFFF;
  padding: 8px 12px;
  border-radius: 50px;
  box-shadow: 0 2px 12px rgba(61, 57, 41, 0.12);
}

body.theme-claude .theme-btn {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}

body.theme-claude .theme-btn.active {
  border-color: #C2714F;
}

body.theme-claude .theme-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: block;
}

body.theme-claude .dot-claude { background: #C2714F; }
body.theme-claude .dot-apple  { background: #0071E3; }
body.theme-claude .dot-fusion { background: #B5654A; }

/* --- Wrapper: two-column layout --- */
body.theme-claude .wrapper {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  min-height: 100vh;
}

/* --- Sidebar: fixed, top-aligned --- */
body.theme-claude .sidebar {
  width: 320px;
  flex-shrink: 0;
  position: fixed; /* 从 sticky 改为 fixed，确保完全固定 */
  left: calc(50% - 560px); /* 560px 是 wrapper 1120px 的一半 */
  top: 60px; /* 为顶栏留出空间 */
  height: calc(100vh - 60px);
  overflow-y: auto;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 60px; /* 进一步往下挪 */
  z-index: 100;
}

body.theme-claude .profile-card {
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

body.theme-claude .image.avatar {
  margin: 0 auto 32px;
  display: block;
}

body.theme-claude .image.avatar img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 0;
  box-shadow: 0 6px 24px var(--claude-card-shadow);
  object-fit: cover;
}

body.theme-claude .site-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--claude-text);
  margin: 0 0 8px;
  line-height: 1.2;
}

body.theme-claude .site-email {
  font-size: 13px;
  color: var(--claude-secondary);
  font-family: "Ubuntu Mono", "SF Mono", monospace;
  margin: 0 0 24px;
  word-break: break-all;
}

/* --- Social Icons: single row --- */
body.theme-claude .social-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

/* --- Sidebar visitor map --- */
body.theme-claude .sidebar-map {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 48px auto 0;
  width: 240px; /* 调整宽度以对齐文字边缘 */
  background-color: transparent;
  border: none; /* 移除边框 */
  border-radius: 12px;
  box-shadow: none; /* 移除阴影 */
  transition: all 0.3s ease;
  box-sizing: border-box;
  overflow: hidden;
  line-height: 0;
}

body.theme-claude .sidebar-map:hover {
  transform: translateY(-4px);
  /* 悬浮时可以保留轻微的阴影或不加，这里先移除以保持极简 */
}

body.theme-claude .sidebar-map img,
body.theme-claude .sidebar-map canvas {
  max-width: 100%;
  width: 100%;
  height: auto !important;
  display: block;
  border: none;
}

/* Hide footer map for Claude theme */
body.theme-claude .site-footer .visitor-map {
  display: none;
}

body.theme-claude .social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--claude-social-bg);
  color: var(--claude-social-text) !important;
  font-size: 1.1rem;
  line-height: 1;
  margin: 0;
  box-shadow: 0 2px 8px rgba(61, 57, 41, 0.08);
  transition: all 0.2s ease;
}

body.theme-claude .social-icons a:hover {
  background: var(--claude-accent);
  color: #FFFFFF !important;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px var(--claude-card-shadow);
}

body.theme-claude .social-icons a i {
  font-size: 1.2rem;
}

/* --- Main Content: right column --- */
body.theme-claude .content {
  flex: 1;
  min-width: 0;
  padding: 120px 40px 80px 60px; /* 顶部增加 padding 往下挪 */
  box-sizing: border-box;
  margin-left: 320px; /* 为左侧固定栏留出空间 */
}

/* --- Sections --- */
body.theme-claude .section {
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

body.theme-claude .section.visible {
  opacity: 1;
  transform: translateY(0);
}

body.theme-claude .section-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--claude-accent);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--claude-accent);
  display: inline-block;
}

body.theme-claude .section-body {
  color: var(--claude-text);
}

body.theme-claude .section-body p {
  margin: 0 0 14px;
}

body.theme-claude .section-body a {
  color: var(--claude-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

body.theme-claude .section-body a:hover {
  color: var(--claude-accent);
  filter: brightness(1.2);
}

/* --- Cards: no background, clean --- */
body.theme-claude .card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  box-shadow: none;
}

/* --- Timeline items (Education & Experience) --- */
body.theme-claude .timeline-item {
  position: relative;
  margin-left: 20px;
  padding-left: 8px;
  padding-bottom: 20px;
}

body.theme-claude .timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--claude-accent), rgba(194, 113, 79, 0.12));
}

body.theme-claude .timeline-item:last-child::before {
  bottom: 50%;
}

body.theme-claude .timeline-item::after {
  content: '';
  position: absolute;
  left: -25px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--claude-accent);
  border: 2px solid var(--claude-bg);
}

body.theme-claude .experience-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0;
  padding-bottom: 4px;
}

body.theme-claude .institution-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-right: 16px;
  flex-shrink: 0;
}

/* 移除深色模式下的 Logo 滤镜，保持彩色 */
@media (prefers-color-scheme: dark) {
  body.theme-claude .institution-logo {
    filter: none;
  }
}

body.theme-claude .experience-content {
  flex: 1;
}

body.theme-claude .experience-content p {
  margin: 0 0 2px;
}

body.theme-claude .exp-title {
  font-size: 15px;
  color: var(--claude-text);
}

body.theme-claude .exp-detail {
  font-size: 14px;
  color: var(--claude-secondary);
}

body.theme-claude .exp-period {
  font-size: 13px;
  color: var(--claude-accent);
  font-weight: 500;
}

/* --- Project card --- */
body.theme-claude .project-card {
  font-size: 15px;
  line-height: 1.6;
}

/* --- Publications --- */
body.theme-claude .publications {
  margin-top: 0;
}

body.theme-claude .publications ol.bibliography {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.theme-claude .publications ol.bibliography li {
  padding: 15px 0 15px 16px;
  border-left: 3px solid var(--claude-accent);
  margin-bottom: 14px;
  min-height: auto;
}

body.theme-claude .pub-row {
  display: block;
}

body.theme-claude .pub-content {
  padding: 0;
}

body.theme-claude .publications ol.bibliography li .title {
  font-weight: 600;
  font-size: 15px;
  color: var(--claude-text);
  margin-bottom: 4px;
}

body.theme-claude .publications ol.bibliography li .author {
  font-size: 14px;
  color: var(--claude-secondary);
  margin-bottom: 4px;
}

body.theme-claude .publications ol.bibliography li .periodical {
  font-size: 14px;
  color: var(--claude-accent);
  margin-bottom: 6px;
}

body.theme-claude .publications ol.bibliography li .links a {
  color: var(--claude-accent);
  font-size: 13px;
  font-weight: 500;
}

body.theme-claude .publications ol.bibliography li .links a:hover {
  filter: brightness(1.2);
}

/* --- Awards --- */
body.theme-claude .awards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.theme-claude .award-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  padding: 4px 0;
}

body.theme-claude .award-icon {
  font-size: 20px;
  flex-shrink: 0;
}

body.theme-claude .award-text {
  font-size: 14px;
  color: var(--claude-text);
}

body.theme-claude .award-text a {
  color: var(--claude-accent);
}

/* --- Footer --- */
body.theme-claude .site-footer {
  position: static !important;
  float: none !important;
  width: 100%;
  flex-basis: 100%;
  text-align: center;
  padding: 32px 24px 40px 380px; /* 增加左边距以避开固定侧边栏 */
  box-sizing: border-box;
  border-top: none !important; /* 强制移除可能继承的边框 */
}

body.theme-claude .site-footer p {
  font-size: 13px;
  color: var(--claude-secondary);
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--claude-footer-border) !important;
  display: block; /* 恢复为块级元素以覆盖整个右侧宽度 */
}

body.theme-claude .visitor-map {
  margin-bottom: 16px;
}

body.theme-claude .visitor-map img {
  max-width: 240px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(194, 113, 79, 0.12);
  transition: box-shadow 0.2s ease;
}

body.theme-claude .visitor-map img:hover {
  box-shadow: 0 4px 16px rgba(194, 113, 79, 0.2);
}

/* --- Headings override --- */
body.theme-claude h1,
body.theme-claude h2,
body.theme-claude h3,
body.theme-claude h4 {
  color: var(--claude-text);
}

body.theme-claude strong {
  color: var(--claude-text);
}

/* --- Responsive --- */
  @media (max-width: 1080px) {
    body.theme-claude .wrapper {
      width: 100%;
      flex-direction: column;
      padding: 0 20px;
      box-sizing: border-box;
    }

    body.theme-claude .sidebar {
      width: 100%;
      position: static;
      height: auto;
      padding: 48px 0 24px;
      overflow: visible;
    }

    body.theme-claude .content {
      padding: 32px 0 48px;
    }

    body.theme-claude .site-footer {
      padding: 32px 0;
    }

    body.theme-claude .site-footer p {
      border-top: none;
      padding-top: 0;
    }

    body.theme-claude .image.avatar img {
      width: 140px;
      height: 140px;
    }

    body.theme-claude .theme-switcher {
      bottom: 16px;
      right: 16px;
    }
  }

@media (max-width: 480px) {
  body.theme-claude .card {
    padding: 14px 16px;
  }

  body.theme-claude .section {
    margin-bottom: 32px;
  }
}
