/* ==========================================================
   MAGNTE://SITE-CSS
   磁感污链 共享层
   ========================================================== */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--paper);
  background-color: var(--bg-ink);
  background-image:
    radial-gradient(ellipse 80% 45% at 85% -10%, rgba(177, 75, 255, 0.13), transparent 60%),
    radial-gradient(ellipse 55% 40% at 5% 108%, rgba(41, 197, 255, 0.09), transparent 55%);
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(41, 197, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 197, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  transform: skewX(-6deg) scale(1.15);
}

/* ---------- 变量 ---------- */
:root {
  --bg-ink: #0B0E14;
  --paper: #F2E6C9;
  --purple: #B14BFF;
  --blue: #29C5FF;
  --pink: #FF2E88;
  --gray: #4A4E59;
  --panel: #161B26;
  --yellow: #FFD166;
  --dark-red: #7A2A2A;

  --font-head: 'Space Grotesk', 'Noto Serif SC', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  --max-width: 1280px;
  --radius: 2px;
}

/* ---------- 基础排版 ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-head);
  color: var(--paper);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 1.25rem; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

a {
  color: var(--purple);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue);
}

::selection {
  background: var(--pink);
  color: var(--bg-ink);
}

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
}

main,
#main-content {
  flex: 1 0 auto;
  width: 100%;
}

#main-content {
  scroll-margin-top: 6rem;
}

/* ---------- 通用宽度容器 ---------- */
.header-frame,
.footer-frame,
.page-wrap,
.container {
  width: min(var(--max-width), calc(100% - clamp(1rem, 5vw, 3rem)));
  margin-inline: auto;
}

.page-wrap {
  padding-block: clamp(1.75rem, 5vw, 3.5rem);
}

/* ---------- 跳过链接与滚动进度 ---------- */
.skip-link {
  position: fixed;
  top: -100%;
  left: 0.75rem;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bg-ink);
  background: var(--yellow);
  border: 1px solid var(--paper);
  border-radius: 2px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0.75rem;
  transform: rotate(-1.5deg);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 200;
  pointer-events: none;
  background: linear-gradient(90deg, var(--purple), var(--blue), var(--pink));
  transform: scaleX(0);
  transform-origin: left top;
}

/* ---------- 头部命令栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  flex: none;
  background: rgba(11, 14, 20, 0.96);
  border-bottom: 1px solid var(--gray);
}

.header-status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(242, 230, 201, 0.45);
  border-bottom: 1px dashed rgba(74, 78, 89, 0.45);
}

.header-status::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: clamp(3.5rem, 14vw, 9rem);
  height: 2px;
  opacity: 0.8;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--purple) 45%, var(--pink));
}

.adult-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0.06em 0.5em;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: linear-gradient(135deg, var(--dark-red), rgba(122, 42, 42, 0.55));
  border: 1px solid var(--pink);
  border-radius: 1px;
}

.status-lead {
  display: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-lead::after {
  content: "_";
  margin-left: 0.35em;
  color: var(--pink);
  animation: cursor-blink 1.1s step-end infinite;
}

.status-sync {
  display: none;
  align-items: center;
  gap: 0.4em;
  margin-left: auto;
  color: rgba(41, 197, 255, 0.85);
}

.status-sync-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px rgba(41, 197, 255, 0.8);
  animation: sync-pulse 2.6s ease-in-out infinite;
}

@media (min-width: 720px) {
  .status-lead {
    display: inline;
  }

  .status-sync {
    display: inline-flex;
  }
}

.header-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
  color: var(--paper);
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--purple);
  text-shadow: 0 0 12px rgba(177, 75, 255, 0.8);
  transition: color 0.2s ease;
}

.brand:hover .brand-mark,
.brand:hover .brand-name {
  color: var(--pink);
}

.brand-code {
  margin-left: 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--blue);
  opacity: 0.85;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--gray);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-toggle:hover {
  color: var(--purple);
  border-color: var(--purple);
}

.nav-toggle-box {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle-line {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-toggle-label {
  font-size: 0.7rem;
}

.site-nav {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: -0.5rem;
  right: -0.5rem;
  padding: 0.5rem 0.6rem 0.85rem;
  background: rgba(11, 14, 20, 0.98);
  border: 1px solid var(--gray);
  border-radius: 2px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.5);
}

.site-nav[data-open="true"] {
  display: block;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-left: 0;
  list-style: none;
}

.nav-item {
  min-width: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.55rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: rgba(242, 230, 201, 0.78);
  text-decoration: none;
  border-radius: 2px;
  border-bottom: 1px dashed rgba(74, 78, 89, 0.35);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  color: var(--paper);
  background: rgba(177, 75, 255, 0.09);
}

.nav-link[aria-current="page"] {
  color: var(--paper);
  font-weight: 700;
  background: linear-gradient(135deg, rgba(177, 75, 255, 0.16), rgba(41, 197, 255, 0.06));
  border-color: var(--purple);
}

.nav-link[aria-current="page"]::before {
  content: "▸";
  margin-right: 0.35em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--pink);
}

@media (min-width: 900px) {
  .site-nav {
    display: block;
    position: static;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 0.15rem;
  }

  .nav-link {
    justify-content: flex-start;
    padding: 0.5rem 0.8rem;
    border: 1px solid transparent;
  }

  .nav-link:hover {
    border-color: rgba(177, 75, 255, 0.45);
  }

  .nav-toggle {
    display: none;
  }
}

@media (max-width: 420px) {
  .brand-code {
    display: none;
  }

  .brand {
    font-size: 1.05rem;
  }
}

/* ---------- 页脚索引终端 ---------- */
.site-footer {
  flex: none;
  margin-top: auto;
  background: rgba(11, 14, 20, 0.97);
  border-top: 1px solid var(--gray);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(242, 230, 201, 0.7);
}

.footer-frame {
  padding-block: clamp(2rem, 5vw, 3.5rem) 1.25rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.3fr 1fr;
  }
}

@media (min-width: 960px) {
  .footer-grid {
    grid-template-columns: 1.4fr 0.8fr 1.2fr;
    gap: clamp(2rem, 4vw, 3.5rem);
  }
}

.footer-cell {
  min-width: 0;
}

.footer-cell--brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand--footer {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.footer-trust {
  max-width: 36em;
  font-size: 0.78rem;
  line-height: 1.9;
  color: rgba(242, 230, 201, 0.66);
}

.footer-minor {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--pink);
}

.footer-title {
  margin-bottom: 1rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

.footer-list {
  display: grid;
  gap: 0.55rem;
  padding-left: 0;
  list-style: none;
}

.footer-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: rgba(242, 230, 201, 0.78);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-list a:hover {
  color: var(--purple);
  border-color: var(--purple);
}

.footer-list--meta li {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  gap: 0.6rem;
  padding-block: 0.4rem;
  border-bottom: 1px dotted rgba(74, 78, 89, 0.5);
}

.footer-list--meta {
  gap: 0;
}

.meta-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(242, 230, 201, 0.4);
}

.meta-value {
  color: rgba(242, 230, 201, 0.88);
  word-break: break-word;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(242, 230, 201, 0.5);
}

.copyright {
  margin: 0;
  letter-spacing: 0.04em;
}

.icp {
  margin: 0;
  letter-spacing: 0.08em;
}

.footer-magnetic {
  position: relative;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple) 20%, var(--blue) 45%, var(--pink) 70%, transparent);
  background-size: 250% 100%;
  animation: magnetic-flow 7s linear infinite;
  opacity: 0.75;
}

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-2 {
  grid-template-columns: 1fr;
}

.grid-cols-3 {
  grid-template-columns: 1fr;
}

.grid-cols-4 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--gray);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.btn--primary {
  color: var(--bg-ink);
  font-weight: 700;
  background: var(--purple);
  border-color: var(--purple);
}

.btn--primary:hover {
  color: var(--bg-ink);
  background: var(--blue);
  border-color: var(--blue);
}

.btn--ghost {
  border-color: var(--blue);
  color: var(--blue);
}

.btn--ghost:hover {
  color: var(--paper);
  background: rgba(41, 197, 255, 0.12);
}

.btn--danger {
  border-color: var(--pink);
  color: var(--pink);
}

.btn--danger:hover {
  color: var(--bg-ink);
  background: var(--pink);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--blue);
  background: rgba(41, 197, 255, 0.08);
  border: 1px solid rgba(41, 197, 255, 0.35);
  border-radius: 1px;
}

.tag--warning {
  color: var(--pink);
  background: rgba(255, 46, 136, 0.08);
  border-color: rgba(255, 46, 136, 0.4);
}

.tag--gold {
  color: var(--yellow);
  background: rgba(255, 209, 102, 0.08);
  border-color: rgba(255, 209, 102, 0.35);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0;
  list-style: none;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--gray);
}

.breadcrumb a {
  color: var(--blue);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-current {
  color: rgba(242, 230, 201, 0.7);
}

/* ---------- 框景与索引分区 ---------- */
.section-frame {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: rgba(22, 27, 38, 0.85);
  border: 1px solid var(--gray);
}

.section-frame[data-index]::before {
  content: attr(data-index);
  position: absolute;
  top: -0.7em;
  left: 1rem;
  padding: 0 0.45em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--blue);
  background: var(--bg-ink);
}

.section-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-bottom: 1.5rem;
}

.section-title-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--blue);
}

.index-list {
  padding-left: 0;
  list-style: none;
  border-top: 1px solid var(--gray);
}

.index-list li {
  border-bottom: 1px solid var(--gray);
}

.index-list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0.35rem;
  color: var(--paper);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.index-list a:hover {
  color: var(--purple);
  background: rgba(177, 75, 255, 0.06);
}

.index-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
}

/* ---------- 正文排版 ---------- */
.prose {
  max-width: 34em;
  font-size: 1rem;
  line-height: 1.9;
}

.prose p {
  margin-bottom: 1.1em;
}

/* ---------- 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--gray);
  aspect-ratio: 4 / 3;
}

.media-frame--wide {
  aspect-ratio: 16 / 9;
}

.media-frame--portrait {
  aspect-ratio: 3 / 4;
}

.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.06);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(177, 75, 255, 0.2), rgba(41, 197, 255, 0.07) 45%, rgba(255, 46, 136, 0.12));
  mix-blend-mode: screen;
}

.media-index {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1;
  padding: 0.1rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--bg-ink);
  background: var(--yellow);
  border-radius: 1px;
}

/* ---------- 主题筛选 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 1.75rem;
  background: rgba(22, 27, 38, 0.9);
  border: 1px solid var(--gray);
  border-left: 2px solid var(--purple);
}

.filter-btn {
  padding: 0.45rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(242, 230, 201, 0.65);
  background: transparent;
  border: 1px solid var(--gray);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-btn:hover {
  color: var(--paper);
  border-color: var(--blue);
}

.filter-btn[aria-pressed="true"] {
  color: var(--bg-ink);
  font-weight: 700;
  background: var(--blue);
  border-color: var(--blue);
}

.filter-item {
  min-width: 0;
}

/* ---------- 动效 ---------- */
@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes sync-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.75); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes magnetic-flow {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .skip-link {
    transition: none;
  }
}
