/* ============================================================
 * _010001SUTANG_ — 首页落地页（参考 neriakatz.com 形式）
 * 布局与动画参考 neriakatz.com，配色统一为 Swapsmore 暖色设计语言
 * ============================================================ */

/* ==== 01. tokens ==== */
:root {
  /* Swapsmore 设计 token（与全站 css/main.css 一致） */
  --bg: #fff9f0;                    /* sg-stage 奶油舞台底 */
  --bg-deep: #f6eedf;
  --panel-bg: #fffdf9;              /* sg-paper 纸色 */
  --text: #161b26;                  /* sg-ink */
  --muted: #524c42;                 /* sg-muted */
  --faint: #827a6d;                 /* sg-subtle */
  --accent: #4670d9;                /* sg-primary */
  --accent-strong: #3156bb;         /* sg-primary-strong */
  --accent-soft: rgba(70, 112, 217, 0.12);
  --card: #fffdf9;
  --card-hover: #ffffff;
  --line: #eae2d6;                  /* sg-line 暖米边框 */
  --dark: #161b26;                  /* sg-dark 深墨区块（页脚） */
  --font-display: Georgia, 'Times New Roman', 'Songti SC', 'STSong', 'SimSun', serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'PingFang SC', monospace;
}

/* ==== 02. base ==== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--accent);
  color: #fff;
}
a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible {
  outline: 2px solid #bbdef1;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}

/* ==== 03. loading screen ==== */
.loading {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  animation: loading-out 0.45s ease 1.15s forwards;
  pointer-events: none;
}
.loading span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: loading-bounce 0.5s ease-in-out infinite alternate;
}
.loading span:nth-child(2) {
  animation-delay: 0.15s;
}
.loading span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes loading-bounce {
  from {
    transform: translateY(-9px);
    opacity: 0.35;
  }
  to {
    transform: translateY(9px);
    opacity: 1;
  }
}
@keyframes loading-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ==== 04. layout ==== */
.panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 330px;
  padding: 56px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, var(--panel-bg), var(--bg-deep));
  border-right: 1px solid var(--line);
  z-index: 10;
}
.content {
  margin-left: 330px;
  min-height: 100vh;
  padding: 72px 64px 0;
}
.content-inner {
  max-width: 880px;
  margin: 0 auto;
}

/* ==== 05. hero panel ==== */
.avatar {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  transform: rotate(-7deg);
  box-shadow: 0 0 0 1px rgba(70, 112, 217, 0.35), 0 18px 50px rgba(22, 27, 38, 0.14);
}
.panel-kicker {
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.panel-name {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.2vw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}
.panel-subtitle {
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
}
.panel-role {
  margin-top: 26px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.panel-role .dot {
  color: var(--accent);
}
.panel-intro {
  margin-top: 22px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}
.panel-intro .word {
  display: inline-block;
  opacity: 0;
  animation: word-in 0.55s ease forwards;
  animation-delay: var(--d, 0s);
}
@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.5em);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
.panel-nav {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.panel-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.panel-nav a::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--line);
  transition: width 0.2s ease, background 0.2s ease;
}
.panel-nav a:hover {
  color: var(--text);
  transform: translateX(3px);
}
.panel-nav a:hover::before {
  width: 22px;
  background: var(--accent);
}
.panel-social {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.panel-social a {
  color: var(--faint);
  transition: color 0.2s ease;
}
.panel-social a:hover {
  color: var(--accent);
}
.panel-social svg {
  width: 20px;
  height: 20px;
}
.panel-cta {
  margin-top: 34px;
}
.panel-cta a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.panel-cta a:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(70, 112, 217, 0.3);
}
.panel-cta .arrow {
  transition: transform 0.25s ease;
}
.panel-cta a:hover .arrow {
  transform: translateX(4px);
}

/* ==== 06. sections ==== */
.section {
  padding: 64px 0 72px;
  border-top: 1px solid var(--line);
}
.section-head {
  margin-bottom: 40px;
}
.section-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.section-title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.section-sub {
  margin-top: 14px;
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
}

/* reveal: 交错入场 */
.reveal {
  opacity: 0;
  animation: fade-in-up 0.7s cubic-bezier(0.2, 0.7, 0.25, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==== 07. latest posts ==== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.post-card {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 12px 34px rgba(22, 27, 38, 0.06);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  background: var(--card-hover);
  box-shadow: 0 24px 60px rgba(22, 27, 38, 0.12);
}
.post-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.post-num {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
.post-date {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
}
.post-title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.post-card:hover .post-title {
  color: var(--accent-strong);
}
.post-meta {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pill-cat {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
}
.section-more {
  margin-top: 34px;
  text-align: center;
}
.section-more a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.section-more a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.section-more .arrow {
  transition: transform 0.25s ease;
}
.section-more a:hover .arrow {
  transform: translateX(4px);
}

/* ==== 08. stats (odometer) ==== */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.stat-number {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(52px, 6vw, 72px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}
.stat-number .unit {
  color: var(--accent);
  font-size: 0.5em;
  letter-spacing: 0;
}
.stat-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.odometer {
  display: inline-flex;
  height: 1em;
  overflow: hidden;
}
.odometer .digit-col {
  display: flex;
  flex-direction: column;
  height: 10em;             /* 完整 0-9 数字列高度，防止被 flex 容器压缩 */
  flex: 0 0 auto;
  animation: odometer-roll 1.4s cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
  animation-delay: var(--o, 0s);
}
.odometer .digit-col span {
  height: 1em;
  display: block;
  line-height: 1;
}
@keyframes odometer-roll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(var(--target));
  }
}
.stat-cats {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==== 09. tag cloud ==== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tag-item {
  padding: 9px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  transition: all 0.22s ease;
}
.tag-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==== 10. archive timeline ==== */
.timeline {
  position: relative;
  padding-left: 26px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.tl-item {
  position: relative;
  padding: 0 0 30px;
}
.tl-item:last-child {
  padding-bottom: 0;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.tl-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.tl-month {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
}
.tl-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}
.tl-desc a {
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
}
.tl-desc a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ==== 11. about ==== */
.about-grid {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.about-text {
  flex: 1;
  min-width: 260px;
  color: var(--muted);
  font-size: 15.5px;
}
.about-text p + p {
  margin-top: 16px;
}
.about-text strong {
  color: var(--text);
  font-weight: 600;
}
.about-text em {
  color: var(--text);
}
.about-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 190px;
}
.about-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  transition: all 0.22s ease;
}
.about-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(4px);
}
.about-links svg {
  width: 16px;
  height: 16px;
}

/* ==== 12. footer（深墨区块，呼应全站页脚） ==== */
.landing-footer {
  margin-top: 32px;
  padding: 34px 44px;
  border-radius: 20px;
  background: var(--dark);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.landing-footer .heart {
  color: #ff6b81;
}
.landing-footer a {
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.2s ease;
}
.landing-footer a:hover {
  color: #fff;
}

/* ==== 13. responsive ==== */
@media (max-width: 1023px) {
  .panel {
    position: relative;
    width: auto;
    height: auto;
    padding: 64px 28px 48px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
    text-align: center;
  }
  .panel-nav,
  .panel-social,
  .panel-cta {
    align-items: center;
    justify-content: center;
  }
  .panel-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 22px;
  }
  .panel-nav a::before {
    display: none;
  }
  .panel-intro {
    max-width: 560px;
  }
  .content {
    margin-left: 0;
    padding: 48px 22px 0;
  }
}
@media (max-width: 640px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    gap: 36px;
  }
  .section {
    padding: 48px 0 52px;
  }
}

/* ==== 14. reduced motion ==== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .loading {
    display: none;
  }
}
