* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo a {
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.user-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.welcome {
  color: white;
}

.btn-link {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background 0.3s;
}

.btn-link:hover {
  background: rgba(255,255,255,0.2);
}

.btn-login, .btn-register {
  padding: 8px 20px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-login {
  background: white;
  color: #667eea;
}

.btn-register {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-login:hover {
  background: #f0f0f0;
}

.btn-register:hover {
  background: white;
  color: #667eea;
}

.main-nav {
  background: rgba(0,0,0,0.1);
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  padding: 12px 0;
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
}

.main-nav a:hover {
  opacity: 0.8;
}

.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.hero-section h1 {
  font-size: 36px;
  margin-bottom: 30px;
}

.search-bar-large {
  max-width: 600px;
  margin: 0 auto 20px;
}

.search-bar-large form {
  display: flex;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.search-bar-large input {
  flex: 1;
  padding: 15px 25px;
  border: none;
  font-size: 16px;
  outline: none;
}

.search-bar-large button {
  padding: 15px 40px;
  background: #667eea;
  color: white;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.search-bar-large button:hover {
  background: #5568d3;
}

.hot-keywords {
  color: white;
}

.hot-keywords a {
  color: white;
  text-decoration: none;
  margin: 0 10px;
  padding: 5px 15px;
  background: rgba(255,255,255,0.2);
  border-radius: 15px;
  display: inline-block;
  margin-top: 5px;
  transition: background 0.3s;
}

.hot-keywords a:hover {
  background: rgba(255,255,255,0.3);
}

.main-container {
  padding: 40px 0;
}

.category-grid h2 {
  font-size: 28px;
  margin-bottom: 30px;
  color: #333;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.category-card {
  background: white;
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.category-card a {
  text-decoration: none;
  color: #333;
}

.category-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.category-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #667eea;
}

.category-card p {
  font-size: 14px;
  color: #666;
}

.stats-section {
  margin: 50px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.stat-item {
  background: white;
  padding: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-icon {
  font-size: 48px;
}

.stat-info h3 {
  font-size: 32px;
  color: #667eea;
  margin-bottom: 5px;
}

.stat-info p {
  color: #666;
  font-size: 14px;
}

.ranking-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ranking-section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #333;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 8px;
  background: #f9f9f9;
  transition: background 0.3s;
}

.ranking-item:hover {
  background: #f0f0f0;
}

.rank-number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: bold;
  font-size: 18px;
  background: #e0e0e0;
  color: white;
  flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.rank-2 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.rank-3 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.resource-info {
  flex: 1;
}

.resource-info h4 {
  margin-bottom: 8px;
}

.resource-info h4 a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

.resource-info h4 a:hover {
  color: #667eea;
}

.resource-meta {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: #999;
}

.resource-meta span {
  display: inline-flex;
  align-items: center;
}

.breadcrumb {
  padding: 15px 0;
  color: #666;
  font-size: 14px;
}

.breadcrumb a {
  color: #667eea;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.category-header {
  background: white;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.category-header h1 {
  font-size: 32px;
  color: #333;
  margin-bottom: 10px;
}

.sub-categories {
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sub-categories h3 {
  margin-bottom: 15px;
  color: #333;
}

.sub-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sub-category-item {
  padding: 8px 20px;
  background: #f0f0f0;
  border-radius: 20px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s;
}

.sub-category-item:hover {
  background: #667eea;
  color: white;
}

.resource-list {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.resource-item {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.3s;
}

.resource-item:last-child {
  border-bottom: none;
}

.resource-item:hover {
  background: #f9f9f9;
}

.resource-content h3 {
  margin-bottom: 10px;
}

.resource-content h3 a {
  color: #333;
  text-decoration: none;
  font-size: 18px;
  transition: color 0.3s;
}

.resource-content h3 a:hover {
  color: #667eea;
}

.resource-desc {
  color: #666;
  margin-bottom: 10px;
  line-height: 1.6;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.page-link {
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
  color: #333;
  background: #f0f0f0;
  transition: all 0.3s;
}

.page-link:hover {
  background: #667eea;
  color: white;
}

.page-link.active {
  background: #667eea;
  color: white;
}

.no-data {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.no-data p {
  font-size: 18px;
  margin-bottom: 20px;
}

.auth-container {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.auth-box {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 450px;
}

.auth-box h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.error-message {
  background: #fee;
  color: #c33;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-actions {
  margin-top: 25px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 30px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  color: #666;
}

.form-footer a {
  color: #667eea;
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

.agreement {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #999;
}

.agreement a {
  color: #667eea;
  text-decoration: none;
}

.resource-detail {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
}

.resource-main {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.resource-main h1 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #333;
}

.resource-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 25px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

.resource-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #666;
}

.resource-description,
.resource-tags {
  margin-bottom: 25px;
}

.resource-description h3,
.resource-tags h3 {
  margin-bottom: 15px;
  color: #333;
}

.resource-description p {
  line-height: 1.8;
  color: #666;
}

.tag {
  display: inline-block;
  padding: 5px 15px;
  background: #f0f0f0;
  border-radius: 15px;
  text-decoration: none;
  color: #333;
  margin-right: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  transition: all 0.3s;
}

.tag:hover {
  background: #667eea;
  color: white;
}

.resource-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.btn-download,
.btn-collect {
  padding: 12px 30px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  font-size: 16px;
}

.btn-download {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-collect {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-collect.collected {
  background: #667eea;
  color: white;
}

.btn-download:hover,
.btn-collect:hover {
  opacity: 0.9;
}

.resource-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.related-resources {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.related-resources h3 {
  margin-bottom: 15px;
  color: #333;
}

.related-resources ul {
  list-style: none;
}

.related-resources li {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.related-resources li:last-child {
  border-bottom: none;
}

.related-resources a {
  text-decoration: none;
  color: #333;
  display: block;
}

.related-resources h4 {
  font-size: 14px;
  margin-bottom: 5px;
  transition: color 0.3s;
}

.related-resources a:hover h4 {
  color: #667eea;
}

.related-resources .views {
  font-size: 12px;
  color: #999;
}

.upload-container {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  max-width: 800px;
  margin: 0 auto;
}

.upload-container h2 {
  margin-bottom: 30px;
  color: #333;
}

.upload-form .form-group {
  margin-bottom: 20px;
}

.upload-form label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.search-header {
  background: white;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-header h1 {
  font-size: 28px;
  margin-bottom: 10px;
  color: #333;
}

.search-header p {
  color: #666;
}

.user-header {
  background: white;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-header h1 {
  font-size: 28px;
  color: #333;
  margin-bottom: 5px;
}

.user-header p {
  color: #666;
}

.status {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.status-approved {
  background: #d4edda;
  color: #155724;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-rejected {
  background: #f8d7da;
  color: #721c24;
}

.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-page h1 {
  font-size: 120px;
  color: #667eea;
  margin-bottom: 20px;
}

.error-page h2 {
  font-size: 32px;
  margin-bottom: 15px;
  color: #333;
}

.error-page p {
  font-size: 18px;
  color: #666;
  margin-bottom: 30px;
}

.footer {
  background: #2c3e50;
  color: white;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h3 {
  margin-bottom: 15px;
  color: white;
}

.footer-section p,
.footer-section a {
  color: #bbb;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}

.footer-section a:hover {
  color: white;
}

.footer-section ul {
  list-style: none;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
  color: #999;
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 15px;
  }

  .main-nav ul {
    flex-wrap: wrap;
    gap: 15px;
  }

  .categories {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .resource-detail {
    grid-template-columns: 1fr;
  }

  .resource-sidebar {
    order: -1;
  }
}
