:root {
  --text-primary: #0a0a0a;
  --text-secondary: #4a5568;
  --text-tertiary: #718096;
  --bg-body: #fafafa;
  --bg-card: #ffffff;
  --border-line: #e2e8f0;
  --accent-primary: #2c3e50;
  --accent-hover: #1a252f;
  --module-hover-bg: #f7fafc;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --gradient-accent: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  background: var(--bg-body);
  background-image:
    radial-gradient(circle at 20% 50%, rgba(44, 62, 80, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(52, 152, 219, 0.03) 0%, transparent 50%);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* 噪点纹理 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' /%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease, transform 0.2s ease;
}

a:hover {
  color: var(--accent-primary);
}

.container {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 80px auto 120px 280px;
  background: var(--bg-card);
  padding: 72px 64px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(44, 62, 80, 0.08);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

/* 容器装饰光晕 */
.container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-accent);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: -1;
  filter: blur(8px);
}

.container:hover::before {
  opacity: 0.08;
}

/* 滚动动画 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.delay-1 {
  transition-delay: 0.15s;
}

.delay-2 {
  transition-delay: 0.3s;
}

/* TOAST 通知 - 玻璃态 */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
  transform: translateX(400px);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* 左侧导航栏 */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border-line);
  padding: 32px 0;
  z-index: 100;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.sidebar-brand {
  padding: 0 32px;
  margin-bottom: 40px;
  text-align: center;
}

.sidebar-brand h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #3498db 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand p {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  font-weight: 500;
}

.nav-menu {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin: 0;
  list-style: none !important;
  list-style-type: none !important;
}

.nav-link {
  display: block;
  padding: 14px 32px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  border-radius: 0 24px 24px 0;
  margin-right: 20px;
  overflow: hidden;
  text-decoration: none;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 0 4px 4px 0;
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: top;
}

.nav-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-primary);
  transform: translateX(8px);
  box-shadow: var(--shadow-sm);
}

.nav-link:hover::before,
.nav-link.active::before {
  transform: scaleY(1);
}

.nav-link:hover::after {
  opacity: 0.05;
}

.nav-link.active {
  background: rgba(44, 62, 80, 0.05);
  font-weight: 600;
}

/* 头部区域 */
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  border-bottom: 2px solid var(--border-line);
  padding-bottom: 48px;
  margin-bottom: 56px;
  position: relative;
}

/* 装饰性渐变线 */
.header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 120px;
  height: 2px;
  background: var(--gradient-accent);
  transition: width 0.6s ease;
}

.header:hover::after {
  width: 200px;
}

h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 700;
  font-family: 'Playfair Display', 'Noto Sans SC', serif;
  letter-spacing: -1.5px;
  color: #000;
  line-height: 1.1;
  background: linear-gradient(135deg, #000 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.job-title {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}

.job-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width 0.4s ease;
}

.job-title:hover::after {
  width: 100%;
}

.contact-info {
  margin-top: 28px;
  font-size: 14px;
  color: var(--text-secondary);
  display: grid;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.85;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.2s ease;
  padding: 4px 0;
  position: relative;
}

.contact-item::before {
  content: '→';
  opacity: 0;
  position: absolute;
  left: -20px;
  transition: opacity 0.3s ease, left 0.3s ease;
  color: var(--accent-primary);
}

.contact-item:hover {
  opacity: 1;
  transform: translateX(8px);
}

.contact-item:hover::before {
  opacity: 1;
  left: -16px;
}

/* 头像增强 */
.avatar {
  width: 95px;
  height: auto;
  display: block;
  border-radius: 12px;
  filter: grayscale(15%);
  transition: filter 0.5s ease, transform 0.5s ease, box-shadow 0.5s ease;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  position: relative;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-wrapper::before {
  content: '';
  position: absolute;
  inset: -4px;
  background: var(--gradient-accent);
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
  filter: blur(12px);
}

.avatar:hover {
  filter: grayscale(0%);
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
}

.avatar-wrapper:hover::before {
  opacity: 0.6;
}

/* 章节标题 */
h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-tertiary);
  margin: 64px 0 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  position: relative;
}

h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-line) 0%, transparent 100%);
  margin-left: 20px;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 40px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* 模块卡片增强 */
.item {
  margin-bottom: 52px;
  padding: 24px 28px;
  border-radius: 8px;
  transition: background 0.4s ease,
    border-color 0.4s ease,
    transform 0.3s ease,
    box-shadow 0.4s ease;
  cursor: default;
  border: 1px solid transparent;
  margin-left: -28px;
  margin-right: -28px;
  position: relative;
  overflow: hidden;
}

/* 卡片悬停光效 */
.item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(44, 62, 80, 0.05), transparent);
  transition: left 0.6s ease;
}

.item:hover::before {
  left: 100%;
}

.item:hover {
  background: var(--module-hover-bg);
  border-color: rgba(44, 62, 80, 0.15);
  transform: translateY(-4px) translateX(4px);
  box-shadow: -4px 8px 24px rgba(0, 0, 0, 0.06);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 20px;
}

.item-title {
  font-weight: 600;
  font-size: 19px;
  color: #000;
  position: relative;
  transition: color 0.3s ease;
}

.item:hover .item-title {
  color: var(--accent-primary);
}

.item-time {
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: 'Inter', monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item-sub-title {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 18px;
  display: inline-block;
}

p {
  margin: 14px 0;
  font-size: 15px;
  color: var(--text-secondary);
  text-align: justify;
}

strong {
  color: #000;
  font-weight: 600;
}

ul {
  margin: 14px 0 0 0;
  padding: 0;
  list-style: none;
}

li {
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  background: var(--gradient-accent);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

li:hover::before {
  transform: scale(1.5);
}

/* 技能标签网格对齐 */
.skills-section {
  display: grid;
  gap: 32px;
}

.skill-group {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  align-items: start;
}

.skill-label {
  font-weight: 600;
  font-size: 14px;
  color: #000;
  padding-top: 8px;
  letter-spacing: 0.5px;
}

.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-accent);
  transition: left 0.4s ease;
  z-index: -1;
}

.tag:hover {
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.tag:hover::before {
  left: 0;
}

/* 下载按钮 - 玻璃态 */
.download-btn {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  background: rgba(26, 54, 93, 0.95);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 16px 32px;
  border-radius: 50px;
  box-shadow: 0 12px 32px rgba(26, 54, 93, 0.3);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
    box-shadow 0.4s ease,
    background 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  animation: btnFadeIn 1s 1.2s forwards;
  overflow: hidden;
}

/* 按钮光效 */
.download-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  pointer-events: none;
}

.download-btn:hover::before {
  left: 100%;
}

@keyframes btnFadeIn {
  to {
    opacity: 1;
  }
}

.download-btn:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 20px 48px rgba(44, 62, 80, 0.4);
  background: rgba(26, 42, 53, 0.98);
}

.download-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.download-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.download-btn:hover svg {
  transform: translateY(2px);
}

/* 社交链接区域 */
.social-links {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 16px;
  z-index: 100;
}

.social-link {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  border: 1px solid rgba(44, 62, 80, 0.1);
  padding: 10px 0;
}

.social-link svg {
  width: 28px;
  height: 28px;
  fill: var(--text-secondary);
  transition: fill 0.3s ease;
}

.social-link:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.15);
  background: var(--bg-card);
}

.social-link:hover svg {
  fill: var(--accent-primary);
}

.social-link-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  transition: color 0.3s ease;
  font-weight: 500;
}

.social-link:hover .social-link-text {
  color: var(--accent-primary);
}

/* 微信二维码弹窗 */
.wechat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wechat-modal.show {
  opacity: 1;
  visibility: visible;
}

.wechat-modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 320px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-align: center;
}

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

.wechat-modal-title {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.wechat-modal-image {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wechat-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-tertiary);
  position: absolute;
  top: 16px;
  right: 16px;
  transition: color 0.3s ease;
}

.wechat-modal-close:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .container {
    padding: 48px 28px;
    margin: 20px;
    border-radius: 12px;
  }

  .header {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .avatar-wrapper {
    order: -1;
  }

  .avatar {
    width: 90px;
    height: auto;
  }

  .skill-group {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  h1 {
    font-size: 32px;
  }

  .download-btn {
    bottom: 20px !important;
    right: 20px !important;
    padding: 14px 24px;
    font-size: 13px;
  }

  .social-links {
    top: 16px;
    right: 16px;
    gap: 12px;
  }

  .social-link {
    width: 54px;
    height: 54px;
    padding: 8px 0;
  }

  .social-link svg {
    width: 26px;
    height: 26px;
  }
  
  .social-link-text {
    font-size: 12px;
    margin-top: 5px;
  }

  .item {
    margin-left: -20px;
    margin-right: -20px;
    padding: 20px 20px;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 12px;
    padding: 36px 20px;
  }

  h1 {
    font-size: 28px;
  }

  .item-header {
    flex-direction: column;
    gap: 4px;
  }

  .item-time {
    font-size: 12px;
  }

  .social-link {
    width: 50px;
    height: 50px;
  }

  .social-link svg {
    width: 24px;
    height: 24px;
  }
  
  .social-link-text {
    font-size: 11px;
    margin-top: 4px;
  }
}

/* AI聊天助手窗口 */
.ai-chat-window {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%) translateX(100%) scale(0.8);
  width: 350px;
  height: 500px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-line);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-out;
  z-index: 1000;
}

.ai-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
}

.ai-chat-header {
  background: var(--accent-primary);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.ai-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.ai-user-message {
  align-self: flex-end;
  background: var(--accent-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-bot-message {
  align-self: flex-start;
  background: var(--module-hover-bg);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.ai-chat-input-container {
  display: flex;
  padding: 16px;
  border-top: 1px solid var(--border-line);
  background: var(--bg-card);
}

.ai-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-line);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.ai-chat-input:focus {
  border-color: var(--accent-primary);
}

.ai-chat-send {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  margin-left: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.ai-chat-send:hover {
  background: var(--accent-hover);
}

.ai-typing-indicator {
  align-self: flex-start;
  background: var(--module-hover-bg);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  border-bottom-left-radius: 4px;
}

.ai-typing-dots {
  display: inline-flex;
  align-items: center;
}

.ai-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  margin: 0 2px;
  animation: typing 1.4s infinite ease-in-out;
}

.ai-typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.ai-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

@media (max-width: 768px) {
  .ai-chat-window {
    width: 300px;
    height: 400px;
    right: 80px;
  }
}

@media (max-width: 480px) {
  .ai-chat-window {
    width: 280px;
    height: 350px;
    right: 70px;
  }
  
  .ai-message {
    max-width: 90%;
  }
}
