/*
Theme Name: Minimal Personal
Description: 极简风格个人向WordPress主题
Version: 1.0
Author: Your Name
*/
/* === 主题变量：白天/夜间模式支持 ===
   使用 [data-theme="dark"] 切换到暗色
*/
:root {
  /* 亮色（默认） */
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --border: #e9e9e9;
  --header-bg: #ffffff;
  --footer-bg: #ffffff;
  --accent: #007cba;
  --button-bg: rgba(0,0,0,0.04);
  --button-color: inherit;
  --link-color: var(--accent);
  --shadow: rgba(0,0,0,0.06);
}

/* 兼容性：同时匹配 html[data-theme] 和 body[data-theme] */
html[data-theme="dark"], body[data-theme="dark"] {
  --bg: #0f1720;
  --text: #e6eef6;
  --muted: #9fb0c8;
  --border: rgba(255,255,255,0.06);
  --header-bg: #0b1116;
  --footer-bg: #071018;
  --accent: #2aa6ff;
  --button-bg: rgba(255,255,255,0.04);
  --button-color: inherit;
  --link-color: var(--accent);
  --shadow: rgba(0,0,0,0.6);
  --title-color: #ffffff;
}

/* 保证当 body 或 html 其中一个含有 data-theme 时样式生效（防止某些模板仅设置 body） */

/* 全局基础颜色使用变量 */
body {
  background-color: var(--bg);
  color: var(--text);
}

/* header/footer 背景 */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--border); }
.site-footer { background: var(--footer-bg); border-top: 1px solid var(--border); }

/* 链接颜色 */
a { color: var(--link-color); }

/* 统一按钮风格（包含主题切换按钮） */
.theme-toggle-button,
.article-actions .action-button,
.button,
button {
  background: var(--button-bg);
  color: var(--button-color);
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* 主题切换按钮的定位（header 右上角） */
.header-content {
  position: relative;
}
.theme-toggle-wrapper {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 切换按钮样式微调 */
.theme-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  font-size: 16px;
  line-height: 1;
  background: var(--button-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: background-color 200ms ease, transform 150ms ease;
}
.theme-toggle-button:hover {
  transform: translateY(-1px);
}
.theme-toggle-button:focus {
  outline: 3px solid rgba(0,124,186,0.18);
  outline-offset: 2px;
}

/* 确保 article / 对话框 等也使用变量 */
.article-header,
.article-content,
.comments-area,
.comment-respond {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

/* 小屏幕时调整切换按钮位置，避免遮挡 */
@media (max-width: 480px) {
  .theme-toggle-wrapper {
    right: 12px;
  }
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    padding: 80px 0 60px;
    min-height: 100vh;
}

/* 顶部区域 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* 头像样式与动画 */
.avatar-link {
    display: inline-block;
}

.header-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    transition: transform 0.5s ease; /* 添加过渡效果 */
}

.header-avatar:hover {
    transform: rotate(360deg); /* 悬停时旋转360度 */
}

.header-text {
    flex: 1;
}

/* 其他原有样式... */

.header-nickname {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.header-signature {
    font-size: 14px;
    color: #666;
}

/* 主内容区 */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 应用于文章标题与评论标题，使用较高优先级以覆盖主题原有规则 */
html[data-theme="dark"] .article-title,
body[data-theme="dark"] .article-title,
html[data-theme="dark"] .comments-title,
body[data-theme="dark"] .comments-title {
  color: var(--title-color) !important;
  /* 若需要更明显的分层，可适当增加 font-weight */
  font-weight: 700 !important;
}

/* 暗色模式：提高评论提交按钮的文字对比度 */
html[data-theme="dark"] .comment-submit,
body[data-theme="dark"] .comment-submit {
  color: var(--text) !important;          /* 使用暗色主题的主文本色，保证可读性 */
  background: var(--button-bg) !important;/* 保持按钮背景与其它按钮一致 */
  border-color: var(--border) !important;
  box-shadow: none !important;
}

/* 底部导航 */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 10px 0;
    z-index: 1000;
}

.nav-menu {
    display: flex;
    justify-content: space-around;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 5px 10px;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: 12px;
}

.nav-button.active,
.nav-button:hover {
    color: #007cba;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* 文章样式 */
.article-list {
    list-style: none;
}

.article-item {
    border-bottom: 1px solid #eee; /* 保留底部边框作为分隔 */
    padding: 25px 0; /* 增加上下内边距 */
    margin-bottom: 15px; /* 增加底部外边距作为间隔 */
}

/* 可选：最后一篇文章去掉底部边框，避免多余线条 */
.article-list .article-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.article-title {
    font-size: 18px;
    margin-bottom: 8px;
}

.article-title a {
    text-decoration: none;
    color: #333;
}

.article-title a:hover {
    color: #007cba;
}

.article-meta {
    font-size: 14px;
    color: #666;
}

.article-excerpt {
    margin-top: 10px;
    color: #555;
}

/* 友情链接样式 */
.links-list {
    list-style: none;
}

.link-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.link-item a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
}

.link-item a:hover {
    color: #007cba;
}

/* 关于页面 */
.about-content {
    line-height: 1.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 70px 0 50px;
    }
    
    .header-avatar {
        width: 40px;
        height: 40px;
    }
    
    .header-nickname {
        font-size: 16px;
    }
    
    .header-signature {
        font-size: 13px;
    }
    
    .site-main {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 10px 15px;
    }
    
    .nav-button {
        font-size: 11px;
        padding: 5px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
}
/* 在原有样式基础上添加以下内容 */

/* 九宫格布局 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.grid-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 1px solid #eee; /* 保留底部边框作为分隔 */
    padding: 25px 0; /* 增加上下内边距 */
    margin-bottom: 15px; /* 增加底部外边距作为间隔 */
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.grid-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.grid-info {
    padding: 15px;
    background: #fff;
}

.grid-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.grid-title a {
    text-decoration: none;
    color: #333;
}

.grid-title a:hover {
    color: #007cba;
}

.grid-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
}

/* 点赞按钮 */
.like-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-button:hover {
    background: #fff0f0;
    color: #e74c3c;
}

.like-button.liked {
    color: #e74c3c;
}

.like-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.like-count {
    margin-left: 3px;
}

/* 灯箱样式 */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    padding: 10px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 10px;
        padding: 15px 0;
    }
    
    .grid-image {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .grid-image {
        height: 180px;
    }
    
    .grid-info {
        padding: 10px;
    }
    
    .grid-title {
        font-size: 14px;
    }
}
/* 在原有样式基础上添加以下内容 */

/* 文章详情页样式 */
.single-post .site-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.article-header {
    margin-bottom: 30px;
    text-align: center;
}

.article-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    color: #333;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-icon {
    font-size: 16px;
}

.article-featured-image {
    margin: 30px 0;
    text-align: center;
}

.article-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 40px;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 2em 0 1em;
    color: #333;
    line-height: 1.4;
}

.article-content h2 {
    font-size: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.article-content h3 {
    font-size: 20px;
}

.article-content blockquote {
    border-left: 4px solid #007cba;
    padding-left: 20px;
    margin: 2em 0;
    font-style: italic;
    color: #666;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.article-footer {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 30px 0;
    margin: 40px 0;
}

.article-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}
/* 统一文章操作按钮样式：保证 a 和 button 外观一致，去除 a 的下划线并垂直居中 */
.article-actions .action-button {
    display: inline-flex;               /* 保证水平布局且垂直居中 */
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 60px;                       /* 统一高度（根据需要调整） */
    padding: 6px 12px;
    margin: 0 6px 0 0;
    border: none;                       /* 如果是 <button>，去掉默认边框 */
    background: transparent;            /* 保持原有风格（可调整为色块） */
    color: inherit;
    font-size: 14px;
    line-height: 1;                     /* 防止行高影响对齐 */
    vertical-align: middle;             /* 与周围文本基线对齐 */
    text-decoration: none;              /* 去掉 a 的下划线 */
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 6px;                 /* 可选，和主题风格一致 */
    box-sizing: border-box;
}

/* 确保 a.action-button 在 hover/active 时也不出现下划线 */
.article-actions .action-button:hover,
.article-actions .action-button:active {
    text-decoration: none;
}

/* 保持无障碍焦点样式（不要去掉 focus） */
.article-actions .action-button:focus {
    outline: 3px solid rgba(0,124,186,0.18);
    outline-offset: 2px;
}

/* 如果需要让图标垂直居中（保险） */
.article-actions .action-button .action-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* 如果仍旧有视觉差（例如按钮高度比其他控件略大），可微调高度/padding */
.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
    padding: 10px;
    border-radius: 8px;
}

.action-button:hover {
    color: #007cba;
    background: #f8f9fa;
}

.action-button.liked {
    color: #e74c3c;
}

.action-button .action-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.action-button .action-text {
    font-size: 12px;
}

.article-tags {
    text-align: center;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    list-style: none;
}

.tag-item a {
    display: inline-block;
    padding: 4px 12px;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 15px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.tag-item a:hover {
    background: #007cba;
    color: white;
}

/* 评论区域样式 */
.comments-area {
    margin-top: 50px;
}

.comments-title {
    font-size: 22px;
    margin-bottom: 30px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.comment-list {
    list-style: none;
    margin-bottom: 40px;
}

.comment {
    border-bottom: 1px solid #eee;
    padding: 25px 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment-body {
    display: flex;
    gap: 15px;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-text {
    line-height: 1.6;
    color: #555;
    margin-bottom: 10px;
}

.comment-reply-link {
    font-size: 12px;
    color: #007cba;
    text-decoration: none;
}

.comment-reply-link:hover {
    text-decoration: underline;
}

.children {
    list-style: none;
    margin-left: 40px;
    margin-top: 20px;
    border-left: 2px solid #f0f0f0;
    padding-left: 20px;
}

/* 评论表单样式 */
.comment-respond {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
}

.comment-reply-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.comment-form {
    display: grid;
    gap: 15px;
}

.comment-form-author,
.comment-form-email,
.comment-form-url {
    display: inline-block;
    width: calc(33.333% - 10px);
}

.comment-form-comment {
    grid-column: 1 / -1;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #007cba;
}

.comment-form textarea {
    resize: vertical;
    min-height: 120px;
}

.comment-submit {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.comment-submit:hover {
    background: #005a87;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .article-title {
        font-size: 24px;
    }
    
    .article-meta {
        gap: 15px;
        font-size: 13px;
    }
    
    .article-actions {
        gap: 20px;
    }
    
    .comment-body {
        flex-direction: column;
    }
    
    .comment-avatar {
        width: 40px;
        height: 40px;
    }
    
    .children {
        margin-left: 20px;
    }
    
    .comment-form-author,
    .comment-form-email,
    .comment-form-url {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .single-post .site-main {
        padding: 0 15px;
    }
    
    .article-title {
        font-size: 20px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-actions {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .comment-respond {
        padding: 20px;
    }
}
/* 分享弹窗样式 */
.share-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.share-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 300px;
    text-align: center;
    position: relative;
}

.share-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.share-qrcode {
    margin: 20px 0;
    padding: 10px;
    background: #fff;
    display: inline-block;
    border: 1px solid #eee;
}

.share-qrcode img {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.copy-link {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.copy-link:hover {
    background: #005a87;
}
/* 优化文章列表样式 */
.article-list {
    list-style: none;
    margin-bottom: 30px;
}

.article-item {
    border-bottom: 1px solid #eee;
    padding: 30px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* 最后一个项目不加边框 */
.article-item:last-child {
    border-bottom: none;
}

.article-title {
    font-size: 22px;
    margin-bottom: 12px;
}

.article-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: #007cba;
}

.article-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
}

.article-excerpt {
    margin-top: 10px;
    color: #555;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.read-more a {
    display: inline-block;
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.read-more a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* 加载更多按钮样式 */
.load-more-container {
    text-align: center;
    padding: 20px 0;
}

.load-more-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.load-more-button:hover {
    background: #005a87;
}

.load-more-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 文章图片网格布局 */
.post-image-grid {
    display: grid;
    gap: 8px;
    margin: 20px 0;
}

/* 单张图片 */
.post-image-grid.single-image {
    grid-template-columns: 1fr;
}

/* 4张以内 - 四宫格 */
.post-image-grid.four-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* 6张以内 - 六宫格 */
.post-image-grid.six-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* 九宫格 */
.post-image-grid.nine-grid {
    grid-template-columns: repeat(3, 1fr);
}

.post-image-grid .grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.post-image-grid .grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    aspect-ratio: 1/1; /* 正方形比例 */
}

/* 单张图片特殊样式 */
.post-image-grid.single-image .grid-image {
    aspect-ratio: auto;
    max-height: 500px;
    margin: 0 auto;
}

/* 查看更多覆盖层 */
.more-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-text {
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

/* === 更柔和的暗色方案（替换之前的强暗色） ===
   把本段追加到 style.css 末尾（或替换之前的暗色变量段）
*/
html[data-theme="dark"], body[data-theme="dark"] {
  /* 更柔和的背景色（比纯黑或更深的深色更轻一点） */
  --bg: #1f2937;           /* 深灰-蓝（更柔和） */
  --text: #dde8f3;         /* 温和的白色文本 */
  --muted: #9fb0c8;
  --border: rgba(255,255,255,0.07);
  --header-bg: #0f1724;    /* 头部比主体稍深，保留分层感 */
  --footer-bg: #0c1622;
  --accent: #4aa3ff;       /* 轻一点的蓝色高亮 */
  --button-bg: rgba(255,255,255,0.03);
  --button-color: inherit;
  --link-color: var(--accent);
  --shadow: rgba(0,0,0,0.45);
  --overlay: rgba(0,0,0,0.45); /* 画廊 / 遮罩层，略透明 */
}

/* 应用到主要容器（保留 !important 用于覆盖主题中写死颜色的情况；调试通过后可去掉） */
html[data-theme="dark"] body,
body[data-theme="dark"] body,
html[data-theme="dark"] .site-main,
body[data-theme="dark"] .site-main,
html[data-theme="dark"] .single-post,
body[data-theme="dark"] .single-post,
html[data-theme="dark"] .article-content,
body[data-theme="dark"] .article-content,
html[data-theme="dark"] .site-header,
body[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-footer,
body[data-theme="dark"] .site-footer {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* 链接与强调色 */
html[data-theme="dark"] a,
body[data-theme="dark"] a {
  color: var(--link-color) !important;
}

/* 减轻暗色遮罩强度（画廊“更多”覆盖层与 lightbox 背景）*/
html[data-theme="dark"] .mp-gallery__more,
body[data-theme="dark"] .mp-gallery__more {
  background: rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .mp-lightbox,
body[data-theme="dark"] .mp-lightbox {
  background: rgba(0,0,0,0.75) !important; /* 比之前更透明一点 */
}

/* 卡片/网格/评论表单：避免纯白背景带来的强烈反差，转为透明或轻微暗色 */
html[data-theme="dark"] .grid-item,
body[data-theme="dark"] .grid-item,
html[data-theme="dark"] .comment-respond,
body[data-theme="dark"] .comment-respond {
  background-color: rgba(255,255,255,0.02) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* 小按钮、导航使用变量 */
html[data-theme="dark"] .nav-button,
body[data-theme="dark"] .nav-button,
html[data-theme="dark"] .theme-toggle-button,
body[data-theme="dark"] .theme-toggle-button {
  background: var(--button-bg) !important;
  border-color: var(--border) !important;
  color: var(--button-color) !important;
}

/* 可选：让图片框在暗色时更融入背景（避免白色图片卡片显突兀） */
html[data-theme="dark"] .mp-gallery__item,
body[data-theme="dark"] .mp-gallery__item {
  background: transparent !important;
}

/* 聚焦样式（保留可见性） */
html[data-theme="dark"] .theme-toggle-button:focus,
body[data-theme="dark"] .theme-toggle-button:focus,
html[data-theme="dark"] .action-button:focus,
body[data-theme="dark"] .action-button:focus {
  outline: 3px solid rgba(74,163,255,0.18) !important;
  outline-offset: 2px !important;
}

/* 响应式保持位置 */
@media (max-width: 480px) {
  .theme-toggle-wrapper {
    right: 12px;
  }
}

/* 说明：如果需要更亮的暗色（接近暗灰而非接近黑），把 --bg 调到 #1b2430 或 #1f2937 */