* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.header {
  text-align: center;
  color: white;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.search-box {
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
}

.search-input-wrapper {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 15px 20px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.search-btn:active {
  transform: translateY(0);
}

.search-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.results-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.results-header {
  padding: 20px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
}

.results-list {
  padding: 20px;
}

.book-item {
  padding: 20px;
  margin-bottom: 15px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.book-item:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.book-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.book-cover {
  flex-shrink: 0;
  width: 100px;
  height: 120px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.book-cover:hover img {
  transform: scale(1.05);
}

.book-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.book-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resources-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.resource-item {
  padding: 12px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 4px;
}

.book-url {
  color: #667eea;
  text-decoration: none;
  word-break: break-all;
  font-size: 0.95rem;
}

.book-url:hover {
  text-decoration: underline;
}

.book-password {
  color: #666;
  font-size: 0.9rem;
}

.book-password span {
  color: #764ba2;
  font-weight: 600;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 1.1rem;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: #667eea;
  font-size: 1.1rem;
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

  0%,
  20% {
    content: '.';
  }

  40% {
    content: '..';
  }

  60%,
  100% {
    content: '...';
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .header p {
    font-size: 1rem;
  }

  .search-box {
    padding: 20px;
  }

  .search-input-wrapper {
    flex-direction: column;
  }

  .search-btn {
    width: 100%;
  }

  .results-header {
    padding: 15px 20px;
    font-size: 1.1rem;
  }

  .book-item {
    padding: 15px;
  }

  .book-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .book-cover {
    width: 100px;
    height: 140px;
  }

  .book-title {
    font-size: 1.1rem;
  }

  .resource-item {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5rem;
  }

  .search-input {
    font-size: 14px;
    padding: 12px 15px;
  }

  .search-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .book-title {
    font-size: 1rem;
  }

  .book-url {
    font-size: 0.9rem;
  }

  .book-password {
    font-size: 0.85rem;
  }
}