/* lpyncu · 组内资料 —— 统一视觉层 v3
   浅色档案索引：纸白底、墨黑字、一处朱红。
   比例按苹果官网的排版精度取：大字、宽留白、发丝线、胶囊按钮；
   内核仍是档案：编号与份数一律等宽，像目录左侧的页码。
   颜色双写 hex + oklch：老版 X5/微信内核不支持 oklch 时退回 hex。 */

:root {
  --bg: #ffffff;
  --bg: oklch(1 0 0);
  --surface: #ffffff;

  /* 第二中性层：搜索框、入口块、表单输入 */
  --field: #f5f5f7;
  --field-hover: #ededf0;

  --ink: #23262a;
  --ink: oklch(0.21 0.004 255);
  --muted: #6d7175;
  --muted: oklch(0.50 0.006 255);
  --faint: #a3a6aa;
  --faint: oklch(0.68 0.005 255);
  --line: #e4e5e7;
  --line: oklch(0.905 0.003 255);
  --line-2: #d0d2d5;
  --line-2: oklch(0.84 0.004 255);

  --wash: rgba(0, 0, 0, .022);
  --hover: #fcfcfc;
  --skeleton: #ececed;
  --neutral-bg: #f1f2f3;
  --neutral-bg: oklch(0.955 0.002 255);
  --good-bg: #f2f7f1;
  --good-ink: #2f5e28;

  --accent: #b23a1d;
  --accent: oklch(0.52 0.165 33);
  --accent-deep: #9a3219;
  --accent-deep: oklch(0.47 0.155 33);
  --accent-ink: #8f2d15;
  --accent-ink: oklch(0.45 0.16 30);
  --accent-soft: #fdf1ee;
  --accent-soft: oklch(0.965 0.012 33);

  --r-sm: 12px;
  --r-lg: 18px;
  --r-pill: 980px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 骨架 ---------- */

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 22px calc(56px + env(safe-area-inset-bottom));
}

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) 0 16px;
}

.mark {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.mark b { color: var(--ink); font-weight: 600; letter-spacing: 0; }
.mark:hover b { color: var(--accent); }
.mark:focus-visible,
.mast .aside:focus-visible,
.wipe:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mast .aside {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 2px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.mast .aside:hover { color: var(--accent); }

.lede {
  overflow-wrap: break-word;
  min-width: 0;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 640;
  letter-spacing: 0;
  margin: 22px 0 8px;
  text-wrap: balance;
}

.sub {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.62;
  color: var(--muted);
  max-width: 30em;
}
.sub a { color: var(--accent); text-decoration: none; }
.sub a:hover { border-bottom: 1px solid var(--accent); }

/* ---------- 搜索 ---------- */

.find {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  transition: background .18s var(--ease), border-color .18s var(--ease),
    box-shadow .18s var(--ease);
}
.find:focus-within {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.find .glass {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0 2px 0 16px;
  color: var(--muted);
}
.find:focus-within .glass { color: var(--accent); }

.find input {
  flex: 1 1 auto;
  min-width: 0;
  height: 54px;
  padding: 0 10px 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  appearance: none;
}
.find input::placeholder { color: var(--muted); }
.find input::-webkit-search-cancel-button { display: none; }

.find .wipe {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  visibility: hidden;
}
.find .wipe[data-on="1"] { visibility: visible; }
.find .wipe:hover { color: var(--ink); }

/* ---------- 结果 ---------- */

.out { margin-top: 4px; }

.out-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.out-head .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.hit {
  display: block;
  padding: 16px 2px 17px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background .18s var(--ease);
}
.hit:hover { background: var(--wash); }
.hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hit-t {
  display: block;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0;
}
.hit-t mark {
  background: none;
  color: var(--accent-ink);
  font-weight: 600;
  padding: 0;
}
.hit-m {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.more {
  padding: 14px 2px;
  font-size: 12.5px;
  color: var(--muted);
}

/* 空 / 错 / 未登录 */
.void {
  padding: 26px 2px 10px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.void h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}
.void p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}
.terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.term {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.term:hover { background: var(--field-hover); }
.term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 骨架 */
.bars { padding: 18px 2px 4px; }
.bar {
  height: 10px;
  margin-bottom: 16px;
  border-radius: 3px;
  background: var(--skeleton);
  animation: pulse 1.4s var(--ease) infinite;
}
.bar:nth-child(2) { width: 62%; }
.bar:nth-child(3) { width: 78%; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- 两个入口：两块浅底，不是一个列表 ---------- */

.doors {
  display: grid;
  gap: 12px;
  margin: 44px 0 0;
}

.door {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 148px;
  padding: 24px 24px 20px;
  border-radius: var(--r-lg);
  background: var(--field);
  color: var(--ink);
  text-decoration: none;
  transition: background .2s var(--ease);
}
.door:hover { background: var(--field-hover); }
.door:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.door-main { flex: 1 1 auto; min-width: 0; padding-bottom: 30px; }

.door-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.door-name {
  display: block;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}
.door-note {
  display: block;
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 34em;
}

.door-flag {
  font-size: 12px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.door-go {
  position: absolute;
  right: 22px;
  bottom: 18px;
  font-size: 13.5px;
  color: var(--accent);
  transition: transform .2s var(--ease);
}
.door:hover .door-go { transform: translateX(3px); }

/* 搜索有结果时收起入口：这一刻的任务是检索，不是浏览 */
body[data-searching] .topics,
body[data-searching] .doors { display: none; }

/* ---------- 专题目录 ---------- */

.topics { margin-top: 48px; }

.topics-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}
.topics-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}
.topics-head .count {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.toc { list-style: none; margin: 0; padding: 0; }

.toc li { border-bottom: 1px solid var(--line); }
.toc li:last-child { border-bottom: 0; }

.toc a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 6px 4px;
  color: var(--ink);
  text-decoration: none;
  transition: background .18s var(--ease);
}
.toc a:hover { background: var(--wash); }
.toc a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toc .no {
  flex: 0 0 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.toc .nm { flex: 1 1 auto; font-size: 16px; }
.toc .ct {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.toc .ar { flex: 0 0 auto; color: var(--faint); font-size: 15px; }
.toc a:hover .ar { color: var(--accent); }

.toc .all .nm { font-weight: 600; }

/* ---------- 专题清单页 ---------- */

.ledger {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.ledger li { border-bottom: 1px solid var(--line); }
.ledger a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 54px;
  padding: 14px 4px;
  color: var(--ink);
  text-decoration: none;
  transition: background .18s var(--ease);
}
.ledger a:hover { background: var(--wash); }
.ledger a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ledger .no {
  flex: 0 0 26px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  padding-top: 3px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ledger .nm {
  flex: 1 1 auto;
  font-size: 16.5px;
  line-height: 1.55;
  letter-spacing: 0;
}
.ledger .dd {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
  letter-spacing: 0;
}
.ledger .ty {
  flex: 0 0 auto;
  font-size: 12.5px;
  line-height: 1.7;
  padding-top: 3px;
  color: var(--muted);
}

.ledger a:active { background: var(--field); }

/* ---------- 门面入口：可点的面 ----------
   专题页是 149 条，用发丝线清单；门面只有 6 条，每条是一次跳转，
   需要看得见的边界与按下去的反应，所以做成独立的面。 */

.entries {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  border-top: 0;
}
.entries li { border-bottom: 0; }

.entries a {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 0;
  padding: 18px 20px 17px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.entries a:hover {
  background: var(--field);
  border-color: var(--accent);
}
.entries a:active {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(.985);
  transition: background .08s var(--ease), border-color .08s var(--ease),
    transform .08s var(--ease);
}
.entries a:focus-visible { outline-offset: 3px; }

.entries .no { flex: 0 0 26px; padding-top: 3px; font-size: 12.5px; }
.entries .nm { font-size: 17px; font-weight: 600; }
.entries .dd { margin-top: 8px; font-size: 13.5px; max-width: 34em; }

.entries .ar {
  flex: 0 0 auto;
  padding-top: 3px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
  transition: color .18s var(--ease), transform .18s var(--ease);
}
.entries a:hover .ar,
.entries a:active .ar {
  color: var(--accent);
  transform: translateX(4px);
}

@media (max-width: 560px) {
  .entries { gap: 10px; }
  .entries a { padding: 16px 16px 15px; gap: 12px; }
  .entries .no { flex: 0 0 22px; }
}

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

.foot {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}
.foot b { color: var(--ink); font-weight: 600; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---------- 单页（登录 / 申请 / 后台） ---------- */

.alone {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 9vh 20px 56px;
  background: var(--field);
}

.sheet {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 28px 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .045);
}
.sheet.wide { max-width: 640px; }

.sheet .mast {
  padding: 0 0 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.sheet .lede { font-size: 26px; margin: 0 0 6px; }
.sheet .sub { margin-bottom: 6px; font-size: 14px; }

.field { margin-top: 18px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: background .18s var(--ease), border-color .18s var(--ease),
    box-shadow .18s var(--ease);
}
.field input { line-height: 1.4; }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.field input:focus,
.field textarea:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .help {
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.btn:hover { background: var(--accent-deep); }
.btn:active { background: var(--accent-deep); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.btn.ghost {
  margin-top: 10px;
  background: var(--field);
  color: var(--ink);
}
.btn.ghost:hover { background: var(--field-hover); }

.note {
  margin: 18px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}
.note a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.note a:hover { border-bottom-color: var(--accent); }

.msg {
  margin: 18px 0 0;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--neutral-bg);
  color: var(--ink);
}
.msg.bad { background: var(--accent-soft); color: var(--accent-ink); }
.msg.good { background: var(--good-bg); color: var(--good-ink); }

/* 后台列表 */

.sheet h2.sec {
  margin: 26px 0 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.queue { margin: 0; }

.empty { padding: 12px 0; font-size: 13.5px; color: var(--muted); }

.done-line {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}
.done-line b { color: var(--ink); font-weight: 600; }
.done-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.req {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.req-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.req-name { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.req-meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  word-break: break-all;
}
.req-meta code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
}
.req-act {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.req-act .btn {
  width: auto;
  min-height: 42px;
  margin: 0;
  padding: 8px 18px;
  font-size: 13.5px;
}
.req-note {
  margin: 8px 0 4px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

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

@media (min-width: 720px) {
  .shell { max-width: 800px; padding: 0 36px 72px; }
  .lede { font-size: 40px; line-height: 1.14; margin-top: 30px; }
  .sub { max-width: 40em; font-size: 15.5px; }
  .doors { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .door { min-height: 168px; padding: 26px 26px 22px; }
  .door-name { font-size: 22px; }
  .ledger .nm { font-size: 17px; }
}

@media (max-width: 560px) {
  .foot { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 专题页内筛 ---------- */

.find.mini { margin: 22px 0 0; }
.find.mini input { height: 46px; font-size: 15px; }

.tally {
  padding: 10px 2px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tally:empty { display: none; }

.ledger li[hidden] { display: none; }

/* ---------- 统计块（资料库总览） ---------- */

.stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  margin-top: 32px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.stats div { background: var(--surface); padding: 16px 18px; }
.stats b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.02em;
}
.stats span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* 单页底部的署名行 */
.sheet .foot {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

/* 专题页标题前的编号 */
.idx {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-right: 8px;
  vertical-align: 3px;
  font-variant-numeric: tabular-nums;
}
