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

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #ec4899;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #f9fafb;
  --bg-white: #ffffff;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header */
.header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.logo p {
  font-size: 0.875rem;
  color: var(--text-light);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 5rem 0;
  text-align: center;
  animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero .highlight {
  color: #fbbf24;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: white;
  color: var(--primary-color);
}

.btn-primary:hover {
  background: #f3f4f6;
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: var(--primary-color);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Section Title */
.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
  color: var(--text-color);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* About Section */
.about {
  padding: 5rem 0;
  background: var(--bg-white);
}

.about-content {
  max-width: 900px;
  margin: 0 auto 3rem;
}

.about-summary h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-align: center;
}

.about-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 2rem;
}

.about-highlights {
  background: var(--bg-color);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 1rem;
  color: var(--text-color);
}

.highlight-icon {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2rem;
}

.subsection-title {
  font-size: 1.25rem;
  color: var(--text-color);
  margin: 2rem 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

/* Experience */
.experience-section {
  max-width: 900px;
  margin: 0 auto 3rem;
}

.experience-timeline {
  position: relative;
  padding-left: 2rem;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary-color);
}

.experience-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.experience-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--primary-color);
}

.experience-period {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.experience-role h4 {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.experience-company {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.experience-desc {
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Skills Section */
.skills-section {
  max-width: 1000px;
  margin: 0 auto;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-category {
  background: var(--bg-color);
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.skill-category h4 {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.4rem 0.8rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  font-size: 0.85rem;
  color: var(--text-color);
  transition: all 0.3s;
}

.skill-tag:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Tech Stack Details */
.tech-stack-details {
  max-width: 1000px;
  margin: 3rem auto 0;
}

.tech-stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.tech-stack-item {
  background: var(--bg-color);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-color);
}

.tech-stack-item h4 {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.tech-tags {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tech-tag {
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-color);
  transition: all 0.3s;
}

.tech-tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Projects Section */
.projects {
  padding: 5rem 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-white);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, opacity 0.6s;
  opacity: 0;
  transform: translateY(30px);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.project-language,
.project-version {
  font-size: 0.875rem;
  font-weight: 500;
}

.project-card-body {
  padding: 1.5rem;
}

.project-card-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.project-tagline {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.project-description {
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  color: white;
  font-weight: 500;
}

.project-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Contact Section */
.contact {
  padding: 5rem 0;
  background: var(--bg-white);
}

.contact-info {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.contact-icon {
  font-size: 1.5rem;
}

.contact-item a {
  color: var(--primary-color);
}

.contact-item a:hover {
  text-decoration: underline;
}

.wechat-qr {
  text-align: center;
}

.wechat-qr p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

.wechat-qr img {
  max-width: 300px;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

/* Footer */
.footer {
  background: var(--text-color);
  color: white;
  padding: 2rem 0;
  text-align: center;
}

/* Project Detail Page */
.project-detail {
  padding: 3rem 0;
}

.back-link {
  display: inline-block;
  color: var(--primary-color);
  margin-bottom: 2rem;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.project-header {
  margin-bottom: 3rem;
}

.project-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.project-header .project-tagline {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.project-meta {
  display: flex;
  gap: 1rem;
}

.project-meta span {
  padding: 0.5rem 1rem;
  background: var(--bg-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.project-content {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.project-section {
  margin-bottom: 3rem;
}

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

.project-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.feature-list {
  list-style: none;
}

.feature-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 1rem;
}

.feature-list li:last-child {
  border-bottom: none;
}

/* Tech Stack */
.tech-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.tech-item {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-color);
  border-radius: 0.5rem;
}

.tech-name {
  font-weight: 500;
  color: var(--text-color);
}

.tech-desc {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Event Types */
.event-types {
  display: grid;
  gap: 1rem;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-color);
  border-radius: 0.5rem;
}

.event-icon {
  font-size: 2rem;
}

.event-info h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.event-info p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.event-duration {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 1rem;
  font-size: 0.75rem;
}

/* Annotation Cards */
.annotation-card {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 0.5rem;
}

.annotation-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-family: monospace;
}

.annotation-card > p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.params-table th,
.params-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.params-table th {
  background: var(--bg-color);
  font-weight: 500;
  color: var(--text-color);
}

.params-table td code {
  background: var(--bg-color);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.85rem;
}

/* Database List */
.database-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.db-tag {
  padding: 0.5rem 1rem;
  background: var(--bg-color);
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

/* Changelog */
.changelog {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.changelog-item h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.changelog-item ul {
  list-style: none;
  padding-left: 0;
}

.changelog-item li {
  padding: 0.25rem 0;
  color: var(--text-light);
}

/* 404 Page */
.not-found {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.not-found h1 {
  font-size: 6rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.not-found p {
  font-size: 1.5rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    gap: 1rem;
  }

  .hero h2 {
    font-size: 1.75rem;
  }

  .hero-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .contact-info {
    flex-direction: column;
    gap: 1rem;
  }

  .project-header h1 {
    font-size: 1.75rem;
  }

  .project-meta {
    flex-wrap: wrap;
  }
}
