:root {
  color-scheme: light;
  --bg: #f3f8ff;
  --bg-soft: #e8f2ff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --text: #17243f;
  --muted: #667596;
  --line: rgba(68, 112, 176, 0.2);
  --accent: #00a7ff;
  --accent-strong: #6c7cff;
  --signal: #19d5bd;
  --warm: #f59e42;
  --shadow: 0 22px 60px rgba(55, 91, 145, 0.16);
  --font-sans: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", sans-serif;
  --font-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(243, 248, 255, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(0, 167, 255, 0.055) 78px 79px),
    repeating-linear-gradient(0deg, transparent 0 78px, rgba(108, 124, 255, 0.045) 78px 79px),
    linear-gradient(135deg, #f8fbff 0%, #eaf5ff 48%, #f5f0ff 100%);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.78;
  text-rendering: geometricPrecision;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(0, 167, 255, 0.08) 38% 38.4%, transparent 38.4% 100%),
    linear-gradient(64deg, transparent 0 58%, rgba(25, 213, 189, 0.075) 58% 58.4%, transparent 58.4% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(232, 242, 255, 0.64));
}

body::after {
  position: fixed;
  top: 128px;
  right: max(18px, calc((100vw - 1120px) / 2));
  z-index: -1;
  width: min(34vw, 390px);
  height: 250px;
  border: 1px solid rgba(0, 167, 255, 0.2);
  border-radius: 8px;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(232, 242, 255, 0.28)),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(0, 167, 255, 0.08) 22px 23px),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(108, 124, 255, 0.06) 22px 23px);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, 90% 0, 100% 18%, 100% 100%, 10% 100%, 0 82%);
}

a {
  color: inherit;
  text-decoration-color: rgba(0, 167, 255, 0.48);
  text-underline-offset: 0.24em;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 255, 0.74);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 900;
  text-decoration: none;
}

.brand::before {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 167, 255, 0.6);
  border-radius: 4px;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 242, 255, 0.4)),
    linear-gradient(135deg, var(--accent), var(--signal));
  box-shadow: 0 0 0 4px rgba(0, 167, 255, 0.08), 0 0 24px rgba(0, 167, 255, 0.28);
  transform: rotate(45deg);
}

.nav {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 32px rgba(55, 91, 145, 0.1);
  font-size: 0.92rem;
}

.nav a {
  min-width: 56px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}

.nav a[aria-current="page"],
.nav a:hover {
  background: linear-gradient(135deg, rgba(0, 167, 255, 0.15), rgba(25, 213, 189, 0.16));
  color: var(--text);
}

.hero {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  min-height: 570px;
  margin: 0 auto;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(42vw, 450px);
  height: 280px;
  border: 1px solid rgba(0, 167, 255, 0.24);
  border-radius: 8px;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(232, 242, 255, 0.6)),
    repeating-linear-gradient(90deg, transparent 0 36px, rgba(0, 167, 255, 0.11) 36px 38px),
    repeating-linear-gradient(0deg, transparent 0 36px, rgba(108, 124, 255, 0.08) 36px 38px);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, 86% 0, 100% 22%, 100% 100%, 14% 100%, 0 76%);
}

.hero::after {
  position: absolute;
  right: min(7vw, 86px);
  bottom: 104px;
  width: 280px;
  height: 128px;
  border: 1px solid rgba(25, 213, 189, 0.34);
  border-radius: 8px;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 167, 255, 0.22) 0 22%, transparent 22% 28%, rgba(108, 124, 255, 0.2) 28% 52%, transparent 52% 59%, rgba(25, 213, 189, 0.22) 59% 100%),
    repeating-linear-gradient(0deg, transparent 0 14px, rgba(23, 36, 63, 0.08) 14px 15px),
    rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 20px 46px rgba(0, 167, 255, 0.14);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 66px 0;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 5px 10px;
  border: 1px solid rgba(0, 167, 255, 0.26);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.66);
  color: #087cbd;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  font-weight: 900;
}

h1 {
  max-width: 890px;
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(2.45rem, 6vw, 5.45rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero h1 {
  background: linear-gradient(100deg, #17243f 0%, #006fc5 42%, #5d6dff 72%, #128d7b 100%);
  background-clip: text;
  color: transparent;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.9rem;
  line-height: 1.22;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.lead {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.13rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(55, 91, 145, 0.12);
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 167, 255, 0.22);
}

.section,
.page,
.article {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 72px 0;
}

.section-heading {
  margin-bottom: 26px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  min-height: 184px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(232, 242, 255, 0.68)),
    linear-gradient(135deg, rgba(0, 167, 255, 0.1), rgba(108, 124, 255, 0.1));
  box-shadow: var(--shadow);
}

.card:nth-child(2) {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(235, 255, 251, 0.66)),
    linear-gradient(135deg, rgba(25, 213, 189, 0.13), rgba(0, 167, 255, 0.1));
}

.card:nth-child(3) {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(246, 240, 255, 0.66)),
    linear-gradient(135deg, rgba(108, 124, 255, 0.12), rgba(245, 158, 66, 0.1));
}

.card p,
.post-item p,
.content li {
  color: var(--muted);
}

.page {
  padding: 82px 0 104px;
}

.page-header {
  max-width: 800px;
  margin-bottom: 52px;
}

.post-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.post-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 30px;
  border-bottom: 1px solid var(--line);
}

.post-item:last-child {
  border-bottom: 0;
}

.post-item:hover {
  background: rgba(232, 242, 255, 0.5);
}

.post-item:hover h2 a {
  color: #006fc5;
}

.post-item time {
  color: var(--muted);
  font-size: 0.95rem;
}

.post-item h2 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.post-meta {
  margin-bottom: 6px;
  color: #087cbd;
  font-size: 0.82rem;
  font-weight: 900;
}

.post-meta a {
  color: inherit;
  text-decoration: none;
}

.post-stats,
.article-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.post-stats span,
.article-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(0, 167, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.article-stats {
  margin: 18px 0 30px;
}

.article-stats span {
  min-height: 30px;
  padding: 0 11px;
}

.post-item a {
  text-decoration: none;
}

.content {
  max-width: 760px;
}

.article {
  max-width: 820px;
  padding: 82px 0 108px;
}

.article h1 {
  font-size: clamp(2.2rem, 5vw, 4.25rem);
}

.article h2 {
  margin-top: 48px;
}

.article p,
.article li {
  color: #334260;
  font-size: 1.03rem;
}

.article p {
  margin-bottom: 18px;
}

.article .lead {
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 1.16rem;
}

.article mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.site-footer {
  min-height: 92px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.activity-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(232, 242, 255, 0.62)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(0, 167, 255, 0.04) 42px 43px);
  box-shadow: var(--shadow);
}

.activity-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.activity-cell {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(68, 112, 176, 0.12);
  border-radius: 3px;
  background: #d8e1ef;
}

.activity-cell.level-1 {
  background: #9be9c7;
}

.activity-cell.level-2 {
  background: #40c463;
}

.activity-cell.level-3 {
  background: #30a14e;
}

.activity-cell.level-4 {
  background: #216e39;
}

.activity-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.graph-page {
  width: min(1240px, calc(100% - 32px));
}

.graph-header {
  max-width: 900px;
}

.graph-shell {
  border: 1px solid rgba(132, 111, 255, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(circle at 22% 18%, rgba(167, 139, 250, 0.22), transparent 22rem),
    radial-gradient(circle at 78% 12%, rgba(121, 192, 255, 0.18), transparent 24rem),
    linear-gradient(145deg, #151821 0%, #1b1d2b 52%, #171a24 100%);
  box-shadow: 0 28px 80px rgba(23, 36, 63, 0.28);
  overflow: hidden;
}

.graph-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid rgba(132, 111, 255, 0.22);
  background: rgba(20, 23, 34, 0.76);
  backdrop-filter: blur(16px);
}

.graph-search {
  display: grid;
  gap: 6px;
  min-width: min(100%, 360px);
}

.graph-search label {
  color: #b7c0d8;
  font-size: 0.82rem;
  font-weight: 900;
}

.graph-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(132, 111, 255, 0.28);
  border-radius: 7px;
  background: rgba(11, 14, 22, 0.78);
  color: #eef2ff;
  font: inherit;
}

.graph-search input::placeholder {
  color: #7f8aa5;
}

.graph-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.graph-actions .button {
  border-color: rgba(132, 111, 255, 0.3);
  background: rgba(31, 35, 50, 0.88);
  color: #eef2ff;
  min-height: 42px;
}

.graph-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 620px;
}

#knowledgeGraph {
  width: 100%;
  height: 620px;
  background:
    radial-gradient(circle at center, rgba(167, 139, 250, 0.08), transparent 18rem),
    radial-gradient(circle at 30% 70%, rgba(121, 192, 255, 0.08), transparent 16rem),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(201, 209, 217, 0.035) 44px 45px),
    repeating-linear-gradient(0deg, transparent 0 44px, rgba(201, 209, 217, 0.035) 44px 45px);
  touch-action: none;
}

.graph-link {
  stroke: rgba(201, 209, 217, 0.18);
  stroke-width: 1;
}

.graph-link-label {
  fill: rgba(183, 192, 216, 0.6);
  font-size: 0.72rem;
  font-weight: 800;
  pointer-events: none;
}

.graph-node {
  cursor: grab;
  filter: url("#nodeGlow");
  outline: none;
}

.graph-node:active {
  cursor: grabbing;
}

.node-halo {
  fill: rgba(167, 139, 250, 0.08);
  stroke: rgba(167, 139, 250, 0.12);
}

.node-core {
  stroke-width: 2.2;
}

.graph-node.selected .node-core {
  stroke: #ffffff;
  stroke-width: 3.4;
}

.graph-node.dimmed {
  opacity: 0.22;
}

.node-type,
.node-label {
  fill: #eef2ff;
  font-weight: 900;
  pointer-events: none;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(11, 14, 22, 0.82);
  stroke-width: 3px;
}

.node-type {
  fill: #9aa8c7;
  font-size: 0.56rem;
}

.node-label {
  font-size: 0.72rem;
}

.graph-detail {
  padding: 24px;
  border-left: 1px solid rgba(132, 111, 255, 0.22);
  background: rgba(20, 23, 34, 0.82);
  color: #eef2ff;
}

.graph-detail h2 {
  color: #eef2ff;
  font-size: 1.35rem;
}

.graph-detail p {
  color: #b7c0d8;
}

.node-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.node-tags span {
  padding: 4px 8px;
  border: 1px solid rgba(132, 111, 255, 0.24);
  border-radius: 999px;
  background: rgba(31, 35, 50, 0.82);
  color: #b7c0d8;
  font-size: 0.8rem;
  font-weight: 800;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(132, 111, 255, 0.18);
  background: rgba(20, 23, 34, 0.66);
  color: #b7c0d8;
  font-size: 0.88rem;
  font-weight: 800;
}

.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.concept {
  background: #a78bfa;
}

.legend-dot.markdown {
  background: #7ee787;
}

.legend-dot.web {
  background: #79c0ff;
}

.legend-dot.pdf {
  background: #ff7b72;
}

.legend-dot.file {
  background: #f2cc60;
}

@media (max-width: 860px) {
  body::after,
  .hero::before,
  .hero::after {
    opacity: 0.22;
  }

  .graph-stage {
    grid-template-columns: 1fr;
  }

  .graph-detail {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .nav a {
    flex: 1;
  }

  .hero {
    min-height: 500px;
  }

  .grid,
  .post-item {
    grid-template-columns: 1fr;
  }

  .post-item {
    gap: 6px;
    padding: 24px;
  }

  .graph-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #knowledgeGraph {
    height: 540px;
  }
}
