/* Elysium 主样式文件 */

:root {
  --primary-color: rgb(67, 56, 202);
  --primary-hover: rgb(49, 46, 129);
  --text-color: rgb(140, 120, 240);
  --bg-gradient: linear-gradient(-225deg, #231557 0%, #43107a 29%, #ff1361 100%);
  --nav-width-collapsed: 100px;
  --nav-width-expanded: 280px;
}

*, *::before, *::after { padding: 0; margin: 0; box-sizing: border-box; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  width: 100%;
  height: 100vh;
  background-image: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  width: var(--nav-width-collapsed);
  height: 700px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(49, 46, 129, 0.85);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.shell:hover { width: var(--nav-width-expanded); }

.nav-box {
  display: block;
  height: 25%;
  width: 100%;
  position: relative;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.nav-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.nav-icon .icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  background: rgba(140, 120, 240, 0.1);
  border: 1px solid rgba(140, 120, 240, 0.2);
  transition: all 0.3s ease;
}

.nav-icon .icon-img i {
  font-size: 28px;
  color: var(--text-color);
  transition: all 0.3s ease;
}

.nav-icon .icon-label {
  font-size: 11px;
  color: rgba(140, 120, 240, 0.6);
  letter-spacing: 1px;
  transition: opacity 0.2s ease;
}

.nav-text {
  position: absolute;
  left: 100px;
  top: 0;
  width: 180px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 20px;
  opacity: 0;
  transition: opacity 0.25s ease 0.1s;
}

.nav-text .title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.nav-text .desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.shell:hover .nav-text { opacity: 1; }
.shell:hover .nav-icon .icon-label { opacity: 0; }

.nav-box::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 120, 240, 0.3), transparent);
}

.nav-box:last-child::after { display: none; }

.nav-box:hover {
  background: rgba(67, 56, 202, 0.5);
}

.nav-box:hover .nav-icon .icon-img {
  background: rgba(140, 120, 240, 0.25);
  border-color: rgba(140, 120, 240, 0.5);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(140, 120, 240, 0.3);
}

.nav-box:hover .nav-icon .icon-img i { color: #fff; }
.nav-box:hover .nav-text .title { color: #fff; }
.nav-box:hover .nav-text .desc { color: rgba(255, 255, 255, 0.7); }

.nav-box:hover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--text-color), transparent);
  border-radius: 0 3px 3px 0;
}

.grid-2048 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 36px;
  height: 36px;
}

.grid-2048 span {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  border-radius: 4px;
}

.grid-2048 span:nth-child(1) { background: #eee4da; color: #776e65; }
.grid-2048 span:nth-child(2) { background: #ede0c8; color: #776e65; }
.grid-2048 span:nth-child(3) { background: #f2b179; color: #fff; }
.grid-2048 span:nth-child(4) { background: #f59563; color: #fff; }

@media (max-width: 768px) {
  .shell { width: 90%; height: auto; padding: 10px 0; border-radius: 12px; }
  .nav-box { height: 70px; display: flex; align-items: center; }
  .nav-icon { position: relative; width: 70px; flex-direction: row; gap: 0; }
  .nav-icon .icon-label { display: none; }
  .nav-text { position: relative; left: 0; width: auto; opacity: 1; padding-left: 10px; }
  .nav-box::after { left: 70px; right: 15px; }
}