/* ==========================================================================
   站务手记：列表 / 详情 / 阅读排版
   与工具箱共用暖白纸感；文章页偏编辑部，弱化表单控件。
   ========================================================================== */

.notes-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, .45fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: end;
  padding: clamp(48px, 8vw, 92px) 0 clamp(34px, 5vw, 58px);
  border-bottom: 1px solid var(--line-strong);
}

.notes-kicker,
.note-aside-label {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

.notes-kicker span { color: var(--muted); }

.notes-hero h1 {
  margin: 0;
  max-width: 780px;
  font-family: var(--display);
  font-size: clamp(46px, 7vw, 86px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.055em;
}

.notes-hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

.notes-hero h1 em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .02em;
  height: .08em;
  background: var(--accent);
  opacity: .55;
}

.notes-lede {
  max-width: 610px;
  margin: 24px 0 0;
  color: var(--ink-2);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.85;
}

.notes-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 20px 0 4px 22px;
  border-left: 1px solid var(--line-strong);
}

.notes-side-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
}

.notes-hero-side strong {
  font-family: var(--display);
  font-size: 58px;
  line-height: 1;
  letter-spacing: -.06em;
  color: var(--ink);
}

.notes-hero-side > span:not(.notes-side-label) { color: var(--muted); font-size: 13px; }

.notes-hero-side a {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 2px;
}

/* ------------------------------- 头条 ------------------------------- */

.note-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
  padding: clamp(30px, 5vw, 54px) 0;
  border-bottom: 1px solid var(--line);
}

.note-lead-cover,
.note-card-cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.note-lead-cover { aspect-ratio: 16 / 9; }

.note-lead-cover img,
.note-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
}

.note-lead-cover:hover img,
.note-card-cover:hover img { transform: scale(1.025); filter: saturate(1.08); }

.note-lead-cover.is-empty,
.note-card-cover.is-empty {
  background:
    linear-gradient(135deg, rgba(24, 25, 22, .92) 0%, rgba(57, 52, 41, .96) 60%, rgba(138, 90, 0, .9) 100%);
  color: #f4efe3;
}

.note-lead-cover.is-empty::before,
.note-card-cover.is-empty::before {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(244, 239, 227, .22);
  pointer-events: none;
}

.note-cover-word {
  position: absolute;
  left: 26px;
  bottom: 18px;
  font-family: var(--display);
  font-size: clamp(54px, 8vw, 108px);
  font-weight: 700;
  line-height: .8;
  letter-spacing: -.07em;
  opacity: .92;
}

.note-cover-index {
  position: absolute;
  top: 24px;
  right: 26px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  opacity: .72;
}

.note-lead-body { min-width: 0; }

.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 13px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}

.note-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .08em;
}

.note-lead-body h2,
.note-card-body h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.18;
}

.note-lead-body h2 { font-size: clamp(28px, 3.2vw, 44px); }
.note-lead-body h2 a, .note-card-body h2 a { color: var(--ink); }
.note-lead-body h2 a:hover, .note-card-body h2 a:hover { color: var(--accent-strong); }

.note-lead-body p {
  max-width: 540px;
  margin: 16px 0 20px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.note-read:hover { color: var(--accent); border-color: var(--accent); }

/* ------------------------------- 宫格 ------------------------------- */

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 26px;
  padding: clamp(30px, 5vw, 52px) 0;
}

.notes-grid--related { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: 0; }

.note-card {
  min-width: 0;
  border-top: 1px solid var(--line-strong);
  padding-top: 16px;
}

.note-card-cover { aspect-ratio: 16 / 9; margin-bottom: 16px; }
.note-card-cover .note-cover-word { font-size: clamp(40px, 5vw, 68px); left: 20px; bottom: 14px; }
.note-card-cover .note-cover-index { top: 18px; right: 20px; font-size: 9px; }

.note-card-body h2 { font-size: clamp(21px, 2.1vw, 28px); }

.note-card-body p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------- 空状态 ------------------------------- */

.notes-empty {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  padding: clamp(48px, 8vw, 100px) 0;
  border-bottom: 1px solid var(--line);
}

.notes-empty-code {
  font-family: var(--display);
  font-size: 128px;
  font-weight: 700;
  line-height: .8;
  letter-spacing: -.09em;
  color: var(--accent);
  opacity: .25;
}

.notes-empty-code sup { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; }

.notes-empty h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.04em;
}

.notes-empty p { max-width: 540px; margin: 0 0 20px; color: var(--muted); }
.notes-empty-link { display: inline-flex; gap: 8px; font-size: 13px; font-weight: 650; color: var(--accent); }

/* ------------------------------- 分页 ------------------------------- */

.notes-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 11px;
}

.notes-pager a, .notes-pager .is-disabled, .notes-pager-pages a, .notes-pager-pages .is-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.notes-pager a:hover { border-color: var(--accent); color: var(--accent); }
.notes-pager .is-disabled { color: var(--muted); opacity: .45; }
.notes-pager-pages { display: flex; align-items: center; gap: 5px; }
.notes-pager-pages .is-current { background: var(--ink); border-color: var(--ink); color: var(--btn-ink); }
.notes-pager-gap { color: var(--muted); }

/* ------------------------------- 详情 ------------------------------- */

.note-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 26px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.note-breadcrumb span[aria-current] {
  max-width: min(62vw, 620px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(240px, 300px);
  gap: clamp(36px, 6vw, 84px);
  justify-content: space-between;
  padding: clamp(28px, 4vw, 46px) 0 clamp(48px, 7vw, 86px);
}

.note-article { min-width: 0; }

.note-article-head { padding-bottom: 28px; border-bottom: 1px solid var(--line); }

.note-article-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 4.8vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.045em;
}

.note-article-summary {
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.85;
}

.note-article-cover {
  margin: 28px 0 0;
  border: 1px solid var(--line);
  overflow: hidden;
}

.note-article-cover img { display: block; width: 100%; height: auto; }

.note-content {
  padding: 34px 0 24px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.note-content > :first-child { margin-top: 0; }
.note-content p { margin: 0 0 1.25em; }
.note-content h2, .note-content h3, .note-content h4 {
  color: var(--ink);
  font-family: var(--display);
  letter-spacing: -.025em;
  line-height: 1.3;
}
.note-content h2 { margin: 2.2em 0 .7em; padding-top: .65em; border-top: 1px solid var(--line); font-size: 28px; }
.note-content h3 { margin: 1.8em 0 .6em; font-size: 21px; }
.note-content h4 { margin: 1.5em 0 .5em; font-size: 17px; }
.note-content a { color: var(--accent-strong); border-bottom: 1px solid var(--accent-line); }
.note-content a:hover { color: var(--accent); border-color: var(--accent); }
.note-content strong { color: var(--ink); }
.note-content ul, .note-content ol { margin: 0 0 1.25em; padding-left: 1.35em; }
.note-content li { margin: .3em 0; }
.note-content li::marker { color: var(--accent); }
.note-content blockquote {
  margin: 1.6em 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  color: var(--ink-2);
}
.note-content blockquote p:last-child { margin-bottom: 0; }
.note-content code {
  padding: .1em .35em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .88em;
  color: var(--code-ink);
}
.note-content pre {
  margin: 1.6em 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: #23241f;
  color: #f4efe3;
  border: 1px solid rgba(0, 0, 0, .2);
  font-size: 13px;
  line-height: 1.7;
}
.note-content pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.note-content img { display: block; max-width: 100%; height: auto; margin: 1.8em auto; border: 1px solid var(--line); }
.note-content hr { margin: 2.4em 0; }
.note-content .table-scroll { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line-strong); }
.note-content table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); }
.note-content th, .note-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.note-content th { background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.note-content tr:last-child td { border-bottom: 0; }

.note-article-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

.note-article-end span { color: var(--accent); }
.note-share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.note-share button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  cursor: pointer;
}
.note-share button:hover { color: var(--accent); border-color: var(--accent); }
.note-share a { color: var(--ink-2); border-bottom: 1px solid var(--line-strong); }
.note-share a:hover { color: var(--accent); border-color: var(--accent); }

.note-adjacent {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.note-adjacent-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.note-adjacent-item:hover { border-color: var(--accent-line); color: var(--ink); background: var(--surface-2); }
.note-adjacent-item small { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; color: var(--accent); }
.note-adjacent-item strong { font-size: 13px; line-height: 1.6; font-weight: 600; }
.note-adjacent-item.is-next { text-align: right; align-items: flex-end; }
.note-adjacent-item.is-empty { opacity: .48; background: transparent; }
.note-adjacent-item.is-empty:hover { border-color: var(--line); background: transparent; }

/* ------------------------------- 侧栏 ------------------------------- */

.note-aside { display: flex; flex-direction: column; gap: 28px; align-self: start; }

.note-aside-box {
  padding: 20px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.note-aside-box h2 { margin: 0 0 16px; font-family: var(--display); font-size: 22px; letter-spacing: -.03em; }
.note-aside-label { margin-bottom: 8px; font-size: 9.5px; }

.note-aside-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 7px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.note-aside-item:hover strong { color: var(--accent-strong); }
.note-aside-num { padding-top: 2px; font-family: var(--mono); font-size: 9.5px; color: var(--accent); }
.note-aside-item strong { display: block; font-size: 12.5px; line-height: 1.55; font-weight: 600; }
.note-aside-item small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.note-aside-empty { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.note-aside-more { display: inline-block; margin-top: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--accent); }

.note-aside-tools a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
}
.note-aside-tools a:hover { color: var(--accent); }
.note-aside-tools a span { font-family: var(--mono); color: var(--muted); }

/* ------------------------------- 相关 ------------------------------- */

.note-related { padding: 34px 0 0; border-top: 1px solid var(--line-strong); }
.note-related-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.note-related-head h2 { margin: 0; font-family: var(--display); font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; }
.note-related-head .note-aside-label { margin: 0; }

/* ------------------------------- 导航补丁 ------------------------------- */

.nav-notes-link { white-space: nowrap; }

/* ------------------------------- 响应式 ------------------------------- */

@media (max-width: 1050px) {
  .note-layout { grid-template-columns: minmax(0, 1fr); }
  .note-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .note-related .notes-grid--related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .notes-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
  .notes-hero-side { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; padding: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .notes-hero-side strong { font-size: 38px; }
  .notes-hero-side a { margin-top: 0; margin-left: auto; }
  .note-lead { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .note-lead-cover { aspect-ratio: 16 / 9; }
  .notes-grid { gap: 24px 20px; }
  .note-layout { padding-top: 26px; }
  .note-aside { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .notes-hero { padding-top: 34px; }
  .notes-hero h1 { font-size: clamp(40px, 12vw, 56px); }
  .notes-lede { font-size: 14.5px; }
  .notes-hero-side > span:not(.notes-side-label) { display: none; }
  .notes-hero-side a { margin-left: 0; }
  .notes-grid, .notes-grid--related, .note-related .notes-grid--related { grid-template-columns: minmax(0, 1fr); }
  .note-card-cover { aspect-ratio: 16 / 9; }
  .notes-empty { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .notes-empty-code { font-size: 82px; }
  .notes-pager { flex-wrap: wrap; justify-content: center; }
  .notes-pager-pages { order: 3; width: 100%; justify-content: center; }
  .note-article-head h1 { font-size: clamp(31px, 9vw, 42px); }
  .note-content { font-size: 15.5px; }
  .note-content h2 { font-size: 24px; }
  .note-adjacent { grid-template-columns: minmax(0, 1fr); }
  .note-adjacent-item.is-next { text-align: left; align-items: flex-start; }
  .note-article-foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .note-lead-cover img, .note-card-cover img { transition: none; }
}
