* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #e0e0e0;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.auth-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-container h1 {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 30px;
  background: linear-gradient(45deg, #ffd700, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active {
  background: linear-gradient(45deg, #667eea, #764ba2);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form input {
  width: 100%;
  padding: 15px;
  margin-bottom: 15px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.auth-form button {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.3s;
}

.auth-form button:hover {
  transform: scale(1.02);
}

.game-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.status-bar {
  background: rgba(0, 0, 0, 0.5);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-info #player-name {
  font-size: 1.2em;
  font-weight: bold;
  color: #ffd700;
}

.realm {
  padding: 3px 10px;
  border-radius: 15px;
  background: linear-gradient(45deg, #ff6b6b, #ffd700);
  font-size: 0.9em;
}

.stats {
  display: flex;
  gap: 20px;
  flex: 1;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  color: #888;
  font-size: 0.9em;
}

.progress-bar {
  width: 100px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.progress {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s;
}

.progress.hp {
  background: linear-gradient(90deg, #ff4757, #ff6b6b);
}

.progress.mp {
  background: linear-gradient(90deg, #3742fa, #5f6fff);
}

.progress.spirit {
  background: linear-gradient(90deg, #2ed573, #7bed9f);
}

.resources {
  display: flex;
  gap: 20px;
}

.resources span {
  color: #aaa;
}

.menu-buttons {
  display: flex;
  gap: 10px;
}

.menu-buttons button {
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  cursor: pointer;
  transition: background 0.3s;
}

.menu-buttons button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.side-menu {
  width: 120px;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-btn {
  padding: 15px 10px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.3s;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-btn.active {
  background: linear-gradient(45deg, #667eea, #764ba2);
}

.content-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel h2 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.cultivate-info {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.cultivate-info p {
  margin-bottom: 10px;
}

.cultivate-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.cultivate-actions button {
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s;
}

.cultivate-actions button:hover:not(:disabled) {
  transform: scale(1.05);
}

.cultivate-actions button:disabled {
  background: #555;
  cursor: not-allowed;
}

.realm-list {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 10px;
}

.realm-list h3 {
  margin-bottom: 15px;
}

.realm-list ul {
  list-style: none;
}

.realm-list li {
  padding: 10px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
}

.location-select {
  margin-bottom: 20px;
}

.location-select select {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
}

.monster-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.monster-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.monster-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

.monster-card.boss {
  border: 2px solid #ffd700;
}

.monster-card h4 {
  color: #ffd700;
  margin-bottom: 10px;
}

.monster-card p {
  color: #aaa;
  font-size: 0.9em;
  margin-bottom: 5px;
}

.battle-area {
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 10px;
}

.battle-info {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 20px;
}

.combatant {
  text-align: center;
}

.combatant span {
  display: block;
  margin-bottom: 10px;
  font-size: 1.2em;
}

.vs {
  font-size: 1.5em;
  color: #ff6b6b;
  font-weight: bold;
}

.battle-log {
  height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.battle-log p {
  margin-bottom: 5px;
  padding: 5px;
  border-radius: 3px;
}

.battle-log .player-action {
  background: rgba(102, 126, 234, 0.3);
}

.battle-log .monster-action {
  background: rgba(255, 107, 107, 0.3);
}

.battle-log .crit {
  color: #ffd700;
  font-weight: bold;
}

.battle-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.battle-actions button {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.3s;
}

#btn-attack {
  background: linear-gradient(45deg, #ff6b6b, #ffd700);
  color: #fff;
}

#btn-flee {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

.battle-result {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  z-index: 1000;
}

.battle-result.win h3 {
  color: #2ed573;
}

.battle-result.lose h3 {
  color: #ff4757;
}

.hidden {
  display: none !important;
}

.chat-area {
  width: 300px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.chat-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
}

.chat-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: #aaa;
  cursor: pointer;
}

.chat-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.chat-messages p {
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

.chat-messages .username {
  color: #ffd700;
  font-weight: bold;
}

.chat-messages .time {
  color: #666;
  font-size: 0.8em;
}

.chat-input {
  display: flex;
  padding: 10px;
  gap: 10px;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chat-input button {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: #fff;
  cursor: pointer;
}

.equipped-slots {
  margin-bottom: 30px;
}

.equipped-slots h3 {
  margin-bottom: 15px;
}

.slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.slot {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.slot-label {
  display: block;
  color: #888;
  font-size: 0.9em;
  margin-bottom: 5px;
}

.slot-item {
  color: #ffd700;
}

.inventory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.inventory-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.inventory-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.inventory-item.equipped {
  border: 2px solid #ffd700;
}

.inventory-item h4 {
  color: #ffd700;
  margin-bottom: 5px;
}

.inventory-item p {
  color: #aaa;
  font-size: 0.85em;
}

.inventory-item .item-actions {
  margin-top: 10px;
  display: flex;
  gap: 5px;
}

.inventory-item .item-actions button {
  padding: 5px 10px;
  border: none;
  border-radius: 3px;
  font-size: 0.8em;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

.pk-mode {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
}

#btn-toggle-pk {
  padding: 8px 20px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(45deg, #ff4757, #ff6b6b);
  color: #fff;
  cursor: pointer;
}

#btn-toggle-pk.off {
  background: rgba(255, 255, 255, 0.1);
}

.player-list {
  display: grid;
  gap: 10px;
}

.player-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-card h4 {
  color: #ffd700;
}

.player-card p {
  color: #aaa;
  font-size: 0.9em;
}

.player-card button {
  padding: 8px 20px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(45deg, #ff6b6b, #ffd700);
  color: #fff;
  cursor: pointer;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #1a1a2e;
  padding: 30px;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 20px;
}

.ranking-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.ranking-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  cursor: pointer;
}

.ranking-tab.active {
  background: linear-gradient(45deg, #667eea, #764ba2);
}

.ranking-list {
  margin-bottom: 20px;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  margin-bottom: 5px;
}

.ranking-item .rank {
  width: 30px;
  color: #ffd700;
  font-weight: bold;
}

.ranking-item .name {
  flex: 1;
}

.ranking-item .value {
  color: #aaa;
}

.btn-close-modal {
  padding: 10px 30px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  cursor: pointer;
}

.create-char-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.create-char-container h1 {
  text-align: center;
  margin-bottom: 30px;
}

.create-char-container input,
.create-char-container select {
  width: 100%;
  padding: 15px;
  margin-bottom: 15px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
}

.create-char-container select option {
  background: #1a1a2e;
}

.create-char-container button {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.notification.success {
  border-left: 4px solid #2ed573;
}

.notification.error {
  border-left: 4px solid #ff4757;
}

.notification.info {
  border-left: 4px solid #667eea;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
