/* ==========================================================================
   全站视觉打磨 - 对比度 / 字重 / 间距统一
   在子主题 style.css 之后加载，用于覆盖偏浅淡的文字并统一版式细节
   仅调整颜色、字重、行高与间距，不改动布局结构
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 正文：更高的对比度与更稳的行距
   -------------------------------------------------------------------------- */

.entry-content {
  color: var(--color-text-secondary);
  line-height: 1.85;
  letter-spacing: 0.005em;
}

.entry-content p {
  color: var(--color-text-secondary);
  line-height: 1.85;
  margin-bottom: 1.35em;
}

/* 加粗文字更“实”，避免整段看起来发虚 */
.entry-content strong,
.entry-content b,
.entry-content th {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
}

/* 正文链接：颜色更深、字重 500，hover 回到品牌色 */
.entry-content a {
  color: var(--color-link);
  font-weight: var(--font-weight-medium);
  border-bottom-color: transparent;
}

.entry-content a:hover,
.entry-content a:focus-visible {
  color: var(--color-link-hover);
}

/* --------------------------------------------------------------------------
   2. 标题层级：字重、颜色、间距统一
   -------------------------------------------------------------------------- */

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.005em;
}

.entry-content h2 {
  margin-top: 2.75rem;
  margin-bottom: 1.125rem;
  line-height: 1.35;
}

.entry-content h3 {
  margin-top: 2.25rem;
  margin-bottom: 0.875rem;
  line-height: 1.4;
}

.entry-content h4 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.entry-content h5,
.entry-content h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.625rem;
  color: var(--color-text-secondary);
}

/* 单篇文章 / 页面的主标题 */
.entry-title,
.ast-single-post .entry-title,
.single .entry-title,
.page .entry-title {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   3. 列表、表格、分割线
   -------------------------------------------------------------------------- */

.entry-content ul,
.entry-content ol {
  line-height: 1.8;
  margin-bottom: 1.4em;
}

.entry-content li {
  color: var(--color-text-secondary);
  margin-bottom: 0.45em;
}

.entry-content li::marker {
  color: var(--color-primary-dark);
}

table {
  border-color: var(--color-border-light);
}

table thead th {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.03em;
}

table td {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--color-border-light);
  margin: 2.5rem 0;
}

/* --------------------------------------------------------------------------
   4. 引用 / 图片
   -------------------------------------------------------------------------- */

.entry-content blockquote {
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.125rem 1.375rem;
  line-height: 1.8;
}

.entry-content blockquote p {
  color: var(--color-text-secondary);
}

.entry-content img {
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   5. 元信息：日期 / 作者 / 分类 / 面包屑
   -------------------------------------------------------------------------- */

.entry-meta,
.blog .ast-article-post .entry-meta,
.archive .ast-article-post .entry-meta {
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
}

.entry-meta a,
.entry-meta span,
.entry-meta .posted-on,
.entry-meta .cat-links,
.entry-meta .author,
.entry-meta .comments-link {
  color: var(--color-text-tertiary);
}

.entry-meta a:hover {
  color: var(--color-link);
}

.entry-meta i,
.entry-meta svg {
  color: var(--color-text-muted);
}

/* 面包屑 */
.ast-breadcrumbs-wrapper,
.ast-breadcrumbs-wrapper .ast-breadcrumbs,
.ast-breadcrumbs-wrapper .trail-items {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

.ast-breadcrumbs-wrapper a {
  color: var(--color-text-tertiary);
}

.ast-breadcrumbs-wrapper a:hover {
  color: var(--color-link);
}

.ast-breadcrumbs-wrapper .trail-items li:last-child,
.ast-breadcrumbs-wrapper .trail-items li:last-child a {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-semibold);
}

/* 归档页描述 */
.archive-description,
.blog .page-header p,
.archive .page-header p {
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   6. 侧栏与右侧目录
   -------------------------------------------------------------------------- */

.doc-toc-list li a,
#toc li a {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.doc-toc-list li a:hover,
#toc li a:hover {
  color: var(--color-text-primary);
}

.doc-toc-list li a.active,
#toc li a.active {
  color: var(--color-primary-dark);
  font-weight: var(--font-weight-semibold);
}

.doc-toc-label {
  color: var(--color-text-tertiary);
}

#secondary .widget-title,
.ast-sidebar .widget-title,
.widget .widget-title {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
}

.recent-category-posts .widget-title {
  color: var(--color-text-tertiary);
}

.recent-category-posts .post-list a {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-regular);
}

.recent-category-posts .post-list a:hover {
  color: var(--color-primary-dark);
}

.recent-category-posts .more-category-link a {
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
}

/* --------------------------------------------------------------------------
   7. 归档页标题区：去掉偏奶黄的大色块与超大留白，改为中性、克制的正式样式
   -------------------------------------------------------------------------- */

/* Astra 用的是 body.archive .ast-archive-description（特异性更高），需同级或更高权重覆盖 */
body.archive .ast-archive-description,
body.blog .ast-archive-description,
body.search .ast-archive-description,
.ast-archive-description {
  background: var(--color-bg-secondary) !important;
  border-bottom: 1px solid var(--color-border-light);
  padding: 3.25rem 1.25rem 2.5rem;
  text-align: center;
}

body.archive .ast-archive-description .ast-archive-title,
.ast-archive-description .ast-archive-title {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.archive .ast-archive-description .taxonomy-description,
.ast-archive-description .taxonomy-description,
.ast-archive-description p {
  max-width: 760px;
  margin: 0.875rem auto 0;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-base);
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   8. 按钮与控件配色统一（修正过浅/对比度不足的颜色）
   -------------------------------------------------------------------------- */

/* 侧栏搜索按钮：原为 Astra 全局色 amber #DCA54A（白字对比度仅 2.1:1）
   统一为品牌深绿，白字对比度 5.9:1；个别插件/主题用高特异性选择器注入，故加 !important */
body .wp-block-search__button,
body .wp-block-search__button.wp-element-button,
body button.wp-block-search__button,
form[class*="wp-block-search__"] .wp-block-search__button {
  background: var(--color-link) !important;
  border-color: var(--color-link) !important;
  color: #ffffff !important;
  font-weight: var(--font-weight-bold);
  transition: background 0.15s ease, border-color 0.15s ease;
}

body .wp-block-search__button:hover,
body .wp-block-search__button:focus-visible {
  background: var(--color-link-hover) !important;
  border-color: var(--color-link-hover) !important;
}

/* 移动端汉堡菜单图标：同色系，避免过浅看不清 */
body .main-header-menu-toggle,
body .main-header-menu-toggle svg,
body .main-header-menu-toggle .mobile-menu-toggle-icon,
body .main-header-menu-toggle .menu-toggle-icon {
  color: var(--color-link) !important;
  fill: var(--color-link) !important;
}

/* 表单按钮统一字重，避免按钮文字发虚 */
button,
input[type="submit"],
input[type="button"] {
  font-weight: var(--font-weight-semibold);
}

/* --------------------------------------------------------------------------
   9. 侧栏与内容卡片：统一的描边与呼吸感
   -------------------------------------------------------------------------- */

#secondary .widget,
#secondary .widget_block {
  color: var(--color-text-secondary);
}

#secondary .widget a {
  color: var(--color-text-secondary);
}

#secondary .widget a:hover {
  color: var(--color-primary-dark);
}

/* 左侧文档导航列表 */
.left-doc-sidebar,
.recent-category-posts {
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   10. 页头导航 / 搜索 / 表单 / 全局细节
   -------------------------------------------------------------------------- */

.main-header-menu a,
.main-header-menu .menu-link {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.main-header-menu a:hover,
.main-header-menu .menu-link:hover,
.main-header-menu .current-menu-item > a {
  color: var(--color-primary-dark);
}

/* 表单控件文字加深，避免浅灰输入框 */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
select,
textarea {
  color: var(--color-text-primary);
  border-color: var(--color-border-medium);
  font-weight: var(--font-weight-regular);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

/* 无下划线的“按钮型”链接不受正文链接样式影响 */
.entry-content a.wp-block-button__link,
.entry-content a.button,
.entry-content a.read-more,
.entry-content a.more-link,
.entry-content a.csrwiki-gate-btn,
.entry-content a.doc-card-item {
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
}

/* 卡片类文字（首页 / 文档卡片）统一加深 */
.doc-card-intro {
  color: var(--color-text-secondary);
}

.doc-card-item .doc-card-title {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

/* --------------------------------------------------------------------------
   11. 顶部导航与搜索框：修正 Astra 全局色带来的过浅配色
   （Astra 把菜单文字设成琥珀 #D09A40，白底对比度仅 2.4:1）
   -------------------------------------------------------------------------- */

.ast-builder-menu-1 .menu-item > .menu-link,
.ast-builder-menu .menu-item > .menu-link,
.main-header-menu .menu-item > .menu-link,
.main-header-menu .menu-item > a {
  color: var(--color-text-primary) !important;
  font-weight: var(--font-weight-semibold);
}

.ast-builder-menu-1 .menu-item > .menu-link:hover,
.ast-builder-menu-1 .menu-item > .menu-link:focus,
.ast-builder-menu .menu-item > .menu-link:hover,
.main-header-menu .menu-item > .menu-link:hover,
.main-header-menu .current-menu-item > .menu-link,
.main-header-menu .current-menu-item > a,
.main-header-menu .current-menu-ancestor > .menu-link,
.main-header-menu .current_page_item > .menu-link {
  color: var(--color-link) !important;
}

/* 下拉菜单（分类导航等） */
.main-header-menu .sub-menu .menu-link,
.main-header-menu .sub-menu a,
.ast-builder-menu .sub-menu .menu-link {
  color: var(--color-text-secondary) !important;
}

.main-header-menu .sub-menu .menu-link:hover,
.main-header-menu .sub-menu a:hover {
  color: var(--color-link) !important;
}

/* 搜索输入框：文字与占位符都加深 */
.ast-header-search .search-field,
.site-header .search-field,
.search-form .search-field,
.ast-search-box .search-field,
input.search-field,
input[type="search"] {
  color: var(--color-text-primary) !important;
  border-color: var(--color-border-medium);
}

.site-header .search-field::placeholder,
.search-form .search-field::placeholder,
.ast-search-box .search-field::placeholder,
input.search-field::placeholder,
input[type="search"]::placeholder {
  color: var(--color-text-muted) !important;
  opacity: 1;
}
