/* ==========================================================================
   QIN 的个人主页 — 样式表
   手账 / 拼贴风 · 奶油方格纸 + 便签 + 胶带 + 楷体手写标题
   与首页（index.html）保持一致：整站同一套视觉语言
   ========================================================================== */

/* 同源自托管字体：桌面与手机加载完全相同的文件，消除「本地楷体有无」与「移动网络 CDN 不稳」两类差异 */
@font-face{font-family:'ZCOOL KuaiLe';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/ZCOOLKuaiLe.woff2') format('woff2');}
@font-face{font-family:'Caveat';font-style:normal;font-weight:400 700;font-display:swap;src:url('/fonts/Caveat-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Caveat';font-style:normal;font-weight:400 700;font-display:swap;src:url('/fonts/Caveat-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;}

:root {
  /* 主色：陶土橙（手账印章色） */
  --primary:        #c2410c;
  --primary-600:    #9a3412;
  --primary-700:    #7c2d12;
  --primary-soft:   #fdf0e4;
  --primary-softer: #fffaf3;
  --primary-line:   #f0d9c0;

  /* 文字（墨色 → 暖灰） */
  --ink:            #1c1917;
  --ink-2:          #4a4436;
  --muted:          #7c6f5d;
  --faint:          #a79b86;

  /* 描边与纸色 */
  --line:           #ede5d4;
  --line-strong:    #ddd4be;
  --bg:             #f8f4e9;
  --bg-soft:        #fdfbf5;
  --paper:          #fffdf7;   /* 便签纸 */
  --grid:           rgba(231, 222, 200, .85);

  /* 手账常用色 */
  --note:           #fef08a;
  --note-2:         #fde68a;
  --tape-pink:      #fbcfe8;
  --tape-blue:      #bfdbfe;
  --tape-yellow:    #fef3c7;

  /* 语义色 */
  --danger:         #b91c1c;
  --danger-soft:    #fef2f2;

  /* 圆角（手账偏方，不用大圆角） */
  --radius:         6px;
  --radius-sm:      5px;
  --radius-lg:      10px;
  --pill:           999px;

  /* 手剪纸片的不规则圆角：四个角各不相同，去掉"网页控件"的规整感 */
  --cut:            4px 10px 5px 9px;
  --cut-lg:         8px 15px 9px 13px;
  --cut-pill:       12px 19px 13px 18px;

  /* 纸纹：极淡的斜向细线，让实心色块看起来像纸而不是一块纯 CSS 颜色 */
  --grain:          repeating-linear-gradient(45deg,
                      rgba(255, 255, 255, .10) 0 1px, transparent 1px 4px);

  /* 阴影（暖色投影，像纸片落在桌上） */
  --shadow-xs:      0 2px 6px rgba(80, 66, 40, .10);
  --shadow-sm:      0 5px 14px rgba(80, 66, 40, .13);
  --shadow:         0 10px 26px rgba(80, 66, 40, .16);
  --shadow-blue:    0 7px 16px rgba(194, 65, 12, .30);
  --shadow-lg:      0 20px 48px rgba(80, 66, 40, .24);

  /* 字体：正文楷体，标题手写体，控件用无衬线保证清晰 */
  --sans: 'ZCOOL KuaiLe', 'Caveat', 'KaiTi', '楷体', 'STKaiti', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --hand: 'Caveat', 'ZCOOL KuaiLe', 'KaiTi', '楷体', 'Microsoft YaHei', 'PingFang SC', cursive;
  --ui:   -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
          'Microsoft YaHei', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: -1px -1px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--hand);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: .01em;
}
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--mono); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 253, 247, .94);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 2px dashed var(--line-strong);
}
.header-inner { display: flex; align-items: center; gap: 26px; height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; color: inherit; flex: none; }
.brand-mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--note-2);
  color: #8a5a00;
  border: 1px solid #f0d98a;
  border-radius: 8px;
  font-family: var(--hand);
  font-size: 22px; font-weight: 700;
  transform: rotate(-5deg);
  box-shadow: var(--shadow-xs);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.24; }
.brand-text strong { font-family: var(--hand); font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: .01em; }
.brand-text small { color: var(--faint); font-size: 12.5px; letter-spacing: .06em; font-family: var(--sans); }

.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  position: relative;
  color: var(--ink-2); font-family: var(--hand); font-size: 18px; font-weight: 600;
  padding: 7px 13px; border-radius: var(--radius-sm);
  transition: color .16s ease, background .16s ease;
}
.nav a:hover { color: var(--primary); background: rgba(254, 240, 138, .45); }
.nav a.active { color: var(--primary); font-weight: 700; }
.nav a.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px;
  height: 5px; border-radius: 3px; background: var(--note-2); z-index: -1;
}

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.nav-toggle {
  display: none; margin-left: auto;
  background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  width: 40px; height: 40px; font-size: 17px; color: var(--ink); cursor: pointer;
}

/* --------------------------------------------------------------- buttons */
/* 手账里的按钮 = 一张剪下来的小纸片 / 一枚盖上去的印章，不是规整的网页控件。
   所以：楷体字、四角不一样的手剪圆角、纸片厚度的实心投影，不用渐变高光。 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--sans); font-size: 15.5px; font-weight: 400; letter-spacing: .03em;
  padding: 6px 17px; border-radius: var(--cut);
  border: 1.6px solid var(--line-strong); background: var(--paper); color: var(--ink-2);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: 0 2px 0 rgba(80, 66, 40, .09), var(--shadow-xs);
  transition: background .16s ease, border-color .16s ease, color .16s ease,
              box-shadow .18s ease, transform .14s ease;
}
.btn:hover {
  border-color: var(--primary-line); color: var(--primary); background: var(--primary-softer);
  transform: translateY(-1px) rotate(-.8deg);
  box-shadow: 0 3px 0 rgba(80, 66, 40, .10), var(--shadow-sm);
}
.btn:active { transform: translateY(1px) rotate(0); box-shadow: 0 1px 0 rgba(80, 66, 40, .10); }

/* 主按钮：一枚压上去的陶土橙印章（实心 + 纸纹 + 深色厚边） */
.btn-primary {
  background-color: var(--primary);
  background-image: var(--grain);
  border-color: var(--primary-700); color: #fff7f1;
  text-shadow: 0 1px 0 rgba(94, 33, 8, .32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22),
              0 3px 0 var(--primary-700), 0 9px 16px -9px rgba(124, 45, 18, .55);
  transform: rotate(-.5deg);
}
.btn-primary:hover {
  background-color: #b23d0b;
  background-image: var(--grain);
  border-color: var(--primary-700); color: #fff;
  transform: translateY(-2px) rotate(0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26),
              0 5px 0 var(--primary-700), 0 12px 20px -10px rgba(124, 45, 18, .6);
}
.btn-primary:active {
  transform: translateY(2px) rotate(0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18),
              0 1px 0 var(--primary-700), 0 4px 10px -8px rgba(124, 45, 18, .5);
}

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: rgba(254, 240, 138, .45); color: var(--ink); border-color: transparent; box-shadow: none; transform: rotate(-1deg); }

.btn-danger { color: var(--danger); border-color: #e6bcbc; background: var(--paper); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 3px 13px; font-size: 14.5px; }
.btn-lg { padding: 9px 26px; font-size: 17.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ----------------------------------------------------------- user chip */

.user-chip {
  display: flex; align-items: center; gap: 9px;
  background: var(--paper); border: 1.6px solid var(--line);
  border-radius: var(--cut-pill); padding: 2px 5px 2px 14px;
  font-size: 15.5px; font-family: var(--sans); color: var(--ink-2);
  box-shadow: 0 2px 0 rgba(80, 66, 40, .08);
  transform: rotate(.7deg);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.user-chip:hover { border-color: var(--primary-line); background: var(--primary-softer); transform: rotate(0); }
.user-chip .who { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--note-2); color: #8a5a00;
  border: 1px solid #f0d98a;
  font-weight: 700; font-size: 13px;
}

/* ------------------------------------------------------------- layout */

.main { padding-block: 34px 80px; min-height: 62vh; }

.layout-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 22px; }
.section-head h2 { font-size: 26px; margin: 0; }
.section-head .count { color: var(--faint); font-size: 13.5px; font-family: var(--ui); }

/* ------------------------------------------------------------ hero band */

.hero {
  position: relative; overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.hero::before {
  content: ""; position: absolute; left: -30px; top: -30px; width: 120px; height: 44px;
  background: var(--tape-yellow); opacity: .8; transform: rotate(-18deg);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--note); border: 1px solid #ecd97a; color: #6b5a08;
  border-radius: var(--radius-sm); padding: 5px 14px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  font-family: var(--ui);
  transform: rotate(-1.2deg);
  box-shadow: var(--shadow-xs);
}
.hero-title {
  font-family: var(--hand);
  font-size: 46px; line-height: 1.16; margin: 20px 0 16px;
  letter-spacing: .01em; font-weight: 700; color: var(--ink);
}
.hero-title em { font-style: normal; color: var(--primary); position: relative; }
.hero-title em::after {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: 4px; height: 12px;
  background: var(--note-2); z-index: -1; border-radius: 3px; transform: rotate(-1.2deg);
}
.hero-sub { color: var(--muted); font-size: 16.5px; margin: 0 0 28px; max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 34px; margin-top: 34px; }
.hero-stats .stat strong { display: block; font-family: var(--hand); font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.hero-stats .stat span { color: var(--faint); font-size: 12.5px; letter-spacing: .04em; font-family: var(--ui); }
.hero-visual { display: grid; place-items: center; }
.hero-visual svg { width: 100%; max-width: 400px; height: auto; display: block; }
.hero-visual { animation: heroFloat 6s ease-in-out infinite; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ------------------------------------------------------ feature strip */

.feat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 44px; }
.feat {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--cut-lg);
  padding: 22px; box-shadow: var(--shadow-xs);
  transition: box-shadow .2s ease, transform .2s ease;
}
.feat:hover { box-shadow: var(--shadow); transform: translateY(-3px) rotate(-.4deg); }
.feat-icon {
  width: 46px; height: 46px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--note); color: #8a5a00;
  border: 1px solid #f0d98a;
  transform: rotate(-4deg);
}
.feat-icon svg { width: 24px; height: 24px; display: block; }
.feat h3 { margin: 2px 0 6px; font-size: 19px; font-weight: 700; }
.feat p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.7; }

/* --------------------------------------------------------- post cards */

.post-list { display: flex; flex-direction: column; gap: 16px; list-style: none; margin: 0; padding: 0; }

.post-card {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) 156px; gap: 24px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--cut-lg);
  border-left: 6px solid var(--accent, var(--note-2));
  padding: 22px 24px; box-shadow: var(--shadow-xs);
  transition: box-shadow .2s ease, transform .2s ease;
}
.post-card:nth-child(4n+1) { --accent: #a9c9e6; }
.post-card:nth-child(4n+2) { --accent: #f2d47a; }
.post-card:nth-child(4n+3) { --accent: #f0b6d2; }
.post-card:nth-child(4n+4) { --accent: #c9b8f0; }
.post-card:hover { box-shadow: var(--shadow); transform: translateX(4px) rotate(-.3deg); }
.post-card.no-cover { grid-template-columns: minmax(0, 1fr); }

.post-card h3 { margin: 0 0 8px; font-size: 23px; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--primary); }
.post-card .summary { color: var(--muted); font-size: 15.5px; margin: 0 0 14px; }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--faint); font-size: 12.5px; font-family: var(--ui); }
.post-meta .sep { color: var(--line-strong); }
.post-meta a { color: var(--primary); font-weight: 600; }

.thumb {
  width: 156px; height: 108px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--line); flex: none;
  box-shadow: var(--shadow-xs);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* -------------------------------------------------------------- tags */

/* 标签 = 一张张裁下来的彩色便签小贴纸 */

.tag-list { display: flex; flex-wrap: wrap; gap: 9px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--tag-bg, var(--note)); color: var(--tag-fg, #6b5a08);
  border: 1.4px solid var(--tag-bd, #e6d072); border-radius: var(--cut);
  padding: 1px 11px; font-size: 14.5px; line-height: 1.7;
  font-family: var(--sans); letter-spacing: .02em;
  box-shadow: 0 2px 0 rgba(80, 66, 40, .07);
  transform: rotate(-1.2deg);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.tag:hover {
  background: var(--note-2); border-color: #e6d072; color: var(--primary-600);
  transform: rotate(0) translateY(-1px);
  box-shadow: 0 3px 0 rgba(80, 66, 40, .09);
}
.tag .n { color: var(--muted); font-size: 12.5px; }
.tag-lg { font-size: 15.5px; padding: 3px 14px; }

/* 便签是五颜六色的：标签云里轮流换色，看起来像贴了一排小纸条 */
.tag-list .tag:nth-child(4n+2) { --tag-bg: var(--tape-pink); --tag-bd: #efbada; --tag-fg: #8d3a69; }
.tag-list .tag:nth-child(4n+3) { --tag-bg: var(--tape-blue); --tag-bd: #a9c9ea; --tag-fg: #2d5a86; }
.tag-list .tag:nth-child(4n+4) { --tag-bg: #dcf0d9;          --tag-bd: #b2d9ae; --tag-fg: #33703a; }
.tag-list .tag:nth-child(4n+1) { transform: rotate(-1.2deg); }
.tag-list .tag:nth-child(4n+2) { transform: rotate(1deg); }
.tag-list .tag:nth-child(4n+3) { transform: rotate(-.6deg); }
.tag-list .tag:nth-child(4n+4) { transform: rotate(1.4deg); }
.tag-list .tag:hover { transform: rotate(0) translateY(-1px); }

/* 选中的标签 = 一枚盖下去的印章 */
.tag.is-active {
  background: var(--primary); background-image: var(--grain);
  border-color: var(--primary-700); color: #fff7f1;
  box-shadow: 0 3px 0 var(--primary-700);
  transform: rotate(0);
}
.tag.is-active:hover { background: #b23d0b; background-image: var(--grain); color: #fff; }
.tag.is-active .n { color: rgba(255, 255, 255, .82); }

.badge-draft {
  display: inline-block; background: var(--danger-soft); color: var(--danger);
  border: 1.4px dashed #e8a9a9; border-radius: var(--cut);
  padding: 0 9px; font-size: 13.5px; font-weight: 400;
  font-family: var(--sans); transform: rotate(-1.5deg);
}

/* ------------------------------------------------------------ sidebar */

.side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 96px; }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--cut-lg);
  padding: 22px; box-shadow: var(--shadow-sm);
  position: relative;
}
.panel h4 {
  margin: 0 0 14px; font-size: 19px; letter-spacing: .01em;
  color: var(--ink); font-weight: 700; font-family: var(--hand);
  display: inline-block; position: relative;
}
.panel h4::after {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: 2px; height: 8px;
  background: var(--note-2); z-index: -1; border-radius: 3px; transform: rotate(-1deg);
}

.side-profile { text-align: center; }
.side-profile .avatar-lg {
  width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--note-2); color: #8a5a00;
  border: 2px solid #f0d98a;
  font-family: var(--hand); font-size: 30px; font-weight: 700;
  transform: rotate(-4deg);
  box-shadow: var(--shadow-xs);
}
.side-profile .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.side-profile strong { display: block; font-family: var(--hand); font-size: 21px; font-weight: 700; color: var(--ink); }
.side-profile .headline { color: var(--primary); font-size: 13px; font-weight: 600; margin: 3px 0 12px; font-family: var(--ui); }
.side-profile .bio { color: var(--muted); font-size: 14.5px; text-align: left; }

.search-box { display: flex; gap: 8px; }
.search-box input {
  flex: 1; min-width: 0; font-family: var(--sans); font-size: 15px;
  padding: 9px 14px; border: 1.6px dashed var(--line-strong); border-radius: var(--cut);
  background: #fff; color: var(--ink);
}
.search-box input::placeholder { color: var(--faint); }
.search-box input:focus {
  outline: none; border-style: solid; border-color: var(--primary);
  background: #fff; box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ---------------------------------------------------------- article */

.article { max-width: 780px; }
.article-head { margin-bottom: 30px; padding-bottom: 24px; border-bottom: 2px dashed var(--line-strong); }
.article-head h1 { font-size: 38px; margin: 0 0 14px; letter-spacing: .01em; }
.article-head .summary { color: var(--muted); font-size: 16.5px; margin: 0 0 16px; }

.prose { font-size: 17px; color: var(--ink-2); }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 28px; margin: 2em 0 .7em; padding-top: .2em; display: inline-block; position: relative; }
.prose h2::after {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: 3px; height: 10px;
  background: var(--note-2); z-index: -1; border-radius: 3px; transform: rotate(-1deg);
}
.prose h3 { font-size: 23px; margin: 1.8em 0 .6em; }
.prose h4 { font-size: 19px; margin: 1.6em 0 .5em; color: var(--ink); }
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.5em; }
.prose li { margin-bottom: .42em; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--primary); border-bottom: 1px dashed var(--primary-line); }
.prose a:hover { border-bottom-style: solid; border-bottom-color: var(--primary); }
.prose blockquote {
  margin: 1.5em 0; padding: 14px 20px;
  background: var(--note);
  border-left: 4px solid #ecd97a; border-radius: 0 var(--radius) var(--radius) 0;
  color: #6b5a08; font-size: 16.5px;
  box-shadow: var(--shadow-xs);
  transform: rotate(-.35deg);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 2px dashed var(--line-strong); margin: 2.4em 0; }
.prose img {
  max-width: 100%; height: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--line); display: block; margin: 1.6em auto;
  background: #fff; padding: 8px;
  box-shadow: var(--shadow-sm);
}
.prose code {
  background: var(--note); border: 1px solid #ecd97a;
  border-radius: 4px; padding: 1px 6px; font-size: .875em; color: #6b5a08;
}
.prose pre {
  background: #2b2620; color: #f2ead9;
  border-radius: var(--cut-lg); padding: 18px 20px; overflow-x: auto;
  margin: 1.6em 0; font-size: 13.5px; line-height: 1.65;
  box-shadow: var(--shadow-sm);
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose table {
  width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--paper);
}
.prose th, .prose td { padding: 11px 14px; border-bottom: 1px dashed var(--line-strong); text-align: left; }
.prose th { background: var(--bg-soft); font-weight: 700; color: var(--ink); }
.prose tr:last-child td { border-bottom: 0; }
.prose .img-locked, .prose img.img-locked {
  display: block; padding: 26px; text-align: center; font-size: 13.5px; color: var(--muted);
  background: var(--bg-soft); border: 2px dashed var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: none; transform: none;
}

/* ---------------------------------------------------------- 评论 */

#commentsPanel .count { color: var(--faint); font-size: 13px; font-family: var(--ui); font-weight: 400; }

#commentList { display: flex; flex-direction: column; gap: 14px; }
#commentList > .hint { color: var(--muted); font-size: 14.5px; margin: 0; }

/* 每条留言 = 一张贴了胶带的小纸条 */
.comment {
  position: relative;
  background: var(--bg-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--cut);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-xs);
}
.comment::before {
  content: ""; position: absolute; left: 16px; top: -6px; width: 48px; height: 12px;
  background: var(--tape-yellow); opacity: .9;
  transform: rotate(-3deg); border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}
.comment-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--ui); font-size: 12.5px; color: var(--faint);
  margin-bottom: 6px;
}
.comment-head strong { font-family: var(--hand); font-size: 19px; font-weight: 700; color: var(--ink); }
.comment-head .sep { color: var(--line-strong); }
.comment-body { color: var(--ink-2); font-size: 15.5px; line-height: 1.78; }

/* 留言表单上方那句提示 */
#commentForm .hint { color: var(--muted); }

/* ----------------------------------------------------------- profile */

.profile-hero {
  position: relative; overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-sm); margin-bottom: 24px;
  display: flex; gap: 30px; align-items: flex-start;
}
.profile-hero::before {
  content: ""; position: absolute; right: -40px; top: -26px; width: 140px; height: 46px;
  background: var(--tape-blue); opacity: .75; transform: rotate(14deg);
}
.profile-hero .avatar-xl {
  width: 100px; height: 100px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center;
  background: var(--note-2); color: #8a5a00;
  border: 3px solid #f0d98a;
  font-family: var(--hand); font-size: 46px; font-weight: 700;
  transform: rotate(-3deg);
  box-shadow: var(--shadow-sm);
}
.profile-hero .avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero h1 { margin: 0 0 6px; font-size: 34px; }
.profile-hero .headline { color: var(--primary); font-size: 14.5px; font-weight: 700; margin: 0 0 14px; font-family: var(--ui); }
.profile-hero .contact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ------------------------------------------------------------- forms */

.form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); font-family: var(--ui); }
.field .hint { font-size: 12px; color: var(--faint); }
.input, .textarea, .select {
  width: 100%; font-family: var(--sans); font-size: 15.5px; color: var(--ink);
  padding: 10px 14px; border: 1.6px dashed var(--line-strong); border-radius: var(--cut);
  background: #fff;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-style: solid; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { resize: vertical; line-height: 1.7; }
.textarea-mono { font-family: var(--mono); font-size: 13.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.card-form {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 36px; box-shadow: var(--shadow-sm); max-width: 460px; margin: 32px auto;
  position: relative;
}
.card-form::before {
  content: ""; position: absolute; left: 50%; top: -14px; width: 110px; height: 26px;
  margin-left: -55px; background: var(--tape-yellow); opacity: .85; transform: rotate(-2deg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .08);
}
.card-form h1 { font-size: 28px; margin: 0 0 6px; }
.card-form .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }

.tabs {
  display: flex; gap: 6px; background: var(--bg-soft); padding: 6px;
  border-radius: var(--cut-lg); margin-bottom: 24px; border: 1.6px dashed var(--line-strong);
}
.tabs button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 15px; font-weight: 400; letter-spacing: .03em;
  color: var(--muted); padding: 5px 10px; border-radius: var(--cut);
  transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.tabs button:hover { color: var(--primary); background: var(--primary-softer); }
.tabs button.active {
  background: var(--note); color: #6b5a08;
  box-shadow: 0 2px 0 #d9c463;
  transform: rotate(-.8deg);
}

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

.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.admin-bar h2 { margin: 0; font-size: 27px; }
.admin-bar .spacer { flex: 1; }
.admin-bar .admin-who { color: var(--faint); font-size: 14px; font-family: var(--sans); }

/* 后台分页签：像一排贴在纸上的小纸条 */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 22px; }
.admin-tab {
  position: relative;
  display: inline-block; font-family: var(--sans); font-size: 15.5px; font-weight: 400;
  letter-spacing: .03em;
  color: var(--ink-2); background: var(--paper);
  border: 1.6px solid var(--line-strong); border-radius: var(--cut);
  padding: 4px 16px; box-shadow: 0 2px 0 rgba(80, 66, 40, .08);
  transition: transform .16s ease, background .16s ease, color .16s ease,
              box-shadow .16s ease, border-color .16s ease;
}
.admin-tab:hover {
  background: var(--primary-softer); color: var(--primary); border-color: var(--primary-line);
  transform: rotate(-1.5deg) translateY(-1px);
}
/* 当前页签 = 一张贴了透明胶带、被按在纸上的便签 */
.admin-tab.is-active {
  background: var(--note); border-color: #e0ca61; color: #6b5a08;
  box-shadow: 0 3px 0 #d9c463, 0 9px 15px -9px rgba(80, 66, 40, .5);
  transform: rotate(-1.2deg);
}
.admin-tab.is-active::before {
  content: ""; position: absolute; left: 50%; top: -7px; width: 34px; height: 11px; margin-left: -17px;
  background: rgba(255, 255, 255, .6);
  border-left: 1px dashed rgba(120, 100, 50, .32);
  border-right: 1px dashed rgba(120, 100, 50, .32);
  border-radius: 1px; transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .07);
}

.table-wrap {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--cut-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
table.data { width: 100%; border-collapse: collapse; font-size: 15.5px; font-family: var(--sans); }
table.data th, table.data td { padding: 13px 16px; text-align: left; border-bottom: 1px dashed var(--line-strong); vertical-align: middle; }
table.data th {
  background: var(--bg-soft); font-family: var(--sans); font-size: 15px;
  color: var(--ink-2); font-weight: 400; letter-spacing: .02em;
  border-bottom: 2px dashed var(--line-strong);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--primary-softer); }
table.data td.title-cell { font-weight: 600; color: var(--ink); font-family: var(--sans); font-size: 15.5px; }
table.data td.title-cell a { color: var(--ink); }
table.data td.title-cell a:hover { color: var(--primary); }
table.data .row-actions { display: flex; gap: 8px; justify-content: flex-end; }
table.data .muted-cell { color: var(--faint); font-size: 12.5px; white-space: nowrap; }

.editor-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.editor-preview {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--cut-lg);
  padding: 24px; max-height: 620px; overflow: auto; box-shadow: var(--shadow-sm);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.4px solid #e6d072; background: var(--note);
  border-radius: var(--cut); padding: 4px 15px; font-size: 15px; color: #6b5a08;
  font-family: var(--sans); letter-spacing: .02em; cursor: pointer;
  box-shadow: 0 2px 0 rgba(80, 66, 40, .07);
  transform: rotate(-1deg);
  transition: background .15s ease, transform .15s ease;
}
.file-btn:hover { background: var(--note-2); transform: rotate(0) translateY(-1px); }
.file-btn input { display: none; }

/* --------------------------------------------- 后台：首页设置表单布局 */

.hp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.hp-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.hp-row .input { margin: 0; }
.hp-w1 { max-width: 170px; }
.hp-w2 { max-width: 220px; }
.hp-grow { flex: 1; min-width: 0; }
.hp-color { width: 92px; flex: none; }
.hp-block {
  background: var(--bg-soft); border: 1px dashed var(--line-strong);
  border-radius: var(--cut-lg); padding: 12px; margin-bottom: 12px;
}
.hp-media { display: flex; gap: 10px; align-items: center; }
.hp-media .input { flex: 1; min-width: 0; }
.hp-label { font-family: var(--sans); font-size: 15px; color: var(--ink-2); margin: 16px 0 8px; }
.hp-savebar {
  position: sticky; bottom: 14px; margin-top: 22px; padding: 14px 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--cut-lg);
  box-shadow: 0 -6px 20px rgba(80, 66, 40, .14);
  z-index: 20;
}

/* --------------------------------------------------------------- misc */

.empty {
  background: var(--paper); border: 2px dashed var(--line-strong); border-radius: var(--cut-lg);
  padding: 60px 24px; text-align: center; color: var(--muted);
}
.empty h3 { margin: 0 0 8px; color: var(--ink); font-size: 24px; }
.empty p { margin: 0 0 18px; font-size: 15px; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, #efe7d6 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease infinite; border-radius: var(--radius);
}
@keyframes sk { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }
.sk-card { height: 132px; margin-bottom: 16px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--faint); margin-bottom: 22px; font-family: var(--ui); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.notice {
  background: var(--note); border: 1px solid #ecd97a; color: #6b5a08;
  border-radius: var(--radius-sm); padding: 14px 18px; font-size: 14.5px; margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  transform: rotate(-.3deg);
}
.notice strong { color: #6b5a08; }
.notice.warn { background: #fde3d5; border-color: #f0bfa0; color: #8a3a08; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 24px);
  background: var(--ink); color: #fdf6ea; font-size: 16px;
  border-radius: var(--cut-lg);
  padding: 10px 22px; box-shadow: var(--shadow-lg);
  font-family: var(--sans); letter-spacing: .03em;
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease;
  z-index: 200; max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

.modal-root { position: fixed; inset: 0; z-index: 150; display: none; }
.modal-root.open { display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(44, 36, 24, .48); backdrop-filter: blur(4px); }
.modal {
  position: relative; background: var(--paper); border-radius: var(--radius-lg);
  padding: 30px; width: min(460px, calc(100vw - 40px)); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.modal h3 { margin: 0 0 10px; font-size: 22px; }
.modal p { color: var(--muted); font-size: 14.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* 顶部备案号：手账贴纸，与首页风格一致 */
.beian-bar { background: transparent; padding: 12px 0 0; }
.beian-bar-inner {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 0 24px;
}
.beian-bar a {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--paper); padding: 5px 13px; border-radius: 4px;
  border: 1px dashed var(--line-strong);
  box-shadow: 0 3px 9px rgba(80, 66, 40, .10);
  font-family: var(--sans); font-size: 12.5px; font-weight: 400;
  color: var(--faint); letter-spacing: .02em;
  transform: rotate(1.6deg);
  transition: transform .2s ease, color .2s ease, border-color .2s ease;
}
.beian-bar a + a { transform: rotate(-1.3deg); }
.beian-bar a img { height: 15px; width: auto; display: block; flex: 0 0 auto; }
.beian-bar a:hover { transform: rotate(0); color: var(--primary); border-color: var(--primary-line); text-decoration: none; }

.site-footer { border-top: 2px dashed var(--line-strong); background: rgba(255, 253, 247, .8); margin-top: 40px; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-block: 26px; color: var(--faint); font-size: 13px; font-family: var(--ui);
}
.footer-inner .dot { color: var(--line-strong); }
.footer-inner a { color: var(--faint); border-bottom: 1px dashed var(--line-strong); padding-bottom: 1px; }
.footer-inner a:hover { color: var(--primary); text-decoration: none; }
.footer-inner a.beian-gongan { display: inline-flex; align-items: center; gap: 4px;
  border-bottom: none; padding-bottom: 2px; }
.footer-inner a.beian-gongan img { height: 15px; width: auto; display: block; flex: 0 0 auto; }

.hidden { display: none !important; }

/* --------------------------------------------- 后台：图片库（小图预览网格） */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

/* 每个文件一张手账小卡 */
.media-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 9px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--cut);
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.media-item:nth-child(3n) { transform: rotate(.5deg); }
.media-item:nth-child(3n+1) { transform: rotate(-.5deg); }
.media-item:hover {
  transform: translateY(-3px) rotate(0deg);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-line);
}

/* 小图预览：固定高度 + 裁切，绝不按原图尺寸裸铺 */
.media-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 118px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background-color: #f7efe0;
  background-image:
    repeating-linear-gradient(45deg, rgba(80, 66, 40, .045) 0 8px, transparent 8px 16px);
}
.media-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease;
}
.media-item:hover .media-thumb img { transform: scale(1.05); }

/* 非图片附件：显示扩展名徽标 */
.media-file {
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-radius: 4px;
  padding: 4px 11px;
}

/* 文件名：点击即可就地重命名 */
.media-name {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink);
  cursor: text;
  padding: 2px 5px;
  border: 1px dashed transparent;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.media-name:hover {
  background: var(--primary-softer);
  border-color: var(--primary-line);
  color: var(--primary);
}

.media-name-input {
  width: 100%;
  margin: 0;
  padding: 3px 6px;
  font-family: var(--sans);
  font-size: 13.5px;
  border-style: solid;
}

.media-meta {
  font-family: var(--ui);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: .01em;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 2px;
}
.media-actions .btn { padding: 1px 8px; font-size: 13px; box-shadow: none; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .layout-split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .side { position: static; }
  .editor-split { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-visual { order: -1; }
  .hero-visual svg { max-width: 300px; }
  .hero { padding: 40px 32px; }
  .hero-title { font-size: 36px; }
  .feat-row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hp-grid2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  /* 窄屏：备案贴纸与首页一致改居中，并缩小尺寸，避免两枚贴纸把首行挤满 */
  .beian-bar-inner { justify-content: center; padding: 0 18px; gap: 6px; }
  .beian-bar a { font-size: 11px; padding: 4px 9px; gap: 4px; }
  .beian-bar a img { height: 13px; }
  .main { padding-block: 24px 60px; }
  .header-inner { gap: 10px; }
  .nav-toggle { display: block; margin-left: auto; width: 38px; height: 38px; font-size: 16px; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 72px;
    flex-direction: column; gap: 2px; margin: 0; padding: 12px 18px 18px;
    background: var(--paper); border-bottom: 2px dashed var(--line-strong); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: var(--radius-sm); }
  .nav a.active::after { display: none; }
  .header-actions { margin-left: 0; gap: 8px; }
  .header-actions .btn-label { display: none; }
  .hide-sm { display: none; }
  .brand-mark { width: 34px; height: 34px; font-size: 19px; }
  .brand-text strong { font-size: 17px; }
  .brand-text small { display: none; }
  #headerSearchBtn { padding: 7px 11px; }
  #headerSearchBtn > span { display: none; }
  .hero { padding: 32px 22px; }
  .hero-title { font-size: 30px; }
  .hero-stats { gap: 22px; margin-top: 26px; }
  .hero-stats .stat strong { font-size: 25px; }
  .post-card { grid-template-columns: minmax(0, 1fr); }
  .thumb { width: 100%; height: 176px; }
  .profile-hero { flex-direction: column; padding: 28px; gap: 18px; }
  .article-head h1 { font-size: 29px; }
  .prose { font-size: 16.5px; }
  .grid-2 { grid-template-columns: 1fr; }
  .card-form { padding: 26px; }
  .user-chip .who { display: none; }
  .hp-row { flex-wrap: wrap; }
  .hp-w1, .hp-w2 { max-width: none; flex: 1 1 140px; }
  .hp-media { flex-wrap: wrap; }
  .hp-savebar { position: static; }
}

/* 图片库在窄屏收成两列小图 */
@media (max-width: 720px) {
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 12px; }
  .media-thumb { height: 98px; }
  .media-item:nth-child(3n), .media-item:nth-child(3n+1) { transform: none; }
}
