/* THEME TOKENS — 亮色为默认，暗色通过 html.dark 覆写 */
:root {
    /* 背景层 */
    --bg: #ffffff;
    --sidebar-bg: rgb(61, 79, 93);

    /* 文字层 */
    --text: #222;
    --text-muted: #666;
    --text-soft: #999;
    --text-on-sidebar: #fff;
    --text-on-sidebar-muted: rgb(176, 202, 219);

    /* 交互 */
    --link: rgb(61, 146, 201);

    /* 分隔 / 边框 */
    --border: #eee;
    --border-subhead: #eee;
}

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}


#loading {
    margin-bottom: 15px;
}
#error {
    display: none;
    margin-bottom: 15px;
}
a {
    text-decoration: none;
    color: var(--link);
}
a:hover,
a:focus {
    text-decoration: underline;
}

h3 {
    font-weight: 100;
}

/* 全局背景（跟随主题） */
html, body {
    background: var(--bg);
    color: var(--text);
    transition: background-color .2s, color .2s;
}

/* LAYOUT CSS */
.pure-img-responsive {
    max-width: 100%;
    height: auto;
}

#layout {
    padding: 0;
}
.ico {
    color: var(--link);
    font-size:1.1em;
    display:inline-block;
    text-align:center;
    width:20px;height:20px;
    line-height:20px;
    vertical-align:middle;
    box-sizing: border-box;
    margin-right: 2px;
}
.header {
    text-align: center;
    top: auto;
    margin: 3em auto;
}

.sidebar {
    background: var(--sidebar-bg);
    color: var(--text-on-sidebar);
    position:relative;
}

.brand-title,
.brand-tagline {
    margin: 0;
}
.brand-title {
    text-transform: uppercase;
}
.brand-tagline {
    font-weight: 300;
    color: var(--text-on-sidebar-muted);
}

.nav-list {
    margin: 0;
    padding: 0;
    list-style: none;
    height: 200%;
    line-height: 200%;
    padding-left: 3em;
}
.nav-item {
    display: inline-block;

}
.nav-item a {
    background: transparent;
    /* border: 2px solid rgb(176, 202, 219); */
    color: var(--text-on-sidebar);
    margin-top: 1em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 1.1em;
}
.nav-item a:hover,
.nav-item a:focus {
    border: 2px solid var(--link);
    text-decoration: none;
}
.sidebar-button-icon{font-size:1.8rem;
    display:inline-block;
    text-align:center;
    width:36px;height:36px;
    line-height:36px;
    padding-top:0;
    vertical-align:middle
}
.content-subhead {
    text-transform: uppercase;
    color: var(--text-soft);
    border-bottom: 1px solid var(--border-subhead);
    padding: 0.4em 0;
    font-size: 80%;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.content {
    padding: 2em 1em 0;
}

.post {
    padding-bottom: 2em;
}
.post-title {
    font-size: 1.5em;
    color: var(--text);
    margin-bottom: 0.2em;
}
.post-avatar {
    border-radius: 50px;
    float: right;
    margin-left: 1em;
}
.post-description {
    color: var(--text);
    line-height: 1.8em;
}
.post-meta {
    color: var(--text-soft);
    font-size: 90%;
    margin: 0;
}

.post-category {
    margin: 0 0.1em;
    padding: 0.3em 1em;
    color: #fff;
    background: #999;
    font-size: 80%;
}
    .post-category-design {
        background: #5aba59;
    }
    .post-category-pure {
        background: #4d85d1;
    }
    .post-category-yui {
        background: #8156a7;
    }
    .post-category-js {
        background: #df2d4f;
    }

.post-images {
    margin: 1em 0;
}
.post-image-meta {
    margin-top: -3.5em;
    margin-left: 1em;
    color: #fff;
    text-shadow: 0 1px 1px #333;
}

.footer {
    padding: 1em 0;
    /* background: rgb(61, 79, 93);
    color: #fff; */
    font-size: 90%;
}
.footer a {
    color: var(--text-muted);
    font-size: 80%;
}
.footer i {
    color: var(--text-muted);
    font-size: 400%;
}

.footer .pure-menu a:hover,
.footer .pure-menu a:focus {
    background: none;
}

@media (min-width: 48em) {
    .content {
        padding: 2em 3em 0;
        margin-left: 12.5%;
    }

    .header {
        margin: 80% 2em 0;
        text-align: right;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
    }

    .footer {
        text-align: center;
    }
}

.comment-head {
    vertical-align:middle;
}




.pure-hidden {
    display: none !important;
    visibility: hidden !important;
}
.pure-alert {
    margin-bottom: 15px;
    padding: 10px;
    background: #ebf7fd;
    color: #2d7091;
}

.pure-form-danger {
    border-color: #dc8d99 !important;
    background: #fff7f8 !important;
    color: #d85030 !important;
}

.pure-alert-danger {
background: #fff1f0;
color: #d85030;
}
.layout-item {
    /* margin-top: 2em; */
    /* padding-top: 2em; */
    border-top: 1px solid var(--border);
}
.layout-item-screenshot {
    text-align: center;
}
.layout-item-head {
    margin-top: 0; /* so that the .layout-item-head lines up with the image */
}
.layout-item-modules {
    padding: 0;
}
.layout-item-module {
    margin-right: 0.5714em;
    font-size: 0.875em;
}
.layout-item-module-base a {
    border-left: 3px solid rgb(14, 144, 210);
}
.layout-item-module-grids a {
    border-left: 3px solid rgb(128, 88, 165);
}
.layout-item-module-forms a {
    border-left: 3px solid rgb(94, 185, 94);
}
.layout-item-module-buttons a {
    border-left: 3px solid rgb(221, 81, 76);
}
.layout-item-module-tables a {
    border-left: 3px solid rgb(243, 123, 29);
}
.layout-item-module-menus a {
    border-left: 3px solid rgb(250, 210, 50);
}
.layout-item-module a:link,
.layout-item-module a:visited {
    text-transform: capitalize;
    color: rgb(75, 75, 75);
    padding: 0 0.5714em;
    line-height: 1.75;
    display: block;
}

/* PAGINATION */
.pagination {
    margin-top: 1.5em;
    text-align: center;
}
.pagination .pure-menu-list {
    display: inline-block;
}
.pagination .pure-menu-item a {
    padding: 0.4em 1em;        /* 扩大点击热区 */
    font-size: 1.4em;          /* 图标变大 */
    min-width: 2.5em;
    display: inline-block;
    text-align: center;
}
.pagination .pure-menu-item.pure-button-disabled {
    padding: 0.4em 1em;
    font-size: 1.4em;
    color: var(--text-muted);
    cursor: not-allowed;
}
.pagination .pure-menu-item span {
    padding: 0 1em;
    font-size: 1.2em;
    color: var(--text-muted);
}

/* ============================================================
   DARK THEME — 通过 html.dark class 触发
   ============================================================ */
html.dark {
    --bg: #1a1d23;
    --sidebar-bg: #0f1115;

    --text: #e4e4e4;
    --text-muted: #a0a0a0;
    --text-soft: #6e6e6e;
    --text-on-sidebar: #cdd6e0;
    --text-on-sidebar-muted: #7a8798;

    --link: #6cb4ee;

    --border: #2d3139;
    --border-subhead: #2d3139;
}

/* 按钮显隐：处于该主题时隐藏带 .hidden-on-<theme> 的元素 */
html.light .hidden-on-light { display: none; }
html.dark  .hidden-on-dark  { display: none; }

/* ============================================================
   代码块容器 —— 仅处理 <pre> 外层和行内 <code>
   highlight.js 的 .hljs 类负责语法高亮的 color/background，
   此处规则通过 :not(.hljs) 避免与 hljs 主题冲突
   ============================================================ */

/* 代码块统一等宽字体栈 */
.markdown-body pre,
.markdown-body code {
    font-family: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
}

/* 亮色模式：行内 <code> 和 <pre> 容器 */
.markdown-body code:not(.hljs),
.markdown-body code:not(.hljs),
.markdown-body code:not(.hljs) {
    background: rgba(175,184,193,.2);   /* GitHub inline-code 灰 */
    border-radius: 6px;
    padding: .2em .4em;
    font-size: 85%;
}
.markdown-body pre code:not(.hljs),
.markdown-body pre code:not(.hljs),
.markdown-body pre code:not(.hljs) {
    background: transparent;    /* 让 hljs 主题的 .hljs 接管 background */
    border-radius: 0;
    padding: 0;
    font-size: 100%;
}
.markdown-body pre,
.markdown-body pre,
.markdown-body pre {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

/* 暗色模式容器 */
html.dark .markdown-body code:not(.hljs),
html.dark .markdown-body code:not(.hljs),
html.dark .markdown-body code:not(.hljs) {
    background: rgba(110,118,129,.4);
}
html.dark .markdown-body pre,
html.dark .markdown-body pre,
html.dark .markdown-body pre {
    border-color: #30363d;
    background: transparent;    /* hljs 主题的 .hljs 已设背景，pre 不需要 */
}

/* ============================================================
   EDITORMD 暗色覆盖 —— 博客详情页 Markdown 渲染（容器级）
   highlight.js 接管语法高亮，不再需要 .pl-* token 覆写
   ============================================================ */

/* 正文基底 */
html.dark .markdown-body,
html.dark .markdown-body { color: var(--text); }

/* 链接 */
html.dark .markdown-body a { color: var(--link); }

/* 预览容器背景 */
html.dark .markdown-body,
html.dark .markdown-body { background-color: var(--bg); }

/* 引用/辅助文字 */
html.dark .markdown-body h6,
html.dark .markdown-body blockquote { color: var(--text-soft); }
html.dark .markdown-body h1 .octicon-link,
html.dark .markdown-body h2 .octicon-link,
html.dark .markdown-body h3 .octicon-link { color: var(--text-soft); }
html.dark .markdown-body blockquote,
html.dark .markdown-body blockquote { color: var(--text-soft); }

/* 表格 */
html.dark .markdown-body table td,
html.dark .markdown-body table th { border-color: var(--border); }
html.dark .markdown-body table tr { background-color: var(--bg); }
html.dark .markdown-body table tr:nth-child(2n) { background-color: #1c2128; }
html.dark .markdown-body table thead tr,
html.dark .markdown-body table thead tr { background-color: #1c2128; }

/* kbd */
html.dark .markdown-body kbd {
    color: var(--text); background-color: #30363d;
    border-color: #30363d; box-shadow: none;
}

/* abbr */
html.dark .markdown-body abbr,
html.dark .markdown-body abbr { background: #3d3619; }

/* hr */
html.dark hr { border-color: var(--border); background: var(--border); }
html.dark .markdown-body hr,
html.dark .markdown-body hr { border-color: var(--border); }
