:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --text-color: #333;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --border-radius: 8px;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
}

body.ui-style-3 {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
}

.container {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

nav {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

nav a {
  position: relative;
  transition: all 0.3s ease;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

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

.card, .item-list, .rank-item, .latest-item {
  transition: all 0.3s ease;
}

.card:hover, .item-list:hover, .rank-item:hover, .latest-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

h1 {
  position: relative;
  padding-bottom: 1rem;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
  }

  .card, .item-list, .rank-item, .latest-item {
    padding: 1rem;
  }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(52, 152, 219, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.back-to-top.show {
  opacity: 1;
}

.back-to-top:hover {
  background: #2980b9;
  transform: translateY(-5px);
}

.card-grid {
  animation: fadeInUp 0.6s ease-out;
}

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

.tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: #ecf0f1;
  color: #34495e;
  border-radius: 15px;
  font-size: 0.85rem;
  margin: 0.2rem;
  transition: all 0.2s ease;
}

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

@media print {
  nav, .back-to-top, .related {
    display: none;
  }

  body {
    background: white;
  }

  .card, .item-list {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
