/* ==========================================================================
   微暖晨雪 · 无方框羽化单列样式表 (Warm Morning Snow & Borderless Plume)
   设计准则：
   1. 前中后三层冬景融合（天光晨曦 + 雪坡暗影 + 真透明人物雪影 + 景深微雪）
   2. 零矩形盒子、零实线硬框、零胶囊色块，纯靠“雪雾羽化带 + 冬日单色阶 + 留白”建立秩序
   ========================================================================== */

:root {
  /* 两侧真透明 RGBA 人物插画参数 */
  --bg-image-fallback: url("./assets/bg/guard_of_honor_rgba.png");
  --bg-cluster-ratio: 0.35;
  --bg-aspect-h-over-w: 0.5625;
  --bg-visible-height-ratio: 0.62;
  --bg-side-width: clamp(200px, min(25vw, 46vh), 500px);
  --bg-side-inset: clamp(0px, calc((100vw - 1360px) * 0.07), 44px);

  /* 统一冬日单色阶（深霜墨 -> 冷岩灰 -> 雾石青，优化字色对比度与 ClearType 清晰度） */
  --ink-strong: #1b2432;
  --ink-number: #2c3a4f;
  --ink-secondary: rgba(38, 50, 70, 0.74);
  --ink-muted: rgba(56, 70, 92, 0.58);
  --ink-accent: #425c88;
  --ink-accent-deep: #2a436c;

  /* 字体栈：优先现代高精无衬线（macOS 苹方 / 鸿蒙 / 思源 / Windows 雅黑 UI），等宽数字对齐群号 */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC",
    "Source Han Sans SC", "Hiragino Sans GB", "Microsoft YaHei UI",
    "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-num: "SF Pro Text", "Bahnschrift", "DIN Alternate", "Segoe UI",
    "PingFang SC", "Microsoft YaHei UI", sans-serif;
  /* 高校校名官方标准印刷衬线/楷体栈（方正小标宋/思源宋体/华文中宋/楷体等，兼顾庄重与高清渲染） */
  --font-university: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
    "STZhongsong", "STSong", "KaiTi", "STKaiti", Georgia, serif;

  /* 柔和过渡时间 */
  --ease-quiet: 160ms ease;

  /* 单列核心文字宽度（落在两侧人物之间的雪雾安全区中央） */
  --column-width: min(
    600px,
    calc(100vw - 2 * (var(--bg-side-width) + var(--bg-side-inset)) - 56px)
  );
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
}

body {
  background-color: #f6f7fa;
  color: var(--ink-strong);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
a {
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   第 0 层：冬日晴雪暖阳天光基底 + 远山雪坡与动态风雪画布
   ========================================================================== */

.winter-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* 清朗冰蓝冬日晴空 + 左上暖阳金杏色日晕 + 下方晴雪坡面，为纯白飘雪提供充足衬托对比 */
  background:
    radial-gradient(
      circle at 17% 15%,
      rgba(255, 253, 244, 0.98) 0%,
      rgba(255, 236, 194, 0.88) 5%,
      rgba(255, 214, 150, 0.48) 15%,
      rgba(255, 224, 178, 0.18) 32%,
      rgba(255, 235, 205, 0) 56%
    ),
    linear-gradient(
      180deg,
      #b5cfe9 0%,
      #c8ddf2 26%,
      #ddeaf7 48%,
      #eef4fb 68%,
      #f6f9fd 100%
    );
}

.winter-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.winter-canvas--front {
  z-index: 3;
}

/* ==========================================================================
   第 1 层：两侧真透明 RGBA 人物插画（含靴底雪地柔影）
   ========================================================================== */

.bg-side {
  position: fixed;
  bottom: 0;
  z-index: 1;
  width: var(--bg-side-width);
  height: calc(
    var(--bg-side-width) / var(--bg-cluster-ratio) * var(--bg-aspect-h-over-w) *
      var(--bg-visible-height-ratio)
  );
  background-image: var(--bg-image-fallback);
  background-image: image-set(
    url("./assets/bg/guard_of_honor_rgba.webp") type("image/webp"),
    url("./assets/bg/guard_of_honor_rgba.png") type("image/png")
  );
  background-repeat: no-repeat;
  background-size: calc(var(--bg-side-width) / var(--bg-cluster-ratio)) auto;
  pointer-events: none;
  user-select: none;
}

.bg-side--left {
  left: var(--bg-side-inset);
  background-position: left bottom;
}

.bg-side--right {
  right: var(--bg-side-inset);
  background-position: right bottom;
}

/* ==========================================================================
   第 2 层：居中“雪雾羽化淡化带”与无方框单列容器
   ========================================================================== */

.page-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--column-width);
  margin: 0 auto;
  padding: 60px 0 84px;
}

/* 上下左右四向无边界余弦羽化雪雾带：既确保中心字迹清透好读，又绝无任何盒子边缘 */
.page-shell::before {
  content: "";
  position: absolute;
  inset: -24px -150px -44px -150px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(253, 252, 249, 0) 0%,
    rgba(253, 252, 249, 0.16) 8%,
    rgba(254, 253, 250, 0.5) 18%,
    rgba(255, 254, 252, 0.82) 30%,
    rgba(255, 254, 252, 0.91) 42%,
    rgba(255, 254, 252, 0.91) 58%,
    rgba(255, 254, 252, 0.82) 70%,
    rgba(254, 253, 250, 0.5) 82%,
    rgba(253, 252, 249, 0.16) 92%,
    rgba(253, 252, 249, 0) 100%
  );
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0px,
    #000 52px,
    #000 calc(100% - 64px),
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0px,
    #000 52px,
    #000 calc(100% - 64px),
    transparent 100%
  );
}

/* 极简页眉 */
.site-header {
  margin-bottom: 18px;
}

.site-title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.35;
  color: var(--ink-strong);
}

.site-subtitle {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--ink-secondary);
}

/* ==========================================================================
   校徽无限滑动展示带（去框化左右羽化，悬停暂停，点击检索对应高校群）
   ========================================================================== */

.badge-marquee {
  width: 100vw;
  margin: 0 0 22px calc(50% - 50vw);
}

.badge-marquee-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 4px 0;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 7%,
    #000 93%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 7%,
    #000 93%,
    transparent 100%
  );
}

.badge-marquee-track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  will-change: transform;
  animation: badge-marquee-scroll 55s linear infinite;
}

.badge-marquee-viewport:hover .badge-marquee-track,
.badge-marquee-viewport:focus-within .badge-marquee-track {
  animation-play-state: paused;
}

.badge-marquee-group {
  display: flex;
  align-items: flex-start;
  gap: 34px;
  padding-right: 34px;
  flex-shrink: 0;
}

.badge-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
}

.badge-emblem {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 2px 6px rgba(27, 36, 50, 0.08));
  transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.badge-name {
  font-family: var(--font-university);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--ink-secondary);
  transition: color 180ms ease;
}

.badge-item:hover .badge-emblem,
.badge-item:focus-visible .badge-emblem,
.badge-item.is-selected .badge-emblem {
  transform: scale(1.1);
  opacity: 1;
  filter: drop-shadow(0 4px 10px rgba(42, 67, 108, 0.16));
}

.badge-item:hover .badge-name,
.badge-item:focus-visible .badge-name,
.badge-item.is-selected .badge-name {
  color: var(--ink-accent-deep);
}

.badge-item:focus-visible .badge-name {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@keyframes badge-marquee-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge-marquee-viewport {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .badge-marquee-viewport::-webkit-scrollbar {
    display: none;
  }

  .badge-marquee-track {
    animation: none;
  }
}

/* ==========================================================================
   去框化搜索底线与纯文本分类词
   ========================================================================== */

.controls-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 36px;
}

.search-line {
  position: relative;
  display: flex;
  align-items: center;
  padding-bottom: 2px;
}

/* 搜索底线采用向右自然渐隐的细霜线，无四面围框 */
.search-line::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(70, 96, 138, 0.3) 0%,
    rgba(70, 96, 138, 0.18) 72%,
    rgba(70, 96, 138, 0) 100%
  );
  transition: background var(--ease-quiet);
}

.search-line:focus-within::after {
  background: linear-gradient(
    90deg,
    rgba(70, 96, 138, 0.72) 0%,
    rgba(70, 96, 138, 0.38) 78%,
    rgba(70, 96, 138, 0) 100%
  );
}

.search-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--ink-muted);
  margin-right: 10px;
  pointer-events: none;
  transition: color var(--ease-quiet);
}

.search-line:focus-within .search-icon {
  color: var(--ink-accent);
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ink-strong);
  outline: none;
}

.search-input::placeholder {
  color: var(--ink-muted);
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  font-size: 12.5px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--ease-quiet);
}

.search-clear:hover {
  color: var(--ink-strong);
}

.search-clear[hidden] {
  display: none;
}

/* 纯文本分类导航（零胶囊背景框） */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.category-tab {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 0 6px;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: color var(--ease-quiet);
}

.category-tab:hover {
  color: var(--ink-strong);
}

.category-tab.is-active {
  font-weight: 600;
  color: var(--ink-strong);
}

/* 激活分类仅用一条两端渐隐的极细冰晶线轻托，不套盒子 */
.category-tab::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0;
  height: 1.5px;
  background: linear-gradient(
    90deg,
    rgba(70, 96, 138, 0) 0%,
    var(--ink-accent) 30%,
    var(--ink-accent) 70%,
    rgba(70, 96, 138, 0) 100%
  );
  opacity: 0;
  transition: opacity var(--ease-quiet);
}

.category-tab.is-active::after {
  opacity: 0.85;
}

.category-count {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink-muted);
}

/* ==========================================================================
   无方框单列群目录（留白节奏 + 雪光微晕悬停）
   ========================================================================== */

.search-summary {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.groups-container {
  display: flex;
  flex-direction: column;
  gap: 38px;
}

.pinned-section {
  margin-bottom: 38px;
}

.group-section {
  position: relative;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

/* 分类小标右侧延伸一缕渐隐消失的薄霜细影，不贯通切死 */
.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(92, 112, 142, 0.16) 0%,
    rgba(92, 112, 142, 0.04) 55%,
    rgba(92, 112, 142, 0) 100%
  );
}

.section-heading-count {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink-muted);
}

.group-list {
  display: flex;
  flex-direction: column;
}

.group-item {
  position: relative;
  padding: 16px 0;
}

.group-item--pinned {
  padding: 18px 0;
}

/* 行间仅保留两端完全透明消隐的极微弱霜息分隔，看不见任何硬边头尾 */
.group-item + .group-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(92, 112, 142, 0) 0%,
    rgba(92, 112, 142, 0.1) 18%,
    rgba(92, 112, 142, 0.1) 82%,
    rgba(92, 112, 142, 0) 100%
  );
}

/* 悬停效果：无任何矩形色块，仅在文字背后泛起一团边缘完全羽化消融的暖晨雪光晕 */
.group-item::before {
  content: "";
  position: absolute;
  inset: -4px -56px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 68% 90% at 50% 50%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 251, 245, 0.54) 54%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0;
  transition: opacity var(--ease-quiet);
}

.group-item:hover::before {
  opacity: 1;
}

.group-line-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.group-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.48;
  color: var(--ink-strong);
  transition: color var(--ease-quiet);
}

.group-item--pinned .group-name {
  font-size: 16px;
  letter-spacing: 0.015em;
}

.group-meta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}

.qq-number {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.qq-copy-trigger .qq-number {
  display: inline-block;
  min-width: 10.5ch;
  text-align: right;
}

/* 纯文本点击复制群号与轻文本操作项（零按钮外框） */
.qq-copy-trigger {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink-number);
  font-size: 13.5px;
  transition: color var(--ease-quiet);
}

.qq-copy-trigger:hover {
  color: var(--ink-strong);
}

.qq-copy-hint {
  font-size: 12.5px;
  color: var(--ink-muted);
  min-width: 38px;
  text-align: left;
  transition: color var(--ease-quiet);
}

.qq-copy-trigger:hover .qq-copy-hint {
  color: var(--ink-accent);
}

.qq-copy-trigger.is-copied,
.qq-copy-trigger.is-copied .qq-copy-hint {
  color: var(--ink-accent-deep);
  font-weight: 500;
}

.dot-sep {
  color: rgba(92, 112, 142, 0.32);
  font-size: 12px;
  user-select: none;
}

.text-action,
.text-link-action {
  position: relative;
  display: inline-block;
  padding: 2px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--ease-quiet);
}

.text-link-action {
  color: var(--ink-accent);
  font-weight: 500;
}

.text-action:hover,
.text-link-action:hover {
  color: var(--ink-accent-deep);
}

/* 悬停轻文本操作时浮现极细渐隐下划线 */
.text-action::after,
.text-link-action::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--ease-quiet);
}

.text-action:hover::after,
.text-link-action:hover::after {
  opacity: 0.45;
}

.text-action.is-copied {
  color: var(--ink-accent-deep);
  font-weight: 500;
}

.group-desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.68;
  letter-spacing: 0.008em;
  color: var(--ink-secondary);
}

button:focus-visible,
a:focus-visible {
  outline: none;
  color: var(--ink-accent-deep);
  box-shadow: 0 1.5px 0 rgba(70, 96, 138, 0.65);
}

/* ==========================================================================
   无框空状态与冬雾单行页脚
   ========================================================================== */

.empty-state {
  padding: 48px 0;
  text-align: center;
}

.empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-strong);
}

.empty-desc {
  margin: 6px 0 16px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.site-footer {
  position: relative;
  margin-top: 48px;
  padding-top: 20px;
  font-size: 12px;
  color: var(--ink-muted);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(92, 112, 142, 0.14) 0%,
    rgba(92, 112, 142, 0.04) 60%,
    rgba(92, 112, 142, 0) 100%
  );
}

/* ==========================================================================
   第 4 层：无硬框“冬雾融景”二维码浮层
   ========================================================================== */

.mist-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  /* 不盖生硬深灰遮罩，而是让全屏温柔浸入微暖晨雪薄雾中 */
  background:
    radial-gradient(
      circle at 50% 46%,
      rgba(255, 254, 251, 0.97) 0%,
      rgba(249, 250, 253, 0.93) 38%,
      rgba(240, 245, 251, 0.88) 100%
    );
}

.mist-modal[hidden] {
  display: none;
}

.mist-modal-content {
  position: relative;
  width: 100%;
  max-width: 340px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mist-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-strong);
}

.mist-modal-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* 二维码由大范围柔和径向白光晕轻托，无实线硬边框、无阴影盒子 */
.qr-halo-wrap {
  position: relative;
  margin: 22px 0 18px;
  padding: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-halo-wrap::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 254, 251, 0.86) 56%,
    rgba(255, 254, 251, 0) 100%
  );
}

.qr-image {
  display: block;
  width: 192px;
  height: 192px;
  object-fit: contain;
  border-radius: 6px;
}

.qr-image[hidden] {
  display: none;
}

.qr-placeholder {
  margin: 0;
  width: 200px;
  padding: 36px 8px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.mist-modal-number-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
}

.mist-modal-label {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.mist-modal-qq {
  font-size: 14.5px;
  color: var(--ink-strong);
}

.mist-modal-footer-actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.text-dismiss-btn {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--ease-quiet);
}

.text-dismiss-btn:hover {
  color: var(--ink-strong);
}

/* ==========================================================================
   多端响应与窄屏冬景自然过渡
   ========================================================================== */

@media (max-width: 1080px) and (min-width: 901px) {
  .group-line-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* 手机竖屏 / 平板窄窗 (< 900px)：两侧人物退场，冬日天光雪坡与稀疏微雪保留 */
@media (max-width: 900px) {
  .bg-side {
    display: none;
  }

  .page-shell {
    max-width: 580px;
    padding: 36px 22px 60px;
  }

  .page-shell::before {
    inset: -16px -36px -28px -36px;
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 28px 18px 52px;
  }

  .site-title {
    font-size: 22px;
  }

  .badge-marquee {
    margin-bottom: 18px;
  }

  .badge-marquee-group {
    gap: 20px;
    padding-right: 20px;
  }

  .badge-emblem {
    width: 36px;
    height: 36px;
  }

  .badge-name {
    font-size: 11.5px;
  }

  .category-tabs {
    gap: 14px 18px;
  }

  .group-line-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
