/**
 * Alpha Club · 高级长文排版系统
 * 风格：Claude / iA Writer 式黑曜石暖灰阶排版
 * 字体：中文字体走系统最顶级的衬线体（苹方 / 宋体 / 思源宋体），英文走 Georgia / Playfair
 * 节奏：行高 1.9，段间距 1.4em，标题弱化字重、强化字距，保持文人阅读沉浸感
 */

/* 引入本地自托管字体（Noto Serif SC / Lora / Playfair Display / JetBrains Mono） */
@import url('/css/fonts.css?v=20261115c');

:root {
  --reader-font-serif: "Lora", "Playfair Display", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", "STSong", Georgia, serif;
  --reader-font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --reader-font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --reader-text-primary: #edece8;     /* 暖象牙白（不刺眼） */
  --reader-text-body: #c5c3bc;        /* 暖灰阶正文 */
  --reader-text-muted: #8a8880;       /* 次要信息 */
  --reader-text-dim: #5c5b56;         /* 装饰/边界 */

  --reader-bg-card: #141413;
  --reader-bg-code: #0d0d0c;
  --reader-border-hairline: rgba(255, 255, 255, 0.08);
  --reader-border-accent: rgba(212, 20, 50, 0.4);  /* 微金色克制点缀 */
}

/* ============================================================
   阅读器容器：字号放大、版心居中、呼吸感
   ============================================================ */
#articleReaderContent {
  font-family: var(--reader-font-serif);
  font-size: 16px;
  line-height: 1.95;
  color: var(--reader-text-body);
  letter-spacing: 0.015em;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 720px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  #articleReaderContent {
    font-size: 17px;
    line-height: 2.0;
  }
}

/* ============================================================
   排版元素细节
   ============================================================ */

/* 一级标题（通常由阅读器顶部显示，正文内极少出现） */
#articleReaderContent .md-h1 {
  font-family: var(--reader-font-serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--reader-text-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 2.4em 0 1.0em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--reader-border-hairline);
}

/* 二级标题：章节起点，留足顶部呼吸 */
#articleReaderContent .md-h2 {
  font-family: var(--reader-font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--reader-text-primary);
  line-height: 1.45;
  letter-spacing: -0.005em;
  margin: 2.2em 0 0.9em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 二级标题前缀小金标 */
#articleReaderContent .md-h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: linear-gradient(180deg, #D41432, rgba(212, 20, 50, 0.2));
  border-radius: 2px;
  flex-shrink: 0;
}

/* 三级标题 */
#articleReaderContent .md-h3 {
  font-family: var(--reader-font-serif);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--reader-text-primary);
  line-height: 1.5;
  margin: 1.8em 0 0.7em;
}

/* 段落 */
#articleReaderContent .md-p {
  margin: 0 0 1.45em;
  text-align: justify;
}

/* 粗体：强调不突兀 */
#articleReaderContent strong {
  color: var(--reader-text-primary);
  font-weight: 600;
}

/* 斜�� */
#articleReaderContent em {
  font-style: italic;
  color: #dfddd6;
}

/* 高亮标记 */
#articleReaderContent mark {
  background: rgba(212, 20, 50, 0.15);
  color: #f5eed6;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  border-bottom: 1px solid rgba(212, 20, 50, 0.4);
}

/* 链接 */
#articleReaderContent a {
  color: #c9b06b;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
#articleReaderContent a:hover {
  color: #f0dfa8;
}

/* ============================================================
   引用块（核心高级感来源）
   ============================================================ */
#articleReaderContent .md-quote {
  margin: 1.8em 0;
  padding: 1.1em 1.4em;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--reader-border-accent);
  border-radius: 0 8px 8px 0;
  color: #dedcd3;
  font-size: 0.96em;
  line-height: 1.85;
  font-style: normal;
  position: relative;
}

/* 分隔线 */
#articleReaderContent .md-hr {
  border: 0;
  height: 1px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 80%);
  margin: 2.6em auto;
  max-width: 60%;
}

/* ============================================================
   列表
   ============================================================ */
#articleReaderContent .md-ul,
#articleReaderContent .md-ol {
  margin: 0.8em 0 1.5em;
  padding-left: 1.4em;
}

#articleReaderContent .md-ul > li {
  list-style: disc;
  margin-bottom: 0.55em;
  padding-left: 0.3em;
}

#articleReaderContent .md-ol > li {
  list-style: decimal;
  margin-bottom: 0.55em;
  padding-left: 0.3em;
  color: var(--reader-text-body);
}

/* ============================================================
   表格（精细黑曜石灰阶）
   ============================================================ */
#articleReaderContent .md-table-wrap {
  margin: 2.0em 0;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--reader-border-hairline);
  background: rgba(255, 255, 255, 0.015);
}

#articleReaderContent .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  line-height: 1.6;
}

#articleReaderContent .md-table th {
  font-family: var(--reader-font-sans);
  background: rgba(255, 255, 255, 0.04);
  color: var(--reader-text-primary);
  font-weight: 600;
  padding: 0.8em 1.0em;
  border-bottom: 1px solid var(--reader-border-hairline);
  letter-spacing: 0.02em;
}

#articleReaderContent .md-table td {
  padding: 0.75em 1.0em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--reader-text-body);
}

#articleReaderContent .md-table tbody tr:last-child td {
  border-bottom: 0;
}

#articleReaderContent .md-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================================
   图片与配图注释
   ============================================================ */
#articleReaderContent .md-figure {
  margin: 2.2em 0;
}

#articleReaderContent .md-figure img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

#articleReaderContent .md-figure figcaption {
  font-family: var(--reader-font-mono);
  font-size: 0.75rem;
  color: var(--reader-text-muted);
  text-align: center;
  margin-top: 0.75rem;
  letter-spacing: 0.03em;
}

/* ============================================================
   行内代码与代码块
   ============================================================ */
#articleReaderContent code {
  font-family: var(--reader-font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #e0ded6;
}

#articleReaderContent pre.md-code {
  font-family: var(--reader-font-mono);
  background: var(--reader-bg-code);
  border: 1px solid var(--reader-border-hairline);
  border-radius: 10px;
  padding: 1.1em 1.3em;
  margin: 1.8em 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

#articleReaderContent pre.md-code code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: #d6d4cb;
}

/* ============================================================
   文章列表卡片：Claude / Substack 杂志质感
   ============================================================ */
.article-card-claude {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  overflow: hidden;
}

.article-card-claude::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.article-card-claude:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
}

.article-card-claude:hover::before {
  opacity: 1;
}

.article-card-claude .art-title {
  font-family: var(--reader-font-serif);
  font-size: 1.05rem;
  line-height: 1.45;
  font-weight: 600;
  color: #edece8;
  letter-spacing: -0.005em;
  transition: color 0.15s ease;
}

/* 标题即独立页面链接：继承标题样式，不显示默认下划线 */
.article-card-claude .art-title-link {
  color: inherit;
  text-decoration: none;
}

.article-card-claude .art-title-link:visited { color: inherit; }

.article-card-claude:hover .art-title {
  color: #ffffff;
}

.article-card-claude .art-desc {
  font-size: 0.825rem;
  line-height: 1.65;
  color: #9c9a92;
  margin-top: 0.45rem;
}

.article-card-claude .art-meta {
  font-family: var(--reader-font-mono);
  font-size: 0.7rem;
  color: #6b6962;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.article-card-claude .art-thumb {
  width: 140px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d0d0c;
  position: relative;
}

.article-card-claude .art-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card-claude:hover .art-thumb img {
  transform: scale(1.04);
}

@media (min-width: 640px) {
  .article-card-claude {
    padding: 1.35rem 1.6rem;
  }
  .article-card-claude .art-title {
    font-size: 1.12rem;
  }
  .article-card-claude .art-thumb {
    width: 160px;
    height: 104px;
  }
}

/* 确保文章阅读弹窗在激活时绝对可见与置顶 */
#articleReaderModal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  z-index: 9999 !important;
}

#articleReaderModal.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 前台文章编辑器置顶最高层级 */
#frontArticleEditModal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  z-index: 10000 !important;
}

#frontArticleEditModal.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================================
   刊头封面（Typography Cover）
   不使用任何图片：全部由文章自身的分类 / 标题 / 期号排出。
   版式参考内容平台列表（B 站热榜 / 公众号 / 知乎）的成熟做法：
   顶部细线报头 + 居中衬线标题 + 底部期号，缩到 160×104 仍可读。
   ============================================================ */
.article-card-claude .art-masthead {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 140px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 11px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 255, 255, 0.055) 0%, transparent 62%),
    linear-gradient(168deg, #17171b 0%, #0f0f11 58%, #0a0a0c 100%);
  overflow: hidden;
  isolation: isolate;
}

/* 极细的斜向排线，模拟印刷网点，远看只是微妙质感 */
.art-masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -38deg,
    rgba(255, 255, 255, 0.028) 0px,
    rgba(255, 255, 255, 0.028) 1px,
    transparent 1px,
    transparent 6px
  );
  pointer-events: none;
}

/* 左上角分类：小号等宽字 + 短杠，纯文字不用色块 */
.art-masthead .mh-kicker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  font-family: var(--reader-font-mono);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(212, 20, 50, 0.82);
  white-space: nowrap;
  overflow: hidden;
}

.art-masthead .mh-kicker::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

/* 主标题：衬线、紧字距、三行封顶，靠字号而非装饰取胜 */
.art-masthead .mh-title {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  font-family: var(--reader-font-serif);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.012em;
  color: #f2f1ec;
  overflow: hidden;
  text-wrap: balance;
}

/* 三行封顶：内层用 -webkit-box 才能正确截断 */
.art-masthead .mh-title > span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部报脚：期号 + 极细横线，把画幅收干净 */
.art-masthead .mh-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--reader-font-mono);
  font-size: 7.5px;
  line-height: 1;
  letter-spacing: 0.12em;
  color: rgba(237, 236, 232, 0.34);
  text-transform: uppercase;
  white-space: nowrap;
}

.art-masthead .mh-foot::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.article-card-claude:hover .art-masthead .mh-title { color: #ffffff; }
.article-card-claude:hover .art-masthead .mh-kicker { color: rgba(226, 190, 76, 1); }

/* 分类色：只改左上角小字的色相，保持整体黑曜石调性 */
.art-masthead[data-cat="内核心智"]   .mh-kicker { color: rgba(251, 191, 36, 0.82); }
.art-masthead[data-cat="实战框架"]   .mh-kicker { color: rgba(125, 205, 246, 0.82); }
.art-masthead[data-cat="展示面精讲"] .mh-kicker { color: rgba(178, 160, 240, 0.84); }
.art-masthead[data-cat="算法破局"]   .mh-kicker { color: rgba(110, 214, 178, 0.82); }
.art-masthead[data-cat="避坑实战"]   .mh-kicker { color: rgba(246, 148, 148, 0.82); }
.art-masthead[data-cat="把妹心法"]   .mh-kicker { color: rgba(250, 172, 110, 0.84); }

@media (min-width: 640px) {
  .article-card-claude .art-masthead { width: 160px; height: 104px; padding: 12px 13px; }
  .article-card-claude .art-masthead .mh-title { font-size: 1.1rem; }
  .article-card-claude .art-masthead .mh-kicker { font-size: 8.5px; }
}

/* ============================================================
   阅读页大封面：同一套刊头语言，放大字号与呼吸感
   ============================================================ */
.masthead-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  padding: 28px 24px 24px;
  background:
    radial-gradient(110% 85% at 8% 0%, rgba(255, 255, 255, 0.07) 0%, transparent 58%),
    linear-gradient(168deg, #1a1a1f 0%, #101013 55%, #0a0a0c 100%);
  overflow: hidden;
  isolation: isolate;
}

.masthead-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -38deg,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 7px
  );
  pointer-events: none;
}

.masthead-hero .mh-kicker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--reader-font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(212, 20, 50, 0.85);
}

.masthead-hero .mh-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.75;
}

.masthead-hero .mh-title {
  position: relative;
  margin: 28px 0 26px;
  font-family: var(--reader-font-serif);
  font-size: clamp(1.45rem, 4.2vw, 2.05rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: #f4f3ee;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}

.masthead-hero .mh-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--reader-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: rgba(237, 236, 232, 0.34);
  text-transform: uppercase;
}

.masthead-hero .mh-foot::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.13);
}

.masthead-hero[data-cat="内核心智"]   .mh-kicker { color: rgba(251, 191, 36, 0.85); }
.masthead-hero[data-cat="实战框架"]   .mh-kicker { color: rgba(125, 205, 246, 0.85); }
.masthead-hero[data-cat="展示面精讲"] .mh-kicker { color: rgba(178, 160, 240, 0.87); }
.masthead-hero[data-cat="算法破局"]   .mh-kicker { color: rgba(110, 214, 178, 0.85); }
.masthead-hero[data-cat="避坑实战"]   .mh-kicker { color: rgba(246, 148, 148, 0.85); }
.masthead-hero[data-cat="把妹心法"]   .mh-kicker { color: rgba(250, 172, 110, 0.87); }

