/* ===== 全局重置 & 变量 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', Roboto, Helvetica, Arial, sans-serif;
}

:root {
  --page-bg: #e9edf2;
  --card-bg: #ffffff;
  --sidebar-bg: #f7f8fa;
  --accent: #4a90d9;
  --accent-soft: #e8f1fb;
  --text-dark: #2c3e50;
  --text-light: #5a6a7a;
  --border: #e5e9ee;
  --date-color: #8896a6;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --radius: 8px;
}

[data-theme="dark"] {
  --page-bg: #0d1117;
  --card-bg: #161b22;
  --sidebar-bg: #1c2128;
  --accent: #58a6ff;
  --accent-soft: #1e2a3a;
  --text-dark: #e6edf3;
  --text-light: #8b949e;
  --border: #30363d;
  --date-color: #6e7681;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body {
  background: var(--page-bg);
  min-height: 100vh;
  padding: 2rem 1.5rem 2rem 5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: background 0.35s ease;
}

/* ===================================================
   左侧固定悬浮按钮组
   =================================================== */
.float-actions {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.float-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 56px;
  padding: 10px 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  border: none;
  border-radius: 0 10px 10px 0;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.25s ease;
  cursor: pointer;
  font-family: inherit;
}

.float-btn i { font-size: 1.05rem; }

.float-btn:hover {
  filter: brightness(1.1);
  padding-left: 12px;
  transform: translateX(2px);
}

.float-btn:nth-child(1) { background: #4a90d9; }
.float-btn:nth-child(2) { background: #4caf50; }
.float-btn:nth-child(3) { background: #ff9800; }

[data-theme="dark"] .float-btn {
  box-shadow: 2px 4px 14px rgba(0, 0, 0, 0.5);
}

/* ===================================================
   整体
   =================================================== */
.resume {
  position: relative;
  width: 100%;
  max-width: 1080px;
}

.resume-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ================= 左侧卡片 ================= */
.sidebar {
  background: var(--sidebar-bg);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: background 0.35s ease;
}

/* ===== 头像 + 上方按钮 ===== */
.profile {
  text-align: center;
  padding-bottom: 1.2rem;
  padding-top: 0.4rem;
  position: relative;
}

.profile-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 6px;
  z-index: 5;
}

/* 两个小圆按钮 */
.mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-dark);
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
}

.mini-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.08);
}

.mini-btn:active {
  transform: scale(0.95);
}

/* 固定按钮激活状态 */
.mini-btn.pin-active {
  background: #d94f4f;
  color: #fff;
  border-color: #d94f4f;
}

.mini-btn.pin-active i {
  transform: rotate(-45deg);
}

/* ===== 头像：音波形 CSS 动画 ===== */
.avatar {
  width: 90px;
  height: 90px;
  margin: 0.6rem auto 0.8rem;
  border-radius: 50%;
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--card-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  gap: 3px;
  transition: background 0.35s ease;
}

[data-theme="dark"] .avatar {
  background: #232c38;
}

.avatar-wave .bar {
  display: block;
  width: 5px;
  border-radius: 2.5px;
  transform-origin: center;
  animation: wave 1s ease-in-out infinite;
}

.avatar-wave .b1 { background: #8fb8d9; animation-delay: 0s;    animation-duration: 1.1s;  height: 14px; }
.avatar-wave .b2 { background: #a8d0ea; animation-delay: 0.15s; animation-duration: 0.9s;  height: 22px; }
.avatar-wave .b3 { background: #b8e0b8; animation-delay: 0.3s;  animation-duration: 0.7s;  height: 12px; }
.avatar-wave .b4 { background: #a8d8a8; animation-delay: 0.45s; animation-duration: 0.85s; height: 22px; }
.avatar-wave .b5 { background: #98d0c0; animation-delay: 0.6s;  animation-duration: 1.05s; height: 16px; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.55); }
  50%      { transform: scaleY(1.35); }
}

.name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
}

.job-intent { font-size: 0.82rem; color: var(--text-light); }

.side-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-dark);
  padding-bottom: 0.4rem;
  margin-bottom: 0.85rem;
  border-bottom: 2px solid var(--accent);
}

.side-title i { color: var(--accent); font-size: 0.9rem; }

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-list li {
  display: flex;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-light);
}

.info-list .label {
  flex: 0 0 4rem;
  color: var(--text-dark);
  font-weight: 500;
}

.info-list .value { color: var(--text-light); word-break: break-all; }

.contact-list li { display: flex; align-items: center; gap: 0.55rem; }
.contact-list li i {
  color: var(--accent);
  font-size: 0.85rem;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}

/* ===== 技能点：保留圆点 ===== */
.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 0.2rem;
}

.skill-list li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.84rem;
  color: var(--text-light);
  line-height: 1.6;
  transition: color 0.25s ease;
}

.skill-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.skill-list li:hover {
  color: var(--accent);
}

/* ================= 右侧卡片 ================= */
.content {
  background: var(--card-bg);
  padding: 2rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.7rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: background 0.35s ease;
}

.block-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-dark);
  padding-bottom: 0.45rem;
  margin-bottom: 0.95rem;
  border-bottom: 2px solid var(--accent);
}
.block-title i { color: var(--accent); font-size: 1rem; }

.timeline-item {
  position: relative;
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
}
.timeline-item:last-child { padding-bottom: 0; margin-bottom: 0; }

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.timeline-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.timeline-date {
  font-size: 0.78rem;
  color: var(--date-color);
  white-space: nowrap;
  font-style: italic;
}
.tag-demo {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-style: normal;
}

/* ===== 工作/实习/项目描述：无圆点 ===== */
.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.timeline-list li {
  font-size: 0.84rem;
  color: var(--text-light);
  line-height: 1.7;
  text-align: justify;
}

/* 技术栈 */
.project-stack {
  font-size: 0.8rem;
  color: #3a6ea5;
  background: #eef5fc;
  border-left: 3px solid #4a90d9;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 0.55rem;
  line-height: 1.6;
  word-break: break-word;
  transition: background 0.25s ease;
}

[data-theme="dark"] .project-stack {
  color: #8ab4f8;
  background: #1a2740;
  border-left-color: #58a6ff;
}

.paragraph {
  font-size: 0.86rem;
  color: var(--text-light);
  line-height: 1.8;
  text-align: justify;
}

/* ===================================================
   ★ 固定模式：左栏 sticky 吸附，右栏跟随页面滚动
   =================================================== */
body.pinned {
  overflow: visible;
  height: auto;
}

body.pinned .sidebar {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.pinned .sidebar::-webkit-scrollbar {
  width: 0;
  display: none;
}

/* ===================================================
   响应式
   =================================================== */

@media screen and (max-width: 900px) {
  body { padding-left: 4.5rem; }
  .resume-body { grid-template-columns: 260px 1fr; gap: 1.2rem; }
  .sidebar { padding: 1.6rem 1.2rem; }
  .content { padding: 1.6rem 1.5rem; }

  .avatar { width: 80px; height: 80px; }
  .avatar-wave .bar { width: 4px; }
  .avatar-wave .b1 { height: 12px; }
  .avatar-wave .b2 { height: 18px; }
  .avatar-wave .b3 { height: 10px; }
  .avatar-wave .b4 { height: 18px; }
  .avatar-wave .b5 { height: 14px; }
}

/* 手机端：隐藏浮动按钮组，取消固定模式 */
@media screen and (max-width: 700px) {
  body,
  body.pinned {
    padding: 1rem 0.7rem 1rem 0.7rem;
    height: auto;
    overflow: auto;
  }

  .float-actions {
    display: none;
  }

  body.pinned .sidebar {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  .resume-body { grid-template-columns: 1fr; gap: 1rem; }

  .sidebar { padding: 1.5rem 1.2rem; gap: 1.3rem; }
  .content { padding: 1.5rem 1.2rem; gap: 1.5rem; }

  .avatar { width: 78px; height: 78px; }
  .avatar-wave .bar { width: 4px; }
  .avatar-wave .b1 { height: 11px; }
  .avatar-wave .b2 { height: 17px; }
  .avatar-wave .b3 { height: 9px;  }
  .avatar-wave .b4 { height: 17px; }
  .avatar-wave .b5 { height: 13px; }
  .name { font-size: 1.3rem; }

  .block-title { font-size: 0.98rem; }
  .timeline-title { font-size: 0.88rem; }
  .timeline-list li,
  .paragraph { font-size: 0.82rem; }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
}

@media screen and (max-width: 420px) {
  .sidebar,
  .content { padding: 1.3rem 1rem; }

  .avatar { width: 70px; height: 70px; }
  .avatar-wave .bar { width: 3px; }
  .avatar-wave .b1 { height: 9px;  }
  .avatar-wave .b2 { height: 14px; }
  .avatar-wave .b3 { height: 8px;  }
  .avatar-wave .b4 { height: 14px; }
  .avatar-wave .b5 { height: 11px; }
  .name { font-size: 1.18rem; }
}

@media print {
  body { background: #fff; padding: 0; }
  .float-actions { display: none; }
  .resume-body { gap: 1rem; }
  .sidebar,
  .content { box-shadow: none; border: 1px solid #ddd; }
  .mini-btn { display: none; }
}