/* =========================================================
   笑鹏 · 个人主页
   方向：暖纸名片。手机优先，375px 起步。
   全部字体走系统栈，不请求任何外部资源。
   ========================================================= */

:root {
  --bg: #f6f2e9;
  --surface: #fffdf8;
  --ink: #191713;
  --ink-2: #575046;
  --muted: #6f675b;
  --line: #e2daca;
  --accent: #9a3f26;
  --accent-ink: #fff8f2;
  --accent-soft: rgba(154, 63, 38, 0.09);

  --font-title: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-num: Georgia, "Times New Roman", "Songti SC", serif;

  --pad: 20px;
  --radius: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 260ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

::selection {
  background: rgba(154, 63, 38, 0.16);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 页面容器 ---------- */
.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--pad) 32px;
}

/* ---------- 首屏 ---------- */
.hero {
  padding-top: 26px;
  padding-bottom: 4px;
}

.hero__bar {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hero__tag {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* 印章：从独立漂浮改为姓名右侧的落款，尺寸随字号走 */
.seal {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-title);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(255, 248, 242, 0.5), inset 0 0 0 3px var(--accent);
  transform: rotate(-4deg);
  margin-top: 4px;
  user-select: none;
}

.hero__id {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

/* 姓名 + 落款章，作为一组视觉签名 */
.hero__sign {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

/* 头像：原图是全身合影，圆形里按人脸位置裁切放大，否则 78px 下人脸认不出 */
.avatar-wrap {
  flex: none;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--line);
  box-shadow: 0 0 0 1px rgba(25, 23, 19, 0.06), 0 8px 20px -12px rgba(25, 23, 19, 0.45);
}

.avatar {
  position: absolute;
  width: 420%;
  height: 420%;
  max-width: none;
  left: -78%;
  top: -27%;
  object-fit: cover;
}

.hero__name {
  font-family: var(--font-title);
  font-size: 44px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero__lead {
  margin-top: 26px;
  font-family: var(--font-title);
  font-size: 22px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.hero__lead em {
  font-style: normal;
  color: var(--accent);
  border-bottom: 1px solid rgba(154, 63, 38, 0.45);
  padding-bottom: 1px;
}

.hero__meta {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
}

.hero__actions {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius);
  font-size: 16px;
  letter-spacing: 0.04em;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  box-shadow: 0 10px 24px -14px rgba(154, 63, 38, 0.9);
}

.btn--primary:hover {
  background: #8a351f;
}

.btn--primary:active {
  transform: translateY(1px);
}

.btn--ghost {
  min-height: 44px;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(87, 80, 70, 0.35);
}

.btn--ghost:hover {
  color: var(--accent);
  text-decoration-color: rgba(154, 63, 38, 0.5);
}

.hero__hint {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hero__hint-line {
  width: 28px;
  height: 1px;
  background: var(--line);
}

/* ---------- 区块 ---------- */
.section {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.section__title {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* ---------- 数据条 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}

.stat {
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
}

.stat:nth-child(-n + 2) {
  border-top: 0;
  padding-top: 0;
}

/* 数字与单位同基线；用 inline-flex，单位才不会被挤到下一行 */
.stat__num {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-height: 38px;
  font-family: var(--font-num);
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stat__num--text {
  font-size: 27px;
}

.stat__unit {
  margin-left: 4px;
  font-size: 13px;
  color: var(--muted);
}

.stat__label {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- 能力卡（抽屉） ---------- */
.abilities {
  border-top: 1px solid var(--line);
}

.ability {
  border-bottom: 1px solid var(--line);
}

.ability__head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 16px 4px;
  text-align: left;
  border-radius: 4px;
  transition: background-color var(--dur) var(--ease);
}

.ability__head:hover {
  background: rgba(25, 23, 19, 0.02);
}

.ability__head:active {
  background: rgba(154, 63, 38, 0.05);
}

.ability__name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* 结果标签不再用色块，改成右对齐的定宽文本，三行右边缘才齐 */
.ability__proof {
  flex: none;
  min-width: 86px;
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  white-space: nowrap;
}

.ability__chev {
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur) var(--ease);
}

.ability__head[aria-expanded="true"] .ability__chev {
  transform: rotate(-135deg) translateY(-1px);
}

.ability__panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--dur) var(--ease);
}

/* 只有 JS 可用时才默认收起，脚本失效时三张卡全部展开可读 */
.js .ability__panel:not(.is-open) {
  grid-template-rows: 0fr;
}

.ability__inner {
  overflow: hidden;
  min-height: 0;
}

.ability__inner p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
  padding-bottom: 18px;
  max-width: 34em;
}

/* ---------- 关于我 ---------- */
.about {
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-2);
  max-width: 34em;
}

/* 只在 JS 可用时做折叠，避免脚本失效导致内容读不到；
   末行做渐隐，避免文字被 hard cut 成半截 */
.js .about:not(.is-open) {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 58%, rgba(0, 0, 0, 0.18) 100%);
  mask-image: linear-gradient(180deg, #000 58%, rgba(0, 0, 0, 0.18) 100%);
}

.more {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ---------- 找我 ---------- */
.contact-list {
  display: grid;
  gap: 10px;
}

/* 联系项做成两张卡片：值可点、动作明确，不再像表格行 */
.contact {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.contact:hover {
  border-color: rgba(154, 63, 38, 0.4);
  box-shadow: 0 8px 20px -14px rgba(25, 23, 19, 0.45);
}

.contact__kind {
  flex: none;
  min-width: 2.2em;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.contact__value {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.contact__action {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 3px;
  padding: 5px 8px;
}

.contact:hover .contact__action {
  background: #8a351f;
}

.contact__note {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

/* 缺口占位：虚线在，但不与主按钮争视觉重量 */
.pending {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: transparent;
}

.pending__label {
  font-size: 12px;
  color: var(--muted);
}

.pending__value {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.footer__slogan {
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* ---------- 手机端常驻加微信 ---------- */
.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
  background: rgba(246, 242, 233, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  transform: translateY(120%);
  transition: transform var(--dur) var(--ease);
}

.sticky .btn {
  width: 100%;
}

.sticky.is-visible {
  transform: none;
}

/* ---------- 微信二维码弹窗 ---------- */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.qr-modal[hidden] {
  display: none;
}

.qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 16, 9, 0.64);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.qr-modal__panel {
  position: relative;
  width: min(320px, 100%);
  padding: 22px 20px 18px;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.55);
  text-align: center;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

/* 焦点放在面板上接管，键盘 Tab 再进按钮，此时关闭按钮才显示焦点环 */
.qr-modal__panel:focus {
  outline: none;
}

.qr-modal.is-open .qr-modal__backdrop {
  opacity: 1;
}

.qr-modal.is-open .qr-modal__panel {
  opacity: 1;
  transform: none;
}

.qr-modal__title {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* 图片按原始比例展示，不做裁剪不做变形，长按才能被微信识别 */
.qr-modal__img {
  display: block;
  width: 100%;
  max-width: 250px;
  max-height: 52vh;
  height: auto;
  margin: 14px auto 0;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.qr-modal__hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.qr-modal__copy {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.qr-modal__copy:hover {
  border-color: rgba(154, 63, 38, 0.4);
  color: var(--accent);
}

.qr-modal__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  border-radius: 50%;
}

.qr-modal__close:hover {
  background: rgba(25, 23, 19, 0.06);
  color: var(--ink);
}

/* ---------- 复制提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 60;
  transform: translate(-50%, 10px);
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 首屏入场：CSS 播放，不依赖脚本 ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rise {
  animation: fade-up 620ms var(--ease) both;
  animation-delay: var(--delay, 0ms);
}

/* 滚动揭示：仅在 JS 可用时隐藏，脚本失效内容照常可见 */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}

/* ---------- 桌面增强 ---------- */
@media (min-width: 900px) {
  body {
    background: #efeae0;
  }

  .page {
    max-width: 760px;
    margin: 48px auto 72px;
    padding: 0 48px 56px;
    background: var(--bg);
    box-shadow: 0 1px 0 rgba(25, 23, 19, 0.05), 0 30px 70px -40px rgba(25, 23, 19, 0.35);
  }

  .hero {
    padding-top: 44px;
  }

  .avatar-wrap {
    width: 96px;
    height: 96px;
  }

  .hero__name {
    font-size: 64px;
  }

  .hero__lead {
    margin-top: 34px;
    font-size: 30px;
  }

  /* 桌面一句话一行读完，不再断成两行留下参差的右边缘 */
  .hero__lead br {
    display: none;
  }

  .seal {
    width: 42px;
    height: 42px;
    font-size: 17px;
    margin-top: 8px;
  }

  .hero__meta {
    font-size: 13px;
  }

  .hero__actions {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
  }

  .btn {
    min-height: 50px;
    padding: 0 30px;
  }

  .btn--primary {
    min-width: 232px;
  }

  .btn--ghost {
    min-height: 44px;
  }

  .hero__hint {
    display: none;
  }

  .section {
    margin-top: 56px;
    padding-top: 32px;
  }

  .section__title {
    font-size: 18px;
  }

  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 24px;
  }

  .stat {
    border-top: 1px solid var(--line);
    padding-top: 18px;
  }

  .stat:nth-child(-n + 2) {
    border-top: 1px solid var(--line);
    padding-top: 18px;
  }

  .stat__num {
    font-size: 38px;
    min-height: 42px;
  }

  .stat__num--text {
    font-size: 30px;
  }

  .contact-list {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .ability__head {
    min-height: 60px;
  }

  .about {
    max-width: none;
    font-size: 16px;
    line-height: 2;
  }

  .js .about:not(.is-open) {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .more {
    display: none;
  }

  .sticky {
    display: none;
  }

  .toast {
    bottom: 32px;
  }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rise,
  .reveal,
  .reveal.in {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .ability__panel,
  .ability__chev,
  .sticky,
  .toast,
  .btn,
  .qr-modal__backdrop,
  .qr-modal__panel {
    transition: none !important;
  }
}
