/* 窗口部件增强样式 - 科幻主题特效 */

/* 全局变量 */
:root {
  --cyber-blue: #00ffff;
  --cyber-purple: #8a2be2;
  --cyber-green: #00ff41;
  --cyber-red: #ff0040;
  --cyber-yellow: #ffff00;
  --cyber-orange: #ff6600;
  --cyber-bg: #0a0a0a;
  --cyber-surface: #1a1a1a;
  --cyber-border: rgba(0, 255, 255, 0.3);
}

/* 状态面板增强 */
.cyber-hp-table {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 8px;
  border: 1px solid var(--cyber-border);
  box-shadow: 
    0 0 20px rgba(0, 255, 255, 0.1),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.cyber-hp-cell {
  padding: 4px;
  transition: all 0.3s ease;
}

.cyber-hp-container {
  position: relative;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(42, 42, 42, 0.9));
  border-radius: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.cyber-hp-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.cyber-hp-container:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(0, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: var(--cyber-blue);
}

.cyber-hp-container:hover::before {
  left: 100%;
}

.cyber-hp-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  font-weight: 600;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
}

.cyber-hp-bar-bg {
  background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
  height: 8px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cyber-hp-bar {
  height: 100%;
  border-radius: 4px;
  position: relative;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 0 8px currentColor,
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: linear-gradient(90deg, currentColor, rgba(255, 255, 255, 0.3));
}

.cyber-hp-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: cyber-scan 2s infinite linear;
}

.cyber-hp-text {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: white;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  z-index: 1;
}

.cyber-hp-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* 状态等级样式 */
.status-critical .cyber-hp-container {
  border-color: var(--cyber-red);
  animation: cyber-danger-glow 1.5s infinite alternate;
}

.status-critical .cyber-hp-bar {
  animation: cyber-pulse-red 1.2s infinite;
  background: linear-gradient(90deg, #ff4444, #ff6666) !important;
}

.status-warning .cyber-hp-container {
  border-color: var(--cyber-yellow);
  animation: cyber-warning-glow 2s infinite alternate;
}

.status-warning .cyber-hp-bar {
  animation: cyber-pulse-yellow 1.5s infinite;
  background: linear-gradient(90deg, #ff8800, #ffaa00) !important;
}

.status-buff .cyber-hp-container {
  border-color: var(--cyber-green);
  animation: cyber-buff-glow 2s infinite alternate;
}

.status-buff .cyber-hp-bar {
  animation: cyber-glow-green 1.8s infinite;
  background: linear-gradient(90deg, #44ff44, #66ff66) !important;
}

/* 聊天窗口增强 */
.chat-message {
  margin: 6px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(26, 26, 26, 0.4));
  border-left: 4px solid var(--cyber-blue);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chat-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.chat-message:hover {
  transform: translateX(2px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(0, 255, 255, 0.1);
}

.chat-message:hover::before {
  left: 100%;
}

.cyber-system-message {
  border-left-color: var(--cyber-purple);
  background: linear-gradient(135deg, rgba(128, 0, 128, 0.2), rgba(138, 43, 226, 0.2));
}

.cyber-combat-message {
  border-left-color: var(--cyber-red);
  background: linear-gradient(135deg, rgba(255, 0, 64, 0.2), rgba(255, 68, 68, 0.2));
  animation: cyber-shake 0.5s ease-in-out;
}

.cyber-reward-message {
  border-left-color: var(--cyber-green);
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.2), rgba(68, 255, 68, 0.2));
  animation: cyber-reward-glow 1s ease-in-out;
}

.chat-timestamp {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  margin-right: 6px;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* 按钮增强 */
.cyber-btn {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 128, 255, 0.2));
  border: 1px solid var(--cyber-blue);
  color: var(--cyber-blue);
  padding: 8px 16px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.cyber-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.cyber-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.4), rgba(0, 128, 255, 0.4));
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 255, 255, 0.5);
}

.cyber-btn:hover::before {
  left: 100%;
}

.cyber-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 255, 255, 0.4);
}

/* 面板增强 */
.cyber-panel {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(26, 26, 26, 0.6));
  border: 1px solid var(--cyber-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.cyber-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyber-blue), transparent);
}

.cyber-panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyber-blue), transparent);
}

/* 动画效果 */
@keyframes cyber-scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes cyber-pulse-red {
  0%, 100% { 
    box-shadow: 0 0 8px #ff0040;
    filter: brightness(1);
  }
  50% { 
    box-shadow: 0 0 16px #ff0040, 0 0 24px #ff6666;
    filter: brightness(1.2);
  }
}

@keyframes cyber-pulse-yellow {
  0%, 100% { 
    box-shadow: 0 0 8px #ff8800;
    filter: brightness(1);
  }
  50% { 
    box-shadow: 0 0 16px #ff8800, 0 0 24px #ffaa00;
    filter: brightness(1.2);
  }
}

@keyframes cyber-glow-green {
  0%, 100% { 
    box-shadow: 0 0 8px #00ff41;
    filter: brightness(1);
  }
  50% { 
    box-shadow: 0 0 16px #00ff41, 0 0 24px #66ff66;
    filter: brightness(1.3);
  }
}

@keyframes cyber-danger-glow {
  0% { box-shadow: 0 0 5px rgba(255, 0, 64, 0.5); }
  100% { box-shadow: 0 0 15px rgba(255, 0, 64, 0.8); }
}

@keyframes cyber-warning-glow {
  0% { box-shadow: 0 0 5px rgba(255, 136, 0, 0.5); }
  100% { box-shadow: 0 0 15px rgba(255, 136, 0, 0.8); }
}

@keyframes cyber-buff-glow {
  0% { box-shadow: 0 0 5px rgba(0, 255, 65, 0.5); }
  100% { box-shadow: 0 0 15px rgba(0, 255, 65, 0.8); }
}

@keyframes cyber-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@keyframes cyber-reward-glow {
  0%, 100% { 
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
    filter: brightness(1);
  }
  50% { 
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.6), 0 0 25px rgba(0, 255, 65, 0.3);
    filter: brightness(1.2);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .cyber-hp-container {
    padding: 6px;
  }
  
  .cyber-hp-label {
    font-size: 10px;
  }
  
  .cyber-hp-text {
    font-size: 8px;
  }
  
  .chat-message {
    padding: 6px 8px;
    margin: 4px 0;
  }
}

/* 加载动画 */
.cyber-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--cyber-blue);
  animation: cyber-spin 1s ease-in-out infinite;
}

@keyframes cyber-spin {
  to { transform: rotate(360deg); }
}

/* 粒子效果背景 */
.cyber-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.cyber-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--cyber-blue);
  border-radius: 50%;
  opacity: 0.7;
  animation: cyber-float 6s infinite linear;
}

@keyframes cyber-float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}