/* PenChanges site styles.
   Served from the plugin with a ?<mtime> version, because DokuWiki's css.php
   URL seed (tseed) only follows config files: edits to conf/userstyle.css would
   otherwise sit behind a year-long browser cache. */

/* Sidebar navigation rhythm. */
#dokuwiki__aside .wrap_pennav > p { margin: 1.15em 0 0.25em; }
#dokuwiki__aside .wrap_pennav > p:first-child { margin-top: 0; }
#dokuwiki__aside .wrap_pennav > p:has(> em:only-child) { margin: 0.55em 0 0.18em 0.85em; }
#dokuwiki__aside .wrap_pennav > ul { margin-top: 0; margin-bottom: 0; }

/* Homepage hero: bound the area, keep the picture's own ratio. */
#dokuwiki__content .wrap_hero { margin: 0 0 1.1em; text-align: center; }
#dokuwiki__content .wrap_hero p { margin: 0; }
#dokuwiki__content .wrap_hero img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 46vh;
    margin: 0 auto;
    border-radius: 4px;
}
@media (max-width: 767px) {
    #dokuwiki__content .wrap_hero { margin-bottom: 0.9em; }
    #dokuwiki__content .wrap_hero img { max-height: 38vh; }
}

/* Comment section: the heading is an h2 carrying the template's .page-header
   class, so it needs an explicit size. The editor stays collapsed until asked. */
#comment_wrapper h2.page-header {
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.45;
    margin: 1.8em 0 0.35em 0;
    padding: 0 0 0.3em 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
#comment_wrapper h2.page-header a {
    color: inherit;
    text-decoration: none;
    border-bottom: 0;
}
#comment_wrapper h2.page-header .iconify {
    font-size: 0.95em;
    vertical-align: -0.1em;
}
.pc-comment-toggle {
    display: inline-block;
    margin: 0 0 1em 0;
    font-size: 0.95em;
}
.pc-js #comment_wrapper > .level2 > .comment_form { display: none; }
.pc-js #comment_wrapper.pc-comment-open > .level2 > .comment_form { display: block; }

/* Empty discussion: a comment-shaped placeholder instead of a blank gap. */
.pc-comment-empty { margin: 0 0 0.6em; }
.pc-comment-empty .comment_body {
    padding: 0.35em 0 0.55em;
    border-bottom: 1px dotted rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.45);
}
.pc-comment-empty-hint {
    padding: 0.35em 0 0.6em;
    font-size: 0.88em;
    color: rgba(0, 0, 0, 0.32);
}
.pc-js #comment_wrapper.pc-comment-open .pc-comment-empty { display: none; }

/* Disambiguation note: a quiet box under the intro. */
.wrap_disambig {
    margin: 0.4em 0 0.9em;
    padding: 0.5em 0.8em;
    border-left: 3px solid rgba(0, 0, 0, 0.18);
    background: rgba(0, 0, 0, 0.02);
    font-size: 0.95em;
}

/* User-menu role badge: right-anchored in the template, so a longer role name
   (Superadmin) grows leftwards instead of wrapping. */
#dw__user_menu .pc-user-card > .label {
    white-space: nowrap;
    max-width: none;
}

/* ---------------------------------------------------------------- admin page */

/* The version block (Release / PHP / Ubuntu / template) is noise here. */
#admin__version { display: none !important; }

/* Two blocks: core tasks on top, our added admin plugins underneath.
   Both blocks are two equal columns of items. Floats are used on purpose so the
   layout does not depend on :has() support in the reader's browser. */
.ui-admin > ul.admin_tasks,
.ui-admin > ul.admin_plugins,
.dokuwiki div.ui-admin > ul.admin_tasks,
.dokuwiki div.ui-admin > ul.admin_plugins {
    float: left;
    box-sizing: border-box;
    width: calc(50% - 0.75rem) !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 0 0.6rem 0;
}

.ui-admin > ul.admin_tasks + ul.admin_tasks,
.ui-admin > ul.admin_plugins + ul.admin_plugins {
    margin-left: 1.5rem;
}

/* Separator spacing between the two blocks (no rule line). */
.ui-admin > h2 {
    clear: both;
    margin: 1.6rem 0 0.6rem;
    padding-top: 0.9rem;
}

@media (max-width: 767px) {
    .ui-admin > ul.admin_tasks,
    .ui-admin > ul.admin_plugins,
    .dokuwiki div.ui-admin > ul.admin_tasks,
    .dokuwiki div.ui-admin > ul.admin_plugins {
        float: none;
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* ------------------------------------------------- struct "create schema" form */

/* Struct's own LESS makes the label span 45% wide and right-aligned, which
   throws the field and the save button off-centre. Rebuild the row as a grid:
   the input sits on the content axis, the label hangs to its left, the button
   and the hint line up with the input's left edge. */
form.struct_newschema {
    display: block;
    margin: 0.75rem 0 0;
    max-width: none;
}

form.struct_newschema fieldset {
    display: grid;
    grid-template-columns: 1fr 15rem 1fr;
    column-gap: 0.3rem;
    row-gap: 0.75rem;
    align-items: center;
    /* DokuWiki core pins every fieldset to 400px, centred, with a frame. */
    width: 100%;
    margin: 0;
    text-align: left;
    border: 0;
    padding: 0;
    box-sizing: border-box;
}

form.struct_newschema legend {
    display: block;
    width: 100%;
    text-align: center;
    float: none;
    border: 0;
    border-bottom: 0;
    margin: 0 0 0.1rem;
    padding: 0;
    font-size: 1em;
    font-weight: 600;
}

/* Drop the label box so its span and input become grid items themselves. */
form.struct_newschema label {
    display: contents;
}

form.struct_newschema label > span {
    display: block;
    grid-column: 1;
    justify-self: end;
    width: auto;
    padding-right: 0;
    text-align: right;
    white-space: nowrap;
}

form.struct_newschema label > input[name="table"] {
    grid-column: 2;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

form.struct_newschema button {
    grid-column: 2;
    justify-self: center;
    margin: 0;
}

form.struct_newschema p {
    grid-column: 1 / -1;
    justify-self: center;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    font-size: 0.9em;
    color: #6c757d;
}

@media (max-width: 767px) {
    form.struct_newschema fieldset { grid-template-columns: 1fr; }
    form.struct_newschema label > span { grid-column: 1; justify-self: start; }
    form.struct_newschema label > input[name="table"] { grid-column: 1; }
    form.struct_newschema button,
    form.struct_newschema p { grid-column: 1; justify-self: start; }
}

/* 成员管理：原生 table 没有内边距，列与列会粘在一起 */
.pc-tablewrap {
    overflow-x: auto;
    margin: 0.3rem 0 1.3rem;
    -webkit-overflow-scrolling: touch;
}

.pc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    line-height: 1.5;
}

.pc-table th,
.pc-table td {
    padding: 0.5rem 1.5rem;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
}

.pc-table th {
    background: rgba(0, 0, 0, 0.035);
    font-weight: 600;
}

/* 首列贴正文左缘，末列（审计“原因”、成员“处理人”）允许换行 */
.pc-table th:first-child,
.pc-table td:first-child { padding-left: 0.2rem; }

.pc-table td:last-child { white-space: normal; }

.pc-table td:empty::after {
    content: "—";
    color: rgba(0, 0, 0, 0.35);
}

.pc-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

@media (max-width: 767px) {
    .pc-table th,
    .pc-table td { padding: 0.4rem 0.6rem; }
}

/* 成员管理：筛选条与分页 */
.pc-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.2rem;
    margin: 0.2rem 0 0.8rem;
}

.pc-filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-weight: normal;
}

.pc-filter input[type="text"],
.pc-filter select {
    width: auto;
    min-width: 9rem;
    margin: 0;
}

.pc-filter button {
    margin: 0;
}

.pc-count,
.pc-clear,
.pc-pager-info {
    color: rgba(0, 0, 0, 0.55);
    font-size: 0.9em;
}

.pc-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0.5rem 0 1.2rem;
}

.pc-pager .pc-page {
    display: inline-block;
    min-width: 2rem;
    padding: 0.15rem 0.5rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    text-decoration: none;
}

.pc-pager .pc-page-current {
    background: rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

.pc-pager .pc-pager-info {
    margin-left: 0.6rem;
}

/* ------------------------------------------------------------ reading scale
   正文 17px，标题按 1.2 档递减（方案 C）。最末两级字号差距小，靠字重和段间距补。
   字号全局生效；行高、字重、段前距只作用于正文区，避免把侧栏和后台撑松。 */
body                                         { font-size: 17px; }
h1, .h1                                      { font-size: 35px; font-weight: 600; }
h2, .h2                                      { font-size: 29px; }
h3, .h3                                      { font-size: 25px; }
h4, .h4                                      { font-size: 20px; }
h5, .h5                                      { font-size: 17px; }   /* 与正文同号，靠加粗区分 */
h6, .h6                                      { font-size: 15px; }
.nav, .breadcrumb, .pager                    { font-size: 13px; }
pre, code, kbd, samp                          { font-size: 16px; }

#dokuwiki__content .page                     { line-height: 1.65; }
#dokuwiki__content .page h2                  { font-weight: 600; margin-top: 1.4em; }
#dokuwiki__content .page h3                  { font-weight: 600; margin-top: 1.2em; }
#dokuwiki__content .page h4                  { font-weight: 600; margin-top: 1em; }
#dokuwiki__content .page h5                  { font-weight: 600; margin-top: 0.9em; }

/* ------------------------------------------------------------ folded 折叠块
   folded 插件 v2023-07-22。语法：

     ++++ 标题栏文字 |
     这里是折叠起来的内容，可以是列表、表格、小节、引用
     ++++

   行内变体用两个加号： ++ 标题 | 隐藏的文字 ++ （只收行内格式，不收块级内容）

   插件自带的 .folded.hidden 隐藏规则是用 document.write 注入 <style> 的，
   而 bootstrap3 的 js.php 以 defer 加载，脚本执行时文档已解析完成，document.write
   会触发 document.open 清空整页。该行已在插件 script.js 中移除，隐藏规则改由本文件承担。 */
.folded.hidden {
    display: none;
}

#dokuwiki__content .page a.folder {
    position: relative;
    display: block;
    margin: 0.9em 0;
    padding: 0.5em 0.95em 0.5em 2em;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.03);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

#dokuwiki__content .page a.folder::before {
    content: "▸";
    position: absolute;
    left: 0.85em;
    opacity: 0.55;
    transition: transform 0.15s ease;
}

#dokuwiki__content .page a.folder.open::before {
    transform: rotate(90deg);
}

#dokuwiki__content .page div.folded {
    margin: -0.4em 0 1em;
    padding: 0 0 0 1em;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
}

/* 打印时全部展开，别让内容掉在纸上没了 */
@media print {
    .folded.hidden {
        display: block;
    }

    #dokuwiki__content .page a.folder::before {
        content: "";
    }
}

/* 行内折叠（++ 标题 | 内容 ++）：链接后面紧跟 span.folded 时收成行内小标签，
   不要沿用块级的整行卡片，否则一页里出现一个迷你卡片很扎眼。 */
#dokuwiki__content .page a.folder:has(+ span.folded) {
    display: inline;
    margin: 0 0.15em;
    padding: 0.05em 0.5em;
    border-radius: 3px;
    font-weight: 600;
}

#dokuwiki__content .page a.folder:has(+ span.folded)::before {
    position: static;
    display: inline-block;
    margin-right: 0.25em;
    opacity: 0.55;
}

/* 行内代码的内边距：bootstrap 默认 code{padding:2px 4px}，那 4px 右边距落在中文标点
   前面会显出一道“假空格”（“落到 brand:英雄 ，正文”）。收紧到 1px 左右，只留背景块。 */
#dokuwiki__content .page code:not(pre code) {
    padding: 1px 0.12em;
    border-radius: 3px;
}

/* 生成页说明与地区元数据：小字灰、无底纹（2026-10-31） */
#dokuwiki__content .page .wrap_pcnote,
#dokuwiki__content .page .wrap_pcmeta {
  font-size: 12px;
  line-height: 1.6;
  color: #8a8a8a;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 .8em;
  font-style: normal;
}
#dokuwiki__content .page .wrap_pcmeta { margin: .1em 0 .9em; }


/* 工具按钮的悬停提示：原生 title 要停约 1 秒、样式也不可控，这里改成自绘小标签。
   任何带 data-pc-tip 的图标按钮都生效（页内工具栏、右上那排、页头用户菜单），
   默认向下弹；右侧竖栏改向左弹；页头在最右边，标签右对齐，避免顶出视口。 */
[data-pc-tip] { position: relative; }

[data-pc-tip]::after {
    content: attr(data-pc-tip);
    position: absolute;
    z-index: 1300;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 9px;
    border-radius: 4px;
    background: #2f3437;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity .1s ease .05s, visibility 0s linear .15s;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

#dw__pagetools [data-pc-tip]::after {
    right: calc(100% + 10px);
    left: auto;
    top: 50%;
    transform: translateY(-50%);
}

#dokuwiki__header [data-pc-tip]::after,
#dokuwiki__usertools [data-pc-tip]::after {
    left: auto;
    right: 0;
    transform: none;
}

[data-pc-tip]:hover::after,
[data-pc-tip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transition: opacity .1s ease .05s;
}

/* ---- 页脚备案：ICP 号与公网安备号同一行，图标在前，整行居中 ----
   模板会给所有 .urlextern 加一个“外链”小地球图标（padding-left:28px），
   这里只在本块里去掉，避免 [地球]鲁ICP备… [徽标]鲁公网安备… 一堆图标并排。 */
.wrap_pcbeian { text-align: center; }
.wrap_pcbeian p { margin: 0; }
.wrap_pcbeian a.urlextern {
    background-image: none !important;
    padding-left: 0 !important;
}
/* ICP 与公安徽标之间留距离；徽标与自己的编号之间收紧 */
.wrap_pcbeian a.urlextern + a.media { margin-left: 22px; }
.wrap_pcbeian a.media { margin-right: 5px; }
/* 关键是 a.media 撞上了 bootstrap 的 .media 类：overflow:hidden + 行高 16px
   会把 22px 高的徽标裁掉下半截，这里只在本块里放开 */
.wrap_pcbeian a.media {
    display: inline-block;
    overflow: visible;
    vertical-align: middle;
    line-height: 1;
}
/* 徽标比 12px 正文高、又受行盒基线影响，位移用 relative 调，不改布局 */
.wrap_pcbeian a.media img { vertical-align: middle; }
.wrap_pcbeian a.media { position: relative; top: -10px; }

/* 页脚留白统一：页脚上沿→备案行 30px，备案行→分隔线 30px，分隔线→许可 30px
   （bootstrap 的 hr 默认 margin:20px 0，比上面那 30px 少一截，看着就是“下面挤”） */
#dw__footer .footer-license hr { margin: 30px 0; }
