/* ==========================================================================
   zzz513.xyz · 纸面
   设计约束见 DESIGN.md。要点：一个背景色、一个点缀色、一种动效。
   ========================================================================== */

:root {
  /* 色彩：只有这九个值，改动前先看 DESIGN.md 第 2 节 */
  --paper: #f7f6f2;
  --ink: #3a3a3a;
  --ink-mid: #6b6862;
  --ink-soft: #8e8b85;
  --sage: #a3b5a0;
  --sage-deep: #5f7359;
  --card: rgba(255, 255, 255, 0.7);
  --line: rgba(0, 0, 0, 0.08);
  --line-soft: rgba(0, 0, 0, 0.045);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

  --r: 12px;
  --measure: 756px;

  /* 背景蒙版透明度，后台可调 */
  --mask: 0.86;
  --bg-blur: 0px;

  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", sans-serif;
  --num: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; }

/* 焦点：浅色底上唯一靠谱的可见性来源 */
:focus-visible {
  outline: 2px solid rgba(163, 181, 160, 0.55);
  outline-offset: 3px;
}

::selection { background: rgba(163, 181, 160, 0.32); }

/* ==========================================================================
   背景层（后台可传图片 / GIF / 视频，默认关闭）
   ========================================================================== */

.bg {
  position: fixed; inset: 0; z-index: -2;
  overflow: hidden; pointer-events: none; background: var(--paper);
}
.bg img, .bg video {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  filter: blur(var(--bg-blur));
}
.bg::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(247, 246, 242, var(--mask));
}

/* ==========================================================================
   光圈：鼠标靠近可点区域时，纸面上浮起一块柔光
   用实心圆 + blur 实现，不用渐变（渐变在禁止清单里）
   ========================================================================== */

.halo {
  position: fixed; left: 0; top: 0;
  width: 150px; height: 150px; margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: var(--sage);
  filter: blur(28px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease;
  will-change: transform, opacity;
}
@media (hover: none), (pointer: coarse) {
  .halo { display: none; }
}

/* ==========================================================================
   版心
   ========================================================================== */

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 96px 0 120px;
}

/* ==========================================================================
   报头
   ========================================================================== */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 76px;
}
.mast-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

.mark {
  width: 26px; height: 26px; border-radius: 50%;
  overflow: hidden; flex: none;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 12px; color: var(--ink-soft);
  background: rgba(0, 0, 0, 0.04);
}
.mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--ink);
  white-space: nowrap;
}

.year {
  font-family: var(--num);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

/* ==========================================================================
   首屏
   ========================================================================== */

.hero { margin-bottom: 76px; }

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 38px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  max-width: 20em;
}

.lede, .bio {
  margin: 24px 0 0;
  text-wrap: balance;
  max-width: 30em;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-mid);
}
.bio { margin-top: 1.5em; white-space: pre-wrap; }

/* ==========================================================================
   区块
   ========================================================================== */

.section { margin-bottom: 76px; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.sec-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
}

/* 全站唯一的装饰：一枚 6px 的印章点 */
.dot {
  width: 6px; height: 6px;
  background: var(--sage);
  display: inline-block;
  margin-right: 10px;
  flex: none;
}

.count {
  margin-left: auto;
  font-family: var(--num);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.sec-head select {
  margin-left: 8px;
  max-width: 190px;
  padding: 2px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.sec-head select:hover { color: var(--ink-mid); border-bottom-color: var(--sage); }
.sec-head select:focus { outline: none; border-bottom-color: var(--sage); }

/* ==========================================================================
   搜索：一条下划线，不是一个盒子
   ========================================================================== */

.search { position: relative; margin: 26px 0 4px; }

.search input {
  width: 100%;
  padding: 10px 46px 10px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 15px;
  color: var(--ink);
  -webkit-appearance: none;
  transition: border-color 0.3s ease;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--ink-soft); }
.search input:focus {
  outline: none;
  border-bottom-color: var(--sage);
}

.search-clear {
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  padding: 8px 0 8px 12px;
  background: none; border: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.3s ease;
}
.search-clear:hover { color: var(--sage-deep); }

/* ==========================================================================
   分类：文字链，不是胶囊
   ========================================================================== */

.tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 18px 0 6px;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  flex: none;
  padding: 0 0 10px;
  background: none; border: 0;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.tab:hover { color: var(--ink-mid); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1.5px; background: var(--sage-deep); opacity: .75;
}

.tab .n {
  margin-left: 6px;
  font-family: var(--num);
  font-style: italic;
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* ==========================================================================
   目录式列表
   ========================================================================== */

.list { margin: 0; }

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 0 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  scroll-margin-top: 48px;
}
.entry:first-child { padding-top: 14px; }
.entry:last-child { border-bottom: 0; }

.entry .idx {
  font-family: var(--num);
  font-style: italic;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
  user-select: none;
}

.entry-main { min-width: 0; }

.entry-name {
  display: inline-block;
  max-width: 100%;
  padding-bottom: 1px;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.entry:hover .entry-name { border-bottom-color: var(--sage); }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  margin-top: 5px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.entry-meta i { font-style: normal; opacity: 0.85; }
.entry-meta .tag { font-size: 12px; }
.entry-meta .tag::before { content: "#"; opacity: 0.5; }

.entry-cmt {
  padding: 2px 0;
  background: none; border: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.3s ease;
}
.entry-cmt:hover { color: var(--sage-deep); }
.entry-cmt::before { content: "·"; margin-right: 8px; opacity: .85; }

.entry-go {
  font-family: var(--num);
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-soft);
  transition: color 0.3s ease;
}
.entry:hover .entry-go { color: var(--sage-deep); }

/* 从后台「查看前台」跳进来时的定位提示 */
.entry.flash { background: rgba(163, 181, 160, 0.12); }
.entry.flash::before {
  content: "";
  position: absolute; left: -18px; top: 18px; bottom: 18px;
  width: 2px; background: var(--sage);
}

/* ==========================================================================
   骨架屏：只在加载时出现，用同一套行结构
   ========================================================================== */

.sk-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 0 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.sk {
  background: var(--line-soft);
  border-radius: 2px;
  animation: breathe 1.6s ease-in-out infinite alternate;
}
.sk-idx { width: 14px; height: 11px; margin-top: 7px; animation-delay: 0.1s; }
.sk-a { width: 46%; height: 13px; }
.sk-b { width: 28%; height: 9px; margin-top: 9px; animation-delay: 0.2s; }

@keyframes breathe {
  from { opacity: 0.4; }
  to { opacity: 0.75; }
}

/* ==========================================================================
   空状态 / 错误
   ========================================================================== */

.state {
  padding: 48px 0 40px;
  color: var(--ink-mid);
  font-size: 15px;
  line-height: 1.9;
}
.state strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  color: var(--ink);
}
.state em { font-style: normal; color: var(--ink); }
.state .link-btn {
  margin-top: 10px;
  padding: 0 0 1px;
  background: none; border: 0;
  border-bottom: 1px solid var(--sage);
  font-size: 14px;
  color: var(--sage-deep);
  cursor: pointer;
}

/* ==========================================================================
   留言：全站唯一使用纸片卡片的地方
   ========================================================================== */

.notes { margin-top: 4px; }

.note {
  margin: 0 0 16px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
body.glass .note {
  background: var(--card);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  backdrop-filter: blur(12px) saturate(1.05);
}

.note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.note-head b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
}
.note-head time {
  font-family: var(--num);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
}
.note-head .on { font-size: 12px; color: var(--ink-soft); }

.note-text {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.note-text a {
  color: var(--sage-deep);
  border-bottom: 1px solid var(--sage);
}

/* ==========================================================================
   留言表单
   ========================================================================== */

.note-form { margin: 26px 0 32px; }

.nf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.note-form input[type="text"],
.note-form textarea {
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.3s ease;
}
.note-form input[type="text"]::placeholder,
.note-form textarea::placeholder { color: var(--ink-soft); }
.note-form input[type="text"]:focus,
.note-form textarea:focus { outline: none; border-bottom-color: var(--sage); }

.note-form textarea {
  margin-top: 18px;
  min-height: 88px;
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
}

.nf-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.cap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.cap b {
  font-family: var(--num);
  font-style: italic;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.cap button {
  padding: 2px 0;
  background: none; border: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.cap button:hover { color: var(--sage-deep); border-bottom-color: var(--sage); }
.cap input {
  width: 72px;
  padding: 4px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 13px;
  text-align: center;
  transition: border-color 0.3s ease;
}
.cap input:focus { outline: none; border-bottom-color: var(--sage); }

.btn {
  padding: 9px 22px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: var(--r);
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}
.btn:hover { background: #2d2d2d; }
.btn:active { opacity: 0.82; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

/* ==========================================================================
   找到我
   ========================================================================== */

.contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
  font-size: 15px;
  line-height: 2.4;
}
.contact {
  padding: 1px 0;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.contact:hover { color: var(--sage-deep); border-bottom-color: var(--sage); }
.slash {
  margin: 0 14px;
  color: var(--ink-soft);
  user-select: none;
}

/* ==========================================================================
   页脚
   ========================================================================== */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  margin-top: 96px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.foot-note { font-family: var(--num); font-style: italic; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100vw - 48px);
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 13.5px;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.toast.show { opacity: 1; }
.toast.err { color: #8a534e; }
.toast.ok { color: var(--sage-deep); }

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 859px) {
  .wrap {
    max-width: none;
    padding: 64px 48px 96px;
  }
}

@media (max-width: 755px) {
  .wrap { padding: 56px 24px 88px; }
  .masthead { margin-bottom: 56px; }
  .hero { margin-bottom: 56px; }
  .hero h1 { font-size: 28px; line-height: 1.45; }
  .section { margin-bottom: 56px; }
  .nf-row { grid-template-columns: 1fr; gap: 0; }
  .nf-row input + input { margin-top: 14px; }
  .foot { margin-top: 72px; }
  .entry { grid-template-columns: 26px 1fr auto; gap: 0 10px; }
  .entry.flash::before { left: -10px; }
}

@media (max-width: 420px) {
  .entry-meta .hide-xs { display: none; }
  .entry-meta .sep-xs { display: none; }
  .contacts { font-size: 14px; }
  .slash { margin: 0 9px; }
}

/* ==========================================================================
   减弱动效
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .halo { display: none; }
}

/* 标签可点：不加底色，只换颜色 */
.entry-meta .tag[data-tag] { cursor: pointer; transition: color 0.3s ease; }
.entry-meta .tag[data-tag]:hover { color: var(--sage-deep); }

/* 下载次数里的数字用 Georgia，跟序号呼应 */
.entry-meta .num { font-family: var(--num); font-style: italic; letter-spacing: 0.02em; }

/* 光圈跟随的可点区域不改变光标语义，只标记 */
.halo-zone { position: relative; }

body.glow .entry-name { cursor: pointer; }

/* ==========================================================================
   右下角彩蛋
   纸面上开了一扇黑窗户：窗外是另一个世界，屋里还是纸。
   宽度分三档，保证它不压到 756px 正文栏：
   ≥1324 完整夜窗 / 1200–1323 小夜窗 / 其余只留 91 按钮
   ========================================================================== */

.corner {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.night {
  position: relative;
  display: none;
  border-radius: var(--r);
  overflow: hidden;
  background: #05060a;
  border: 1px solid rgba(0, 0, 0, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  cursor: zoom-in;
  transition: width 0.3s ease, height 0.3s ease, box-shadow 0.3s ease;
}
.night canvas { display: block; width: 100%; height: 100%; }
.night-cap {
  position: absolute;
  left: 10px;
  bottom: 7px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(247, 246, 242, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
/* 平时就是一扇夜景，靠近才浮出说明 */
.night:hover .night-cap,
.night:focus-visible .night-cap { opacity: 1; }
.night:focus-visible { outline: 2px solid rgba(163, 181, 160, 0.6); outline-offset: 3px; }

.btn91 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: #0a0b0f;
  color: #f7f6f2;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s ease, background-color 0.3s ease, width 0.3s ease;
}
.btn91 b {
  font-family: var(--num);
  font-style: italic;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.btn91 span {
  display: none;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(247, 246, 242, 0.45);
}
/* 霓虹只在悬停那一瞬出现，全站唯一的例外 */
.btn91:hover { box-shadow: 0 0 0 1px rgba(53, 224, 255, 0.55), 0 6px 20px rgba(53, 224, 255, 0.12); }
.btn91:active { opacity: 0.82; }

@media (min-width: 1200px) {
  .night { display: block; width: 180px; height: 92px; }
  .night.is-open { width: 300px; height: 154px; cursor: zoom-out; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
}

@media (min-width: 1324px) {
  .night { width: 260px; height: 132px; }
  .night.is-open { width: 420px; height: 214px; }
  .btn91 { width: auto; height: auto; padding: 7px 12px; }
  .btn91 span { display: inline; }
}

@media (max-width: 755px) {
  .corner { right: 16px; bottom: 16px; }
  .btn91 { width: 38px; height: 38px; }
  .toast { bottom: 74px; }
}
