/* ============================================================
   资源包合集 · 极简黑白
   仅使用系统字体，无外部依赖
   ============================================================ */

:root {
  --ink: #0f0f0f;
  --ink-soft: #2e2e2e;
  --muted: #6f6f6f;
  --muted-2: #8c8c8c;
  --line: #e5e5e5;
  --line-strong: #0f0f0f;
  --bg: #ffffff;
  --bg-hover: #fafafa;
  --bg-chip: #f2f2f2;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --wrap: 1080px;
  --header-h: 60px;
  --ease: 180ms cubic-bezier(0.2, 0, 0, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* 背景由 body.bg-* 类控制，在编辑页「网站背景」里切换 */
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 网站背景（编辑页「网站背景」里切换） ---------------- */

body.bg-ink {
  /* 水墨：右上角墨晕 + 远山，页面滚动时自然移出 */
  background-image: url("ink.svg");
  background-repeat: no-repeat;
  background-position: right -60px top -80px;
  background-size: 1500px auto;
}

body.bg-warm {
  /* 暖阳：米色纸底 + 右上晨光 */
  background-color: #fffaf2;
  background-image: url("bg-warm.svg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
}

body.bg-mist {
  /* 远山：淡青灰层叠山影 */
  background-color: #f7faf9;
  background-image: url("bg-mist.svg?v=2");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
}

body.bg-paper {
  /* 素纸：米白底 + 细纤维纹，整页平铺 */
  background-color: #fbf8f2;
  background-image: url("bg-paper.svg");
  background-repeat: repeat;
  background-position: left top;
  background-size: 320px auto;
}

body.bg-grid {
  /* 细格：淡蓝灰方格，整页平铺 */
  background-color: #fbfcfd;
  background-image: url("bg-grid.svg");
  background-repeat: repeat;
  background-position: left top;
  background-size: 120px auto;
}

body.bg-custom {
  /* 自己上传的图：铺满视口，叠一层白纱保证字看得清 */
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  transition: top var(--ease);
}

.skip:focus {
  top: 12px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------------- 顶栏 ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(8px);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  background: var(--ink);
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--ink-soft);
}

.nav a {
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}

.nav a:hover::after,
.nav a:focus-visible::after {
  transform: scaleX(1);
}

.nav-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.nav-count b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------- 首屏 ---------------- */

.hero {
  padding: 76px 0 48px;
}

.hero h1 {
  margin: 18px 0 0;
  font-size: clamp(2rem, 5.4vw, 3.5rem);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.035em;
  max-width: 18em;
}

/* 首页介绍：一句短标题 + 一段话 */
.hero-intro {
  margin: 14px 0 0;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.lead {
  margin: 24px 0 0;
  max-width: 34em;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 540px;
  height: 56px;
  margin-top: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  transition: box-shadow var(--ease);
}

.search:focus-within {
  box-shadow: 0 0 0 3px rgba(15, 15, 15, 0.08);
}

.search-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
}

.search input::placeholder {
  color: var(--muted-2);
}

.search input:focus {
  outline: none;
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search kbd {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 1px 6px;
  background: var(--bg-hover);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.stats dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stats dd {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 滚动广告位 ---------------- */

.promo {
  position: relative;
  overflow: hidden;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.promo[hidden] {
  display: none;
}

.promo-track {
  display: flex;
  width: max-content;
  animation: promo-scroll var(--promo-duration, 24s) linear infinite;
  will-change: transform;
}

.promo:hover .promo-track,
.promo:focus-within .promo-track {
  animation-play-state: paused;
}

.promo-group {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding-right: 16px;
}

.promo-item {
  flex: none;
  display: block;
  height: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color var(--ease);
}

.promo-item img {
  display: block;
  width: auto;
  height: 100%;
  object-fit: cover;
}

a.promo-item:hover {
  border-color: var(--line-strong);
}

@keyframes promo-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    /* 内容放了两份，滚过一半正好首尾相接 */
    transform: translate3d(-50%, 0, 0);
  }
}

/* ---------------- 筛选栏 ---------------- */

.index {
  padding-top: 40px;
}

.filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.chip:hover {
  background: var(--bg-chip);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip sup {
  font-family: var(--mono);
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.6;
  vertical-align: super;
}

.result-count {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------------- 卡片网格 ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  margin-top: 32px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 208px;
  padding: 26px 26px 20px;
  background: var(--bg);
  transition: background var(--ease);
}

.card:hover {
  background: var(--bg-hover);
}

.card:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-idx {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}

.card-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 2px 8px;
  background: var(--bg);
}

.card h3 {
  margin: 20px 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card-desc {
  flex: 1;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--muted);
}

.card-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.card-keys li {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}

.card-keys li::before {
  content: "#";
  margin-right: 2px;
  color: #c4c4c4;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.card-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.card-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.card-open .arrow {
  transition: transform var(--ease);
}

.card:hover .card-open .arrow {
  transform: translateX(4px);
}

.card-open::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card-open:focus-visible {
  outline: none;
}

.empty {
  padding: 72px 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------------- 使用说明 ---------------- */

.notes {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  padding: 64px 0 72px;
}

.notes-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
}

.notes-head h2 {
  margin-top: 14px;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.notes-list li {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.notes-list li:first-child {
  padding-top: 0;
}

.note-idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  padding-top: 3px;
}

.notes-list h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.notes-list p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 46em;
}

/* ---------------- 微信 / 联系 ---------------- */

.contact {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding: 64px 0 72px;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 56px;
  align-items: center;
}

.contact-copy h2 {
  margin-top: 14px;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.contact-lead {
  margin-top: 12px;
  max-width: 34em;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--muted);
}

.wechat {
  display: flex;
  align-items: stretch;
  gap: 18px;
  border: 1px solid var(--ink);
  background: var(--bg);
  padding: 22px 24px;
}

.wechat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.wechat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.wechat-id {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  align-self: flex-start;
  max-width: 100%;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.01em;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}

.wechat-id:hover:not(:disabled) {
  border-color: var(--ink);
}

.wechat-id.is-empty {
  color: var(--muted-2);
  cursor: default;
}

.wechat-id.is-copied .wechat-hint {
  color: var(--ink);
}

.wechat-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-hint {
  flex: none;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

.wechat-note {
  font-size: 12.5px;
  color: var(--muted-2);
  line-height: 1.6;
}

.wechat-qr {
  flex: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.wechat-qr[hidden] {
  display: none;
}

.wechat-qr img {
  display: block;
  width: 104px;
  height: 104px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.wechat-qr figcaption {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}

@media (max-width: 860px) {
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .contact {
    padding: 48px 0 56px;
  }
}

/* ---------------- 页脚 ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 56px;
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  font-size: 15px;
  font-weight: 600;
}

.muted {
  font-size: 13px;
  color: var(--muted-2);
}

.footer-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-meta a {
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- 资源清单弹层 ---------------- */

.detail {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(680px, calc(100% - 32px));
  max-width: none;
  max-height: min(84vh, 780px);
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}

.detail::backdrop {
  background: rgba(10, 10, 10, 0.42);
}

.detail[open] {
  animation: sheet-in 200ms cubic-bezier(0.2, 0, 0, 1);
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.detail-head h2 {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.close-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}

.close-btn:hover {
  background: var(--bg-chip);
  border-color: var(--ink);
}

.close-btn svg {
  width: 12px;
  height: 12px;
}

.detail-desc {
  padding: 18px 28px 0;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--muted);
}

/* ---------------- 套餐速览滚动条 ---------------- */

.ticker {
  display: flex;
  align-items: stretch;
  margin: 16px 28px 0;
  border: 1px solid var(--line);
  background: var(--bg-hover);
  overflow: hidden;
}

.ticker[hidden] {
  display: none;
}

.ticker-label {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 11px;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.ticker-view {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 9px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 18px), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 26s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  flex: none;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.ticker-item + .ticker-item::before {
  content: "";
  flex: none;
  width: 3px;
  height: 3px;
  margin: 0 15px;
  background: #b9b9b9;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }

  .ticker-view {
    overflow-x: auto;
  }
}

.res-list {
  padding: 10px 28px 0;
}

.res {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.res-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.res-name {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}

.res-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted-2);
}

.res-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: #7a7a7a;
  white-space: nowrap;
}

.res-tag-disk {
  color: var(--ink);
  font-weight: 600;
}

.res-tag-date {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border: 1px solid var(--ink);
}

.res-tag-host {
  color: var(--ink);
}

.res-tag-host::before {
  content: "↗";
  margin-right: 3px;
  font-family: var(--sans);
}

.code-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px dashed #c9c9c9;
  padding: 0 0 1px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--ease), border-color var(--ease);
}

.code-chip:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.code-chip.is-copied {
  color: var(--ink);
  border-bottom-style: solid;
}

.res-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 1.2;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}

.res-link:hover {
  background: var(--ink);
  color: #fff;
}

.res-link .arrow {
  transition: transform var(--ease);
}

.res-link:hover .arrow {
  transform: translate(2px, -2px);
}

.res-pending {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #c2c2c2;
  white-space: nowrap;
}

/* 条目前的缩略图：可选，没传图就完全不显示 */
.res-thumb {
  flex: none;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-chip);
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color var(--ease);
}

.res-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.res-thumb:hover,
.res-thumb:focus-visible {
  border-color: var(--ink);
}

/* 点缩略图后的大图预览 */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 56px 20px 28px;
  border: 0;
  border-radius: 0;
  background: rgba(12, 12, 12, 0.9);
  overflow: hidden;
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lightbox::backdrop {
  background: rgba(10, 10, 10, 0.9);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-cap {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
}

.lightbox-close svg {
  width: 14px;
  height: 14px;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 760px) {
  .res {
    gap: 12px;
  }
  .res-thumb {
    width: 46px;
    height: 46px;
  }
}

.detail-foot {
  padding: 16px 28px 26px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted-2);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .notes-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 54px;
  }

  .header-inner {
    gap: 12px;
  }
  .brand {
    gap: 8px;
    font-size: 14px;
  }
  .nav {
    gap: 13px;
    font-size: 13px;
  }
  .nav-count {
    display: none;
  }
  .nav a.nav-login {
    padding: 3px 8px;
    font-size: 11px;
  }

  .hero {
    padding: 44px 0 36px;
  }
  .hero h1 {
    font-size: 23px;
    line-height: 1.35;
    letter-spacing: -0.02em;
  }
  .hero-intro {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.7;
  }
  .search {
    margin-top: 24px;
  }

  body {
    font-size: 15px;
    background-position: right -120px top 0;
    background-size: 900px auto;
  }

  .hero {
    padding: 56px 0 40px;
  }

  .lead {
    font-size: 15px;
  }

  .search {
    height: 50px;
    margin-top: 28px;
  }

  .search kbd {
    display: none;
  }

  .promo {
    padding: 12px 0;
  }

  .promo-group {
    gap: 10px;
    padding-right: 10px;
  }

  .promo-item {
    height: 120px;
  }

  .index {
    padding-top: 24px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 0 -24px;
    padding: 10px 24px;
  }

  .chips {
    width: 100%;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
  }

  .card {
    min-height: 0;
    padding: 16px 14px 12px;
  }

  .card-idx {
    font-size: 10.5px;
  }

  .card-tag {
    max-width: 62%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 9.5px;
    padding: 1px 5px;
  }

  .card h3 {
    margin: 12px 0 6px;
    font-size: 16px;
    line-height: 1.35;
  }

  .card-keys {
    gap: 6px;
    margin-top: 6px;
  }

  .card-keys li {
    font-size: 10px;
  }

  .card-foot {
    gap: 8px;
    padding-top: 12px;
  }

  .card-count {
    font-size: 10.5px;
  }

  .card-open {
    gap: 3px;
    font-size: 12px;
  }

  .notes {
    margin-top: 64px;
    padding: 48px 0 56px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .footer-meta {
    text-align: left;
  }

  .detail {
    inset: auto 0 0 0;
    margin: 0;
    width: 100%;
    max-height: 88vh;
    border-width: 1px 0 0;
  }

  .detail-head {
    padding: 20px 20px 14px;
  }

  .detail-head h2 {
    font-size: 20px;
  }

  .detail-desc,
  .res-list,
  .detail-foot {
    padding-left: 20px;
    padding-right: 20px;
  }

  .res {
    align-items: flex-start;
  }

}

@media (max-width: 420px) {
  .nav {
    gap: 11px;
    font-size: 12.5px;
  }
  .brand {
    font-size: 13.5px;
  }

  .nav-count {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  /* 关掉动效时，广告位改成可以手动横向滑动 */
  .promo {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .promo::-webkit-scrollbar {
    display: none;
  }

  .promo-track {
    animation: none;
  }
}

/* 打赏码：与微信码并排，手机上折到下方 */
@media (max-width: 760px) {
  .wechat {
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
  }

  .wechat-body {
    flex: 1 0 100%;
  }

  .wechat-qr {
    flex: 1 1 0;
    min-width: 0;
  }

  .wechat-qr img {
    width: 100%;
    max-width: 132px;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

/* 页头登录入口 */
.nav a.nav-login {
  padding: 4px 10px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.nav a.nav-login::after {
  display: none;
}
.nav a.nav-login:hover,
.nav a.nav-login:focus-visible {
  border-color: var(--ink);
  color: var(--ink);
}
