/* ==========================================================================
   VeiHub 软件集 · 苹果柔光玻璃风格
   ========================================================================== */

:root {
  --text: #14161c;
  --text-2: #5d6270;
  --text-3: #8b90a0;

  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-soft: rgba(255, 255, 255, 0.38);
  --stroke: rgba(255, 255, 255, 0.72);
  --stroke-soft: rgba(255, 255, 255, 0.5);
  /* 边界：玻璃容器外缘的暗描边 + 内部分隔线，避免边框过浅糊成一片 */
  --edge: rgba(84, 98, 136, 0.2);
  --line: rgba(84, 98, 136, 0.26);
  --line-soft: rgba(84, 98, 136, 0.17);

  --accent: #0a7cff;
  --accent-soft: rgba(10, 124, 255, 0.12);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-sm: 0 4px 14px rgba(24, 32, 66, 0.07);
  --shadow-md: 0 14px 38px rgba(24, 32, 66, 0.12);
  --shadow-lg: 0 40px 90px rgba(16, 22, 58, 0.28);

  --blur: blur(28px) saturate(180%);
  --ease: cubic-bezier(0.22, 0.85, 0.25, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC",
    "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Segoe UI",
    system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.72;
  color: var(--text);
  background: #eef1f8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; color: inherit; }

::selection { background: rgba(10, 124, 255, 0.2); }

/* ---------------------------------------------------------------- 背景光晕 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #f4f6fc 0%, #e9edf8 45%, #f7f1fb 100%);
}

.aurora .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.62;
}

.blob-1 {
  width: 640px; height: 640px; left: -180px; top: -240px;
  background: radial-gradient(circle at 35% 35%, #86bdff, #4f86ff 48%, transparent 72%);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.blob-2 {
  width: 720px; height: 720px; right: -240px; top: -180px;
  background: radial-gradient(circle at 60% 40%, #ffb0d3, #b98cff 52%, transparent 74%);
  animation: drift-b 32s var(--ease) infinite alternate;
}
.blob-3 {
  width: 600px; height: 600px; left: 32%; bottom: -300px;
  background: radial-gradient(circle at 50% 50%, #93f0d6, #57c9ff 55%, transparent 76%);
  animation: drift-c 28s var(--ease) infinite alternate;
}

.aurora .grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

@keyframes drift-a { to { transform: translate3d(80px, 60px, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-90px, 80px, 0) scale(1.12); } }
@keyframes drift-c { to { transform: translate3d(60px, -70px, 0) scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  .aurora .blob { animation: none; }
}

/* ------------------------------------------------------------------ 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px clamp(16px, 4vw, 40px) 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(145deg, #4f9bff, #0a7cff 55%, #6f5bff);
  box-shadow: 0 6px 18px rgba(10, 124, 255, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: 0.2px; }
.brand-text small { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.4px; }

/* 详情页顶栏：分页切换紧贴品牌左侧，下载 / 开源入口靠右
   外观与游戏的 .seg 分段控件一致：整块圆角容器 + 实心蓝底选中项 */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  /* 4px 内边距由分段容器提供，用等量负外边距抵消，避免把顶栏撑高、位置偏移 */
  padding: 4px;
  margin: -4px auto -4px -4px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.topbar-nav .nav-item {
  width: auto;
  flex: none;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
}

.topbar-nav .nav-item:hover { color: var(--text); background: var(--accent-soft); }

.topbar-nav .nav-item.is-active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(10, 124, 255, 0.28);
}

.topbar-nav .nav-item.is-active .nav-count { color: rgba(255, 255, 255, 0.86); }

.topbar-links { display: flex; align-items: center; gap: 8px; }
.topbar-links .side-link { padding: 7px 12px; font-size: 13px; }

/* ------------------------------------------------------------------ 视图 */
.view {
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px) 40px;
  max-width: 1320px;
  margin: 0 auto;
}

.view-head { margin-bottom: 28px; }

.view-tagline {
  margin: 0;
  font-size: clamp(23px, 2.9vw, 31px);
  font-weight: 650;
  letter-spacing: 4px;
  line-height: 1.25;
  color: var(--text);
}

.view-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--glass-soft);
  border: 1px solid var(--stroke-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

/* ------------------------------------------------- 首页搜索与分类筛选 */
.home-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: -8px 0 26px;
}

.home-search {
  position: relative;
  display: block;
  flex: 1 1 260px;
  max-width: 420px;
}

.home-search .doc-search-icon {
  left: 14px;
  width: 15px;
  height: 15px;
}

.home-search-input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  outline: none;
  transition: all 0.22s var(--ease);
}

.home-search-input::placeholder { color: var(--text-3); }

.home-search-input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(10, 124, 255, 0.45);
  box-shadow: 0 4px 14px rgba(10, 124, 255, 0.16);
}

.home-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass-soft);
  border: 1px solid var(--stroke-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--edge);
}

.chip {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s var(--ease);
}

.chip:hover { color: var(--text); background: rgba(255, 255, 255, 0.6); }

.chip:focus-visible {
  outline: 2px solid rgba(10, 124, 255, 0.45);
  outline-offset: 2px;
}

.chip.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(24, 32, 66, 0.1);
}

@media (max-width: 560px) {
  .home-toolbar { margin-top: 0; }
  .home-search { flex-basis: 100%; max-width: none; }
}

/* ------------------------------------------------------------- 卡片墙 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease),
    border-color 0.45s var(--ease);
  animation: card-in 0.6s var(--ease) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.card:hover,
.card:focus-visible {
  transform: translateY(-7px);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 30px 66px rgba(24, 32, 66, 0.2), 0 0 0 1px rgba(84, 98, 136, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  outline: none;
}

.card-cover {
  position: relative;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  /* 彩色玻璃打底 */
  background:
    radial-gradient(120% 130% at 10% -10%, rgba(122, 174, 255, 0.62), transparent 58%),
    radial-gradient(120% 130% at 94% 6%, rgba(206, 156, 255, 0.55), transparent 60%),
    radial-gradient(140% 140% at 52% 118%, rgba(110, 226, 206, 0.5), transparent 62%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.22));
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

/* 有预览图：预览图模糊后作为占位符的底层背景，
   占位符（彩色渐变 + 首字母 + 名称）始终叠在上层 */
.cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: blur(7px) saturate(1.15) brightness(1.02);
  transform: scale(1.08); /* 放大以遮住模糊产生的透明边缘 */
  opacity: 0.75;
  pointer-events: none;
}

.card:hover .cover-photo {
  transform: scale(1.12);
  transition: transform 0.7s var(--ease);
}

/* 无截图时按文件夹名生成的文字封面 */
.card-cover-text {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  color: #fff;
  transition: transform 0.7s var(--ease), box-shadow 0.5s var(--ease);
}

.card-cover-text::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 20% 12%, rgba(255, 255, 255, 0.4), transparent 62%);
}

.card:hover .card-cover-text {
  transform: scale(1.03);
}

.card-cover-text.tone-0 { background: linear-gradient(135deg, #6fa8ff, #4f6bff 52%, #8a7bff); }
.card-cover-text.tone-1 { background: linear-gradient(135deg, #a78bfa, #c77dff 50%, #ff8fc7); }
.card-cover-text.tone-2 { background: linear-gradient(135deg, #57c9ff, #3f8cff 55%, #5f7bff); }
.card-cover-text.tone-3 { background: linear-gradient(135deg, #ff9f7a, #ff7aa8 55%, #c47bff); }
.card-cover-text.tone-4 { background: linear-gradient(135deg, #4fd6b0, #35b7d6 55%, #4f86ff); }
.card-cover-text.tone-game { background: linear-gradient(135deg, #ff9d72, #f2542d 52%, #d62246); }

/* 游戏卡片：<a> 直达游戏页面 */
a.card { color: inherit; text-decoration: none; }

.card-game .card-ver {
  color: #d8422f;
  background: rgba(216, 66, 47, 0.12);
}

.cover-mark {
  position: absolute;
  right: 6%;
  bottom: -20%;
  font-size: 168px;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.16);
  pointer-events: none;
  user-select: none;
}

.cover-name {
  position: relative;
  z-index: 1;
  padding: 0 22px;
  font-size: clamp(19px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  word-break: break-word;
  text-shadow: 0 2px 12px rgba(20, 26, 60, 0.22);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 22px;
}

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

.card-name {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.card-ver {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: #0a7cff;
  background: var(--accent-soft);
}

.card-summary {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.72;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  letter-spacing: 0.2px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-soft);
}

/* ------------------------------------------------------------- 更新历史 */
.timeline { display: flex; flex-direction: column; gap: 16px; }

.tl-item {
  position: relative;
  padding: 22px 26px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: card-in 0.5s var(--ease) both;
}

.tl-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.app-chip {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  color: #fff;
  background: linear-gradient(135deg, #4f9bff, #6f5bff);
  box-shadow: 0 3px 10px rgba(79, 155, 255, 0.35);
  cursor: pointer;
}

.tl-ver {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tl-date {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ 空态 */
.empty {
  padding: 64px 28px;
  text-align: center;
  border-radius: var(--radius-xl);
  background: var(--glass-soft);
  border: 1px dashed var(--line);
  color: var(--text-2);
}

.empty strong { display: block; margin-bottom: 8px; font-size: 16px; color: var(--text); }
.empty code {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  background: rgba(120, 130, 160, 0.17);
}

/* ========================================================== 软件详情页壳 */
.app-view {
  /* 与首页一致的居中版心，避免整页铺满后内容贴左显得头重脚轻 */
  max-width: 1280px;
  padding-top: clamp(18px, 3vw, 30px);
  padding-bottom: clamp(18px, 3vw, 30px);
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100vh - 132px);
  min-height: 420px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(252, 253, 255, 0.84);
  backdrop-filter: blur(44px) saturate(180%);
  -webkit-backdrop-filter: blur(44px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--edge);
}

/* 有手册时左侧让出一列给目录树 */
.app-shell.has-side { grid-template-columns: 262px 1fr; }

/* 详情页各 Tab 面板：同一页内切换，仅显示其一 */
.panel[hidden] { display: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(24px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: calc(100vh - 116px);
  }
  /* .has-side 与 .app-shell 同处窄屏时也要收成单列 */
  .app-shell.has-side { grid-template-columns: 1fr; }
  /* 窄屏放不下时让分页切换横向滚动，避免撑破顶栏 */
  .topbar-nav { overflow-x: auto; }
  .topbar-links .side-link { padding: 8px; }
  .topbar-links .side-link span { display: none; }
}

/* 侧栏：只承载手册目录树，且仅在「手册」分页显示 */
.sheet-side[hidden] { display: none; }

.sheet-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 16px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.34);
  border-right: 1px solid var(--line);
}

@media (max-width: 860px) {
  .sheet-side {
    padding: 12px 14px 6px;
    max-height: 40vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 13.6px;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.7); color: var(--text); }

.nav-item.is-active {
  color: #0a7cff;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(24, 32, 66, 0.1), 0 0 0 1px rgba(10, 124, 255, 0.28);
  font-weight: 550;
}

.nav-item .nav-count,
.nav-group-head .nav-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.nav-item.is-active .nav-count { color: #0a7cff; }

.side-group-label {
  padding: 16px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-3);
}

/* 手册目录树：文件夹为父节点，层级由 --depth 控制缩进 */
.nav-sub {
  padding-left: calc(22px + var(--depth, 0) * 13px);
  font-size: 13.2px;
  white-space: normal;
  line-height: 1.45;
}

.nav-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  padding-left: calc(22px + var(--depth, 0) * 13px);
  border-radius: var(--radius-sm);
  font-size: 13.4px;
  font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  transition: all 0.2s var(--ease);
}

.nav-group-head::-webkit-details-marker { display: none; }
.nav-group-head:hover { background: rgba(255, 255, 255, 0.7); color: var(--text); }

.nav-group-head::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  margin-right: 1px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  opacity: 0.5;
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}

.nav-group[open] > .nav-group-head::before { transform: rotate(45deg); }

.nav-group-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-sub[hidden],
.nav-group[hidden],
.doc-search-empty[hidden] { display: none; }

/* 手册搜索框 */
.doc-search {
  position: relative;
  display: block;
  /* 用 margin 而非 padding，保证图标以输入框为基准垂直居中 */
  margin: 0 10px 6px;
}

.doc-search-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.doc-search-input {
  width: 100%;
  padding: 8px 10px 8px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 2px 8px rgba(24, 32, 66, 0.06);
  outline: none;
  transition: all 0.22s var(--ease);
}

.doc-search-input::placeholder { color: var(--text-3); }

.doc-search-input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(10, 124, 255, 0.45);
  box-shadow: 0 4px 14px rgba(10, 124, 255, 0.16);
}

.doc-search-empty {
  padding: 8px 12px;
  font-size: 12.6px;
  color: var(--text-3);
}

/* 下载 / 开源入口（详情页顶栏右侧） */
.side-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.4px;
  color: var(--text-2);
  white-space: nowrap;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(24, 32, 66, 0.06);
  transition: all 0.22s var(--ease);
}

a.side-link:hover {
  color: #0a7cff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 16px rgba(24, 32, 66, 0.13);
  transform: translateY(-1px);
}

.side-link.is-empty {
  color: var(--text-3);
  cursor: default;
  background: rgba(255, 255, 255, 0.34);
  border-style: dashed;
  border-color: var(--line);
  box-shadow: none;
}

.side-link svg { width: 16px; height: 16px; flex: none; }

/* 主区 */
.sheet-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.sheet-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.sheet-top h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.sheet-top .crumb { font-size: 12.5px; color: var(--text-3); }

.sheet-top .sheet-ver {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  margin-left: auto;
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.icon-btn:hover {
  background: #fff;
  color: #e5484d;
  transform: rotate(90deg);
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px clamp(20px, 3vw, 40px) 56px;
}

/* ------------------------------------------------ 截图画廊（瀑布流） */
.shots {
  column-width: 330px;
  column-gap: 18px;
}

.shot {
  display: block;
  margin: 0 0 18px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--edge);
  cursor: zoom-in;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.shot:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.shot img {
  width: 100%;
  height: auto;
  background: rgba(120, 130, 160, 0.12);
}

.shot figcaption {
  padding: 11px 14px 13px;
  font-size: 13px;
  color: var(--text-2);
  border-top: 1px solid var(--line-soft);
}

/* ---------------------------------------------------------- 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vh, 48px) clamp(16px, 5vw, 72px);
  background: rgba(10, 13, 28, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fade-in 0.25s var(--ease);
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
  animation: sheet-in 0.35s var(--ease);
}

.lb-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
}

.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s var(--ease);
}

.lb-btn:hover { background: rgba(255, 255, 255, 0.28); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-close { top: 18px; right: 18px; transform: none; }

/* ------------------------------------------------------------ 点击涟漪 */
.ripple {
  position: fixed;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 120;
  /* 波峰：细窄亮环 + 内外柔和过渡 */
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0) 58%,
    rgba(170, 208, 255, 0.45) 67%,
    rgba(255, 255, 255, 0.9) 70.5%,
    rgba(170, 208, 255, 0) 78%);
  will-change: transform, opacity;
  animation: ripple-out 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

/* 波尾：内侧更淡的一圈，跟波峰同速扩散，形成水波层次 */
.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(190, 220, 255, 0) 34%,
    rgba(190, 220, 255, 0.4) 48%,
    rgba(190, 220, 255, 0) 60%);
  animation: ripple-fade 0.9s var(--ease) forwards;
}

@keyframes ripple-out {
  0% { opacity: 0.92; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(20); }
}

@keyframes ripple-fade {
  0% { opacity: 0; }
  14% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* ==================================================== Markdown 排版 */
.doc-body { max-width: 78ch; font-size: 14.6px; }

.doc-body > *:first-child { margin-top: 0; }

.md-h {
  margin: 1.9em 0 0.7em;
  font-weight: 650;
  letter-spacing: -0.2px;
  line-height: 1.35;
  scroll-margin-top: 20px;
}

.md-h1 { margin-top: 0; font-size: 25px; }
.md-h2 {
  font-size: 19px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.md-h3 { font-size: 16.5px; }
.md-h4, .md-h5, .md-h6 { font-size: 15px; color: var(--text-2); }

.md-p { margin: 0.85em 0; }

.doc-body strong { font-weight: 650; }

.doc-body ul.md-list,
.doc-body ol.md-list {
  margin: 0.7em 0;
  padding-left: 1.35em;
}

.md-list li { margin: 0.32em 0; }
.md-list li::marker { color: #9aa2b8; }
.doc-body .md-list .md-list { margin: 0.3em 0; }

.md-quote {
  margin: 1em 0;
  padding: 12px 18px;
  border-left: 3px solid rgba(10, 124, 255, 0.5);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-2);
}

.md-hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.doc-body code {
  padding: 0.15em 0.42em;
  border-radius: 6px;
  font-family: "SF Mono", "JetBrains Mono", Consolas, "Cascadia Mono", monospace;
  font-size: 0.88em;
  color: #b1308c;
  background: rgba(120, 130, 160, 0.17);
}

.md-pre {
  margin: 1.1em 0;
  padding: 18px 20px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: rgba(22, 26, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.md-pre code {
  padding: 0;
  background: none;
  color: #d7e2f7;
  font-family: "SF Mono", "JetBrains Mono", Consolas, "Cascadia Mono", monospace;
  font-size: 12.6px;
  line-height: 1.62;
  white-space: pre;
}

.md-table-wrap {
  margin: 1.1em 0;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.6px;
}

.md-table th,
.md-table td {
  padding: 9px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.md-table th {
  font-weight: 600;
  color: var(--text-2);
  background: rgba(120, 130, 160, 0.13);
  white-space: nowrap;
}

.md-table tbody tr:last-child td { border-bottom: 0; }
.md-table tbody tr:hover { background: rgba(255, 255, 255, 0.6); }

.md-img {
  display: block;
  margin: 1.1em 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.md-img-ext {
  display: inline-block;
  margin: 0.3em 0.4em 0.3em 0;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  vertical-align: middle;
}

.md-img-broken { display: none !important; }

/* 详情内小屏微调 */
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .doc-body { font-size: 14px; }
  .brand-text small { display: none; }
  .seg-btn { padding: 7px 14px; }
}