/* ---------- 四条主线页：左轨 dossier ---------- */
.line-page {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  width: 100%;
}

.line-rail {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 34px 24px 30px;
  border-right: 1px solid var(--hsp-line);
  background: linear-gradient(180deg, #f8f6ee 0%, #fbfaf5 55%);
}

.line-no {
  font-family: var(--hsp-mono);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--hsp-accent);
}

.line-kicker {
  margin-top: 12px;
  font-family: var(--hsp-mono);
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--hsp-muted-2);
}

.line-rail h2 {
  margin: 9px 0 0;
  font-family: var(--hsp-serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--hsp-ink);
}

.line-meta {
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--hsp-muted);
}

.line-nav {
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid var(--hsp-line);
}

.line-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 11.5px;
  color: var(--hsp-ink-2);
}

.line-nav a::before {
  content: "";
  width: 12px;
  height: 1px;
  background: var(--hsp-accent-2);
}

.line-nav a:hover { color: var(--hsp-accent-deep); }

.line-mascot {
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid var(--hsp-line);
}

.line-mascot img {
  display: block;
  width: 102px;
  margin: 0 auto;
  mix-blend-mode: multiply;
}

.line-bubble {
  max-width: 166px;
  margin: 7px auto 0;
  text-align: center;
  font-family: var(--hsp-serif);
  font-size: 11px;
  line-height: 1.8;
  color: var(--hsp-muted);
}

.line-back {
  display: inline-flex;
  margin-top: 18px;
  font-family: var(--hsp-mono);
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--hsp-muted-2);
}

.line-back:hover { color: var(--hsp-accent-deep); }

.line-main {
  min-width: 0;
  padding: 42px 52px 38px;
}

.line-dossier .line-kicker { color: var(--hsp-accent); }

.line-dossier h1 {
  margin: 10px 0 0;
  font-family: var(--hsp-serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -.01em;
  color: var(--hsp-ink);
}

.line-lede {
  max-width: 720px;
  margin: 13px 0 0;
  font-size: 13.5px;
  line-height: 2;
  color: var(--hsp-muted);
}

.line-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 24px;
  border-top: 1px solid var(--hsp-line);
  border-bottom: 1px solid var(--hsp-line);
}

.line-stat {
  padding: 14px 14px 12px 0;
  border-right: 1px solid var(--hsp-line);
}

.line-stat:last-child {
  padding-left: 14px;
  border-right: 0;
}

.line-stat b {
  display: block;
  font-family: var(--hsp-mono);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.04em;
  color: var(--hsp-ink);
}

.line-stat span {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  color: var(--hsp-muted);
}

.line-section { margin-top: 38px; }

.line-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.line-sec-kicker {
  font-family: var(--hsp-mono);
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--hsp-muted-2);
}

.line-sec-head h2 {
  margin: 6px 0 0;
  font-family: var(--hsp-serif);
  font-size: 23px;
  font-weight: 600;
  color: var(--hsp-ink);
}

.line-sec-head p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--hsp-muted);
}

.line-more {
  flex: none;
  font-family: var(--hsp-mono);
  font-size: 9px;
  color: var(--hsp-muted-2);
  white-space: nowrap;
}

.line-more:hover { color: var(--hsp-accent-deep); }

/* featured */
.line-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid var(--hsp-line);
  border-radius: 14px;
  background: linear-gradient(135deg, #f7f3e8, #fbfaf5 62%);
}

.line-feature-copy { padding: 24px 24px 20px; }

.line-feature-copy .line-kicker { color: var(--hsp-bronze); }

.line-feature-copy h3 {
  margin: 8px 0 0;
  font-family: var(--hsp-serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--hsp-ink);
}

.line-feature-copy p {
  margin: 9px 0 0;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--hsp-muted);
}

.line-feature-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
  font-family: var(--hsp-mono);
  font-size: 8px;
  letter-spacing: .05em;
  color: var(--hsp-muted-2);
}

.line-feature-link {
  display: inline-flex;
  margin-top: 15px;
  padding: 7px 12px;
  border: 1px solid var(--hsp-accent);
  border-radius: 6px;
  font-size: 10px;
  color: var(--hsp-accent-deep);
}

.line-feature-link:hover { background: var(--hsp-accent-soft); }

.line-code {
  margin: 18px;
  align-self: start;
  overflow: hidden;
  border-radius: 10px;
  background: #0e211c;
}

.line-code-head {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(143, 179, 168, .16);
  font-family: var(--hsp-mono);
  font-size: 7.5px;
  letter-spacing: .12em;
  color: var(--hsp-accent-2);
}

.line-code pre {
  margin: 0;
  padding: 12px 12px 15px;
  overflow: hidden;
  font-family: var(--hsp-mono);
  font-size: 9.5px;
  line-height: 1.7;
  color: #eaf2ec;
  white-space: pre;
}

.line-code .tok-k { color: var(--hsp-accent-2); }
.line-code .tok-s { color: #d9b892; }
.line-code .tok-c { color: #6f8b82; font-style: italic; }

/* pattern ladder */
.line-ladder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.line-step {
  padding: 14px 12px 12px;
  border: 1px solid var(--hsp-line);
  border-radius: 9px;
  background: #fffdf8;
}

.line-step .n {
  font-family: var(--hsp-mono);
  font-size: 8px;
  color: var(--hsp-accent-2);
}

.line-step strong {
  display: block;
  margin-top: 7px;
  font-family: var(--hsp-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--hsp-ink);
}

.line-step span {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  line-height: 1.6;
  color: var(--hsp-muted);
}

.line-step em {
  display: inline-block;
  margin-top: 9px;
  font-family: var(--hsp-mono);
  font-size: 8px;
  font-style: normal;
  color: var(--hsp-bronze);
}

.line-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.line-chip {
  padding: 4px 8px;
  border: 1px solid var(--hsp-line);
  border-radius: 999px;
  font-size: 9px;
  color: var(--hsp-muted);
  background: #fbfaf5;
}

.line-chip b {
  font-family: var(--hsp-mono);
  font-weight: 400;
  color: var(--hsp-accent-deep);
}

/* directions / courses */
.line-dirs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.line-dir {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 10px;
  padding: 15px 16px;
  border: 1px solid var(--hsp-line);
  border-radius: 10px;
  background: #fffdf8;
  transition: .2s ease;
}

.line-dir:hover {
  border-color: var(--hsp-accent-2);
  transform: translateY(-1px);
}

.line-dir .top {
  display: flex;
  justify-content: space-between;
  font-family: var(--hsp-mono);
  font-size: 7.5px;
  letter-spacing: .1em;
  color: var(--hsp-muted-2);
}

.line-dir h3 {
  margin: 6px 0 0;
  font-family: var(--hsp-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--hsp-ink);
}

.line-dir .count {
  font-family: var(--hsp-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.05em;
  color: var(--hsp-accent);
}

.line-dir p {
  margin: 5px 0 0;
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--hsp-muted);
}

.line-dir .latest {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: 8.5px;
  color: var(--hsp-muted-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* latest */
.line-latest { border-top: 1px solid var(--hsp-line); }

.line-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--hsp-line);
}

.line-row time {
  padding-top: 2px;
  font-family: var(--hsp-mono);
  font-size: 9px;
  color: var(--hsp-muted-2);
}

.line-row h3 {
  margin: 0;
  font-family: var(--hsp-serif);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--hsp-ink);
}

.line-row p {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--hsp-muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.line-row .arrow {
  padding-top: 2px;
  font-size: 12px;
  color: var(--hsp-accent-2);
  text-align: right;
}

/* CS timeline */
.line-courses {
  border-top: 1px solid var(--hsp-line);
}

.line-course {
  display: grid;
  grid-template-columns: 66px 1fr 52px;
  gap: 13px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--hsp-line);
}

.line-course .code {
  font-family: var(--hsp-mono);
  font-size: 9px;
  color: var(--hsp-accent-deep);
}

.line-course .name {
  font-family: var(--hsp-serif);
  font-size: 15px;
  color: var(--hsp-ink);
}

.line-course .name small {
  display: block;
  margin-top: 3px;
  font-family: var(--hsp-sans);
  font-size: 9px;
  color: var(--hsp-muted);
}

.line-course .state {
  font-family: var(--hsp-mono);
  font-size: 8px;
  text-align: right;
  color: var(--hsp-muted-2);
}

.line-course .state.done { color: var(--hsp-accent); }
.line-course .state.current { color: var(--hsp-bronze); }

.line-principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.line-principle {
  padding: 15px 16px;
  border: 1px solid var(--hsp-line);
  border-radius: 10px;
  background: #fffdf8;
}

.line-principle .n {
  font-family: var(--hsp-mono);
  font-size: 8px;
  color: var(--hsp-accent-2);
}

.line-principle h3 {
  margin: 7px 0 0;
  font-family: var(--hsp-serif);
  font-size: 16px;
  color: var(--hsp-ink);
}

.line-principle p {
  margin: 5px 0 0;
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--hsp-muted);
}

/* systems stack */
.line-stacks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.line-stack {
  padding: 16px 17px;
  border: 1px solid var(--hsp-line);
  border-radius: 11px;
  background: #fffdf8;
}

.line-stack h3 {
  margin: 0;
  font-family: var(--hsp-serif);
  font-size: 16px;
  color: var(--hsp-ink);
}

.line-stack .hint {
  margin: 4px 0 0;
  font-size: 9px;
  color: var(--hsp-muted);
}

.line-stack a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(28, 43, 39, .1);
  font-size: 11px;
  color: var(--hsp-ink-2);
}

.line-stack a:last-child { border-bottom: 0; }
.line-stack a b {
  font-family: var(--hsp-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--hsp-accent);
}

/* research plan / scope / notes */
.line-plan {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 10px;
  border-top: 1px solid var(--hsp-line);
  border-bottom: 1px solid var(--hsp-line);
}

.line-plan-step {
  padding: 15px 12px;
  border-right: 1px solid var(--hsp-line);
}

.line-plan-step:last-child { border-right: 0; }

.line-plan-step .n {
  font-family: var(--hsp-mono);
  font-size: 8px;
  color: var(--hsp-accent-2);
}

.line-plan-step strong {
  display: block;
  margin-top: 6px;
  font-family: var(--hsp-serif);
  font-size: 13.5px;
  color: var(--hsp-ink);
}

.line-plan-step span {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  line-height: 1.7;
  color: var(--hsp-muted);
}

.line-plan-step em {
  display: inline-block;
  margin-top: 7px;
  font-family: var(--hsp-mono);
  font-size: 7.5px;
  font-style: normal;
  color: var(--hsp-bronze);
}

.line-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.line-scope-item {
  padding: 15px 16px;
  border: 1px solid var(--hsp-line);
  border-radius: 10px;
  background: #fffdf8;
}

.line-scope-item .n {
  font-family: var(--hsp-mono);
  font-size: 8px;
  color: var(--hsp-accent-2);
}

.line-scope-item h3 {
  margin: 7px 0 0;
  font-family: var(--hsp-serif);
  font-size: 15px;
  color: var(--hsp-ink);
}

.line-scope-item p {
  margin: 4px 0 0;
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--hsp-muted);
}

.line-note {
  display: block;
  margin-top: 16px;
  padding: 20px 22px;
  border: 1px solid var(--hsp-line);
  border-radius: 12px;
  background: linear-gradient(135deg, #f7f3e8, #fbfaf5 70%);
}

.line-note .line-kicker { color: var(--hsp-bronze); }

.line-note h3 {
  margin: 8px 0 0;
  font-family: var(--hsp-serif);
  font-size: 19px;
  line-height: 1.55;
  color: var(--hsp-ink);
}

.line-note p {
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.85;
  color: var(--hsp-muted);
}

.line-note .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-family: var(--hsp-mono);
  font-size: 8px;
  color: var(--hsp-muted-2);
}

.line-next {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px dashed #cfd4c6;
  border-radius: 10px;
  color: var(--hsp-muted);
}

.line-next b {
  font-family: var(--hsp-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--hsp-ink-2);
}

.line-next span { font-size: 9px; }

.line-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--hsp-line);
  font-family: var(--hsp-mono);
  font-size: 9px;
  color: var(--hsp-muted-2);
}

.line-foot a { color: var(--hsp-accent-deep); }

/* inner page hero: left aligned line title */
#body-wrap.type-algorithms #page-header #page-site-info,
#body-wrap.type-cs-learning #page-header #page-site-info,
#body-wrap.type-systems #page-header #page-site-info,
#body-wrap.type-research #page-header #page-site-info {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
  text-align: left;
}

#body-wrap.type-algorithms #page-header #page-site-info::before,
#body-wrap.type-cs-learning #page-header #page-site-info::before,
#body-wrap.type-systems #page-header #page-site-info::before,
#body-wrap.type-research #page-header #page-site-info::before {
  display: block;
  margin-bottom: 8px;
  font-family: var(--hsp-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .55);
}

#body-wrap.type-algorithms #page-header #page-site-info::before { content: 'MAINLINE 01 · ALGORITHMS'; }
#body-wrap.type-cs-learning #page-header #page-site-info::before { content: 'MAINLINE 02 · CS LEARNING'; }
#body-wrap.type-systems #page-header #page-site-info::before { content: 'MAINLINE 03 · SYSTEMS'; }
#body-wrap.type-research #page-header #page-site-info::before { content: 'MAINLINE 04 · RESEARCH NOTES'; }

#body-wrap.type-algorithms #page-header #page-site-info h1,
#body-wrap.type-cs-learning #page-header #page-site-info h1,
#body-wrap.type-systems #page-header #page-site-info h1,
#body-wrap.type-research #page-header #page-site-info h1 {
  font-family: var(--hsp-serif);
  font-size: clamp(32px, 3.2vw, 44px);
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .line-page { grid-template-columns: 1fr; }

  .line-rail {
    position: static;
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 0 12px;
    padding: 22px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--hsp-line);
  }

  .line-no { grid-row: 1 / 3; }
  .line-nav, .line-mascot, .line-back { grid-column: 1 / -1; }
  .line-main { padding: 28px 20px 30px; }
  .line-dossier h1 { font-size: 25px; }
  .line-stats { grid-template-columns: 1fr 1fr; }
  .line-stat:nth-child(2) { border-right: 0; }
  .line-stat:nth-child(3), .line-stat:nth-child(4) { border-top: 1px solid var(--hsp-line); }
  .line-feature { grid-template-columns: 1fr; }
  .line-ladder, .line-plan { grid-template-columns: 1fr 1fr; }
  .line-dirs, .line-scope, .line-stacks, .line-principles { grid-template-columns: 1fr; }
  .line-row { grid-template-columns: 45px minmax(0, 1fr) 14px; }
  .line-sec-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .line-code { margin-top: 0; }
}

.line-section, .line-feature { scroll-margin-top: 84px; }


#body-wrap.type-algorithms #page-header #page-site-info,
#body-wrap.type-cs-learning #page-header #page-site-info,
#body-wrap.type-systems #page-header #page-site-info,
#body-wrap.type-research #page-header #page-site-info {
  justify-content: flex-start;
}
#body-wrap.type-algorithms #page-header #page-site-info h1,
#body-wrap.type-cs-learning #page-header #page-site-info h1,
#body-wrap.type-systems #page-header #page-site-info h1,
#body-wrap.type-research #page-header #page-site-info h1 {
  text-align: left !important;
  margin-left: 0 !important;
}

#body-wrap.type-algorithms #page-header #page-site-info,
#body-wrap.type-cs-learning #page-header #page-site-info,
#body-wrap.type-systems #page-header #page-site-info,
#body-wrap.type-research #page-header #page-site-info {
  left: 50%;
  width: 100%;
  max-width: 1180px;
  padding-left: 14px;
  padding-right: 14px;
  margin: 0 auto;
  transform: translateX(-50%);
}
