/* ============================================================
   ZZOJ 门户（index.html）视觉皮肤
   覆盖 material-dashboard 默认样式：去掉 404.jpg 底图遮罩，
   改为渐变侧栏 + 卡片化内容区
   ============================================================ */

/* ---------- 整页锁定：整体不滚动，仅侧栏列表内部滚动 ----------
   基础库用 100vh，移动端会把地址栏/底部工具栏也算进高度，
   导致整页被撑高、整页可上下滑。改用 100dvh（排除工具栏后的真实可视高度），
   并锁住 body，让只有 .sidebar-wrapper（分类列表）在内部滚动。 */
html, body { height: 100%; }
body { overflow: hidden; }
.wrapper {
  height: 100vh;            /* 回退：不支持 dvh 的旧浏览器 */
  height: 100dvh;          /* 现代浏览器：真实可视高度 */
  min-height: 100vh;
  min-height: 100dvh;
}
.sidebar .sidebar-wrapper,
.off-canvas-sidebar .sidebar-wrapper {
  height: calc(100vh - 75px);
  height: calc(100dvh - 75px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 全局底色 ---------- */
body {
  background-color: #eef0f8;
  background-image:
    radial-gradient(1100px 560px at 86% -12%, #efe4ff 0%, rgba(239, 228, 255, 0) 62%),
    radial-gradient(900px 520px at 6% 108%, #e4ecff 0%, rgba(228, 236, 255, 0) 60%);
  background-attachment: fixed;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

/* ---------- 侧栏：紫蓝渐变 ---------- */
.sidebar {
  background: linear-gradient(170deg, #2c1a5c 0%, #40267f 45%, #6b34a8 100%) !important;
  box-shadow: 0 0 40px rgba(44, 26, 92, .35) !important;
}
/* 去掉原皮肤用 404.jpg 铺的深色遮罩 */
.sidebar:before,
.sidebar:after,
.sidebar .sidebar-background {
  display: none !important;
}

.sidebar .sidebar-wrapper {
  background: transparent;
  position: relative;
  z-index: 1;
}
.sidebar .logo {
  position: relative;
  z-index: 1;
}

/* 侧栏装饰光斑 */
.sidebar-glow {
  position: absolute;
  top: -90px;
  right: -70px;
  z-index: 0;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 95, 143, .38), rgba(255, 95, 143, 0) 66%);
  animation: sidebarFloat 11s ease-in-out infinite;
}
.sidebar-glow:before {
  content: '';
  position: absolute;
  left: -170px;
  top: 300px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(74, 217, 255, .3), rgba(74, 217, 255, 0) 66%);
  animation: sidebarFloat 13s ease-in-out infinite reverse;
}
@keyframes sidebarFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(-16px, 20px, 0); }
}

/* 品牌区 */
.sidebar .logo {
  padding: 26px 16px 20px !important;
}
.sidebar .logo:after {
  display: none !important;
}
.sidebar .logo .simple-text {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 !important;
  font-size: 19px !important;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: none !important;
  color: #fff !important;
  line-height: 1.4 !important;
}
.sidebar .logo .simple-text img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .14);
  padding: 2px;
}
.sidebar .brand-tag {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, .5);
  text-transform: uppercase;
}

/* 导航项 */
.sidebar .nav {
  margin-top: 10px;
}
.sidebar .nav li > a {
  display: flex;
  align-items: center;
  margin: 4px 14px !important;
  padding: 11px 16px !important;
  border-radius: 12px;
  color: rgba(255, 255, 255, .8) !important;
  transition: background .22s, color .22s, transform .22s;
}
.sidebar .nav li > a i {
  width: 22px;
  font-size: 17px;
  color: rgba(255, 255, 255, .65) !important;
  transition: color .22s;
}
.sidebar .nav li > a p {
  margin: 0 0 0 10px !important;
  font-size: 14.5px;
  line-height: 1.2 !important;
}
.sidebar .nav li:hover > a {
  background: rgba(255, 255, 255, .12) !important;
  color: #fff !important;
  transform: translateX(3px);
}
.sidebar .nav li:hover > a i,
.sidebar .nav li:hover > a p {
  color: #fff !important;
}
/* 选中项：白底胶囊 */
.sidebar .nav li.active > a,
.sidebar[data-color="purple"] .nav li.active > a {
  background: #fff !important;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .5) !important;
  color: #3a2478 !important;
  font-weight: 600;
}
.sidebar .nav li.active > a i,
.sidebar .nav li.active > a p,
.sidebar[data-color="purple"] .nav li.active > a i,
.sidebar[data-color="purple"] .nav li.active > a p {
  color: #3a2478 !important;
}

/* 侧栏底部版权 */
.sidebar .sidebar-footer {
  padding: 14px 16px 22px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .45);
}
.sidebar .sidebar-footer hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
  margin: 0 24px 12px;
}
.sidebar .sidebar-footer a {
  color: rgba(255, 255, 255, .7);
}
.sidebar .sidebar-footer a:hover {
  color: #fff;
}
.sidebar .sidebar-footer .sf-count {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  letter-spacing: .5px;
}
.sidebar .sidebar-footer .sf-count b {
  font-size: 17px;
  color: #fff;
}

/* ---------- 顶栏 ---------- */
.navbar.navbar-transparent.navbar-absolute {
  background: rgba(255, 255, 255, .86) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 22px rgba(30, 20, 70, .09);
}

/* 全屏按钮 */
.navbar-nav > li.fs-switch > .fs-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0 !important;
  margin: 6px 8px;
  border-radius: 50%;
  background: rgba(107, 52, 168, .1);
  color: #6b34a8 !important;
  transition: background .2s, color .2s, transform .2s;
}
.navbar-nav > li.fs-switch > .fs-toggle:hover,
.navbar-nav > li.fs-switch > .fs-toggle:focus {
  background: linear-gradient(135deg, #7b3fbe, #40267f) !important;
  color: #fff !important;
  transform: translateY(-1px);
}
.navbar-nav > li.fs-switch > .fs-toggle i {
  float: none;
  margin: 0;
  width: auto;
  font-size: 15px;
  line-height: 1;
  color: inherit !important;
}
.navbar .navbar-brand {
  color: #3a2478;
  font-weight: 600;
  font-size: 16px;
}
.navbar-toggle .icon-bar {
  background-color: #5b4a86 !important;
}
.navbar-nav > li > a {
  color: #6b6b85 !important;
}
.navbar-nav > li > a:hover {
  color: #3a2478 !important;
}
.navbar-nav > li > a p {
  display: inline-block;
  margin: 0 0 0 6px;
}

/* 语言切换做成胶囊按钮 */
.navbar-nav > li.lang-switch > .lang-toggle,
.sidebar .lang-switch > .lang-toggle {
  /* flex 布局：抵消侧栏 .nav i 的 float:left，保证 图标/文字/箭头 按顺序排列 */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 8px 12px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6b34a8, #40267f);
  color: #fff !important;
  font-size: 13px;
  line-height: 1;
}
.navbar-nav > li.lang-switch > .lang-toggle:hover,
.sidebar .lang-switch > .lang-toggle:hover {
  filter: brightness(1.12);
}
.lang-switch .lang-current {
  margin: 0;
  font-weight: 600;
}
.navbar-nav > li.lang-switch > .lang-toggle i,
.sidebar .lang-switch > .lang-toggle i {
  float: none;
  margin: 0;
  font-size: 14px;
  line-height: 1;
  color: #fff !important;
}

/* ---------- 内容区：卡片化 ---------- */
.main-panel > .content {
  margin-top: 70px;
}
.content .container-fluid {
  padding: 14px;
}
.content .row {
  margin: 0 !important;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 34px -18px rgba(44, 26, 92, .35);
}
iframe#game-frame {
  border-radius: 0;
}

/* ---------- iframe 加载遮罩 ---------- */
.frame-wrap {
  position: relative;
}
.frame-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, .88);
  transition: opacity .35s;
}
.frame-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.frame-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(107, 52, 168, .18);
  border-top-color: #6b34a8;
  border-radius: 50%;
  animation: frameSpin .9s linear infinite;
}
@keyframes frameSpin {
  to { transform: rotate(360deg); }
}
.frame-loading p {
  margin: 0;
  font-size: 13px;
  color: #7a7396;
}

/* ---------- 抽屉打开时的遮罩 ---------- */
.close-layer {
  background-color: rgba(24, 16, 48, .45);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-glow,
  .sidebar-glow:before { animation: none; }
  .frame-spinner { animation-duration: 2s; }
}

/* ---------- 手机端 ---------- */
@media (max-width: 991px) {
  .content .container-fluid {
    padding: 8px;
  }
  .content .row {
    border-radius: 12px;
  }
  .navbar .navbar-brand {
    font-size: 15px;
  }
  .sidebar .nav li > a {
    margin: 4px 12px !important;
  }
}
