:root {
  --ys-purple: #8E3FB2;
  --ys-purple-light: #AB4DC9;
  --ys-purple-soft: rgba(171, 77, 201, 0.12);
  --ys-ink: #1a1424;
  --ys-muted: #8a8098;
  --ys-bg: #f4eef8;
  --ys-aside: #ffffff;
  --ys-aside-w: 248px;
  --el-color-primary: #8E3FB2;
  --el-color-primary-light-3: #ab4dc9;
  --el-color-primary-light-5: #c07ad6;
  --el-color-primary-light-7: #d5a8e4;
  --el-color-primary-light-8: #e4c6ef;
  --el-color-primary-light-9: #f3e5f8;
  --el-color-primary-dark-2: #742f96;
  --el-border-radius-base: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  background: var(--ys-bg);
  color: var(--ys-ink);
}

[v-cloak] { display: none !important; }
.muted { color: var(--ys-muted); }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ===== Login ===== */
.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  padding: 40px 6vw;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
}

.login-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(28, 8, 45, 0.72) 0%, rgba(142, 63, 178, 0.55) 48%, rgba(171, 77, 201, 0.78) 100%);
}

.login-left {
  position: relative;
  z-index: 1;
  color: #fff;
  padding-right: 40px;
}

.login-kicker {
  letter-spacing: 3px;
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 14px;
}

.login-left h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.2;
  font-weight: 700;
}

.login-left p {
  margin: 16px 0 0;
  opacity: 0.88;
  font-size: 15px;
}

.login-trophy {
  width: min(240px, 28vw);
  margin-top: 28px;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.4));
  animation: floaty 5s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  justify-self: end;
  border: none !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(40, 10, 70, 0.35) !important;
}

.login-card .el-card__body { padding: 36px 32px 40px; }

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.login-logo, .side-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  background: linear-gradient(135deg, #AB4DC9, #8E3FB2);
  box-shadow: 0 10px 24px rgba(142, 63, 178, 0.35);
}

.side-logo { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }

.login-brand, .side-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ys-purple);
}

.side-title { font-size: 18px; letter-spacing: 2px; }
.login-sub, .side-sub { font-size: 12px; color: var(--ys-muted); margin-top: 2px; }

.login-card h1 { margin: 0 0 6px; font-size: 26px; }
.login-desc { margin: 0 0 22px; color: var(--ys-muted); font-size: 13px; }

.login-btn {
  width: 100%;
  height: 46px !important;
  margin-top: 8px;
  font-weight: 600;
  border: none !important;
  background: linear-gradient(135deg, #AB4DC9, #8E3FB2) !important;
  box-shadow: 0 12px 28px rgba(142, 63, 178, 0.35);
}

/* ===== Shell ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top right, rgba(171, 77, 201, 0.12), transparent 40%),
    linear-gradient(180deg, #faf7fc 0%, #f0e8f6 100%);
}

.aside {
  width: var(--ys-aside-w);
  flex: 0 0 var(--ys-aside-w);
  background: var(--ys-aside);
  border-right: 1px solid rgba(142, 63, 178, 0.1);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  box-shadow: 4px 0 24px rgba(100, 40, 140, 0.04);
}

.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 18px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  color: #6b6280;
  font-size: 14px;
  text-align: left;
  transition: all 0.18s ease;
}

.nav-item:hover {
  background: rgba(171, 77, 201, 0.08);
  color: var(--ys-purple);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(171, 77, 201, 0.16), rgba(142, 63, 178, 0.08));
  color: var(--ys-purple);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(142, 63, 178, 0.12);
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
}

.nav-label { flex: 1; }

.nav-badge {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ys-purple);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.side-promo {
  position: relative;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  margin: 12px 4px;
}

.side-promo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.side-promo-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(50, 10, 70, 0.78));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px;
  font-size: 12px;
}

.side-promo-mask strong { font-size: 13px; }

.side-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 4px;
  border-top: 1px solid rgba(142, 63, 178, 0.1);
  margin-top: 4px;
}

.admin-avatar {
  background: linear-gradient(135deg, #AB4DC9, #8E3FB2) !important;
  color: #fff !important;
  font-weight: 700;
}

.admin-meta { flex: 1; min-width: 0; }
.admin-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role { font-size: 11px; color: var(--ys-muted); }

.logout-btn {
  color: #E85D4C !important;
  border-color: rgba(232, 93, 76, 0.25) !important;
}

.aside-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 8, 30, 0.45);
  z-index: 25;
}

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(250, 247, 252, 0.96), rgba(250, 247, 252, 0.85));
  backdrop-filter: blur(10px);
}

.top-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.menu-btn { display: none !important; }

.top-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-title-icon { color: var(--ys-purple); }

.topbar h2 {
  margin: 0;
  font-size: 24px;
  color: var(--ys-ink);
}

.top-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ys-muted);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tour-tag {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(135deg, #AB4DC9, #8E3FB2) !important;
  border: none !important;
}

.main {
  padding: 8px 28px 36px;
  flex: 1;
}

.page-block { animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Hero */
.hero-banner {
  position: relative;
  height: 200px;
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 18px 40px rgba(100, 40, 140, 0.18);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(40, 8, 60, 0.82) 0%, rgba(142, 63, 178, 0.45) 55%, rgba(171, 77, 201, 0.2) 100%);
}

.hero-copy {
  position: absolute;
  left: 28px;
  bottom: 26px;
  color: #fff;
  z-index: 1;
}

.hero-kicker {
  font-size: 11px;
  letter-spacing: 3px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.hero-copy h3 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

.hero-copy p {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero-trophy {
  position: absolute;
  right: 28px;
  bottom: -8px;
  width: 158px;
  z-index: 1;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
  animation: floaty 6s ease-in-out infinite;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(100, 40, 140, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(100, 40, 140, 0.12);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
}

.stat-label { font-size: 12px; color: var(--ys-muted); }
.stat-value {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ys-purple);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
}

.settings-grid { grid-template-columns: 1.2fr 1fr; }

.panel-card {
  border: none !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 8px 24px rgba(100, 40, 140, 0.07) !important;
  margin-bottom: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ys-ink);
}

.card-title .el-icon { color: var(--ys-purple); }

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-tile {
  border: 1px solid rgba(142, 63, 178, 0.12);
  background: #faf7fc;
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ys-ink);
  transition: all 0.18s ease;
}

.action-tile .el-icon { color: var(--ys-purple); margin-bottom: 4px; }
.action-tile strong { font-size: 14px; }
.action-tile span { font-size: 12px; color: var(--ys-muted); }

.action-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(142, 63, 178, 0.28);
  box-shadow: 0 8px 18px rgba(142, 63, 178, 0.1);
}

.action-tile.primary {
  background: linear-gradient(135deg, rgba(171, 77, 201, 0.14), rgba(142, 63, 178, 0.08));
  border-color: rgba(142, 63, 178, 0.22);
}

.action-tile.danger {
  background: rgba(232, 93, 76, 0.06);
  border-color: rgba(232, 93, 76, 0.18);
}

.action-tile.danger .el-icon { color: #E85D4C; }

.action-tile:disabled { opacity: 0.6; cursor: not-allowed; }

.tour-desc { margin-top: 0; }

.score-text {
  font-weight: 700;
  color: var(--ys-purple);
  font-variant-numeric: tabular-nums;
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ys-purple-soft);
  color: var(--ys-purple);
  font-weight: 700;
  font-size: 13px;
}

.rank-badge.r1 { background: linear-gradient(135deg, #f6d365, #fda085); color: #5a3a10; }
.rank-badge.r2 { background: linear-gradient(135deg, #e8e8e8, #c0c0c0); color: #333; }
.rank-badge.r3 { background: linear-gradient(135deg, #f0c27b, #c48a3a); color: #4a2e0c; }

.hint { margin: 0 0 14px; color: var(--ys-muted); font-size: 13px; }

.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.media-card {
  background: rgba(171, 77, 201, 0.06);
  border: 1px solid rgba(171, 77, 201, 0.14);
  border-radius: 14px;
  padding: 14px;
}

.media-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ys-purple);
  margin-bottom: 10px;
}

.media-preview {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  background: #eee;
}

.image-slot {
  height: 150px;
  display: grid;
  place-items: center;
  color: var(--ys-muted);
  background: #f3eef7;
}

.dialog-vs {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}

.dialog-vs span {
  margin: 0 10px;
  color: var(--ys-purple);
  font-weight: 500;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.score-colon {
  font-size: 28px;
  font-weight: 700;
  color: var(--ys-purple);
}

@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .login-page {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 28px 20px;
  }
  .login-left { display: none; }
  .login-card { justify-self: center; }

  .aside {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(40, 10, 70, 0.2);
  }
  .aside.open { transform: translateX(0); }
  .aside-mask { display: block; }
  .menu-btn { display: inline-flex !important; }

  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-grid { grid-template-columns: 1fr; }
  .form-2col { grid-template-columns: 1fr; }
  .hero-banner { height: 160px; }
  .hero-copy { left: 16px; right: 16px; bottom: 18px; }
  .hero-copy h3 { font-size: 18px; max-width: 100%; padding-right: 0; }
  .hero-trophy { display: none; }
  .main { padding: 8px 16px 28px; }
  .topbar { padding: 14px 16px 8px; }
  .tour-tag { max-width: min(220px, 52vw); }
  .top-title-row h2 { font-size: 20px; }
}
