/* ============================================================
   墨韵清河 · 个人主页 —— 暖纸文艺风
   配色：米白纸底 / 深褐墨字 / 赭石点缀
   质感：纸纹肌理 + 中央暖光 + 入场渐显 + hover 反馈
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --paper: #f6efe3;        /* 页面底色（米白纸感） */
  --surface: #fffdf7;      /* 卡片 / 条目底（暖白） */
  --ink: #3d2f1e;          /* 主文字（深褐墨色） */
  --ink-soft: #8a7a5f;     /* 次级文字（灰褐） */
  --accent: #a4552f;       /* 链接 / 强调（赭石） */
  --line: #e7dcc8;         /* 细线 / 边框 */
  /* 立体投影：顶部一道纸边高光 + 层层投下的暖褐阴影，像纸片浮在桌面上 */
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.7),
                 0 2px 6px rgba(61, 47, 30, 0.08),
                 0 14px 28px -10px rgba(61, 47, 30, 0.22),
                 0 30px 60px -18px rgba(61, 47, 30, 0.26);
  --shadow-item: 0 1px 2px rgba(61, 47, 30, 0.06),
                 0 5px 12px -6px rgba(61, 47, 30, 0.16);
  --shadow-item-hover: 0 2px 4px rgba(61, 47, 30, 0.08),
                 0 10px 22px -8px rgba(61, 47, 30, 0.24);

  --serif: "Songti SC", "STSong", "Noto Serif CJK SC",
           "Source Han Serif SC", "SimSun", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  /* 一盏暖光，位置由 JS 每次刷新轻微偏移；变量兜底保持默认 */
  background:
    radial-gradient(58rem 40rem at var(--glow-x, 50%) var(--glow-y, 16%),
                    rgba(216, 178, 128, 0.16),
                    transparent 62%),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  /* 左键拖不选、文字抄不走（静默，不弹警告） */
  -webkit-user-select: none;
  user-select: none;
  /* 垂直居中：内容矮时上下均分留白，内容高时自然滚动 */
  min-height: 100dvh;
  display: flex;
}

/* 纸纹肌理：固定在视口、不随滚动重绘、不拦交互 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
}

::selection { background: rgba(164, 85, 47, 0.2); }

img { -webkit-user-drag: none; }   /* Safari 图片不可拖拽 */

/* 跟随笔标的暖阳画布：只看不拦，悬浮于内容之上 */
#sun {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

/* 右键警告：不规则手裁小纸片，蹦出来又自己消失 */
.warn {
  position: fixed;
  z-index: 70;
  padding: 0.7rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow-item-hover);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8) rotate(var(--tilt, 0deg));
  transition: opacity 0.25s var(--ease-out),
              transform 0.25s var(--ease-out);
}

.warn.show {
  opacity: 1;
  transform: scale(1) rotate(var(--tilt, 0deg));
}

.page {
  max-width: 26rem;
  width: 100%;
  /* flex 子项 margin:auto：水平+垂直居中，且内容超高时不会被裁顶 */
  margin: auto;
  padding: 3rem 1.25rem;
}

/* ---------- 入场渐显（有叙事顺序：名片 → 联系 → 页脚） ---------- */
/* --tilt 由 JS 每次刷新随机注入，让名片带着一点随性的倾斜入场 */
@keyframes rise {
  from { opacity: 0; transform: rotate(var(--tilt, 0deg)) translateY(14px); }
  to   { opacity: 1; transform: rotate(var(--tilt, 0deg)) translateY(0); }
}

.card    { animation: rise 0.7s var(--ease-out) both; }
.contact { animation: rise 0.7s var(--ease-out) 0.12s both; }
.footer  { animation: rise 0.7s var(--ease-out) 0.22s both; }

/* ---------- 名片区 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  /* 有机形状兜底（JS 关闭时也好看）；JS 会在每次刷新时随机重掷 */
  border-radius: 58% 42% 47% 53% / 45% 58% 42% 55%;
  box-shadow: var(--shadow-card);
  padding: 2.75rem 1.75rem 2.5rem;
  text-align: center;
  /* 静止时也带着那点随性的倾斜（减弱动效下依然生效） */
  transform: rotate(var(--tilt, 0deg));
}

.avatar {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(61, 47, 30, 0.08);
}

.name {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.role {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}

.motto {
  margin-top: 1.25rem;
  color: var(--accent);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
}

/* ---------- 找到我 ---------- */
.contact { margin-top: 3.5rem; }

.contact h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3em;
}

.contact h2::before,
.contact h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.contact-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.contact-item {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.9rem 2.5rem 0.9rem 1.25rem;   /* 右侧留白给浮现的箭头 */
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-item);
  /* 每条带着各自随性的小倾斜（JS 注入 --tilt） */
  transform: rotate(var(--tilt, 0deg));
  transition: border-color 0.25s var(--ease-out),
              box-shadow 0.25s var(--ease-out),
              transform 0.25s var(--ease-out);
}

/* hover：边框转赭石、轻抬，右侧浮现一个箭头作为"可点"的反馈 */
.contact-item::after {
  content: "\2192";            /* → */
  position: absolute;
  right: 1.1rem;
  top: 50%;
  color: var(--accent);
  opacity: 0;
  transform: translate(-6px, -50%);
  transition: opacity 0.25s var(--ease-out),
              transform 0.25s var(--ease-out);
}

.contact-item:hover,
.contact-item:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-item-hover);
  transform: rotate(var(--tilt, 0deg)) translateY(-2px);
}

.contact-item:hover::after,
.contact-item:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.contact-item:hover .platform,
.contact-item:focus-visible .platform { color: var(--accent); }

/* 按下时的物理回馈 */
.contact-item:active { transform: rotate(var(--tilt, 0deg)) translateY(0); }

.contact-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.platform {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
}

.handle {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  word-break: break-all;
}

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 4rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
  .card { padding: 2.25rem 1.25rem 2rem; }
  .avatar { width: 78px; height: 78px; }
  .contact { margin-top: 2.5rem; }
  .footer { margin-top: 3rem; }
}

/* ---------- 减弱动效：一切归零 ---------- */
@media (prefers-reduced-motion: reduce) {
  .card, .contact, .footer { animation: none; }
  .contact-item,
  .contact-item::after,
  .warn { transition: none; }
}
