/* ===== 817读易笔记 - 暖夜星空全站样式 ===== */

/* 1. 全局背景改为暖夜深色 */
body {
  background-color: #1a1714 !important;
  color: #d4c8b8 !important;
}

/* 2. 动态星空画布 */
#dyd-starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* 3. 主内容区域透明化 */
.wp-site-blocks,
.site-content,
main,
.entry-content,
.post-content,
.page-content,
.content-area {
  background: transparent !important;
}

/* 4. 文章卡片暖色风格 */
article,
.post,
.entry,
.wp-block-post,
.wp-block-query .wp-block-post-template > li,
.type-post,
.type-page {
  background: rgba(245, 240, 232, 0.88) !important;
  border: 1px solid rgba(200, 185, 165, 0.35) !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  box-shadow: 0 2px 12px rgba(60, 45, 30, 0.08) !important;
  transition: all 0.4s ease !important;
}

article:hover,
.post:hover,
.entry:hover,
.wp-block-post:hover,
.wp-block-query .wp-block-post-template > li:hover {
  background: rgba(252, 248, 242, 0.95) !important;
  border-color: rgba(180, 136, 100, 0.4) !important;
  box-shadow: 0 8px 32px rgba(60, 45, 30, 0.12) !important;
  transform: translateY(-2px);
}

/* 5. 文章标题 */
article h2,
article h3,
.entry-title,
.post-title,
.wp-block-post-title a,
.wp-block-post-title {
  color: #3d3529 !important;
  transition: color 0.3s ease;
}

article:hover h2,
article:hover h3,
article:hover .entry-title,
article:hover .post-title,
.wp-block-post:hover .wp-block-post-title a {
  color: #8a6d4b !important;
}

/* 6. 文章摘要/正文 */
article p,
.entry-summary,
.entry-content,
.wp-block-post-excerpt,
.wp-block-post-excerpt__excerpt {
  color: #5c4d3a !important;
  line-height: 1.75 !important;
}

/* 7. 日期、元信息 */
.post-date,
.entry-date,
.wp-block-post-date,
.post-meta,
.entry-meta {
  color: #9a8e7e !important;
}

/* 8. 分类标签 */
.post-categories a,
.cat-links a,
.wp-block-post-terms a,
.tag-links a {
  display: inline-block !important;
  padding: 0.2rem 0.6rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  background: rgba(180, 136, 100, 0.12) !important;
  color: #8a6d4b !important;
  border: 1px solid rgba(180, 136, 100, 0.2) !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
}

.post-categories a:hover,
.cat-links a:hover,
.wp-block-post-terms a:hover {
  background: rgba(180, 136, 100, 0.2) !important;
}

/* 9. 分页按钮 */
.pagination a,
.page-numbers,
.nav-links a,
.wp-block-query-pagination a,
.wp-block-query-pagination .wp-block-query-pagination-numbers a {
  background: rgba(200, 185, 165, 0.3) !important;
  border: 1px solid rgba(180, 170, 155, 0.4) !important;
  color: #9a8e7e !important;
  border-radius: 9999px !important;
  padding: 0.4rem 0.9rem !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
}

.pagination a:hover,
.page-numbers:hover,
.nav-links a:hover {
  background: rgba(180, 136, 100, 0.15) !important;
  border-color: rgba(180, 136, 100, 0.3) !important;
  color: #b48864 !important;
}

.pagination .current,
.page-numbers.current {
  background: rgba(180, 136, 100, 0.2) !important;
  border-color: rgba(180, 136, 100, 0.4) !important;
  color: #b48864 !important;
}

/* 10. 导航栏 */
header,
.site-header,
.wp-block-group:has(nav) {
  background: rgba(26, 23, 20, 0.85) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

nav a,
.wp-block-navigation a,
.menu a,
.site-navigation a {
  color: #c4b8a8 !important;
  transition: color 0.3s ease;
}

nav a:hover,
.wp-block-navigation a:hover,
.menu a:hover {
  color: #b48864 !important;
}

/* 11. 页脚 */
footer,
.site-footer {
  background: rgba(26, 23, 20, 0.9) !important;
  border-top: 1px solid rgba(180, 170, 155, 0.15) !important;
  color: #9a8e7e !important;
}

footer a,
.site-footer a {
  color: #c4b8a8 !important;
  transition: color 0.3s ease;
}

footer a:hover,
.site-footer a:hover {
  color: #b48864 !important;
}

/* 12. 搜索框 */
input[type="search"],
.wp-block-search__input,
.search-field {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(120, 110, 95, 0.3) !important;
  border-radius: 9999px !important;
  color: #d4c8b8 !important;
  padding: 0.6rem 1rem 0.6rem 2.5rem !important;
}

input[type="search"]::placeholder,
.wp-block-search__input::placeholder {
  color: #7a6e5e !important;
}

input[type="search"]:focus,
.wp-block-search__input:focus {
  border-color: rgba(180, 136, 100, 0.5) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  outline: none !important;
}

/* 搜索按钮 */
.wp-block-search__button,
.search-submit,
button[type="submit"] {
  background: rgba(180, 136, 100, 0.2) !important;
  border: 1px solid rgba(180, 136, 100, 0.3) !important;
  color: #8a6d4b !important;
  border-radius: 9999px !important;
  padding: 0.5rem 1.2rem !important;
  cursor: pointer !important;
  transition: all 0.3s ease;
}

.wp-block-search__button:hover,
.search-submit:hover {
  background: rgba(180, 136, 100, 0.35) !important;
}

/* 13. 侧边栏小工具 */
.widget,
.wp-block-widget-area .wp-block-group {
  background: rgba(245, 240, 232, 0.85) !important;
  border: 1px solid rgba(200, 185, 165, 0.3) !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
  color: #5c4d3a !important;
}

.widget-title,
.wp-block-widget-area h2,
.wp-block-widget-area h3 {
  color: #3d3529 !important;
}

.widget a,
.wp-block-widget-area a {
  color: #8a6d4b !important;
}

/* 14. 按钮通用 */
.wp-block-button__link,
button,
.btn,
.button {
  background: rgba(180, 136, 100, 0.2) !important;
  border: 1px solid rgba(180, 136, 100, 0.3) !important;
  color: #8a6d4b !important;
  border-radius: 9999px !important;
  transition: all 0.3s ease;
}

.wp-block-button__link:hover,
button:hover,
.btn:hover {
  background: rgba(180, 136, 100, 0.35) !important;
  color: #b48864 !important;
}

/* 15. 链接 */
a {
  color: #b48864;
  transition: color 0.3s ease;
}

a:hover {
  color: #d4a882;
}

/* 16. 引用块 */
blockquote,
.wp-block-quote {
  border-left: 3px solid rgba(180, 136, 100, 0.4) !important;
  background: rgba(180, 136, 100, 0.05) !important;
  color: #6a5e4e !important;
  padding: 1rem 1.5rem !important;
  border-radius: 0 0.5rem 0.5rem 0 !important;
}

/* 17. 代码块 */
code,
pre,
.wp-block-code {
  background: rgba(180, 136, 100, 0.08) !important;
  color: #6a5e4e !important;
  border-radius: 0.5rem !important;
}

/* 18. 表格 */
table,
.wp-block-table {
  background: rgba(245, 240, 232, 0.85) !important;
  border-color: rgba(200, 185, 165, 0.3) !important;
}

table th,
.wp-block-table th {
  background: rgba(180, 136, 100, 0.1) !important;
  color: #3d3529 !important;
}

table td,
.wp-block-table td {
  color: #5c4d3a !important;
  border-color: rgba(200, 185, 165, 0.2) !important;
}

/* 19. 评论区域 */
.comment,
.wp-block-comments .comment {
  background: rgba(245, 240, 232, 0.85) !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
}

.comment-author,
.comment-meta {
  color: #5c4d3a !important;
}

.comment-content {
  color: #5c4d3a !important;
}

/* 20. 表单输入 */
input[type="text"],
input[type="email"],
input[type="url"],
textarea,
select {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(120, 110, 95, 0.3) !important;
  border-radius: 0.5rem !important;
  color: #d4c8b8 !important;
  padding: 0.6rem 1rem !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: rgba(180, 136, 100, 0.5) !important;
  outline: none !important;
}

/* 21. 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1714;
}

::-webkit-scrollbar-thumb {
  background: rgba(180, 136, 100, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(180, 136, 100, 0.5);
}

/* 22. 选中文字颜色 */
::selection {
  background: rgba(180, 136, 100, 0.3);
  color: #f5f0e8;
}

/* 23. 确保图片在暖色卡片里正常显示 */
article img,
.post img,
.entry img,
.wp-block-post img {
  border-radius: 0.5rem !important;
}

/* 24. 面包屑导航 */
.breadcrumb,
.wp-block-group:has(.breadcrumb) {
  color: #9a8e7e !important;
}

.breadcrumb a {
  color: #b48864 !important;
}
/* ===== 回到顶部/底部按钮 ===== */
#dyd-scroll-buttons {
  position: fixed;
  right: 1.5rem;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

#dyd-scroll-buttons.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#dyd-scroll-buttons button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(180, 136, 100, 0.2);
  border: 1px solid rgba(180, 136, 100, 0.3);
  color: #b48864;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#dyd-scroll-buttons button:hover {
  background: rgba(180, 136, 100, 0.35);
  color: #d4a882;
  transform: scale(1.1);
}

@media (max-width: 767px) {
  #dyd-scroll-buttons { right: 1rem; bottom: 1.5rem; }
  #dyd-scroll-buttons button { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
}