/* ==========================================================================
   个人文章档案与思想演化系统 — 样式表
   设计原则（§46）：简洁、稳定、以阅读为中心；响应式（§47）
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #1f2328;
  --text-soft: #5b636c;
  --text-muted: #868f99;
  --accent: #2f6feb;
  --accent-soft: #eaf1fe;
  --accent-dark: #1f52b8;
  --green: #1f8a54;
  --green-soft: #e8f6ee;
  --amber: #a06400;
  --amber-soft: #fdf4e3;
  --red: #c0392b;
  --red-soft: #fdecea;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 4px 16px rgba(16, 24, 40, .10);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC",
          "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  --read-width: 860px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.06rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
code, pre { font-family: var(--font-mono); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-muted); }
.small { font-size: .86rem; }
.dot { margin: 0 .4em; color: var(--border-strong); }
.sep { margin: 0 .35em; color: var(--border-strong); }

/* ---------------------------------------------------------------- 顶部导航 */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #2f6feb, #6f4bf2);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: .98rem; }
.brand-text small { color: var(--text-muted); font-size: .72rem; letter-spacing: .04em; }

.main-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.main-nav a {
  padding: 7px 13px; border-radius: var(--radius-sm); color: var(--text-soft);
  font-size: .93rem; white-space: nowrap;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.main-nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.who { color: var(--text-soft); font-size: .88rem; }

/* -------------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font-size: .92rem; font-family: inherit; cursor: pointer; line-height: 1.4;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-muted); }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #a5301f; border-color: #a5301f; }
.btn-sm { padding: 5px 11px; font-size: .85rem; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }

/* -------------------------------------------------------------------- 布局 */

.main { padding: 28px 20px 60px; }

.page-head { margin-bottom: 22px; }
.page-head h1 { margin-bottom: .2em; }
.page-head .lead { color: var(--text-soft); margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title { margin: 0 0 .35em; font-size: 1.1rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-meta { color: var(--text-muted); font-size: .86rem; margin-bottom: .6em; }
.card-summary { color: var(--text-soft); margin: 0 0 .7em; font-size: .94rem; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.05rem; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sidebar-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }

/* ------------------------------------------------------------------ 首页 */

.hero {
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.hero h1 { font-size: 1.75rem; margin-bottom: .35em; }
.hero p { color: var(--text-soft); max-width: 640px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.stat .num { font-size: 1.5rem; font-weight: 700; color: var(--accent-dark); line-height: 1.2; }
.stat .label { color: var(--text-muted); font-size: .84rem; }

.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { margin-bottom: 10px; }
.bar-list .row { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 4px; }
.bar-track { height: 7px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #4f8bf5, #2f6feb); }

/* ------------------------------------------------------------------ 表单 */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .88rem; color: var(--text-soft); margin-bottom: 5px; font-weight: 500; }
.field .hint { color: var(--text-muted); font-size: .8rem; margin-top: 4px; }
.field .required { color: var(--red); margin-left: 2px; }

input[type=text], input[type=password], input[type=date], input[type=datetime-local],
input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 8px 11px; font-family: inherit; font-size: .94rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 235, .12);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.65; }
select[multiple] { min-height: 120px; }

.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text-soft); }
.checkline input[type=checkbox] { width: auto; }

.filter-bar {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.filter-bar .field { margin-bottom: 0; min-width: 150px; flex: 1 1 150px; }
.filter-bar .actions { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ 标签 */

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-dark); font-size: .8rem;
}
.tag:hover { text-decoration: none; background: #dbe7fd; }
.tag.selected { background: var(--accent); color: #fff; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 99px;
  font-size: .75rem; font-weight: 500; vertical-align: middle;
}
.badge-draft { background: var(--amber-soft); color: var(--amber); }
.badge-published { background: var(--green-soft); color: var(--green); }
.badge-archived { background: #eef0f2; color: var(--text-muted); }
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-error { background: var(--red-soft); color: var(--red); }
.badge-info { background: var(--accent-soft); color: var(--accent-dark); }

.time-source { color: var(--text-muted); font-size: .82rem; }

/* -------------------------------------------------------------- 文章阅读页 */

.reading-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

.article-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.article-title { font-size: 1.7rem; margin: 0 0 14px; }
.article-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 20px; font-size: .89rem; color: var(--text-soft);
  border-top: 1px solid var(--border); padding-top: 14px;
}
.article-meta-grid .k { color: var(--text-muted); margin-right: 6px; }
.article-summary {
  margin: 16px 0 0; padding: 12px 16px; background: var(--surface-2);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft); font-size: .94rem;
}

.view-switch { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.view-switch .tab {
  padding: 7px 15px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-soft); font-size: .9rem;
}
.view-switch .tab:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.view-switch .tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.view-switch .tab.disabled { opacity: .45; cursor: not-allowed; }

.doc-frame {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px 42px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.doc-frame .docx-target { min-height: 120px; }
.docx-hint {
  color: var(--text-muted); font-size: .85rem; padding: 10px 14px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); margin-bottom: 16px;
}

/* 正文排版：尽量贴近 Word 的阅读观感（§15 / §46） */
.article-body { font-size: 16px; line-height: 1.9; color: var(--text); word-wrap: break-word; overflow-wrap: anywhere; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1em; }
.article-body h1 { font-size: 1.5rem; margin: 1.6em 0 .7em; }
.article-body h2 { font-size: 1.3rem; margin: 1.5em 0 .65em; }
.article-body h3 { font-size: 1.13rem; margin: 1.4em 0 .6em; }
.article-body h4, .article-body h5, .article-body h6 { font-size: 1rem; margin: 1.3em 0 .55em; }
.article-body img { max-width: 100%; height: auto; margin: 12px 0; border-radius: 4px; }
.article-body ul, .article-body ol { padding-left: 1.6em; margin: 0 0 1em; }
.article-body li { margin-bottom: .35em; }
.article-body blockquote {
  margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-soft);
}
.article-body pre {
  background: #f6f8fa; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; overflow-x: auto; font-size: .88rem;
}
.article-body table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: .94rem; }
.article-body th, .article-body td { border: 1px solid var(--border-strong); padding: 7px 10px; vertical-align: top; }
.article-body th { background: var(--surface-2); font-weight: 600; }
.article-body .table-scroll { overflow-x: auto; max-width: 100%; margin: 12px 0; }
.article-body .table-scroll table { margin: 0; min-width: 100%; }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 1.6em 0; }
.article-body a { text-decoration: underline; }
.article-body .empty-doc { color: var(--text-muted); font-style: italic; }
.article-body .doc-title { font-size: 1.7rem; }

.docx-page {
  background: #fff; box-shadow: 0 1px 6px rgba(16, 24, 40, .12);
  margin: 0 auto 16px; padding: 48px 56px; max-width: 100%;
}
.docx-page section.docx { box-shadow: none !important; margin: 0 !important; }

/* 上/下一篇 */
.prevnext {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px;
  align-items: center; margin-bottom: 18px;
}
.prevnext a, .prevnext span {
  padding: 11px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.prevnext .center { text-align: center; white-space: nowrap; }
.prevnext .next { text-align: right; }
.prevnext span.disabled { color: var(--text-muted); background: var(--surface-2); }
.prevnext a:hover { border-color: var(--accent); text-decoration: none; }

/* 评论 */
.comment-list { list-style: none; margin: 0 0 20px; padding: 0; }
.comment {
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.comment-name { font-weight: 600; font-size: .93rem; }
.comment-time { color: var(--text-muted); font-size: .82rem; }
.comment-body { color: var(--text); font-size: .95rem; }
.comment-body p { margin: 0 0 .5em; }
.comment-body p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ 时间轴 */

.timeline { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline-group { position: relative; margin-bottom: 26px; }
.timeline-group-head {
  position: relative; font-weight: 700; font-size: .98rem; color: var(--accent-dark);
  margin-bottom: 12px; padding-left: 2px;
}
.timeline-group-head::before {
  content: ""; position: absolute; left: -26px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}
.timeline-group-head .count { color: var(--text-muted); font-weight: 400; font-size: .84rem; margin-left: 8px; }
.timeline-items { list-style: none; margin: 0; padding: 0; }
.timeline-items li { position: relative; padding: 9px 0 9px 0; border-bottom: 1px dashed var(--border); }
.timeline-items li:last-child { border-bottom: none; }
.timeline-items .t-date {
  display: inline-block; min-width: 92px; color: var(--text-muted);
  font-size: .85rem; font-variant-numeric: tabular-nums;
}
.timeline-items .t-title { font-size: .98rem; font-weight: 500; }
.timeline-items .t-title a { color: var(--text); }
.timeline-items .t-title a:hover { color: var(--accent); text-decoration: none; }
.timeline-items .t-tags { color: var(--text-muted); font-size: .82rem; margin-left: 8px; }

/* ------------------------------------------------------------------ 表格 */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td {
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data th {
  background: var(--surface-2); color: var(--text-soft); font-weight: 600;
  font-size: .85rem; white-space: nowrap;
}
table.data tr:hover td { background: #fafbfc; }
table.data td.actions { white-space: nowrap; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ 分页 */

.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 22px 0 6px; }
.page-link {
  display: inline-block; min-width: 34px; padding: 6px 10px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-soft); font-size: .88rem;
}
.page-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.page-link.current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.page-link.disabled { color: var(--text-muted); background: var(--surface-2); }
.page-ellipsis { color: var(--text-muted); padding: 0 2px; }
.page-total { color: var(--text-muted); font-size: .84rem; margin-left: 8px; }

/* ------------------------------------------------------------------ 提示 */

.flash-area { margin-bottom: 16px; }
.flash {
  padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 8px;
  font-size: .92rem; border: 1px solid transparent;
}
.flash-success { background: var(--green-soft); color: var(--green); border-color: #bfe6cf; }
.flash-warning { background: var(--amber-soft); color: var(--amber); border-color: #f0dcae; }
.flash-danger { background: var(--red-soft); color: var(--red); border-color: #f3c6c0; }
.flash-info { background: var(--accent-soft); color: var(--accent-dark); border-color: #c6dafc; }

.notice {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  margin-bottom: 14px;
}
.notice-warn { background: var(--amber-soft); color: var(--amber); border-color: #f0dcae; }
.notice-error { background: var(--red-soft); color: var(--red); border-color: #f3c6c0; }
.notice-ok { background: var(--green-soft); color: var(--green); border-color: #bfe6cf; }

.empty {
  padding: 40px 20px; text-align: center; color: var(--text-muted);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty a { font-weight: 500; }

/* ------------------------------------------------------------------ 登录页 */

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 30px; box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 1.3rem; margin-bottom: .3em; }
.login-card .sub { color: var(--text-muted); font-size: .88rem; margin-bottom: 22px; }
.login-foot { margin-top: 18px; font-size: .82rem; color: var(--text-muted); text-align: center; }

/* ------------------------------------------------------------------ 后台 */

.admin-nav {
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.admin-nav .wrap { display: flex; gap: 2px; flex-wrap: wrap; }
.admin-nav a {
  padding: 11px 14px; color: var(--text-soft); font-size: .9rem;
  border-bottom: 2px solid transparent;
}
.admin-nav a:hover { color: var(--text); text-decoration: none; }
.admin-nav a.active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 600; }

.upload-result { max-width: 620px; }
.upload-result .row { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.upload-result .row .k { width: 130px; color: var(--text-muted); flex: none; }
.upload-result .row .v { color: var(--text); word-break: break-all; }

.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.steps .step {
  padding: 6px 14px; border-radius: 99px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-muted); font-size: .85rem;
}
.steps .step.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.status-list li:last-child { border-bottom: none; }
.status-list .name { font-weight: 600; min-width: 96px; font-size: .92rem; }
.status-list .msg { flex: 1; font-size: .9rem; color: var(--text-soft); }
.status-list .detail { color: var(--text-muted); font-size: .82rem; word-break: break-all; }

.dot-status { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 7px; }
.dot-ok { background: var(--green); }
.dot-warn { background: #e0a020; }
.dot-error { background: var(--red); }

/* ------------------------------------------------------------------ 页脚 */

.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 22px 0 30px; margin-top: 40px;
}
.site-footer p { margin: 0 0 5px; font-size: .84rem; color: var(--text-muted); }

/* ------------------------------------------------------------------ 错误页 */

.error-page { text-align: center; padding: 70px 20px; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--border-strong); line-height: 1; }
.error-page h1 { margin: 12px 0 8px; }
.error-page p { color: var(--text-soft); }

/* ------------------------------------------------------------------ 响应式 */

@media (max-width: 1080px) {
  .sidebar-layout { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .doc-frame { padding: 22px 18px; }
  .article-header { padding: 20px 18px; }
  .article-title { font-size: 1.4rem; }
  .header-inner { min-height: 56px; gap: 12px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .main-nav { margin-left: 0; width: 100%; order: 3; }
  .main-nav a { padding: 6px 10px; font-size: .88rem; }
  .header-actions { margin-left: auto; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 14px; }
  .main { padding: 18px 14px 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 1.35rem; }
  .doc-frame { padding: 16px 12px; }
  .article-body { font-size: 15.5px; }
  .docx-page { padding: 20px 14px; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext .next { text-align: left; }
  .prevnext .center { order: -1; }
  .timeline { padding-left: 20px; }
  .timeline-group-head::before { left: -20px; width: 10px; height: 10px; }
  .timeline-items .t-date { min-width: 100%; display: block; }
  .page-head h1 { font-size: 1.3rem; }
}

@media print {
  .site-header, .site-footer, .view-switch, .prevnext, .comment-form, .main-nav { display: none !important; }
  .doc-frame, .article-header { box-shadow: none; border: none; padding: 0; }
}
