:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --background: #f5f5f5;
  --card-bg: #ffffff;
  --text-primary: #333;
  --text-secondary: #666;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

nav {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

nav .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

nav li {
  white-space: nowrap;
}

nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: var(--transition);
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #3498db;
  transition: width 0.3s ease;
}

nav a:hover {
  color: white;
  text-decoration: none;
}

nav a:hover::after {
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  color: var(--secondary-color);
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  border-left: 5px solid var(--primary-color);
  padding-left: 1.2rem;
  line-height: 1.3;
}

h2 {
  color: var(--secondary-color);
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.intro {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
  line-height: 1.9;
  color: var(--text-secondary);
  border-left: 4px solid var(--primary-color);
}

.section {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.section h2 {
  border-bottom: 3px solid var(--border-color);
  padding-bottom: 0.8rem;
  margin-bottom: 2rem;
  position: relative;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
}

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

.card {
  background: #f8f9fa;
  padding: 1.8rem;
  border-radius: 10px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

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

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
  font-weight: 600;
  line-height: 1.4;
}

.card .meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0.6rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card .desc {
  color: var(--text-secondary);
  margin: 1rem 0;
  line-height: 1.7;
  font-size: 0.95rem;
}

.card a {
  display: inline-block;
  margin-top: 1rem;
  color: var(--primary-color);
  font-weight: 600;
  transition: var(--transition);
}

.card a:hover {
  color: var(--accent-color);
  transform: translateX(5px);
}

.detail-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 3rem;
  box-shadow: var(--shadow-md);
}

.detail-card .meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.tag {
  background: linear-gradient(135deg, #ecf0f1 0%, #d5dbdb 100%);
  color: var(--secondary-color);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
}

.tag:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.8rem;
  margin-top: 1.5rem;
}

.related-item {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.related-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.related-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.8rem;
  color: var(--secondary-color);
  font-weight: 600;
}

.related-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.related-item a {
  color: var(--primary-color);
  font-weight: 600;
}

@media (max-width: 768px) {
  nav .container {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.5rem;
    overflow-x: visible;
  }

  nav li {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
  }

  nav a {
    font-size: 0.85rem;
    padding: 0.4rem 0.2rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 {
    font-size: 1.6rem;
    padding-left: 1rem;
    border-left-width: 4px;
  }

  h2 {
    font-size: 1.3rem;
  }

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

  .intro,
  .section {
    padding: 1.5rem;
  }

  .detail-card {
    padding: 1.5rem;
  }

  .detail-card .meta {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
  }

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

@media (max-width: 480px) {
  nav .logo {
    font-size: 1.2rem;
  }

  nav a {
    font-size: 0.75rem;
    padding: 0.3rem 0.1rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .container {
    padding: 1rem 0.8rem;
  }
}
