@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3a86ff;
  --secondary: #ff006e;
  --accent: #fb5607;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #5cdb95;
  --text-light: #f8f9fa;
  --text-dark: #333;
  --bg-blur: rgba(255, 255, 255, 0.15);
  --card-bg: rgba(255, 255, 255, 0.25);
  --gradient-primary: linear-gradient(135deg, #3a86ff 0%, #4361ee 100%);
  --gradient-secondary: linear-gradient(135deg, #ff006e 0%, #ff4d6d 100%);
  --gradient-accent: linear-gradient(135deg, #fb5607 0%, #ffbe0b 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.8;
  background: url('background/wikibackground.png') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-dark);
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(240,240,245,0.85) 100%);
  z-index: -1;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.site-header {
  position: relative;
  padding: 1.5rem 0;
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(to right, #3a86ff, #ff006e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-bar {
  background: rgba(33, 37, 41, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.8rem 0;
  border-radius: var(--border-radius-md);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.nav-bar ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-bar li a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  font-weight: 500;
}

.nav-bar li a:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Search Box */
.search-container {
  text-align: center;
  margin-bottom: 2rem;
}

.search-box {
  width: 100%;
  max-width: 500px;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 50px;
  background: rgba(255,255,255,0.9);
  transition: all 0.3s ease;
}

.search-box:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.1);
}

/* Wiki Layout */
.wiki-container {
  display: flex;
  gap: 2rem;
  position: relative;
}

/* Sidebar Navigation */
.wiki-nav {
  width: 280px;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
  max-height: 85vh;
  overflow-y: auto;
}

.wiki-nav:hover {
  transform: translateY(-5px);
}

.wiki-nav h2 {
  color: var(--dark);
  border-bottom: 2px solid rgba(0,0,0,0.1);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  background: var(--gradient-accent);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.wiki-nav ul {
  list-style: none;
}

.wiki-nav > ul > li {
  margin: 0.8rem 0;
}

.wiki-nav a {
  color: var(--dark);
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: var(--border-radius-sm);
  display: block;
  transition: all 0.3s ease;
  font-weight: 400;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.wiki-nav a:hover {
  background: rgba(58, 134, 255, 0.08);
  transform: translateX(5px);
  border-left: 3px solid var(--primary);
}

.wiki-nav a.active {
  background: rgba(58, 134, 255, 0.15);
  border-left: 3px solid var(--primary);
  font-weight: 500;
}

/* 子菜单样式 */
.wiki-nav .submenu {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  display: none;
}

.wiki-nav .submenu.show {
  display: block;
}

.wiki-nav .submenu a {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
}

.wiki-nav .has-submenu > a::after {
  content: '▼';
  float: right;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.wiki-nav .has-submenu.expanded > a::after {
  transform: rotate(180deg);
}

/* Main Content */
.wiki-content {
  flex: 1;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0,0,0,0.05);
}

.wiki-section {
  margin-bottom: 3rem;
  animation: fadeIn 0.5s ease forwards;
  display: none;
}

.wiki-section.active {
  display: block;
}

.wiki-section h1 {
  color: var(--dark);
  font-size: 2.2rem;
  border-bottom: 2px solid rgba(0,0,0,0.1);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  position: relative;
}

.wiki-section h1::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--gradient-accent);
}

.wiki-section h2 {
  color: var(--dark);
  font-size: 1.7rem;
  margin: 2rem 0 1rem;
  position: relative;
  padding-left: 1rem;
}

.wiki-section h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 4px;
  background: var(--gradient-primary);
  border-radius: 4px;
}

.wiki-section h3 {
  color: var(--dark);
  font-size: 1.4rem;
  margin: 1.5rem 0 1rem;
}

.wiki-section p {
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

.wiki-section ul, .wiki-section ol {
  margin: 1.2rem 0 1.5rem 1.2rem;
}

.wiki-section li {
  margin-bottom: 0.7rem;
}

/* Feature Cards */
.gameplay-feature {
  background: rgba(255,255,255,0.6);
  border-radius: var(--border-radius-md);
  padding: 1.8rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.05);
}

.gameplay-feature:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  background: rgba(255,255,255,0.8);
}

.gameplay-feature h3 {
  color: var(--dark);
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gameplay-feature h3::before {
  content: '⚡';
  color: var(--accent);
}

.gameplay-feature p {
  margin-bottom: 0.8rem;
}

.gameplay-feature ul {
  list-style-type: none;
  margin-left: 0;
}

.gameplay-feature li {
  padding-left: 1.5rem;
  position: relative;
}

.gameplay-feature li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 50px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-green {
  background: rgba(92, 219, 149, 0.2);
  color: #2b9d6a;
  border: 1px solid rgba(92, 219, 149, 0.4);
}

.tag-blue {
  background: rgba(58, 134, 255, 0.2);
  color: #1a6bdc;
  border: 1px solid rgba(58, 134, 255, 0.4);
}

.tag-orange {
  background: rgba(251, 86, 7, 0.2);
  color: #d14400;
  border: 1px solid rgba(251, 86, 7, 0.4);
}

.tag-red {
  background: rgba(255, 0, 110, 0.2);
  color: #d10057;
  border: 1px solid rgba(255, 0, 110, 0.4);
}

.tag-legendary {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.2));
  color: #ff8c00;
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.tag-epic {
  background: rgba(138, 43, 226, 0.2);
  color: #8a2be2;
  border: 1px solid rgba(138, 43, 226, 0.4);
}

.tag-rare {
  background: rgba(30, 144, 255, 0.2);
  color: #1e90ff;
  border: 1px solid rgba(30, 144, 255, 0.4);
}

/* Tables */
.wiki-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.wiki-table th {
  background: rgba(33, 37, 41, 0.8);
  color: white;
  padding: 1rem;
  text-align: left;
}

.wiki-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.5);
}

.wiki-table tr:last-child td {
  border-bottom: none;
}

.wiki-table tr:nth-child(even) td {
  background: rgba(240,240,245,0.5);
}

/* Enchantment Table */
.enchantment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.enchantment-card {
  background: rgba(255,255,255,0.7);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.05);
}

.enchantment-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.enchantment-card h4 {
  margin: 0 0 0.5rem 0;
  color: var(--dark);
  font-size: 1.1rem;
}

.enchantment-card .enchant-cmd {
  font-family: monospace;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.5rem;
  background: rgba(0,0,0,0.05);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}

.enchantment-card .enchant-desc {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.enchantment-card .enchant-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Enchantment Filter */
.enchantment-filter {
  margin: 1.5rem 0;
  padding: 1.2rem;
  background: rgba(255,255,255,0.5);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}

.filter-group {
  margin-bottom: 1rem;
}

.filter-group label {
  display: inline-block;
  margin-right: 1rem;
  font-weight: 500;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.filter-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(0,0,0,0.2);
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--light);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Footer */
footer {
  background: rgba(33, 37, 41, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
  border-radius: var(--border-radius-lg);
}

footer p {
  letter-spacing: 1px;
  font-size: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--gradient-primary);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.5rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  transform: translateY(10px);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px);
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
}

.spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 992px) {
  .wiki-container {
    flex-direction: column;
  }
  
  .wiki-nav {
    position: static;
    width: 100%;
    margin-bottom: 2rem;
    max-height: none;
  }
  
  .wiki-section h1 {
    font-size: 1.8rem;
  }
  
  .wiki-section h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .nav-bar ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
  }
  
  .nav-bar li a {
    white-space: nowrap;
  }
  
  .wiki-content {
    padding: 1.5rem;
  }
  
  .gameplay-feature {
    padding: 1.2rem;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
  
  .enchantment-grid {
    grid-template-columns: 1fr;
  }
}

/* Animation Keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
