/* ============ YCore 暗黑霓虹主题 ============ */

/* 全局深色渐变背景 */
html.dark body {
  background:
    radial-gradient(1100px 760px at 12% 8%, rgba(99, 102, 241, 0.20), transparent 60%),
    radial-gradient(1000px 720px at 88% 18%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(960px 920px at 50% 118%, rgba(168, 85, 247, 0.18), transparent 66%),
    #070b18 !important;
  background-attachment: fixed !important;
}

/* 半透明科技网格 */
html.dark body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 25%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 0%, black 25%, transparent 78%);
}

/* 跟随鼠标的光斑 */
html.dark body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    620px circle at var(--spot-x, 50%) var(--spot-y, 12%),
    rgba(129, 140, 248, 0.10),
    transparent 70%
  );
}

/* 漂浮的霓虹光团 */
html.dark #page_wrapper::before,
html.dark #page_wrapper::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  animation: ycore-float 16s ease-in-out infinite alternate;
}

html.dark #page_wrapper::before {
  width: 620px;
  height: 620px;
  top: -180px;
  left: -160px;
  background: rgba(99, 102, 241, 0.28);
}

html.dark #page_wrapper::after {
  width: 520px;
  height: 520px;
  right: -140px;
  bottom: -120px;
  background: rgba(34, 211, 238, 0.20);
  animation-delay: -8s;
}

@keyframes ycore-float {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(90px, 50px) scale(1.18);
  }
}

/* 分组标题渐变字 */
html.dark .service-group-name,
html.dark .bookmark-group-name {
  width: fit-content;
  background: linear-gradient(90deg, #a5b4fc, #67e8f9, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

/* 服务卡片：玻璃拟态 + 霓虹悬浮 */
html.dark .service-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px !important;
  box-shadow:
    0 10px 30px rgba(2, 6, 23, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease !important;
}

html.dark .service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(129, 140, 248, 0.45) !important;
  box-shadow:
    0 14px 34px rgba(79, 70, 229, 0.25),
    0 0 22px rgba(99, 102, 241, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

html.dark .service-icon svg {
  filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.35));
}

/* 书签卡片 */
html.dark .bookmark > a {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px !important;
  box-shadow:
    0 8px 24px rgba(2, 6, 23, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease !important;
}

html.dark .bookmark > a:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.45) !important;
  box-shadow:
    0 10px 26px rgba(79, 70, 229, 0.22),
    0 0 18px rgba(99, 102, 241, 0.10);
}

/* 信息组件（资源监控 / 搜索） */
html.dark .widget-container {
  background: rgba(255, 255, 255, 0.05) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px !important;
  box-shadow:
    0 8px 24px rgba(2, 6, 23, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

html.dark .information-widget-search input {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease !important;
}

html.dark .information-widget-search input:focus {
  border-color: rgba(129, 140, 248, 0.7) !important;
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.16),
    0 0 24px rgba(99, 102, 241, 0.18);
}

/* 卡片入场动画 */
html.dark .service,
html.dark .bookmark {
  animation: ycore-rise 0.45s ease both;
}

html.dark .service:nth-child(2),
html.dark .bookmark:nth-child(2) {
  animation-delay: 0.05s;
}

html.dark .service:nth-child(3),
html.dark .bookmark:nth-child(3) {
  animation-delay: 0.1s;
}

html.dark .service:nth-child(4),
html.dark .bookmark:nth-child(4) {
  animation-delay: 0.15s;
}

@keyframes ycore-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动条 */
html.dark::-webkit-scrollbar {
  width: 10px;
}

html.dark::-webkit-scrollbar-track {
  background: #0b1020;
}

html.dark::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #22d3ee);
  border-radius: 8px;
}

html.dark ::selection {
  background: rgba(99, 102, 241, 0.45);
}
