/* ==========================================================================
   Linear 风格主题 — 近黑底 / 1px 白线 / 靛紫渐变仅主按钮 / 紧凑密度
   ========================================================================== */

:root {
  --ln-bg: #0a0a0b;
  --ln-panel: rgba(255, 255, 255, 0.03);
  --ln-panel-2: rgba(255, 255, 255, 0.04);
  --ln-panel-hover: rgba(255, 255, 255, 0.06);
  --ln-border: rgba(255, 255, 255, 0.1);
  --ln-text: #ffffff;
  --ln-text-2: rgba(255, 255, 255, 0.5);
  --ln-text-3: rgba(255, 255, 255, 0.4);
  --ln-muted: #8a8a94;
  --ln-brand: #5e6ad2;
  --ln-brand-2: #8b5cf6;
  --ln-grad: linear-gradient(to right, #5e6ad2, #8b5cf6);
  --ln-amber: #f2c94c;
  --ln-green: #27ae60;
  --ln-red: #eb5757;
  --ln-blue: #2d9cdb;
  --ln-radius: 8px;
  --ln-pill: 999px;
  --ln-max: 1280px;
  --ln-gap: 8px;
  --ln-section: 32px;
  --ln-card-pad: 20px;
  --ln-shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.55);
  --ln-font: 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.ln-body {
  margin: 0;
  background: var(--ln-bg);
  color: var(--ln-text);
  font-family: var(--ln-font);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
img { max-width: 100%; display: block; }
button { font-family: inherit; letter-spacing: inherit; }
input, textarea, select { font-family: inherit; letter-spacing: inherit; }

.hide { display: none !important; }

.ln-container { max-width: var(--ln-max); margin: 0 auto; padding: 0 16px; }

.ln-main { min-height: 60vh; padding-bottom: 48px; }

/* 通用面板 / 标题 / 空态 */
.ln-empty {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  background: var(--ln-panel);
  color: var(--ln-text-2);
  font-size: 12px;
  text-align: center;
}

.ln-result-count { color: var(--ln-muted); font-size: 11px; letter-spacing: 0.02em; }

/* ==========================================================================
   顶部命令栏
   ========================================================================== */

.ln-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ln-panel-2);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--ln-border);
}

.ln-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}

.ln-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ln-brand img { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.ln-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--ln-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.ln-brand span:last-child { font-size: 14px; font-weight: 600; }

.ln-menu-btn {
  display: none;
  margin-left: auto;
  padding: 6px 10px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  color: var(--ln-text-2);
  font-size: 14px;
  cursor: pointer;
}

.ln-nav { display: flex; align-items: center; gap: 4px; }
.ln-nav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--ln-text-2);
  font-size: 13px;
  font-weight: 500;
}
.ln-nav a:hover { color: var(--ln-text); background: var(--ln-panel-hover); }

/* 移动端抽屉内搜索框，桌面端隐藏 */
.ln-nav-search { display: none; }

.ln-header-search { margin-left: auto; display: flex; gap: 8px; }
.ln-header-search input {
  width: 200px;
  padding: 6px 12px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  color: var(--ln-text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ln-header-search input::placeholder { color: var(--ln-text-3); }
.ln-header-search input:focus { border-color: rgba(94, 106, 210, 0.5); background: rgba(255, 255, 255, 0.05); }
.ln-header-search button {
  padding: 6px 12px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  color: var(--ln-text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.ln-header-search button:hover { color: var(--ln-text); background: var(--ln-panel-hover); }

/* ==========================================================================
   Hero 与页面头
   ========================================================================== */

.ln-hero { padding: 48px 16px 32px; }
.ln-hero-kicker {
  margin: 0 0 8px;
  color: var(--ln-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ln-hero-title { margin: 0 0 8px; font-size: 24px; font-weight: 600; line-height: 1.25; }
.ln-hero-desc { margin: 0 0 20px; max-width: 640px; color: var(--ln-text-2); font-size: 13px; }

.ln-hero-search { display: flex; gap: 8px; max-width: 560px; }
.ln-hero-search input {
  flex: 1;
  padding: 8px 12px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  color: var(--ln-text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ln-hero-search input::placeholder { color: var(--ln-text-3); }
.ln-hero-search input:focus { border-color: rgba(94, 106, 210, 0.5); background: rgba(255, 255, 255, 0.05); }
.ln-hero-search button {
  padding: 8px 16px;
  background: var(--ln-grad);
  border: none;
  border-radius: var(--ln-radius);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.ln-hero-search button:hover { opacity: 0.9; }
.ln-hero-search button:active { opacity: 0.8; }

.ln-page-head { padding: 32px 0 24px; }
.ln-page-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.ln-page-desc { margin: 0 0 8px; color: var(--ln-text-2); font-size: 12px; }
.ln-page-head .ln-hero-search { margin-top: 16px; }

/* ==========================================================================
   布局 / 区块
   ========================================================================== */

.ln-layout { display: flex; gap: 24px; align-items: flex-start; }
.ln-content { flex: 1; min-width: 0; }

.ln-section { margin-bottom: var(--ln-section); }
.ln-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.ln-section-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.ln-section-more { color: var(--ln-muted); font-size: 12px; font-weight: 500; }
.ln-section-more:hover { color: var(--ln-text); }

/* ==========================================================================
   资源卡片（comm/cards，Ajax 同构）
   ========================================================================== */

.ln-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--ln-gap);
}

.ln-card {
  display: flex;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 16px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  transition: background-color 0.15s ease;
}
.ln-card:hover { background: var(--ln-panel-hover); }

.ln-card-thumb {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--ln-radius);
  border: 1px solid var(--ln-border);
  background: var(--ln-panel);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ln-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ln-card-ph { font-size: 16px; }

.ln-card-body { flex: 1; min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: 8px; }
.ln-card-title {
  color: var(--ln-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  min-width: 0;
  max-width: 100%;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ln-card-title:hover { opacity: 0.85; }

.ln-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.ln-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-pill);
  color: var(--ln-text-2);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.ln-chip:hover { color: var(--ln-text); background: var(--ln-panel-hover); }
.ln-chip-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chip-color, var(--ln-muted));
}

.ln-card-meta {
  display: flex;
  gap: 12px;
  margin-top: auto;
  color: var(--ln-text-3);
  font-size: 11px;
}

/* ==========================================================================
   热门排行
   ========================================================================== */

.ln-hot-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  background: var(--ln-panel);
  overflow: hidden;
}

.ln-hot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ln-border);
  transition: background-color 0.15s ease;
}
.ln-hot-card:last-child { border-bottom: none; }
.ln-hot-card:hover { background: var(--ln-panel-hover); }

.ln-rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--ln-border);
  color: var(--ln-muted);
  font-size: 11px;
  font-weight: 500;
}
.ln-rank-1 { border-color: rgba(242, 201, 76, 0.4); color: var(--ln-amber); }
.ln-rank-2 { border-color: rgba(45, 156, 219, 0.4); color: var(--ln-blue); }
.ln-rank-3 { border-color: rgba(39, 174, 96, 0.4); color: var(--ln-green); }

.ln-hot-thumb {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--ln-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.ln-hot-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ln-hot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ln-hot-body strong {
  color: var(--ln-text);
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ln-hot-body small { color: var(--ln-text-3); font-size: 11px; }

/* ==========================================================================
   专题卡片（comm/topic_cards，Ajax 同构）
   ========================================================================== */

.ln-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--ln-gap);
}

.ln-topic-card {
  display: flex;
  flex-direction: column;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  overflow: hidden;
  transition: background-color 0.15s ease;
}
.ln-topic-card:hover { background: var(--ln-panel-hover); }

.ln-topic-cover {
  height: 96px;
  background: var(--ln-panel-2);
  border-bottom: 1px solid var(--ln-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ln-topic-cover img { width: 100%; height: 100%; object-fit: cover; }
.ln-topic-cover span { color: var(--ln-text-2); font-size: 12px; font-weight: 500; padding: 0 16px; text-align: center; }

.ln-topic-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.ln-topic-kicker {
  margin: 0;
  color: var(--ln-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ln-topic-body h3 { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.4; }
.ln-topic-desc {
  margin: 0;
  color: var(--ln-text-2);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ln-topic-meta { color: var(--ln-text-3); font-size: 11px; }

/* ==========================================================================
   侧栏
   ========================================================================== */

.ln-sidebar { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }

.ln-sidebar-card {
  padding: 16px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
}
.ln-sidebar-title {
  margin: 0 0 12px;
  color: var(--ln-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ln-link-list { display: flex; flex-direction: column; }
.ln-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  color: var(--ln-text-2);
  font-size: 12px;
  font-weight: 500;
}
.ln-link-item:hover { color: var(--ln-text); background: var(--ln-panel-hover); }
.ln-link-item span { color: var(--ln-text-3); font-size: 11px; }

.ln-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-tag-pill {
  padding: 3px 10px;
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-pill);
  color: var(--ln-text-2);
  font-size: 11px;
}
.ln-tag-pill:hover { color: var(--ln-text); background: var(--ln-panel-hover); }

/* ==========================================================================
   筛选条 / 加载更多
   ========================================================================== */

.ln-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.ln-filter-links { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-filter-link {
  padding: 4px 12px;
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-pill);
  background: var(--ln-panel);
  color: var(--ln-text-2);
  font-size: 12px;
  font-weight: 500;
}
.ln-filter-link:hover { color: var(--ln-text); background: var(--ln-panel-hover); }
.ln-filter-link.is-active {
  border-color: rgba(94, 106, 210, 0.5);
  background: rgba(94, 106, 210, 0.15);
  color: var(--ln-text);
}

.ln-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.ln-load-more {
  padding: 8px 16px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  color: var(--ln-text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.ln-load-more:hover { color: var(--ln-text); background: var(--ln-panel-hover); }
.ln-load-more.is-loading { opacity: 0.6; pointer-events: none; }
.ln-end { margin: 0; color: var(--ln-text-3); font-size: 11px; }

/* ==========================================================================
   分类 / 标签导航页
   ========================================================================== */

.ln-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--ln-gap);
  margin-bottom: var(--ln-section);
}
.ln-category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: var(--ln-card-pad);
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  transition: background-color 0.15s ease;
}
.ln-category-card:hover { background: var(--ln-panel-hover); }
.ln-category-name { font-size: 14px; font-weight: 500; }
.ln-category-count { color: var(--ln-muted); font-size: 11px; }

.ln-tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--ln-gap);
}
.ln-tag-card {
  padding: var(--ln-card-pad);
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  transition: background-color 0.15s ease;
}
.ln-tag-card:hover { background: var(--ln-panel-hover); }
.ln-tag-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ln-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-pill);
  font-size: 12px;
  font-weight: 500;
}
.ln-tag-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chip-color, var(--ln-muted));
}
.ln-tag-count { color: var(--ln-muted); font-size: 11px; }
.ln-tag-desc { margin: 0; color: var(--ln-text-2); font-size: 12px; }

/* ==========================================================================
   专题详情
   ========================================================================== */

.ln-topic-hero {
  display: flex;
  gap: 24px;
  margin: 32px 0;
  padding: var(--ln-card-pad);
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
}
.ln-topic-hero-cover {
  flex-shrink: 0;
  width: 200px;
  height: 120px;
  border-radius: var(--ln-radius);
  border: 1px solid var(--ln-border);
  overflow: hidden;
}
.ln-topic-hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.ln-topic-hero-body { flex: 1; min-width: 0; }
.ln-topic-hero-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.ln-topic-hero-desc { margin: 0 0 12px; color: var(--ln-text-2); font-size: 12px; }
.ln-topic-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--ln-muted); font-size: 11px; }

.ln-share-btn {
  padding: 4px 12px;
  background: var(--ln-grad);
  border: none;
  border-radius: var(--ln-radius);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.ln-share-btn:hover { opacity: 0.9; }
.ln-share-btn:active { opacity: 0.8; }

/* ==========================================================================
   详情页
   ========================================================================== */

.ln-detail { padding-top: 32px; }
.ln-detail article { min-width: 0; }

.ln-article-head { margin-bottom: 24px; }
.ln-article-category {
  display: inline-flex;
  padding: 3px 10px;
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-pill);
  color: var(--ln-text-2);
  font-size: 11px;
  font-weight: 500;
}
.ln-article-category:hover { color: var(--ln-text); background: var(--ln-panel-hover); }
.ln-article-title { margin: 12px 0 8px; font-size: 24px; font-weight: 600; line-height: 1.25; }
.ln-article-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--ln-text-3); font-size: 11px; }

.ln-content-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.ln-summary-card {
  margin-bottom: 16px;
  padding: 16px var(--ln-card-pad);
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
}
.ln-summary-eyebrow {
  margin: 0 0 6px;
  color: var(--ln-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ln-summary-card p:last-child { margin: 0; color: var(--ln-text-2); font-size: 12px; }

.ln-pan-card {
  margin-bottom: 24px;
  padding: var(--ln-card-pad);
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
}
.ln-pan-title { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.ln-pan-hint { margin: 0 0 12px; color: var(--ln-text-2); font-size: 12px; }
.ln-pan-link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ln-pan-link { color: var(--ln-brand); font-size: 12px; word-break: break-all; }
.ln-pan-link:hover { opacity: 0.85; }
.ln-pan-code { margin: 12px 0 0; color: var(--ln-text-2); font-size: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ln-pan-code strong { color: var(--ln-text); font-weight: 600; }

.ln-copy-btn {
  padding: 4px 12px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  color: var(--ln-text-2);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.ln-copy-btn:hover { color: var(--ln-text); background: var(--ln-panel-hover); }

.ln-pan-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ln-pan-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  color: var(--ln-text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ln-pan-input:focus { border-color: rgba(94, 106, 210, 0.5); background: rgba(255, 255, 255, 0.05); }
.ln-pan-submit {
  padding: 8px 16px;
  background: var(--ln-grad);
  border: none;
  border-radius: var(--ln-radius);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.ln-pan-submit:hover { opacity: 0.9; }
.ln-pan-submit:active { opacity: 0.8; }
.ln-pan-error { margin: 8px 0 0; color: var(--ln-red); font-size: 12px; }

/* 正文排版 */
.ln-prose { color: rgba(255, 255, 255, 0.8); font-size: 13px; line-height: 1.7; word-wrap: break-word; }
.ln-prose h1, .ln-prose h2, .ln-prose h3, .ln-prose h4 { color: var(--ln-text); font-weight: 600; line-height: 1.3; margin: 24px 0 12px; }
.ln-prose h1 { font-size: 20px; }
.ln-prose h2 { font-size: 16px; }
.ln-prose h3 { font-size: 14px; }
.ln-prose h4 { font-size: 13px; }
.ln-prose p { margin: 0 0 12px; }
.ln-prose a { color: var(--ln-brand); }
.ln-prose a:hover { opacity: 0.85; }
.ln-prose img { max-width: 100%; border-radius: var(--ln-radius); border: 1px solid var(--ln-border); margin: 8px 0; }
.ln-prose ul, .ln-prose ol { margin: 0 0 12px; padding-left: 20px; }
.ln-prose li { margin-bottom: 4px; }
.ln-prose blockquote {
  margin: 12px 0;
  padding: 8px 16px;
  border-left: 2px solid var(--ln-brand);
  background: var(--ln-panel);
  border-radius: 0 var(--ln-radius) var(--ln-radius) 0;
  color: var(--ln-text-2);
}
.ln-prose pre {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--ln-panel);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
}
.ln-prose code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }
.ln-prose p code, .ln-prose li code {
  padding: 1px 6px;
  background: var(--ln-panel-hover);
  border: 1px solid var(--ln-border);
  border-radius: 4px;
}
.ln-prose table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.ln-prose th, .ln-prose td { padding: 6px 12px; border: 1px solid var(--ln-border); text-align: left; }
.ln-prose th { background: var(--ln-panel); color: var(--ln-text); font-weight: 500; }
.ln-prose hr { border: none; border-top: 1px solid var(--ln-border); margin: 24px 0; }

.ln-related { margin-top: var(--ln-section); }

/* ==========================================================================
   页脚 / 返回顶部
   ========================================================================== */

.ln-footer { border-top: 1px solid var(--ln-border); padding: 32px 0; margin-top: 48px; }
.ln-footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: space-between; }
.ln-footer .ln-brand span:last-child { font-size: 13px; }
.ln-footer-desc { margin: 8px 0 0; max-width: 420px; color: var(--ln-text-3); font-size: 12px; }
.ln-footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.ln-footer-links a { color: var(--ln-text-2); font-size: 12px; font-weight: 500; }
.ln-footer-links a:hover { color: var(--ln-text); }
.ln-copyright { width: 100%; margin: 0; color: var(--ln-text-3); font-size: 11px; }
.ln-copyright a { color: var(--ln-text-2); }
.ln-copyright a:hover { color: var(--ln-text); }

.ln-backtop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 36px;
  height: 36px;
  background: var(--ln-panel-2);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  color: var(--ln-text-2);
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.ln-backtop:hover { color: var(--ln-text); background: var(--ln-panel-hover); }

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 980px) {
  .ln-layout { flex-direction: column; align-items: stretch; }
  .ln-content { width: 100%; }
  .ln-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .ln-sidebar-card { flex: 1; min-width: 240px; }
  .ln-topic-hero { flex-direction: column; }
  .ln-topic-hero-cover { width: 100%; height: 140px; }
}

@media (max-width: 760px) {
  /* 锁定 100% 宽，禁止横向滚动；clip 不创建滚动容器，sticky 导航不受影响 */
  body.ln-body { overflow-x: clip; }
  /* 移动端加大左右边距，内容不贴屏幕边缘 */
  .ln-container { padding-left: 20px; padding-right: 20px; }
  .ln-menu-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
  .ln-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 16px;
    background: var(--ln-bg);
    border-bottom: 1px solid var(--ln-border);
    box-shadow: var(--ln-shadow-pop);
  }
  .ln-nav.is-open { display: flex; }
  .ln-nav a { padding: 12px 10px; font-size: 14px; border-radius: 6px; }
  .ln-nav-search {
    display: flex;
    gap: 8px;
    padding: 0 0 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--ln-border);
  }
  .ln-nav-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    background: var(--ln-panel);
    border: 1px solid var(--ln-border);
    border-radius: var(--ln-radius);
    color: var(--ln-text);
    font-size: 14px;
    outline: none;
  }
  .ln-nav-search input::placeholder { color: var(--ln-text-3); }
  .ln-nav-search input:focus { border-color: rgba(94, 106, 210, 0.5); background: rgba(255, 255, 255, 0.05); }
  .ln-nav-search button {
    padding: 10px 16px;
    background: var(--ln-grad);
    border: none;
    border-radius: var(--ln-radius);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
  }
  .ln-header-search { display: none; }

  .ln-hero { padding: 32px 16px 24px; }
  .ln-hero-title { font-size: 20px; }
  .ln-article-title { font-size: 20px; }
  .ln-page-head { padding: 24px 0 16px; }
  .ln-section { margin-bottom: 24px; }
  .ln-card { padding: 14px; }
  .ln-topic-hero { margin: 24px 0; }

  /* 触控目标放大 */
  .ln-filter-link { padding: 8px 14px; }
  .ln-link-item { padding: 10px 8px; }
  .ln-tag-pill { padding: 6px 12px; }
  .ln-copy-btn { padding: 8px 14px; }
  .ln-load-more, .ln-pan-submit, .ln-hero-search button, .ln-share-btn { min-height: 44px; }
  .ln-backtop { width: 44px; height: 44px; right: 16px; bottom: 16px; }

  /* 正文宽表格横向滚动，避免撑破页面 */
  .ln-prose { overflow-wrap: anywhere; }
  .ln-prose table { display: block; max-width: 100%; overflow-x: auto; }
  .ln-prose pre { max-width: 100%; }
}

@media (max-width: 520px) {
  .ln-grid, .ln-topic-grid, .ln-category-grid, .ln-tag-grid { grid-template-columns: 1fr; }
  .ln-sidebar { flex-direction: column; }
  .ln-sidebar-card { min-width: 0; }
  .ln-hero-search { flex-direction: column; }
  .ln-filter-bar { flex-direction: column; align-items: flex-start; }
  .ln-header-inner { gap: 8px; }
  .ln-brand span:last-child { font-size: 13px; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ln-pan-form { flex-direction: column; }
  .ln-pan-input { min-width: 0; width: 100%; }
  .ln-pan-submit { width: 100%; }
  .ln-topic-hero-meta { gap: 8px; }
  .ln-footer-inner { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}