/* ============================================================
   chenxingfs.com — 单页个人主页
   纯静态，无外部依赖，无 web font 请求
   ============================================================ */

:root {
  --bg: #08080a;
  --ink: #f4f1ea;
  --muted: #9d998f;
  --dim: #7d7971;
  --line: rgba(244, 241, 234, 0.09);
  --accent: #ff6b3d;
  --accent-2: #ffb066;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 0.72, 0.24, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: rgba(255, 107, 61, 0.28);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- 背景 ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #141216 0%, transparent 55%),
    var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.62;
  will-change: transform;
}

.blob-a {
  width: 46vw;
  height: 46vw;
  top: -18vw;
  left: 50%;
  margin-left: -23vw;
  background: radial-gradient(circle at 50% 50%, rgba(255, 107, 61, 0.34), transparent 68%);
  animation: drift-a 22s ease-in-out infinite alternate;
}

.blob-b {
  width: 40vw;
  height: 40vw;
  bottom: -22vw;
  right: -8vw;
  background: radial-gradient(circle at 50% 50%, rgba(96, 132, 255, 0.2), transparent 68%);
  animation: drift-b 27s ease-in-out infinite alternate;
}

.blob-c {
  width: 34vw;
  height: 34vw;
  bottom: -18vw;
  left: -10vw;
  background: radial-gradient(circle at 50% 50%, rgba(255, 176, 102, 0.14), transparent 70%);
  animation: drift-c 31s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d(3%, 4%, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 2%, 0) scale(1.05); }
  to   { transform: translate3d(-4%, -3%, 0) scale(0.95); }
}
@keyframes drift-c {
  from { transform: translate3d(2%, 0, 0) scale(0.98); }
  to   { transform: translate3d(-3%, -4%, 0) scale(1.1); }
}

/* 细网格，向下淡出 */
.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(244, 241, 234, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(244, 241, 234, 0.045) 1px, transparent 1px);
  background-size: 76px 76px;
  -webkit-mask-image: radial-gradient(90% 60% at 50% 22%, #000 0%, transparent 78%);
  mask-image: radial-gradient(90% 60% at 50% 22%, #000 0%, transparent 78%);
  opacity: 0.6;
}

/* 跟随鼠标的柔光（桌面端） */
.spotlight {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: radial-gradient(
    520px circle at var(--mx, 50%) var(--my, 30%),
    rgba(255, 107, 61, 0.09),
    transparent 62%
  );
}

.spotlight.is-on {
  opacity: 1;
}

/* 颗粒质感 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 36px 0;
}

.brand {
  font-family: var(--mono);
  font-size: 14.5px;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: color 0.25s ease;
}

.brand:hover {
  color: var(--accent-2);
}

.brand-dot {
  color: var(--accent);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.status-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5ee08a;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(94, 224, 138, 0.4);
  animation: ping 2.6s ease-out infinite;
}

@keyframes ping {
  0%   { transform: scale(0.7); opacity: 0.9; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- 主内容 ---------- */

.stage {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(52px, 10.5vh, 112px) 36px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--dim);
}

.eyebrow-line {
  width: 26px;
  height: 1px;
  background: linear-gradient(to right, var(--accent), transparent);
}

h1 {
  margin: 0;
  font-size: clamp(2.75rem, 7.2vw, 4.75rem);
  text-wrap: balance;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.038em;
}

h1 .name {
  white-space: nowrap;
}

h1 .accent {
  color: var(--accent);
  margin-left: 0.04em;
}

.lede {
  margin: 26px 0 0;
  max-width: 34em;
  font-size: clamp(15.5px, 1.6vw, 17.5px);
  line-height: 1.85;
  color: var(--muted);
  letter-spacing: 0.005em;
}

/* ---------- 工具卡片 ---------- */

.tool {
  position: relative;
  margin-top: clamp(38px, 6vh, 62px);
  padding: 28px 34px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.015));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.45s ease, box-shadow 0.45s ease;
}

.tool::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.32), transparent);
  opacity: 0.6;
}

.tool:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 61, 0.26);
  box-shadow: 0 34px 90px -46px rgba(255, 107, 61, 0.55);
}

.tool-glow {
  position: absolute;
  top: -150px;
  right: -90px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 61, 0.22), transparent 66%);
  filter: blur(40px);
  pointer-events: none;
}

.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
  color: var(--dim);
}

.tool-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.1em;
  color: #8a877f;
}

.tool-state-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5ee08a;
  box-shadow: 0 0 8px rgba(94, 224, 138, 0.6);
}

.tool h2 {
  margin: 18px 0 0;
  font-size: clamp(20px, 2.6vw, 25px);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.35;
}

.tool-desc {
  margin: 12px 0 0;
  max-width: 54ch;
  font-size: 14.8px;
  line-height: 1.8;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 5px 11px;
  border: 1px solid rgba(244, 241, 234, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.028);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #c9c4b9;
}

.tool-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(244, 241, 234, 0.06);
}

.tool-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #7d7971;
}

/* ---------- 按钮 ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 13px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7f4e 0%, #ff5a2c 100%);
  color: #1b0c06;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow:
    0 12px 30px -12px rgba(255, 90, 44, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease, filter 0.3s ease;
  overflow: hidden;
  isolation: isolate;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    110deg,
    transparent 28%,
    rgba(255, 255, 255, 0.42) 48%,
    transparent 68%
  );
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.06);
  box-shadow:
    0 18px 40px -14px rgba(255, 90, 44, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn:hover::after {
  transform: translateX(130%);
}

.btn:active {
  transform: translateY(0);
}

.btn-icon {
  display: inline-flex;
  transition: transform 0.3s var(--ease);
}

.btn-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

.btn:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 4px;
}

/* ---------- 其他 ---------- */

.more {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: clamp(28px, 4.6vh, 44px) 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: #7d7971;
}

.dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding-bottom: 2px;
}

.dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.5s ease-in-out infinite;
}

.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 100% { opacity: 0.2; }
  45%      { opacity: 1; }
}

.foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 36px 30px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: #7d7971;
}

.foot-sep {
  opacity: 0.6;
}

/* 备案号，拿到后填 content.js 的 icp 字段才出现 */
.icp {
  transition: color 0.25s ease;
}

.icp::before {
  content: "·";
  margin-right: 10px;
  opacity: 0.6;
}

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

/* ---------- 入场动画 ---------- */

.reveal {
  opacity: 0;
  animation: rise 0.95s var(--ease) var(--d, 0ms) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* 矮屏笔记本（1280x800 这类）压缩纵向留白，尽量一屏放下 */
@media (min-width: 900px) and (max-height: 830px) {
  .stage {
    padding-top: 54px;
  }

  h1 {
    font-size: clamp(2.6rem, 5.4vw, 4.05rem);
  }

  .tool {
    margin-top: 36px;
    padding: 26px 32px 22px;
  }

  .more {
    margin-top: 28px;
  }

  .foot {
    padding: 26px 36px 24px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 22px 22px 0;
  }

  .stage {
    padding: clamp(52px, 10vh, 88px) 22px 0;
  }

  .eyebrow {
    margin-bottom: 20px;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.85rem);
    letter-spacing: -0.028em;
  }

  .lede {
    margin-top: 24px;
    font-size: 15px;
    line-height: 1.8;
  }

  .lede br {
    display: none;
  }

  .tool {
    padding: 24px 22px 22px;
    border-radius: 20px;
  }

  .tool-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .btn {
    justify-content: center;
    padding: 15px 22px;
    font-size: 15.5px;
  }

  .tool-meta {
    order: 2;
    text-align: center;
  }

  .foot {
    padding: 44px 22px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
