/* Material Design 2.0 主题变量 */
:root {
  --mdc-theme-primary: #6200ee;
  --mdc-theme-primary-variant: #3700b3;
  --mdc-theme-secondary: #03dac6;
  --mdc-theme-background: #ffffff;
  --mdc-theme-surface: #ffffff;
  --mdc-theme-error: #b00020;
  --mdc-theme-on-primary: #ffffff;
  --mdc-theme-on-secondary: #000000;
  --mdc-theme-on-surface: #000000;
  --mdc-theme-on-error: #ffffff;
  
  /* 自定义变量 */
  --shadow-1: 0 2px 1px -1px rgba(0,0,0,0.2), 0 1px 1px 0 rgba(0,0,0,0.14), 0 1px 3px 0 rgba(0,0,0,0.12);
  --shadow-2: 0 3px 1px -2px rgba(0,0,0,0.2), 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12);
  --shadow-4: 0 2px 4px -1px rgba(0,0,0,0.2), 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12);
  --shadow-8: 0 5px 5px -3px rgba(0,0,0,0.2), 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12);
  
  --border-radius: 8px;
  --spacing-unit: 8px;
}

/* 深色主题 */
[data-theme="dark"] {
  --mdc-theme-primary: #bb86fc;
  --mdc-theme-primary-variant: #3700b3;
  --mdc-theme-secondary: #03dac6;
  --mdc-theme-background: #121212;
  --mdc-theme-surface: #1e1e1e;
  --mdc-theme-error: #cf6679;
  --mdc-theme-on-primary: #000000;
  --mdc-theme-on-secondary: #000000;
  --mdc-theme-on-surface: #ffffff;
  --mdc-theme-on-error: #000000;
}

/* 重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--mdc-theme-background);
  color: var(--mdc-theme-on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Material App Bar */
.app-bar {
  background-color: var(--mdc-theme-primary);
  color: var(--mdc-theme-on-primary);
  box-shadow: var(--shadow-4);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.app-bar__row {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.app-bar__menu-icon {
  margin-right: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.app-bar__menu-icon:hover {
  background-color: rgba(255,255,255,0.1);
}

.app-bar__title {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.0125em;
  flex: 1;
}

.app-bar__actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.icon-button:hover {
  background-color: rgba(255,255,255,0.1);
}

/* 主内容区域 */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 16px 32px;
}

/* Material Card */
.mdc-card {
  background-color: var(--mdc-theme-surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s, background-color 0.3s ease;
}

.mdc-card:hover {
  box-shadow: var(--shadow-8);
}

/* 个人资料部分 */
.profile-section {
  margin-bottom: 48px;
}

.profile-card {
  padding: 32px;
}

.profile-card__content {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-4);
  border: 4px solid var(--mdc-theme-primary);
}

.profile-info {
  flex: 1;
  min-width: 280px;
}

.profile-name {
  font-size: 2rem;
  font-weight: 500;
  color: var(--mdc-theme-on-surface);
  margin-bottom: 8px;
}

.profile-title {
  font-size: 1.125rem;
  color: var(--mdc-theme-primary);
  font-weight: 500;
  margin-bottom: 16px;
}

.profile-bio {
  font-size: 1rem;
  color: var(--mdc-theme-on-surface);
  opacity: 0.87;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 600px;
}

.profile-links {
  display: flex;
  gap: 16px;
}

.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--mdc-theme-primary);
  color: var(--mdc-theme-on-primary);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s ease;
  box-shadow: var(--shadow-2);
}

.profile-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-4);
  background-color: var(--mdc-theme-primary-variant);
}

.icon-svg {
  width: 24px;
  height: 24px;
}

/* 章节标题 */
.section-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--mdc-theme-on-surface);
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mdc-theme-primary);
  display: inline-block;
}

/* 技能部分 */
.skills-section {
  margin-bottom: 48px;
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  height: 32px;
  border-radius: 16px;
  background-color: var(--mdc-theme-surface);
  box-shadow: var(--shadow-1);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mdc-theme-on-surface);
  transition: background-color 0.3s ease, box-shadow 0.2s;
}

.skill-chip:hover {
  box-shadow: var(--shadow-2);
}

.skill-chip__text {
  margin-right: 8px;
}

.skill-chip__level {
  font-size: 0.75rem;
  color: var(--mdc-theme-primary);
  font-weight: 600;
}

/* 项目部分 */
.projects-section {
  margin-bottom: 48px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background-color: var(--mdc-theme-surface);
}

.project-card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--mdc-theme-primary) 0%, var(--mdc-theme-primary-variant) 100%);
}

.project-card__content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card__title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--mdc-theme-on-surface);
  margin-bottom: 8px;
}

.project-card__description {
  font-size: 0.875rem;
  color: var(--mdc-theme-on-surface);
  opacity: 0.7;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.project-tag {
  padding: 4px 12px;
  border-radius: 16px;
  background-color: var(--mdc-theme-primary);
  color: var(--mdc-theme-on-primary);
  font-size: 0.75rem;
  font-weight: 500;
}

.project-card__actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.12);
}

[data-theme="dark"] .project-card__actions {
  border-top-color: rgba(255,255,255,0.12);
}

/* Material Button */
.mdc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 36px;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.0892857em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.mdc-button--raised {
  background-color: var(--mdc-theme-primary);
  color: var(--mdc-theme-on-primary);
  box-shadow: var(--shadow-2);
}

.mdc-button--raised:hover {
  box-shadow: var(--shadow-4);
  background-color: var(--mdc-theme-primary-variant);
}

.mdc-button--outlined {
  background-color: transparent;
  color: var(--mdc-theme-primary);
  border: 1px solid rgba(0,0,0,0.12);
}

[data-theme="dark"] .mdc-button--outlined {
  border-color: rgba(255,255,255,0.12);
}

.mdc-button--outlined:hover {
  background-color: rgba(98, 0, 238, 0.04);
}

.mdc-button__icon {
  margin-right: 8px;
  font-size: 18px;
}

/* 页脚 */
.footer {
  background-color: var(--mdc-theme-surface);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-2);
  margin-top: 48px;
  transition: background-color 0.3s ease;
}

.footer p {
  color: var(--mdc-theme-on-surface);
  opacity: 0.6;
  font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .app-bar__row {
    height: 56px;
  }
  
  .main-content {
    padding-top: 80px;
  }
  
  .profile-card__content {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
  
  .profile-avatar img {
    width: 120px;
    height: 120px;
  }
  
  .profile-name {
    font-size: 1.5rem;
  }
  
  .profile-links {
    justify-content: center;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* 加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-card,
.skill-chip,
.project-card {
  animation: fadeIn 0.5s ease forwards;
}

.skill-chip:nth-child(1) { animation-delay: 0.1s; }
.skill-chip:nth-child(2) { animation-delay: 0.15s; }
.skill-chip:nth-child(3) { animation-delay: 0.2s; }
.skill-chip:nth-child(4) { animation-delay: 0.25s; }
.skill-chip:nth-child(5) { animation-delay: 0.3s; }
.skill-chip:nth-child(6) { animation-delay: 0.35s; }

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
