.piece-type-archive {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.piece-type-archive-header {
  margin-bottom: 32px;
}

.piece-type-archive-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #333;
}

.piece-type-archive-subtitle {
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.95;
  font-weight: 500;
}

.piece-type-content {
  margin-bottom: 40px;
}

.era-block {
  margin-bottom: 8px;
}

.era-title {
  margin: 0 0 24px;
  padding-bottom: 12px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #334155;
  border-bottom: 3px solid #9475E1;
}

.composer-block {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.composer-block:hover {
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
  transform: translateY(-2px);
}

.composer-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #333;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.composer-title a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s;
}

.composer-title a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.composer-count {
  background: #f8f9fa;
  color: #666;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.piece-item .piece-scores-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 6px;
}

.piece-item .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.piece-item .badge .k {
  opacity: 0.95;
}

.piece-item .badge .v {
  font-variant-numeric: tabular-nums;
}

.piece-item .b-total {
  background: #efe8f8;
  color: #6e5a9e;
  border-color: rgba(110, 90, 158, 0.22);
}

.piece-item .b-tech {
  background: #f5e6e2;
  color: #a05544;
  border-color: rgba(160, 85, 68, 0.22);
}

.piece-item .b-exp {
  background: #e6eef6;
  color: #4f6f91;
  border-color: rgba(79, 111, 145, 0.22);
}

.piece-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.piece-item {
  margin: 0;
}

.piece-item a {
  display: block;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.piece-item-title {
  display: block;
}

.piece-item-duration {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #666;
}

.piece-item a::before {
  content: none;
}

.piece-item a:hover {
  background: #e3f2fd;
  border-color: #1976d2;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
}

.composer-piece-subtype-block {
  margin-bottom: 24px;
}

.composer-piece-subtype-title {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  margin: 0 0 12px 0;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  border-left: 4px solid #1976d2;
  border-radius: 4px;
}

.composer-piece-subtype-count {
  font-size: 0.85rem;
  color: #777;
  font-weight: 500;
  margin-left: 8px;
}

.composer-piece-direct-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 18px;
}

.composer-piece-direct-divider-line {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0), rgba(102, 126, 234, 0.42), rgba(102, 126, 234, 0));
}

.piece-sublist {
  margin-bottom: 16px;
}

.piece-type-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  color: #666;
  font-size: 1rem;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.piece-type-end {
  text-align: center;
  padding: 32px;
  color: #999;
  font-size: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
  margin-top: 24px;
}

.piece-type-empty {
  text-align: center;
  padding: 80px 20px;
}

.piece-type-empty p {
  font-size: 1.1rem;
  color: #999;
}

@media (max-width: 768px) {
  .piece-type-archive {
    padding: 24px 12px;
  }

  .piece-type-archive-header {
    margin-bottom: 24px;
  }

  .piece-type-archive-title {
    font-size: 1.6rem;
  }

  .piece-type-archive-subtitle {
    font-size: 1rem;
  }

  .era-block {
    margin-bottom: 12px;
  }

  .era-title {
    margin-bottom: 20px;
    font-size: 1.6rem;
    padding-bottom: 12px;
    border-bottom-width: 3px;
  }

  .composer-block {
    padding: 16px;
    margin-bottom: 16px;
  }

  .composer-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }

  .piece-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .piece-item a {
    font-size: 13px;
    padding: 10px 14px;
  }

  .piece-item a::before {
    font-size: 14px;
    left: 8px;
  }
}

.pia-infinite-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 10000;
}

.pia-infinite-overlay.is-visible {
  display: flex;
}

.pia-infinite-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.pia-infinite-overlay__spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(25, 118, 210, 0.2);
  border-top-color: #1976d2;
  animation: piaInfiniteSpin 0.8s linear infinite;
}

.pia-infinite-overlay__text {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

@keyframes piaInfiniteSpin {
  to {
    transform: rotate(360deg);
  }
}

.piece-type-endline {
  display: none;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0));
  margin: 24px 0 8px;
}

.piece-type-endline.is-visible {
  display: block;
}
