/* 基础与变量 */
:root {
  --bg-page: #f0f0f0;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --border-radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --sidebar-width: 280px;
  --max-width: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.page-wrapper {
  min-height: 100vh;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  min-height: 80vh;
}

/* 左侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.profile {
  text-align: center;
  margin-bottom: 1.5rem;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem;
}

.name {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.nav-links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
  font-weight: 500;
}

.nav-item svg {
  flex-shrink: 0;
}

/* 右侧主内容 */
.main-content {
  flex: 1;
  padding: 2.5rem 2rem;
  min-width: 0;
}

.section {
  margin-bottom: 2.5rem;
}

.section:last-child {
  margin-bottom: 0;
}

.section-title {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* 介绍区域 */
.intro-section {
  max-width: 100%;
}

.intro-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-primary);
}

.intro-list li {
  margin-bottom: 0.75rem;
}

.intro-list li:last-child {
  margin-bottom: 0;
}

/* 作品集卡片 */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.portfolio-card {
  background: #fafafa;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}

.portfolio-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.portfolio-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.portfolio-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.portfolio-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.portfolio-meta .star {
  color: #f5a623;
}

/* 分享卡片 */
.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.share-card {
  text-decoration: none;
  color: inherit;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafafa;
  transition: box-shadow 0.2s, transform 0.2s;
}

.share-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.share-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eee;
}

.share-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.share-title {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* 留言区 */
.contact-section .contact-text {
  margin: 0;
  color: var(--text-secondary);
}

/* 响应式 */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
  }

  .profile {
    margin-bottom: 0;
    width: 100%;
  }

  .social-links {
    margin-bottom: 0;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .portfolio-grid,
  .share-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 600px) {
  .page-wrapper {
    padding: 1rem 0.5rem;
  }

  .main-content {
    padding: 1.5rem 1rem;
  }

  .sidebar {
    padding: 1.25rem 1rem;
  }

  .avatar {
    width: 100px;
    height: 100px;
  }

  .name {
    font-size: 1.25rem;
  }
}
