/* ============================================================
   Lihsin 个人主页样式
   风格：简约 × 科技感 × 动效
   ============================================================ */

:root {
  --bg: #f7f8fb;
  --bg-soft: #ffffff;
  --text: #16181d;
  --text-2: #5b6472;
  --line: rgba(22, 24, 29, 0.09);
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --radius: 16px;
  --shadow-soft: 0 8px 30px rgba(22, 24, 29, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Cascadia Code",
    "Liberation Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* 细点阵背景：科技感的底色 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(22, 24, 29, 0.055) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

main, .hero, .footer { position: relative; z-index: 1; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

::selection { background: rgba(99, 102, 241, 0.22); }

/* ============ 导航栏 ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.nav.scrolled {
  background: rgba(247, 248, 251, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.65; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text) !important;
  background: var(--bg-soft);
  transition: box-shadow 0.25s, transform 0.25s !important;
}
.nav-cta:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 鼠标跟随光晕 */
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    560px circle at var(--mx, 50%) var(--my, 42%),
    rgba(99, 102, 241, 0.10),
    transparent 70%
  );
  transition: background 0.12s linear;
}

/* 浮动渐变光斑 */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  pointer-events: none;
}
.orb-1 {
  width: 420px; height: 420px;
  background: #a5b4fc;
  top: -120px; left: -80px;
  animation: drift 14s ease-in-out infinite alternate;
}
.orb-2 {
  width: 360px; height: 360px;
  background: #a5f3fc;
  bottom: -100px; right: -60px;
  animation: drift 17s ease-in-out infinite alternate-reverse;
}
.orb-3 {
  width: 240px; height: 240px;
  background: #ddd6fe;
  top: 40%; right: 18%;
  animation: drift 11s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(48px, 36px) scale(1.12); }
}

.hero-content { position: relative; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-2);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  display: inline-block;
  animation: pulse 2s ease-out infinite;
}
.pulse-dot.small { width: 7px; height: 7px; margin-right: 7px; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.hero-name {
  font-size: clamp(2.6rem, 7.5vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-typed {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  color: var(--text-2);
  min-height: 2em;
  margin-bottom: 40px;
}

/* 打字光标 */
.caret {
  display: inline-block;
  width: 2px; height: 1.15em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
.caret.dark { background: #7dd3fc; height: 1em; }
@keyframes blink { 50% { opacity: 0; } }

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  padding: 13px 32px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.32);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(99, 102, 241, 0.4); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}
.btn-ghost:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }

/* 向下滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid rgba(22, 24, 29, 0.18);
  border-radius: 999px;
}
.scroll-hint span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 4px;
  background: var(--accent);
  animation: scrollHint 1.8s ease-in-out infinite;
}
@keyframes scrollHint {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============ 区块通用 ============ */
.section { padding: 110px 0; scroll-margin-top: 64px; }
.section-alt { background: rgba(255, 255, 255, 0.55); }

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 46px;
}

/* ============ 关于我 ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 52px;
  align-items: center;
}
.about-text p { color: var(--text-2); margin-bottom: 16px; font-size: 1.05rem; }
.about-text a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.4);
}
.about-text a:hover { border-bottom-style: solid; }

.about-facts { list-style: none; margin-top: 28px; }
.about-facts li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.fact-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  width: 44px;
  flex-shrink: 0;
}
.fact-open { display: inline-flex; align-items: center; }

/* 终端风卡片 */
.terminal {
  background: #0d1117;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(13, 17, 23, 0.22);
  transform: rotate(1.2deg);
  transition: transform 0.4s ease;
}
.terminal:hover { transform: rotate(0deg) scale(1.015); }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.t-dot { width: 12px; height: 12px; border-radius: 50%; }
.t-dot.red { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green { background: #28c840; }
.terminal-title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}
.terminal-body {
  padding: 20px 22px 26px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e6edf3;
}
.terminal-body p { margin-bottom: 6px; }
.t-prompt { color: #7ee787; margin-right: 8px; }
.t-out { color: #9da7b3; padding-left: 18px; }

/* ============ 技能 ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}
.skill-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.35);
}
.skill-card:hover::before { transform: scaleX(1); }
.skill-icon {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 18px;
}
.skill-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.skill-card p { color: var(--text-2); font-size: 0.92rem; }

/* ============ 最新文章（博客同步） ============ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.post-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.15);
}
.post-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 10px;
}
.post-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
}
.post-excerpt {
  color: var(--text-2);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 加载占位：微光扫过动画 */
.post-skeleton {
  height: 170px;
  border-radius: var(--radius);
  background: linear-gradient(
    100deg,
    rgba(22, 24, 29, 0.05) 40%,
    rgba(22, 24, 29, 0.1) 50%,
    rgba(22, 24, 29, 0.05) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.posts-error {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 42px 24px;
}
.posts-error a { color: var(--accent); }
.blog-more { text-align: center; margin-top: 38px; }

/* ============ 现在 ============ */
.now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.now-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.now-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 14px 34px rgba(6, 182, 212, 0.12);
}
.now-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-2);
  background: rgba(6, 182, 212, 0.1);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}
.now-card h3 { font-size: 1.12rem; margin-bottom: 6px; }
.now-card p { color: var(--text-2); font-size: 0.92rem; }

/* ============ 联系 ============ */
.contact-inner { text-align: center; }
.contact-desc { color: var(--text-2); margin: -18px 0 34px; }
.contact-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.contact-chip {
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.contact-chip:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  background: rgba(255, 255, 255, 0.55);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-2);
  font-size: 0.9rem;
}
.footer-mono { font-family: var(--font-mono); font-size: 0.8rem; opacity: 0.75; }
.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(22, 24, 29, 0.25);
}
.footer a:hover { color: var(--accent); }

/* ============ 滚动显现动画 ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0s);
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .orb, .pulse-dot, .scroll-hint span, .post-skeleton { animation: none; }
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .terminal { transform: none; }
}
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .section { padding: 84px 0; }
  .hero-actions .btn { padding: 12px 26px; }
}
