.nav-active { color: var(--green) !important; }
.nav-active::after { transform: scaleX(1) !important; }

#read-progress {
  position: fixed;
  top: 60px; left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,0.06);
  z-index: 199;
}
@media (max-width: 768px) {
  #read-progress { top: 56px; }
}
#read-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(0,232,122,0.5);
  transition: width 0.1s linear;
}

.wu-page {
  display: flex;
  align-items: flex-start;
  max-width: 1300px;
  margin: 0 auto;
  padding-top: 60px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.wu-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 2rem 1.25rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-right: 1px solid var(--border);
}
.wu-sidebar::-webkit-scrollbar { width: 3px; }
.wu-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.wu-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  text-decoration: none;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  letter-spacing: 0.05em;
  transition: color 0.2s, border-color 0.2s;
  width: fit-content;
}
.wu-back-btn svg { flex-shrink: 0; transition: transform 0.2s; }
.wu-back-btn:hover { color: var(--green); border-color: rgba(0,232,122,0.3); }
.wu-back-btn:hover svg { transform: translateX(-3px); }

.sidebar-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem;
}
.scard-title {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--green); text-transform: uppercase;
  letter-spacing: 0.15em; margin-bottom: 0.75rem;
}

.sidebar-loading { display: flex; align-items: center; gap: 5px; padding: 4px 0; }
.ldot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: ldot-pulse 1.2s ease-in-out infinite;
}
.ldot:nth-child(2) { animation-delay: 0.2s; }
.ldot:nth-child(3) { animation-delay: 0.4s; }
.ldot-text { font-family: var(--font-mono); font-size: 11px; color: var(--text3); margin-left: 6px; }
@keyframes ldot-pulse { 0%,100%{opacity:.2} 50%{opacity:1} }

.sdl { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; }
.sdl dt {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.08em; white-space: nowrap; padding-top: 1px;
}
.sdl dd { font-size: 13px; color: var(--text2); }

.stags {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.toc-link {
  display: block;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text3); text-decoration: none;
  padding: 3px 0 3px 10px;
  border-left: 2px solid transparent;
  line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.15s, border-color 0.15s;
}
.toc-link:hover { color: var(--text2); }
.toc-link.toc-active { color: var(--green); border-left-color: var(--green); }
.toc-h1 { font-weight: 700; }
.toc-h2 { padding-left: 18px; }
.toc-h3 { padding-left: 28px; font-size: 10px; }

.wu-main {
  flex: 1;
  min-width: 0;
  padding: 3rem 3rem 6rem 3rem;
}

.wu-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.wuh-eyebrow {
  font-family: var(--font-mono); font-size: 11px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.15em;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 1rem;
}
.wuh-dot { color: var(--border); }
.wuh-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(36px, 4.5vw, 58px);
  letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 1.25rem;
}
.wuh-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.wu-badge {
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 11px; border-radius: 100px; border: 1px solid;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.wu-badge-neutral { color: var(--text3); border-color: transparent; background: transparent; }
.diff-veasy  { color: var(--green);  border-color: rgba(0,232,122,0.3);   background: rgba(0,232,122,0.07); }
.diff-easy   { color: var(--green);  border-color: rgba(0,232,122,0.3);   background: rgba(0,232,122,0.07); }
.diff-medium { color: var(--amber);  border-color: rgba(245,158,11,0.3);  background: rgba(245,158,11,0.07); }
.diff-hard   { color: var(--red);    border-color: rgba(239,68,68,0.3);   background: rgba(239,68,68,0.07); }
.diff-insane { color: var(--purple); border-color: rgba(167,139,250,0.3); background: rgba(167,139,250,0.07); }
.wuh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.25rem; }
.wu-tag {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); padding: 3px 9px; border-radius: 4px;
}
.wuh-desc {
  font-size: 15px; color: var(--text2); line-height: 1.8;
  max-width: 640px; padding: 1rem 1.25rem;
  border-left: 2px solid var(--green);
  background: rgba(0,232,122,0.04);
  border-radius: 0 var(--r) var(--r) 0;
}

.wu-article { max-width: 740px; }

.wu-article h1,.wu-article h2,.wu-article h3,.wu-article h4 {
  font-family: var(--font-display); font-weight: 800;
  line-height: 1.2; letter-spacing: -0.02em; scroll-margin-top: 80px;
}
.wu-article h1 {
  font-size: clamp(22px, 3vw, 32px); color: var(--green);
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid rgba(0,232,122,0.2);
}
.wu-article h1:first-child { margin-top: 0; }
.wu-article h2 {
  font-size: clamp(18px, 2.5vw, 24px);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.wu-article h3 { font-size: clamp(15px, 2vw, 19px); color: var(--cyan); margin: 2rem 0 0.75rem; }
.wu-article h4 { font-size: 16px; color: var(--amber); margin: 1.5rem 0 0.5rem; }
.wu-article p { font-size: 15px; color: var(--text2); line-height: 1.9; margin-bottom: 1rem; }
.wu-article strong { color: var(--text); font-weight: 600; }
.wu-article em { font-style: italic; }
.wu-article del { color: var(--text3); }
.wu-article a { color: var(--green); text-underline-offset: 3px; }
.wu-article ul,.wu-article ol { padding-left: 1.5rem; margin-bottom: 1rem; color: var(--text2); font-size: 15px; }
.wu-article li { margin-bottom: 0.35rem; line-height: 1.75; }
.wu-article ul li::marker { color: var(--green); }
.wu-article ol li::marker { color: var(--green); font-family: var(--font-mono); font-size: 13px; }
.wu-article input[type="checkbox"] { accent-color: var(--green); margin-right: 6px; }
.wu-article blockquote {
  border-left: 2px solid var(--amber); padding: 0.875rem 1.25rem;
  margin: 1.5rem 0; background: rgba(245,158,11,0.05);
  border-radius: 0 var(--r) var(--r) 0;
}
.wu-article blockquote p { margin: 0; font-style: italic; }
.wu-article code:not(pre code) {
  font-family: var(--font-mono); font-size: 13px;
  background: rgba(0,232,122,0.1); color: var(--green);
  padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(0,232,122,0.2);
}
.wu-article pre {
  background: var(--bg3) !important; border: 1px solid var(--border);
  border-radius: var(--r-lg); margin: 1.5rem 0;
  overflow: hidden; position: relative;
}

.wu-article pre .code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.code-dots { display: flex; gap: 5px; align-items: center; }
.code-dot   { width: 10px; height: 10px; border-radius: 50%; }
.code-dot-r { background: #ff5f56; }
.code-dot-a { background: #febc2e; }
.code-dot-g { background: #28c840; }
.code-lang {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--green); letter-spacing: 0.12em; text-transform: lowercase;
  pointer-events: none;
}
.wu-article pre code {
  display: block; padding: 1.25rem 1.5rem !important;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.8;
  overflow-x: auto; background: transparent !important; color: var(--text2);
}
.wu-article pre code::-webkit-scrollbar { height: 4px; }
.wu-article pre code::-webkit-scrollbar-thumb { background: var(--border); }
.copy-btn {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); background: transparent;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 3px 10px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--text2); border-color: rgba(255,255,255,0.15); }
.copy-btn.copied { color: var(--green); border-color: rgba(0,232,122,0.4); }
.wu-article table {
  width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 14px;
  overflow: hidden; border-radius: var(--r); border: 1px solid var(--border);
}
.wu-article th {
  background: var(--bg3); color: var(--green); padding: 10px 16px; text-align: left;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; border-bottom: 1px solid var(--border-g);
}
.wu-article td { padding: 10px 16px; color: var(--text2); border-bottom: 1px solid var(--border); }
.wu-article tr:last-child td { border-bottom: none; }
.wu-article tr:hover td { background: rgba(255,255,255,0.02); }
.wu-article img { max-width: 100%; border-radius: var(--r-lg); border: 1px solid var(--border); margin: 1.5rem 0; display: block; }
.wu-article hr { border: none; height: 1px; background: var(--border); margin: 2.5rem 0; }

.wu-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.wu-bottom-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12px;
  padding: 9px 18px; border-radius: var(--r);
  text-decoration: none; cursor: pointer; border: none;
  letter-spacing: 0.04em; transition: all 0.2s;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2);
}
.wu-bottom-btn:hover { border-color: rgba(255,255,255,0.15); color: var(--text); }
.wu-bottom-share {
  color: var(--green) !important;
  border-color: rgba(0,232,122,0.3) !important;
  background: rgba(0,232,122,0.05) !important;
}
.wu-bottom-share:hover { background: rgba(0,232,122,0.1) !important; }

@media (max-width: 1024px) {
  .wu-page { flex-direction: column; padding-top: 60px; }
  .wu-sidebar {
    position: relative; top: 0; width: 100%;
    height: auto; border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    flex-direction: row; flex-wrap: wrap;
    gap: 0.75rem; overflow: visible;
  }
  .wu-back-btn { order: -1; }
  #sidebar-toc { display: none !important; }
  .wu-main { padding: 2rem 2rem 5rem; }
}

@media (max-width: 640px) {
  .wu-sidebar { padding: 1.25rem; }
  .wu-main { padding: 1.5rem 1.25rem 4rem; }
  .wuh-title { font-size: 30px; }
  .wu-article pre code { font-size: 12px; padding: 1rem !important; }
  .wu-article table { font-size: 12px; }
  .wu-article td, .wu-article th { padding: 7px 10px; }
}

@media (max-width: 1024px) {
  .wu-page { flex-direction: column; }
  .wu-sidebar {
    position: relative; top: 0; width: 100%;
    height: auto; border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.25rem 1rem;
    flex-direction: row; flex-wrap: wrap;
    gap: 0.75rem; overflow: visible;
  }
  .wu-back-btn { order: -1; width: 100%; }
  #sidebar-toc { display: none !important; }
  #sidebar-meta { flex: 1; min-width: 200px; }
  .wu-main { padding: 1.5rem 1.25rem 4rem; }
}

@media (max-width: 768px) {
  .wu-main { padding: 1.25rem 1rem 3rem; }
  .wu-header { margin-bottom: 2rem; padding-bottom: 1.5rem; }
  .wuh-title { font-size: clamp(26px, 7vw, 40px); }
  .wuh-badges { gap: 6px; }
  .wu-badge { font-size: 10px; padding: 3px 9px; }
  .wuh-desc { font-size: 14px; padding: 0.875rem 1rem; }

  .wu-article { max-width: 100%; }
  .wu-article h1 { font-size: clamp(20px, 5vw, 28px); }
  .wu-article h2 { font-size: clamp(17px, 4vw, 22px); }
  .wu-article h3 { font-size: clamp(15px, 3.5vw, 18px); }
  .wu-article p { font-size: 14px; }
  .wu-article pre code { font-size: 11px; padding: 0.875rem 1rem !important; }
  .wu-article table { font-size: 12px; display: block; overflow-x: auto; }
  .wu-article td, .wu-article th { padding: 7px 10px; white-space: nowrap; }

  .code-lang { font-size: 10px; }
  .copy-btn { font-size: 9px; padding: 2px 8px; }

  .wu-bottom { flex-direction: column; gap: 0.75rem; margin-top: 2.5rem; }
  .wu-bottom-btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .wu-sidebar { padding: 1rem; }
  .wu-main { padding: 1rem 0.875rem 3rem; }
  .wuh-title { font-size: clamp(22px, 8vw, 34px); }
  .wu-article pre code { font-size: 10.5px; }
  .sdl { font-size: 12px; }
  .sdl dt, .sdl dd { font-size: 11px; }
}
