/* 全局样式重置和基础设置 */
* {
  box-sizing: border-box;
}

:root {
  --color-text: #f6f8ff;
  --color-muted: rgba(246, 248, 255, 0.65);
  --color-primary: #66d9ff;
  --color-accent: #a855f7;
  --color-overlay: rgba(8, 14, 24, 0.62);
  --color-border: rgba(255, 255, 255, 0.12);
  --shadow-elevated: 0 28px 80px rgba(8, 16, 32, 0.45);
}

body { 
  padding: 0; 
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
  overflow: hidden;
  color: var(--color-text);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 20%, rgba(102, 217, 255, 0.22), transparent 55%),
              radial-gradient(circle at 80% 10%, rgba(168, 85, 247, 0.18), transparent 50%),
              linear-gradient(120deg, rgba(8, 12, 24, 0.55), rgba(8, 12, 24, 0.75));
  z-index: -1;
  pointer-events: none;
}

/* 视频背景样式 */
#video-background {
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: -2;
  object-fit: cover;
  opacity: 0.6;
  filter: brightness(0.8) contrast(1.1);
  pointer-events: none;
}
/* 容器样式 */
#unity-container { 
  position: absolute;
  background: var(--color-overlay);
  backdrop-filter: blur(20px) saturate(135%);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-elevated);
  border-radius: 18px;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  z-index: 1;
  overflow: hidden;
}

#unity-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  mix-blend-mode: screen;
  opacity: 0.6;
  pointer-events: none;
}

#unity-container::after {
  content: '';
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle at 20% 30%, rgba(102, 217, 255, 0.18), transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.16), transparent 55%),
              linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 65%);
  filter: blur(12px);
  opacity: 0.55;
  animation: containerGlow 14s ease-in-out infinite alternate;
  pointer-events: none;
}

#unity-container.unity-desktop { 
  left: 50%; 
  top: 50%; 
  transform: translate(-50%, -50%);
}

#unity-container.unity-desktop:hover {
  transform: translate(-50%, -50%) scale(1.015);
  box-shadow: 0 40px 90px rgba(8, 16, 32, 0.55);
  border-color: rgba(255, 255, 255, 0.2);
}

#unity-container.unity-mobile { 
  position: fixed; 
  width: 100%; 
  height: 100%;
  background: rgba(8, 12, 24, 0.65);
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Canvas 样式 */
#unity-canvas { 
  background: linear-gradient(135deg, rgba(44, 62, 80, 0.85) 0%, rgba(52, 152, 219, 0.65) 100%);
  display: block;
  border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}

.unity-mobile #unity-canvas { 
  width: 100%; 
  height: 100%;
}

/* 加载条样式 */
#unity-loading-bar { 
  position: absolute; 
  left: 50%; 
  top: 50%; 
  transform: translate(-50%, -50%); 
  display: none;
  text-align: center;
  padding: 24px 32px;
  background: rgba(8, 14, 24, 0.78);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 60px rgba(8, 16, 32, 0.55);
}

#unity-logo { 
  width: 154px; 
  height: 130px; 
  background: url('unity-logo-light.png') no-repeat center;
  margin: 0 auto;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

#unity-progress-bar-empty { 
  width: 240px; 
  height: 24px; 
  margin: 20px auto 0; 
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

#unity-progress-bar-full { 
  width: 0%; 
  height: 100%; 
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: inherit;
  transition: width 0.35s ease;
  box-shadow: 0 0 18px rgba(102, 217, 255, 0.45);
  position: relative;
  overflow: hidden;
}

#unity-progress-bar-full::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.55) 45%, transparent 100%);
  animation: shimmer 2.2s infinite;
  mix-blend-mode: screen;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes containerGlow {
  0% {
    transform: translate(0%, 0%) rotate(0deg);
    opacity: 0.45;
  }
  50% {
    transform: translate(4%, -3%) rotate(8deg);
    opacity: 0.6;
  }
  100% {
    transform: translate(-4%, 3%) rotate(-6deg);
    opacity: 0.5;
  }
}

/* 页脚样式 */
#unity-footer { 
  position: relative;
  background: linear-gradient(90deg, rgba(8, 14, 24, 0.85) 0%, rgba(8, 14, 24, 0.65) 100%);
  backdrop-filter: blur(18px);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.unity-mobile #unity-footer { 
  display: none;
}

#unity-footer .unity-footer__left,
#unity-footer .unity-footer__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

#unity-footer .unity-footer__left {
  flex-wrap: wrap;
  align-items: center;
}

#unity-logo-title-footer { 
  width: 102px; 
  height: 38px; 
  background: url('unity-logo-title-footer.png') no-repeat center;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}

#unity-logo-title-footer:hover {
  opacity: 1;
}

#unity-build-title { 
  flex: 1;
  text-align: right;
  margin-right: 0; 
  line-height: 38px; 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.65px;
  text-transform: uppercase;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

#unity-runtime {
  font-size: 14px;
  color: var(--color-muted);
  letter-spacing: 0.6px;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.04);
}

#unity-quit-tip {
  font-size: 13px;
  color: var(--color-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 8px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.03);
}

#unity-instruction-note {
  flex-basis: 100%;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  margin-top: 4px;
  text-align: left;
  box-shadow: inset 0 0 12px rgba(8, 16, 32, 0.25);
}

#unity-github-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.3s ease;
  box-shadow: 0 12px 28px rgba(8, 16, 32, 0.38);
}

#unity-github-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#unity-github-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-primary);
  box-shadow: 0 18px 40px rgba(8, 16, 32, 0.5);
}

#unity-github-button:hover svg {
  opacity: 1;
  transform: scale(1.05);
}

#unity-fullscreen-button { 
  cursor: pointer; 
  width: 38px; 
  height: 38px; 
  background: url('fullscreen-button.png') no-repeat center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.3s ease;
  opacity: 0.85;
  backdrop-filter: blur(6px);
  margin-left: 12px;
}

#unity-fullscreen-button:hover { 
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.14);
  transform: scale(1.08);
  box-shadow: 0 10px 25px rgba(8, 16, 32, 0.35);
}

#unity-fullscreen-button:active {
  transform: scale(0.95);
}

/* 警告提示样式 */
#unity-warning { 
  position: absolute; 
  left: 50%; 
  top: 5%; 
  transform: translate(-50%); 
  background: rgba(12, 18, 28, 0.9);
  color: var(--color-text);
  backdrop-filter: blur(16px);
  padding: 18px 26px; 
  display: none;
  border-radius: 14px;
  box-shadow: 0 25px 65px rgba(8, 16, 32, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 80%;
  z-index: 1000;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  #unity-build-title {
    font-size: 16px;
  }
  
  #unity-progress-bar-empty {
    width: 180px;
  }
}

/* 滚动条美化 (适用于webkit浏览器) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
