/*
    single页面css

*/
.content-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    display: flex;
    gap: 30px;
}

.main-content {
    flex: 1;
    min-width: 0;
}
.entry-header {
    margin-bottom: 30px; /* 整体底部间距 */
    padding-bottom: 15px;
    border-bottom: 1px solid #eee; /* 分隔线 */
}

.entry-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    text-align: center;
    margin: 60px 0 30px;
}

.entry-content h1 {
font-size: 22px;
font-weight: 700;
margin: 28px 0 12px;
color: #111;
border-bottom: 1px solid #ccc;
padding-bottom: 4px;
}
.entry-content h2 {
font-size: 18px;
font-weight: 600;
margin: 24px 0 10px;
color: #333;
border-left: 4px solid #4285f4;
padding-left: 8px;
}
.entry-content h3 {
font-size: 16px;
font-weight: 600;
margin: 20px 0 8px;
color: #444;
}

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

.entry-meta span {
    margin-right: 10px;
}

.entry-meta span.byline {
    font-style: italic;
}

.sidebar {
    flex: 0 0 250px;
    background: #f7f7f7;
    padding: 20px;
    border-radius: 10px;
    position: sticky;
    top: 100px;
    height: fit-content;
    font-size: 14px;
}

.table-of-contents h2 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 6px;
    cursor: pointer;
}

.table-of-contents li ul {
    padding-left: 15px;
    display: none;
}

.table-of-contents li.expanded > ul {
    display: block;
}

.table-of-contents li a {
    color: #0073aa;
    text-decoration: none;
}

.table-of-contents li a:hover {
    text-decoration: underline;
}

.table-of-contents li a.active {
    font-weight: 600;
    color: #e67e22;
}

.entry-content h1, .entry-content h2, .entry-content h3 {
    scroll-margin-top: 120px;
}

/*=====正文表格处理=====*/
/* =========================================================
   内容区表格统一美化（Gutenberg / 经典编辑器通用）
   ========================================================= */

/* 表格整体 */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    font-size: 14px;
    line-height: 1.6;

    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;

    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

/* 表头 */
.entry-content thead th {
    background: #f5f7fa;
    color: #111827;
    font-weight: 600;

    padding: 14px 16px;
    text-align: left;

    border-bottom: 1px solid #e5e7eb;
}

/* 表格单元格 */
.entry-content th,
.entry-content td {
    padding: 14px 16px;
    vertical-align: top;

    border-bottom: 1px solid #f0f0f0;

    white-space: normal;
    word-break: break-word;
}

/* 控制单列最大宽度，避免被拉成“面条表” */
.entry-content td {
    max-width: 380px;
}

/* 斑马纹 */
.entry-content tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Hover 提示 */
.entry-content tbody tr:hover {
    background: #f0f7ff;
}

/* 最后一行不要额外下边框，表格整体下边框会覆盖 */
.entry-content tbody tr:last-child th,
.entry-content tbody tr:last-child td {
    border-bottom: none;
}

/* 整体表格下边框 */
.entry-content table {
    border-bottom: 2px solid #cbd5e1; /* ⭐ 最下面的下边框 */
}

/* 单元格内段落 */
.entry-content td p {
    margin: 0;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .entry-content table {
        font-size: 13px;
    }

    .entry-content th,
    .entry-content td {
        padding: 10px 12px;
    }

    .entry-content td {
        max-width: none;
    }
}
/*=====正文表格处理 end=====*/



@media(max-width: 992px){
    /*目录手机端*/
    .content-wrapper {
        flex-direction: column;
    }
    .sidebar {
        display: none; /* 手机端隐藏右侧目录 */
    }    
    /*内容手机端*/
     .main-content {
        padding-left: 15px;
        padding-right: 15px;
    }
}
/*======h1-h3样式=======*/
/* ================= 正文标题层级（精修小字号版） ================= */
/* 强制修复：正文里的长链接自动换行 */
.entry-content a {
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: anywhere;
}
/* 正文 H1 */
.entry-content h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 36px 0 20px;
    line-height: 1.35;

    color: #1f2937;
    padding: 8px 12px;

    background-color: #eef6ff;
    border-radius: 8px;
}

/* 正文 H2 */
.entry-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 30px 0 16px;
    line-height: 1.45;

    color: #374151;
    padding: 6px 10px;

    background-color: #f3f8ff;
    border-radius: 6px;
}

/* 正文 H3 */
.entry-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 12px;
    line-height: 1.5;

    color: #4b5563;
    padding: 5px 8px;

    background-color: #f7faff;
    border-radius: 5px;
}

/* 标题后段落贴合 */
.entry-content h1 + p,
.entry-content h2 + p,
.entry-content h3 + p {
    margin-top: 6px;
}

/* 段落 */
.entry-content p {
    margin: 0 0 16px;
    line-height: 1.8;
    color: #444;
}

.entry-content p.has-background {
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8; /* 保持正常行间距，自动换行舒适 */
    margin: 20px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

/* 只针对连续的 br 调整间距 */
.entry-content p.has-background br + br {
    display: block;
    line-height: 0;
    margin: 0.4em 0; /* 两个 br 间距小 */
    height: 0;
}


/* ================= 移动端 ================= */
@media (max-width: 768px) {
    .entry-content h1 {
        font-size: 22px;
        margin: 28px 0 16px;
    }

    .entry-content h2 {
        font-size: 18px;
        margin: 24px 0 14px;
    }

    .entry-content h3 {
        font-size: 15px;
        margin: 20px 0 10px;
    }
}
/*======h1-h3样式 end =======*/


/*密码登陆访问样式*/
/* =====密码保护表单容器 =====*/
.post-password-form {
    max-width: 500px;
    margin: 40px auto;
    padding: 25px 20px;
    background-color: #f7f9fc;  /* 淡色背景 */
    border: 1px solid #ddd;
    border-radius: 10px;
    text-align: center;
    font-family: 'Helvetica', 'Arial', sans-serif;
}

/* 提示文字 */
.post-password-form p:first-of-type {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

/* 输入框容器 */
.post-password-form label {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #444;
}

/* 密码输入框 */
.post-password-form input[type="password"] {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    flex: 1;
    min-width: 120px;
}

/* 提交按钮 */
.post-password-form input[type="submit"] {
    padding: 10px 20px;
    font-size: 14px;
    background-color: #0073e6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.post-password-form input[type="submit"]:hover {
    background-color: #005bb5;
}

/* 响应式处理 */
@media(max-width: 600px){
    .post-password-form {
        padding: 20px 15px;
    }
    .post-password-form label {
        flex-direction: column;
        gap: 8px;
    }
    .post-password-form input[type="submit"] {
        width: 100%;
    }
}
/*====密码登陆访问样式===== end*/

/*======p标签模块化 样式优化 （模仿飞书）======*/
/* 通用模块样式 */
.has-background {
    padding: 25px 20px;
    border-radius: 10px;
    margin: 20px 0;
    line-height: 1.7;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

/* 浅色系背景 */
.has-light-gray-background-color { background-color: #F5F5F5; color: #202124; }
.has-light-red-background-color { background-color: #FDECEA; color: #202124; }
.has-light-orange-background-color { background-color: #FFF4E5; color: #202124; }
.has-light-yellow-background-color { background-color: #FFFBE6; color: #202124; }
.has-light-green-background-color { background-color: #E6F4EA; color: #202124; }
.has-light-blue-background-color { background-color: #E8F0FE; color: #202124; }
.has-light-purple-background-color { background-color: #F3E8FF; color: #202124; }

/* 中色系背景 */
.has-mid-gray-background-color { background-color: #D9D9D9; color: #202124; }
.has-gray-background-color { background-color: #BFBFBF; color: #202124; }
.has-mid-orange-background-color { background-color: #FBBC05; color: #202124; }
.has-mid-yellow-background-color { background-color: #F4B400; color: #202124; }
.has-mid-green-background-color { background-color: #34A853; color: #fff; }
.has-mid-blue-background-color { background-color: #4285F4; color: #fff; }
.has-mid-purple-background-color { background-color: #A142F4; color: #fff; }

/* 悬停效果 */
.has-background:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

/* 内部元素适应模块 */
.has-background p,
.has-background li { margin-bottom: 12px; }
.has-background table { width: 100%; margin: 12px 0; border-collapse: collapse; }
.has-background img { max-width: 100%; border-radius: 6px; display: block; margin: 12px 0; }
/*=======p标签模块化 样式优化end====*/

/*==========代码块============*/
.entry-content pre.wp-block-code {
    position: relative;          /* 为复制按钮定位 */
    background-color: #f5f5f5;   /* 浅灰背景 */
    border-radius: 10px;
    padding: 15px 20px;
    margin: 20px 0;
    overflow-x: auto;            /* 横向滚动 */
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;

    white-space: pre-wrap;       /* 自动换行 */
    word-wrap: break-word;       /* 强制长单词换行 */
    word-break: break-all;       /* 兼容特殊长字符 */
}

/* 复制按钮 */
.entry-content pre.wp-block-code .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 5px;
    background-color: #4285F4;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10;
}

.entry-content pre.wp-block-code .copy-btn:hover {
    background-color: #3367d6;
}

/* code 内部样式 */
.entry-content pre.wp-block-code code {
    display: block;
    white-space: inherit; /* 继承 pre-wrap 自动换行 */
}

/* 响应式 */
@media (max-width: 768px) {
    .entry-content pre.wp-block-code {
        font-size: 13px;
        padding: 12px 15px;
    }
}
/*=========代码块end=========*/


/*=======打印====*/
/* =========================================
   打印样式（完整最终版）
   作用：只打印正文 main-content
========================================= */
/*按钮样式*/
.print-btn {
    float: right;
    display: inline-block;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4285F4, #34A853);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    margin-bottom: 20px;
}

.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.4);
    background: linear-gradient(135deg, #3367d6, #2c8c43);
}

.print-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(66, 133, 244, 0.3);
}

@media (max-width: 768px) {
    .print-btn {
        width: 100%;
        font-size: 15px;
        padding: 12px 0;
    }
}
/*//打印样式 开始*/
@media print {

  /* ---------- 页面尺寸与边距 ---------- */
  @page {
    size: A4;
    margin: 20mm 18mm;
  }

  /* ---------- 全站隐藏非必要元素 ---------- */
  .site-header,
  .site-footer,
  .sidebar,
  .print-btn,
  nav,
  header,
  footer {
    display: none !important;
  }

  /* ---------- 保留正文布局 ---------- */
  body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #222;
    background: #fff;
  }

  .content-wrapper {
    display: block !important; /* 保持网页布局 */
    width: 100%;
    margin: 0 auto;
    padding: 0;
  }

  .main-content {
    width: 100% !important;
    margin: 0 auto;
    position: relative;
  }

  /* ---------- 段落优化 ---------- */
  .entry-content p {
    font-size: 14px;
    margin-bottom: 12px;
    color: #222;
    text-align: justify;
  }
/* 正文里 a 标签：像文字一样自动换行 */
.entry-content p a {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
}

  /* ---------- 标题优化 ---------- */
  .entry-content h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: #111;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
  }
  .entry-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px;
    color: #333;
    border-left: 4px solid #4285f4;
    padding-left: 8px;
  }
  .entry-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px;
    color: #444;
  }

  /* ---------- 表格优化 ---------- */
  .entry-content table {
    width: 100% !important;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 12px;
  }
  .entry-content th,
  .entry-content td {
    padding: 8px 10px;
    border: 1px solid #ccc;
  }
  .entry-content thead th {
    background: #f5f7fa;
    font-weight: 600;
  }
  .entry-content tbody tr:nth-child(even) {
    background: #fafafa;
  }

  /* ---------- 代码块优化 ---------- */
  .entry-content pre,
  .entry-content code {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    background: #f4f4f4;
    border-left: 4px solid #34a853;
    padding: 10px 12px;
    margin: 12px 0;
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* ---------- 图片优化 ---------- */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  /* ---------- 避免分页拆分 ---------- */
  h1, h2, h3, table, pre, blockquote, figure, ul, ol {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  /* ---------- 页脚 ---------- */
  .print-footer {
    display: block !important;
    position: fixed;
    bottom: 10mm;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 4px;
  }

  /* ---------- 链接不显示 URL ---------- */
  a[href]:after {
    content: "";
  }

  /* ---------- 背景与阴影去除 ---------- */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }
}
/*====打印end====*/