/*
 * 博客园浅紫 Apple 风格
 * 推荐基础皮肤：SimpleMemory
 * 使用方式：博客园后台 → 设置 → 页面定制 CSS 代码
 * 建议保留模板默认 CSS，本文件负责覆盖视觉样式。
 */

:root {
  --apple-purple: #7c5cff;
  --apple-purple-dark: #5f3ee8;
  --apple-purple-soft: #eee9ff;
  --apple-lilac: #f7f4ff;
  --apple-bg: #f5f3fa;
  --apple-card: rgba(255, 255, 255, 0.84);
  --apple-card-solid: #ffffff;
  --apple-text: #1d1d1f;
  --apple-text-secondary: #6e6e73;
  --apple-border: rgba(94, 68, 176, 0.13);
  --apple-shadow: 0 18px 50px rgba(76, 54, 128, 0.10);
  --apple-shadow-hover: 0 22px 58px rgba(76, 54, 128, 0.15);
  --apple-radius: 24px;
  --apple-radius-small: 14px;
  --reading-width: 820px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--apple-text);
  background:
    radial-gradient(circle at 12% 5%, rgba(194, 178, 255, 0.30), transparent 30%),
    radial-gradient(circle at 88% 15%, rgba(231, 211, 255, 0.42), transparent 28%),
    linear-gradient(180deg, #fbfaff 0%, var(--apple-bg) 52%, #faf9fd 100%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: #342066;
  background: #ddd3ff;
}

a {
  color: var(--apple-purple-dark);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--apple-purple);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(124, 92, 255, 0.28);
  outline-offset: 3px;
}

/* 页面容器 */
#home {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0 24px 42px;
  background: transparent;
  box-shadow: none;
}

/* 顶部：轻盈的半透明导航 */
#header {
  width: min(1120px, 100%);
  min-height: 132px;
  margin: 22px auto 18px;
  padding: 28px 34px 18px;
  overflow: hidden;
  border: 1px solid var(--apple-border);
  border-radius: var(--apple-radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 35px rgba(83, 57, 142, 0.08);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
}

#blogTitle {
  float: none;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0 2px 22px;
  text-align: left;
}

#blogTitle h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 720;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

#blogTitle h1 a {
  color: var(--apple-text);
  text-decoration: none;
}

#blogTitle h2 {
  margin: 10px 0 0;
  color: var(--apple-text-secondary);
  font-size: 15px;
  font-weight: 450;
  line-height: 1.6;
}

#navigator {
  width: 100%;
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#navList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  float: none;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

#navList li {
  float: none;
  width: auto !important;
  min-width: max-content;
  margin: 0;
  white-space: nowrap;
}

#navList li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: max-content;
  min-height: 38px;
  padding: 7px 15px;
  color: #4e4268;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#navList li a:hover {
  color: #4f2ed5;
  background: var(--apple-purple-soft);
  text-decoration: none;
  transform: translateY(-1px);
}

.blogStats {
  float: none;
  margin: 14px 0 0;
  color: var(--apple-text-secondary);
  font-size: 13px;
  text-align: right;
}

/* 主体：隐藏侧边栏，使内容真正位于页面中央 */
#main {
  display: block;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

#mainContent {
  float: none;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 0;
}

#mainContent .forFlow {
  float: none;
  width: 100%;
  margin: 0;
}

#sideBar,
#sideBarMain {
  display: none;
}

/* 首页文章列表与文章详情卡片 */
.day,
.entrylist,
#topics,
.post {
  margin: 0 0 22px;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
  border: 1px solid var(--apple-border);
  border-radius: var(--apple-radius);
  background: var(--apple-card);
  box-shadow: var(--apple-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
}

.day,
.entrylist,
.post {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.day:hover,
.entrylist:hover,
.post:hover {
  box-shadow: var(--apple-shadow-hover);
  transform: translateY(-2px);
}

.dayTitle,
.entrylistTitle {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 32px;
  margin: 0 0 20px;
  padding: 5px 13px;
  color: #684bd1;
  border: 0;
  border-radius: 999px;
  background: var(--apple-purple-soft);
  font-size: 13px;
  font-weight: 650;
}

.postTitle,
.entrylistPosttitle {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.postTitle a,
.entrylistPosttitle a,
#topics .postTitle a {
  color: var(--apple-text);
}

.postTitle a:hover,
.entrylistPosttitle a:hover,
#topics .postTitle a:hover {
  color: var(--apple-purple-dark);
  text-decoration: none;
}

.postCon,
.entrylistPostSummary {
  color: #434047;
  font-size: 16px;
  line-height: 1.85;
}

.c_b_p_desc_readmore {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--apple-purple-soft);
  font-size: 14px;
  font-weight: 600;
}

.postDesc,
.entrylistItemPostDesc {
  margin-top: 24px;
  padding-top: 16px;
  color: #86818f;
  border-top: 1px solid var(--apple-border);
  font-size: 13px;
  text-align: right;
}

/* 正文：控制行宽以提升长文阅读体验 */
.postBody,
.blogpost-body,
#cnblogs_post_body {
  width: 100%;
  max-width: var(--reading-width);
  margin-right: auto;
  margin-left: auto;
  color: #29272d;
  font-size: 17px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.postBody p,
.blogpost-body p,
#cnblogs_post_body p {
  margin: 1.05em 0;
}

.postBody h1,
.postBody h2,
.postBody h3,
.postBody h4,
.blogpost-body h1,
.blogpost-body h2,
.blogpost-body h3,
.blogpost-body h4,
#cnblogs_post_body h1,
#cnblogs_post_body h2,
#cnblogs_post_body h3,
#cnblogs_post_body h4 {
  color: var(--apple-text);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.postBody h1,
.blogpost-body h1,
#cnblogs_post_body h1 {
  margin: 1.8em 0 0.8em;
  font-size: 2em;
}

.postBody h2,
.blogpost-body h2,
#cnblogs_post_body h2 {
  margin: 1.7em 0 0.75em;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--apple-border);
  font-size: 1.55em;
}

.postBody h3,
.blogpost-body h3,
#cnblogs_post_body h3 {
  margin: 1.55em 0 0.65em;
  font-size: 1.25em;
}

.postBody ul,
.postBody ol,
.blogpost-body ul,
.blogpost-body ol,
#cnblogs_post_body ul,
#cnblogs_post_body ol {
  margin: 1em 0;
  padding-left: 1.6em;
}

.postBody li,
.blogpost-body li,
#cnblogs_post_body li {
  margin: 0.35em 0;
}

/* 引用块 */
.postBody blockquote,
.blogpost-body blockquote,
#cnblogs_post_body blockquote {
  position: relative;
  margin: 1.5em 0;
  padding: 18px 22px 18px 24px;
  color: #514a5e;
  border: 0;
  border-left: 4px solid #a78bfa;
  border-radius: 0 var(--apple-radius-small) var(--apple-radius-small) 0;
  background: linear-gradient(90deg, #f1ecff, #faf8ff);
}

.postBody blockquote p:first-child,
.blogpost-body blockquote p:first-child,
#cnblogs_post_body blockquote p:first-child {
  margin-top: 0;
}

.postBody blockquote p:last-child,
.blogpost-body blockquote p:last-child,
#cnblogs_post_body blockquote p:last-child {
  margin-bottom: 0;
}

/* 行内代码与代码块 */
.postBody code,
.blogpost-body code,
#cnblogs_post_body code {
  padding: 0.16em 0.42em;
  color: #643fc7;
  border: 1px solid rgba(124, 92, 255, 0.12);
  border-radius: 7px;
  background: #f2effa;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.postBody pre,
.blogpost-body pre,
#cnblogs_post_body pre,
.cnblogs-markdown .hljs {
  margin: 1.5em 0;
  padding: 20px 22px;
  overflow: auto;
  color: #332d3d;
  border: 1px solid #ded6f0;
  border-radius: var(--apple-radius-small);
  background: linear-gradient(145deg, #fbfaff, #f4f0fc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 24px rgba(83, 57, 142, 0.08);
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}

.postBody pre code,
.blogpost-body pre code,
#cnblogs_post_body pre code {
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  font-size: 14px;
}

/* 浅色语法高亮：兼容博客园常见的 highlight.js 类名 */
.hljs-comment,
.hljs-quote {
  color: #7b7388;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst,
.hljs-doctag {
  color: #6b3fc5;
  font-weight: 600;
}

.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition {
  color: #187a70;
}

.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-variable,
.hljs-regexp {
  color: #b2572a;
}

.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-class {
  color: #a33f72;
}

.hljs-meta,
.hljs-meta .hljs-keyword {
  color: #50698f;
}

.hljs-deletion {
  color: #bf3e59;
  background: #fff0f3;
}

.hljs-addition {
  background: #eaf8f4;
}

/* 文章底部作者信息：头像与用户名区域横向对齐 */
#author_profile {
  margin-top: 24px;
}

#author_profile_info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 0;
}

#author_profile_info > a {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  line-height: 0;
}

#author_profile_info img.author_avatar {
  display: block;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  margin: 0 !important;
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(83, 57, 142, 0.16);
  object-fit: cover;
}

#author_profile_detail {
  display: block;
  min-width: 0;
  margin: 0 !important;
  padding: 0;
  color: var(--apple-text-secondary);
  font-size: 13px;
  line-height: 1.55;
  white-space: nowrap;
}

#author_profile_detail a {
  display: inline;
  line-height: inherit;
}

/* 表格与图片 */
.postBody table,
.blogpost-body table,
#cnblogs_post_body table {
  display: table;
  width: 100%;
  margin: 1.5em 0;
  overflow: hidden;
  border: 1px solid var(--apple-border);
  border-spacing: 0;
  border-collapse: separate;
  border-radius: var(--apple-radius-small);
  background: rgba(255, 255, 255, 0.72);
  font-size: 15px;
}

.postBody th,
.postBody td,
.blogpost-body th,
.blogpost-body td,
#cnblogs_post_body th,
#cnblogs_post_body td {
  padding: 11px 14px;
  border: 0;
  border-right: 1px solid var(--apple-border);
  border-bottom: 1px solid var(--apple-border);
  text-align: left;
}

.postBody th,
.blogpost-body th,
#cnblogs_post_body th {
  color: #4c396f;
  background: #f2edff;
  font-weight: 650;
}

.postBody tr:last-child td,
.blogpost-body tr:last-child td,
#cnblogs_post_body tr:last-child td {
  border-bottom: 0;
}

.postBody th:last-child,
.postBody td:last-child,
.blogpost-body th:last-child,
.blogpost-body td:last-child,
#cnblogs_post_body th:last-child,
#cnblogs_post_body td:last-child {
  border-right: 0;
}

.postBody img,
.blogpost-body img,
#cnblogs_post_body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
  border-radius: var(--apple-radius-small);
  box-shadow: 0 12px 32px rgba(54, 40, 83, 0.12);
}

.postBody hr,
.blogpost-body hr,
#cnblogs_post_body hr {
  height: 1px;
  margin: 2.5em 0;
  border: 0;
  background: linear-gradient(90deg, transparent, #cfc3ef, transparent);
}

/* 标签、翻页、按钮 */
.postTag,
.postTag a,
.entrylistItemPostDesc a {
  color: #6b4ed2;
}

.pager {
  margin: 28px auto;
  color: var(--apple-text-secondary);
  text-align: center;
}

.pager a,
.pager span,
.topicListFooter a,
#comment_form_container input[type="button"],
#comment_form_container input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 3px;
  padding: 7px 14px;
  color: #5940b5;
  border: 1px solid var(--apple-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 5px 16px rgba(71, 47, 126, 0.07);
  font-size: 14px;
}

.pager a:hover,
.topicListFooter a:hover {
  color: #ffffff;
  border-color: var(--apple-purple);
  background: var(--apple-purple);
  text-decoration: none;
}

/* 评论区 */
#blog-comments-placeholder,
#comment_form,
#comment_form_container,
#comments {
  width: min(960px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.feedbackItem,
.commentbox_main {
  margin: 14px 0;
  padding: 20px;
  border: 1px solid var(--apple-border);
  border-radius: var(--apple-radius-small);
  background: rgba(255, 255, 255, 0.76);
}

.feedbackListSubtitle,
.feedbackManage {
  color: var(--apple-text-secondary);
  font-size: 13px;
}

#tbCommentBody,
textarea {
  width: 100%;
  min-height: 150px;
  padding: 14px 16px;
  color: var(--apple-text);
  border: 1px solid #dcd3ee;
  border-radius: var(--apple-radius-small);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  line-height: 1.7;
  resize: vertical;
}

#tbCommentBody:focus,
textarea:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15);
}

/* 页脚 */
#footer {
  width: min(960px, 100%);
  margin: 28px auto 0;
  padding: 22px 16px;
  color: #8a8592;
  border: 0;
  background: transparent;
  font-size: 13px;
  text-align: center;
}

/* 平板与手机 */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    background-attachment: scroll;
  }

  #home {
    padding: 0 12px 24px;
  }

  #header {
    min-height: 0;
    margin: 12px auto;
    padding: 22px 20px 14px;
    border-radius: 20px;
  }

  #blogTitle {
    padding-bottom: 16px;
  }

  #blogTitle h1 {
    font-size: 30px;
  }

  #navList {
    gap: 5px;
  }

  #navList li a {
    min-height: 36px;
    padding: 7px 11px;
  }

  .blogStats {
    text-align: left;
  }

  .day,
  .entrylist,
  #topics,
  .post {
    margin-bottom: 14px;
    padding: 22px 18px;
    border-radius: 20px;
  }

  .postBody,
  .blogpost-body,
  #cnblogs_post_body {
    font-size: 16px;
    line-height: 1.82;
  }

  .postBody table,
  .blogpost-body table,
  #cnblogs_post_body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

/* 尊重系统的“减少动画”设置 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
