/* ===== 个人主页 · 左右布局（参考 eric_webpage） ===== */
body.page-home {
  /* 首屏顶距 = 侧栏吸附位置，避免贴到导航栏或上漂后再吸住 */
  --home-content-offset: 6.25rem;
  min-height: 100vh;
  padding-top: var(--home-content-offset);
  box-sizing: border-box;
  background: linear-gradient(
    135deg,
    var(--bg-light) 0%,
    var(--primary-soft) 100%
  );
}

.home-container {
  max-width: 1280px;
  margin: 0 auto 2.5rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
  box-sizing: border-box;
}

.profile-sidebar {
  position: sticky;
  top: var(--home-content-offset);
  height: fit-content;
  z-index: 1;
}

.profile-card-modern {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.avatar-wrapper {
  width: 150px;
  height: 150px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--primary-soft);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-md);
}

.avatar-modern {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--primary-deep);
  margin-bottom: 0.25rem;
}

.profile-title {
  text-align: center;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.profile-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.profile-location i {
  color: var(--primary);
}

.profile-contact {
  background: var(--primary-soft);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.4rem 0;
}

.contact-item i {
  width: 18px;
  color: var(--primary);
  text-align: center;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.skill-tag {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tag-text);
  background: var(--tag-bg);
  border-radius: var(--radius-full);
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
}

.profile-link-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.copyright-info {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.copyright-small {
  margin-top: 0.25rem;
  font-size: 0.72rem;
}

.content-main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 右侧首屏欢迎区：左对齐 + 色带 + 打字机引言 */
.home-hero {
  min-height: calc(100dvh - var(--home-content-offset, 6.25rem));
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: clamp(3rem, 12vh, 7rem) 0 4rem;
  box-sizing: border-box;
}

.home-hero-inner {
  --hero-stripe: 4px;
  --hero-indent: 1.5rem;
  --hero-shift: 2.35rem;
  /* 标题与诗色条左缘对齐 */
  --hero-text-start: var(--hero-shift);
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
}

.home-hero-copy {
  margin-left: var(--hero-text-start);
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: calc(100% - var(--hero-text-start));
  box-sizing: border-box;
}

.home-hero-line {
  margin: 0;
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.home-hero-line--lead,
.home-hero-line--sub {
  opacity: 0;
  transform: translateY(1.35rem);
  animation: home-title-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.home-hero-line--lead {
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  font-weight: 700;
  color: var(--text-primary);
  animation-delay: 0.1s;
}

.home-hero-line--sub {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 500;
  color: var(--text-secondary);
  animation-delay: 0.28s;
}

@keyframes home-title-rise {
  from {
    opacity: 0;
    transform: translateY(1.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-hero-hi {
  color: var(--primary);
  margin-right: 0.12em;
}

.home-hero-motto {
  margin: 0.35rem 0 0;
  min-height: 1.65em;
  font-size: clamp(0.95rem, 1.55vw, 1.08rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.home-typewriter-text {
  white-space: pre-wrap;
}

.home-typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.08em;
  background: var(--primary);
  animation: home-cursor-blink 1s step-end infinite;
}

@keyframes home-cursor-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.home-hero-poem {
  position: relative;
  margin: clamp(2rem, 5vh, 3rem) 0 0 var(--hero-text-start);
  padding: 0 0 0 var(--hero-indent);
  border: none;
  width: 100%;
  max-width: calc(100% - var(--hero-text-start));
  box-sizing: border-box;
}

/* 诗下方 · 首屏内靠上，水平居中 */
.home-hero-scroll {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: clamp(0.5rem, 1.2vh, 0.85rem);
  margin-bottom: clamp(0.75rem, 2vh, 1.25rem);
  padding: 0;
}

/* 左侧色条自上而下展开 */
.home-hero-poem::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--hero-stripe);
  height: 100%;
  background: var(--primary-light);
  transform: scaleY(0);
  transform-origin: top center;
  animation: home-poem-stripe 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 1.2s;
}

.home-hero-poem p {
  margin: 0 0 0.45rem;
  font-size: clamp(0.92rem, 1.45vw, 1.05rem);
  font-weight: 300;
  line-height: 1.85;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(0.6rem);
  animation: home-poem-line-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.home-hero-poem p:nth-child(1) {
  animation-delay: 1.28s;
}

.home-hero-poem p:nth-child(2) {
  animation-delay: 1.44s;
}

.home-hero-poem p:nth-child(3) {
  animation-delay: 1.6s;
}

.home-hero-poem p:nth-child(4) {
  animation-delay: 1.76s;
}

.home-hero-poem p:nth-child(n + 5) {
  animation-delay: 1.92s;
}

.home-hero-poem p:last-child {
  margin-bottom: 0;
}

@keyframes home-poem-stripe {
  to {
    transform: scaleY(1);
  }
}

@keyframes home-poem-line-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] .home-hero-poem::before {
  background: var(--primary);
}

.home-scroll-hint {
  display: block;
  margin: 0;
  padding: 0.5rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.home-scroll-hint:hover {
  opacity: 0.85;
}

.home-scroll-arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06rem;
  line-height: 1;
}

.home-scroll-arrows i {
  font-size: 1.05rem;
  color: var(--primary);
  opacity: 0.18;
  will-change: transform, opacity;
  animation: home-wave-flow 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.home-scroll-arrows i:nth-child(1) {
  animation-delay: 0s;
}

.home-scroll-arrows i:nth-child(2) {
  animation-delay: 0.36s;
}

.home-scroll-arrows i:nth-child(3) {
  animation-delay: 0.72s;
}

/* 海浪式递推：亮点与位移自上而下传递 */
@keyframes home-wave-flow {
  0% {
    opacity: 0.12;
    transform: translateY(-6px) scale(0.88);
  }
  22% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  44% {
    opacity: 0.35;
    transform: translateY(5px) scale(0.96);
  }
  66% {
    opacity: 0.12;
    transform: translateY(9px) scale(0.9);
  }
  100% {
    opacity: 0.12;
    transform: translateY(-6px) scale(0.88);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-line--lead,
  .home-hero-line--sub {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .home-hero-poem::before {
    transform: scaleY(1);
    animation: none;
  }

  .home-hero-poem p {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .home-scroll-arrows i {
    animation: none;
    opacity: 0.45;
    transform: none;
  }

  .home-typewriter-cursor {
    animation: none;
    opacity: 1;
  }
}

.home-content-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

#home-content {
  scroll-margin-top: var(--home-content-offset, 6.25rem);
}

.content-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.content-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--primary-soft);
}

.card-title i {
  color: var(--primary);
}

.about-text {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.placeholder-hint {
  font-size: 0.85rem;
  color: var(--text-soft);
  font-style: italic;
  line-height: 1.6;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 1rem;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.timeline-meta {
  font-size: 0.8rem;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.awards-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.award-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem;
  background: var(--item-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.award-item > i {
  color: var(--primary);
  margin-top: 0.2rem;
}

.award-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.award-item p {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--item-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.project-item:hover {
  border-color: var(--border-hover);
  background: var(--primary-soft);
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  line-height: 1.5;
}

[data-theme="dark"] body.page-home {
  background: linear-gradient(
    135deg,
    var(--bg-dark) 0%,
    var(--primary-soft) 100%
  );
}

[data-theme="dark"] .profile-card-modern,
[data-theme="dark"] .content-card {
  background: rgba(26, 31, 48, 0.65);
}

[data-theme="dark"] .profile-name {
  color: var(--primary-light);
}

@media (max-width: 900px) {
  body.page-home {
    --home-content-offset: 5.5rem;
  }

  .home-container {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    position: static;
    top: auto;
  }

  .profile-card-modern {
    max-width: 420px;
    margin: 0 auto;
  }

  .home-hero {
    min-height: auto;
    padding: 2.5rem 1rem 2rem;
  }

  .home-hero-inner {
    --hero-shift: 1.35rem;
    min-height: auto;
  }

  .home-hero-line--lead {
    font-size: 1.65rem;
  }

  .home-hero-poem p {
    font-size: 0.9rem;
  }

  .home-hero-scroll {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
}

@media (max-width: 600px) {
  .home-container {
    padding: 0 1rem 2rem;
  }

  .content-card {
    padding: 1.25rem 1.35rem;
  }
}
