/* ===========================================================
   个人多元领域 · 样式
   暖调纸感 · 轻手作 · 无任何外部依赖
   内容不依赖 JS，永远可见
   =========================================================== */

:root {
  --paper:    #f8f4ed;
  --card:     #fffdf9;
  --ink:      #2f2a25;
  --ink-soft: #6b6257;
  --muted:    #9b9184;
  --line:     #e8dfd2;
  --accent:   #b7683f;
  --header:   rgba(248, 244, 237, .86);
  --shadow:   0 1px 2px rgba(60, 45, 30, .05), 0 10px 26px -14px rgba(60, 45, 30, .22);
  --radius:   14px;
  --wrap:     760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #1c1a17;
    --card:     #26231e;
    --ink:      #ece6dc;
    --ink-soft: #b0a696;
    --muted:    #8a8074;
    --line:     #37322a;
    --accent:   #d98a5f;
    --header:   rgba(28, 26, 23, .86);
    --shadow:   0 1px 2px rgba(0, 0, 0, .35), 0 10px 26px -14px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
               "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* 极淡的纸纹，几乎看不见，但让白底不那么“死” */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(120, 95, 70, .05) 1px, transparent 1px);
  background-size: 22px 22px;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶部 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
}

.nav a {
  margin-left: 22px;
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
  transition: color .25s;
}

.nav a:hover { color: var(--accent); }

/* ---------- 问候 ---------- */

.hello {
  padding: 92px 0 62px;
  text-align: center;
}

.hello-name {
  margin: 0 0 14px;
  font-size: clamp(27px, 6vw, 38px);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.3;
}

.squiggle {
  display: block;
  width: 104px;
  height: 12px;
  margin: 0 auto 22px;
  color: var(--accent);
  opacity: .8;
}

.hello-text {
  max-width: 32em;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 16px;
}

/* ---------- 区段 ---------- */

.section { padding: 42px 0; }

.h2 {
  position: relative;
  margin: 0 0 6px;
  padding-left: 14px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .01em;
}

/* 标题左侧一笔手画感的短竖线 */
.h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .42em;
  width: 4px;
  height: .92em;
  border-radius: 3px;
  background: var(--accent);
  transform: rotate(6deg);
}

.section-sub {
  margin: 0 0 26px;
  padding-left: 14px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 记录卡片 ---------- */

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

.note {
  padding: 20px 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: rotate(-.5deg);
  transition: transform .38s cubic-bezier(.2, .7, .3, 1), border-color .38s;
}

.notes .note:nth-child(even) { transform: rotate(.6deg); }

.note:hover {
  transform: rotate(0deg) translateY(-3px);
  border-color: #ddd0bd;
}

.note h3 {
  margin: 0 0 9px;
  font-size: 16px;
  font-weight: 600;
}

.note h3::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  margin-top: 9px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .45;
}

.note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.85;
}

/* ---------- 收藏 ---------- */

.links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  font-size: 14.5px;
  text-decoration: none;
  transition: color .25s, border-color .25s, transform .25s;
}

.links a::after {
  content: "↗";
  color: var(--muted);
  font-size: 12px;
  transition: color .25s;
}

.links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.links a:hover::after { color: var(--accent); }

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

.site-footer {
  margin-top: 66px;
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-icp { margin: 0; }

.footer-icp a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color .25s;
}

.footer-icp a:hover { color: var(--accent); }

.footer-mail { margin: 7px 0 0; }

.footer-mail a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color .25s;
}

.footer-mail a:hover { color: var(--accent); }

/* ===========================================================
   头像 · 统计 · 分类收藏 · 留言板
   =========================================================== */

/* ---------- 头像 ---------- */
/* 外层负责给 multiply 提供一块纸色底，
   否则它只会和透明背景相乘，白底就留成一块「白瓷砖」 */
.hello-avatar-hold {
  display: block;
  width: 104px;
  height: 104px;
  margin: 0 auto 20px;
  border-radius: 26px;
  background: var(--paper);
  overflow: hidden;
}

.hello-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 白底直接融进纸色，不用手动抠图 */
  mix-blend-mode: multiply;
}

/* ---------- 统计 ---------- */
.stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.stat {
  min-width: 96px;
  padding: 12px 14px 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.stat b {
  display: block;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .02em;
}

/* ---------- 分类切换 ---------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.tabs-arrow {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color .25s, border-color .25s;
}

.tabs-arrow:hover { color: var(--accent); border-color: var(--accent); }

.tabs-track {
  display: flex;
  flex: 1 1 auto;
  gap: 7px;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs-track::-webkit-scrollbar { display: none; }

.tab {
  flex: none;
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: color .25s, background .25s, border-color .25s;
}

.tab:hover { color: var(--accent); border-color: var(--accent); }

.tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffdf9;
}

/* 切分类时列表轻微落位（纯 CSS，一定会跑完，不会停在透明） */
.links.is-swap { animation: swap .28s ease-out; }

@keyframes swap {
  from { opacity: .35; transform: translateY(4px); }
  to   { opacity: 1;   transform: none; }
}

/* ---------- 顶部「留言」按钮 ---------- */
.nav-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color .25s, border-color .25s;
}

.nav-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 留言板 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 34, 24, .45);
  animation: fade .22s ease-out;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 26px 24px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px -22px rgba(50, 35, 20, .5);
}

.modal-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.modal-note {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.modal-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.modal-x:hover { color: var(--accent); }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.7;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea {
  min-height: 106px;
  resize: vertical;
}

/* 蜜罐：真人看不见，也不会误触 */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  width: 100%;
  padding: 11px 18px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: #fffdf9;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: opacity .25s;
}

.btn:hover { opacity: .88; }
.btn:disabled { opacity: .55; cursor: default; }

.msg-result {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.msg-result--ok  { color: #3f7d52; }
.msg-result--err { color: #b04a3a; }

/* 深色下 multiply 会把整图压暗，改成「相纸」式浅底小方片 */
@media (prefers-color-scheme: dark) {
  .hello-avatar-hold {
    background: #f3ede3;
    box-shadow: 0 0 0 1px #3d372d;
  }
  .hello-avatar { mix-blend-mode: normal; }
  .msg-result--ok  { color: #7fbf94; }
  .msg-result--err { color: #e08a7c; }
}

@media (max-width: 640px) {
  .hello-avatar-hold { width: 88px; height: 88px; border-radius: 22px; }
  .stats { gap: 8px; }
  .stat { flex: 1 1 0; min-width: 0; padding: 10px 8px 11px; }
  .stat b { font-size: 18px; }
  .tab { padding: 6px 12px; font-size: 13.5px; }
  .tabs-arrow { width: 30px; height: 30px; }
}

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

@media (max-width: 640px) {
  .hello { padding: 62px 0 42px; }
  .notes { grid-template-columns: 1fr; }
  .links { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 34px 0; }
  .nav a { margin-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
