/* ============================================================
   Notes — 手记系统样式
   用于 Mav/knowledge/notes/ 下的列表页与详情页。
   依赖模板 style.css 的设计变量（--ink, --line, --mono 等）。
   ============================================================ */

/* ── Note 详情页 ──────────────────────────────────────────── */
.note-article {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-8) var(--gutter) var(--space-9);
}

.note-head {
  margin-bottom: var(--space-7);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--line);
}
.note-head-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-4);
}
.note-head-meta .num {
  color: var(--ink);
  font-weight: var(--weight-medium);
}
.note-head h1 {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: var(--space-4);
}
.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.note-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border: 1px solid var(--line-2);
  padding: 3px 10px;
  border-radius: 2px;
}

/* 正文复用 chapter-body 的排版能力 */
.note-content {
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--ink-2);
}
.note-content h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.015em;
  margin: var(--space-8) 0 var(--space-4);
  color: var(--ink);
}
.note-content h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  margin: var(--space-6) 0 var(--space-3);
  color: var(--ink);
}
.note-content p {
  margin-bottom: var(--space-5);
}
.note-content ul, .note-content ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-5);
}
.note-content li {
  margin-bottom: var(--space-2);
}
.note-content img {
  max-width: 100%;
  display: block;
  margin: var(--space-5) auto;
}
.note-content blockquote {
  border-left: 2px solid var(--line-2);
  padding-left: var(--space-4);
  color: var(--ink-soft);
  margin-bottom: var(--space-5);
}
.note-content .table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-5);
}
.note-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.note-content th, .note-content td {
  border: 1px solid var(--line);
  padding: var(--space-2) var(--space-3);
  text-align: left;
}
.note-content th {
  background: var(--bg-soft);
  font-weight: var(--weight-medium);
}
.note-content pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: var(--space-4);
  overflow-x: auto;
  margin-bottom: var(--space-5);
  font-size: 13px;
  line-height: 1.6;
}
.note-content code {
  font-family: var(--mono);
  font-size: 0.88em;
}
.note-content p code, .note-content li code, .note-content td code {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
}

/* callout 块（与书籍一致） */
.note-content .callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  background: var(--bg-soft);
}
.note-content .callout .callout-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--ink);
}
.note-content .callout p:last-child {
  margin-bottom: 0;
}

/* 底部返回导航 */
.note-back-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.note-back-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.note-back-nav a:hover {
  color: var(--ink);
}

/* ── Notes 列表页 ─────────────────────────────────────────── */
.notes-page {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-8) var(--gutter) var(--space-9);
}

.notes-header {
  margin-bottom: var(--space-7);
}
.notes-header .eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-4);
}
.notes-header h1 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: var(--space-3);
}
.notes-desc {
  font-size: var(--text-base);
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}
.notes-stats {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* 标签筛选 */
.notes-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.filter-pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.filter-pill:hover {
  color: var(--ink);
  border-color: var(--line-2);
}
.filter-pill.active {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}

/* 手记列表 */
.notes-list {
  display: flex;
  flex-direction: column;
}
.note-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--space-4) var(--space-5);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}
.note-card:first-child {
  border-top: 1px solid var(--line);
}
.note-card:hover {
  background: var(--bg-soft);
}
.note-card:hover .note-card-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note-card-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: 2px;
}
.note-card-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.note-card-time {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.note-card-main {
  min-width: 0;
}
.note-card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--ink);
  margin-bottom: var(--space-1);
  line-height: 1.4;
}
.note-card-desc {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: var(--space-2);
}
.note-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.note-card-tags span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 2px;
}

.notes-empty {
  padding: var(--space-7) 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .note-card {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .note-card-side {
    flex-direction: row;
    gap: var(--space-3);
  }
  .note-article {
    padding-top: var(--space-6);
  }
}
