/* ===== Claude Code 红宝书 - 自定义样式 ===== */

/* --- 中文排版优化 --- */
:root {
  --md-text-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --md-code-font: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, monospace;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #7c141b;
  --md-primary-fg-color--light: #b1242a;
  --md-primary-fg-color--dark: #571015;
  --md-accent-fg-color: #ffb06b;
  --md-accent-fg-color--transparent: rgba(255, 176, 107, 0.12);
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: #b1242a;
  --md-primary-fg-color--light: #cf4333;
  --md-primary-fg-color--dark: #7c141b;
  --md-accent-fg-color: #cf4333;
  --md-accent-fg-color--transparent: rgba(207, 67, 51, 0.12);
}

.md-typeset {
  font-size: 0.82rem;
  line-height: 1.8;
}

.md-content__inner {
  margin-top: 1rem;
}

.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.md-typeset h2 {
  margin-top: 2.4em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

/* --- 参考 ccbook：桌面端以左侧目录为主，不显示顶部 tabs --- */
.md-tabs {
  display: none;
}

/* --- Mermaid 图表优化 --- */
.mermaid {
  margin: 1.5em 0;
  text-align: center;
}

.md-typeset .mermaid svg {
  max-width: 100%;
  height: auto;
}

/* --- Admonition 自定义图标颜色 --- */

/* 生活类比 - 温暖的金色 */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #f9a825;
}
.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
  background-color: rgba(249, 168, 37, 0.1);
}

/* 深水区 - 深邃的蓝色 */
.md-typeset .admonition.abstract,
.md-typeset details.abstract {
  border-color: #1565c0;
}
.md-typeset .abstract > .admonition-title,
.md-typeset .abstract > summary {
  background-color: rgba(21, 101, 192, 0.1);
}

/* --- 代码块增强 --- */
.md-typeset code {
  font-size: 0.78rem;
}

.md-typeset pre > code {
  font-size: 0.76rem;
}

/* --- 表格优化 --- */
.md-typeset table:not([class]) {
  font-size: 0.78rem;
  display: table;
}

.md-typeset table:not([class]) th {
  white-space: nowrap;
  font-weight: 600;
}

/* --- 章节导航卡片样式 --- */
.chapter-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  padding: 1.2em;
  margin: 0.8em 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chapter-card:hover {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chapter-card h3 {
  margin-top: 0 !important;
  color: var(--md-accent-fg-color);
}

/* --- 可信度标记颜色 --- */
.reliability-a { color: #4caf50; font-weight: 600; }
.reliability-b { color: #ff9800; font-weight: 600; }
.reliability-c { color: #f44336; font-weight: 600; }

/* --- 首页 Hero 区域 --- */
.hero-section {
  text-align: center;
  padding: 3em 1em;
}

.hero-section h1 {
  font-size: 2.4rem;
  background: linear-gradient(135deg, #7c4dff, #ff6d00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2em;
  flex-wrap: wrap;
  margin: 2em 0;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--md-accent-fg-color);
}

.hero-stat .label {
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
}

/* --- 编介绍页样式 --- */
.part-intro {
  border-left: 4px solid var(--md-accent-fg-color);
  padding-left: 1.5em;
  margin: 2em 0;
}

/* --- 首页封面 --- */
:root {
  --warwolf-bg: #111315;
  --warwolf-panel: rgba(255, 255, 255, 0.05);
  --warwolf-panel-strong: rgba(255, 255, 255, 0.08);
  --warwolf-line: rgba(255, 255, 255, 0.14);
  --warwolf-text: #f8f1e8;
  --warwolf-muted: rgba(248, 241, 232, 0.72);
  --warwolf-orange: #cf4333;
  --warwolf-orange-soft: #ffb06b;
  --warwolf-red-deep: #5a1117;
  --warwolf-red-mid: #8e1d24;
  --warwolf-red-bright: #cb3631;
  --warwolf-cyan: #0fd5e7;
}

.cover-page,
.community-page {
  position: relative;
  margin: 1.4rem 0 1.8rem;
  padding: clamp(1.8rem, 4vw, 3rem);
  overflow: hidden;
  border: 1px solid var(--warwolf-line);
  border-radius: 32px;
}

.cover-page {
  background:
    radial-gradient(circle at 18% 18%, rgba(203, 54, 49, 0.48), transparent 34%),
    radial-gradient(circle at 84% 22%, rgba(255, 176, 107, 0.18), transparent 28%),
    linear-gradient(135deg, #17080a 0%, #311014 45%, #67191e 100%);
}

.community-page {
  background:
    radial-gradient(circle at 78% 24%, rgba(203, 54, 49, 0.22), transparent 26%),
    radial-gradient(circle at 12% 12%, rgba(255, 176, 107, 0.12), transparent 20%),
    linear-gradient(180deg, #170c0d 0%, #100f11 100%);
  border-top: 1px solid var(--warwolf-line);
  border-bottom: 1px solid var(--warwolf-line);
}

.cover-shell,
.community-shell {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.cover-shell {
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
}

.community-shell {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
}

.cover-art-panel {
  position: relative;
  display: grid;
  place-items: center;
  gap: 1rem;
  min-height: 520px;
  padding: 2rem;
  border: 1px solid var(--warwolf-line);
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(45, 11, 15, 0.9);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.cover-art-ring {
  position: absolute;
  inset: 8%;
  border-radius: 38px;
  background:
    radial-gradient(circle at top, rgba(203, 54, 49, 0.34), rgba(255, 176, 107, 0.18) 36%, transparent 70%),
    linear-gradient(180deg, rgba(15, 213, 231, 0.08), transparent 52%);
  filter: blur(12px);
}

.cover-poster-frame {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  padding: 1rem;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(26, 7, 10, 0.92);
  box-shadow: 0 34px 68px rgba(0, 0, 0, 0.42);
  transform: rotate(-4deg);
}

.cover-book-poster {
  display: block;
  width: 100%;
  aspect-ratio: 1000 / 1483;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.cover-promo-flag {
  position: absolute;
  left: -0.5rem;
  top: 1.2rem;
  z-index: 2;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd36a, #ff8a52);
  color: #531518;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  box-shadow: 0 16px 30px rgba(255, 138, 82, 0.28);
}

.cover-art-badge {
  position: absolute;
  right: 1.4rem;
  bottom: 1.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 107, 0.35);
  color: var(--warwolf-orange-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  background: rgba(43, 11, 14, 0.72);
}

.cover-art-caption {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.25rem;
  width: min(100%, 360px);
  padding: 0.95rem 1rem;
  border: 1px solid var(--warwolf-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--warwolf-text);
}

.cover-art-caption strong {
  font-size: 0.95rem;
}

.cover-art-caption span {
  color: var(--warwolf-muted);
  font-size: 0.82rem;
}

.cover-copy,
.community-copy {
  color: var(--warwolf-text);
}

.cover-kicker,
.community-kicker {
  margin: 0 0 1rem;
  color: var(--warwolf-orange-soft);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cover-copy h1,
.community-copy h2 {
  margin: 0;
  line-height: 1.05;
  color: var(--warwolf-text);
}

.cover-copy h1 {
  font-size: clamp(2.7rem, 6vw, 5.1rem);
  letter-spacing: -0.04em;
}

.community-copy h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.03em;
}

.cover-subtitle,
.community-lead {
  margin: 1.15rem 0 0;
  max-width: 42rem;
  color: var(--warwolf-muted);
  font-size: clamp(1.02rem, 1.2vw, 1.2rem);
  line-height: 1.9;
}

.cover-promo-strip {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.35rem;
  padding: 1rem 1.15rem;
  max-width: 44rem;
  border: 1px solid rgba(255, 176, 107, 0.26);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(255, 176, 107, 0.16), rgba(203, 54, 49, 0.08)),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cover-promo-strip span {
  width: fit-content;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 176, 107, 0.14);
  color: var(--warwolf-orange-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cover-promo-strip strong {
  color: var(--warwolf-text);
  font-size: 1rem;
  line-height: 1.8;
}

.cover-slogan {
  margin: 2rem 0 0;
  padding: 1.3rem 1.5rem;
  border-left: 3px solid var(--warwolf-orange-soft);
  border-radius: 0 20px 20px 0;
  background: linear-gradient(90deg, rgba(223, 116, 68, 0.12), rgba(15, 213, 231, 0.03));
  color: var(--warwolf-text);
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  line-height: 1.85;
}

.cover-slogan span {
  display: block;
  margin-top: 0.65rem;
  color: var(--warwolf-orange-soft);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.cover-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.cover-metrics span {
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--warwolf-line);
  border-radius: 999px;
  background: var(--warwolf-panel);
  color: var(--warwolf-text);
  font-size: 0.82rem;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.landing-button,
.md-typeset .landing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.4rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--warwolf-line);
  border-radius: 14px;
  color: var(--warwolf-text);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.landing-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 176, 107, 0.42);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.landing-button--primary,
.md-typeset .landing-button--primary {
  color: #fff6ef;
  border-color: transparent;
  background: linear-gradient(135deg, var(--warwolf-red-bright), var(--warwolf-orange));
}

.cover-note {
  margin-top: 1rem;
  color: rgba(248, 241, 232, 0.58);
  font-size: 0.84rem;
}

.cover-reading-note {
  margin-top: 0.75rem;
  color: rgba(248, 241, 232, 0.84);
  font-size: 0.92rem;
}

.community-points {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.community-point {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--warwolf-line);
  border-radius: 18px;
  background: var(--warwolf-panel);
}

.community-point strong {
  color: var(--warwolf-orange-soft);
  font-size: 0.92rem;
}

.community-point span {
  color: var(--warwolf-muted);
}

.community-poster {
  padding: 1.25rem;
  border: 1px solid var(--warwolf-line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.community-poster img {
  display: block;
  width: 100%;
  border-radius: 20px;
}

.community-poster p {
  margin: 0.95rem 0 0;
  color: var(--warwolf-muted);
  font-size: 0.86rem;
}

.quick-entry-grid,
.idea-grid {
  display: grid;
  gap: 1rem;
  margin: 1.6rem 0 2.2rem;
}

.quick-entry-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.idea-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-entry-card,
.idea-card {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(223, 116, 68, 0.04), rgba(15, 213, 231, 0.02));
}

.quick-entry-card {
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.quick-entry-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 213, 231, 0.42);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.quick-entry-card span {
  color: var(--warwolf-orange);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.quick-entry-card strong,
.idea-card h3 {
  font-size: 1rem;
}

.quick-entry-card em,
.idea-card p {
  color: var(--md-default-fg-color--light);
  font-style: normal;
}

.mobile-share-strip {
  display: none;
}

@keyframes coverFloat {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-10px); }
}

.cover-poster-frame {
  animation: coverFloat 6s ease-in-out infinite;
}

@media screen and (max-width: 960px) {
  .md-typeset {
    font-size: 0.92rem;
    line-height: 1.9;
  }

  .md-content__inner {
    margin-top: 0.35rem;
  }

  .cover-shell,
  .community-shell {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .cover-art-panel {
    min-height: 320px;
    padding: 1.4rem;
  }

  .cover-poster-frame,
  .cover-art-caption {
    width: min(100%, 300px);
  }

  .cover-copy h1 {
    font-size: clamp(2.1rem, 10vw, 3.2rem);
  }

  .community-copy h2 {
    font-size: clamp(1.65rem, 7vw, 2.4rem);
  }

  .cover-slogan {
    padding: 1rem 1.1rem;
    border-radius: 0 16px 16px 0;
  }

  .cover-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .cover-metrics span {
    text-align: center;
  }

  .quick-entry-grid,
  .idea-grid {
    grid-template-columns: 1fr;
  }

  .community-poster {
    padding: 1rem;
  }
}

@media screen and (max-width: 600px) {
  .md-typeset {
    font-size: 0.98rem;
  }

  .md-main__inner {
    margin-top: 0.25rem;
  }

  .md-content {
    padding-bottom: 5rem;
  }

  .cover-page,
  .community-page {
    margin: 0.9rem 0 1.2rem;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
    border-radius: 22px;
  }

  .cover-art-panel {
    min-height: 260px;
    border-radius: 24px;
  }

  .cover-art-badge {
    right: 1rem;
    bottom: 1rem;
  }

  .cover-promo-flag {
    left: 0.4rem;
    top: 0.8rem;
    padding: 0.55rem 0.8rem;
    letter-spacing: 0.1em;
  }

  .cover-kicker,
  .community-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }

  .cover-subtitle,
  .community-lead,
  .cover-reading-note {
    font-size: 0.96rem;
    line-height: 1.8;
  }

  .cover-promo-strip {
    padding: 0.9rem 1rem;
    border-radius: 16px;
  }

  .cover-promo-strip strong {
    font-size: 0.95rem;
  }

  .cover-metrics {
    grid-template-columns: 1fr;
  }

  .cover-actions {
    gap: 0.7rem;
  }

  .landing-button,
  .md-typeset .landing-button {
    width: 100%;
    min-height: 3.1rem;
    font-size: 0.98rem;
  }

  .community-point,
  .quick-entry-card,
  .idea-card {
    padding: 1rem;
    border-radius: 16px;
  }

  .community-poster img {
    border-radius: 16px;
  }

  .mobile-share-strip {
    position: sticky;
    bottom: 0.75rem;
    z-index: 6;
    display: flex;
    justify-content: center;
    margin-top: 1rem;
  }

  .mobile-share-strip a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(100%, 16rem);
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--warwolf-red-bright), var(--warwolf-orange));
    color: #fff8f2;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 14px 35px rgba(90, 17, 23, 0.28);
  }
}

/* --- 打印优化 --- */
@media print {
  .md-sidebar, .md-header, .md-footer {
    display: none;
  }
  .md-typeset {
    font-size: 10pt;
  }
}
