/* ==========================================================================
   又白忙活了 · AI 工具博客 — 诚实、编辑感、有一点机械的浪漫
   ========================================================================== */

:root {
  --paper: #f2ede3;
  --paper-2: #eae2d2;
  --card: #faf6ee;
  --ink: #1a1712;
  --ink-soft: #3d372e;
  --muted: #7a7061;
  --accent: #e23b2e;
  --line: rgba(26, 23, 18, 0.16);
  --line-strong: rgba(26, 23, 18, 0.32);
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

.mono {
  font-family: var(--mono);
}

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

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

/* ---------- 噪点纹理 ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 无障碍 ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  z-index: 1000;
}

.skip-link:focus {
  left: 0;
}

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

/* ---------- 顶部导航 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 237, 227, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

.site-nav {
  display: flex;
  gap: 26px;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.site-nav a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-soft);
  transition: color 0.25s var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.head-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}

.head-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e44;
  box-shadow: 0 0 0 0 rgba(47, 158, 68, 0.5);
  animation: pulse 2.2s var(--ease) infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 158, 68, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(47, 158, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 158, 68, 0); }
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 76px;
  position: relative;
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 26px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(58px, 10.5vw, 132px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 34px;
}

.hero-meta {
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin-bottom: 38px;
}

.hero-lead {
  max-width: 640px;
  font-size: 18px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin-bottom: 42px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 14px 30px;
  border: 1.5px solid var(--ink);
  transition: all 0.25s var(--ease);
}

.btn-solid {
  background: var(--ink);
  color: var(--paper);
}

.btn-solid:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.75s var(--ease) forwards;
}

.hero .reveal:nth-child(1) { animation-delay: 0.05s; }
.hero .reveal:nth-child(2) { animation-delay: 0.14s; }
.hero .reveal:nth-child(3) { animation-delay: 0.23s; }
.hero .reveal:nth-child(4) { animation-delay: 0.32s; }
.hero .reveal:nth-child(5) { animation-delay: 0.41s; }

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

.reveal-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-scroll.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 跑马灯 ---------- */
.ticker {
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding: 12px 0;
}

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  width: max-content;
  animation: ticker 36s linear infinite;
}

.ticker-track span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  padding: 0 22px;
}

.ticker-track i {
  font-style: normal;
  color: var(--accent);
  font-size: 12px;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 通用区块 ---------- */
.section {
  padding: 96px 0;
}

.section-tint {
  background: var(--paper-2);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: 0.01em;
}

.sec-index {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 文章列表 ---------- */
.posts {
  display: grid;
  gap: 26px;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 rgba(26, 23, 18, 0.07);
}

.post-link {
  display: block;
  padding: 28px 32px 26px;
}

.post-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 14px;
}

.post-num {
  color: var(--accent);
}

.post-link h3 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 10px;
  transition: color 0.25s var(--ease);
}

.post-card:hover .post-link h3 {
  color: var(--accent);
}

.post-excerpt {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.85;
  margin-bottom: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 3px 10px;
  border-radius: 999px;
}

.post-read {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.post-card:hover .post-read {
  color: var(--accent);
}

/* ---------- 栏目 ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.chip {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  border: 1.5px solid var(--line-strong);
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--card);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.col-note {
  margin-top: 26px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 56px;
  align-items: start;
}

.lead-p {
  font-size: 20px;
  line-height: 1.9;
  font-weight: 600;
  margin-bottom: 22px;
}

.about-grid p {
  margin-bottom: 18px;
  color: var(--ink-soft);
}

.pull-quote {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.8;
  margin-top: 30px;
  padding: 26px 30px;
  border-left: 4px solid var(--accent);
  background: var(--card);
  box-shadow: 6px 6px 0 var(--line-strong);
}

.about-side {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 28px;
}

.side-title {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted);
  margin-bottom: 18px;
}

.tag-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.tag-list li {
  font-size: 14px;
  color: var(--ink);
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.side-note {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  line-height: 1.9;
}

/* ---------- 联系 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 28px 26px;
  min-height: 160px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 rgba(26, 23, 18, 0.07);
}

.contact-label {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.contact-value {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 800;
  word-break: break-all;
}

.contact-hint {
  margin-top: auto;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- 文章页 ---------- */
.article-main {
  padding: 72px 0 96px;
}

.article {
  max-width: 760px;
  margin: 0 auto;
}

.article-title {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 20px;
}

.article-meta i {
  font-style: normal;
  color: var(--accent);
}

.article-head .tags {
  margin-bottom: 26px;
}

.article-excerpt {
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-soft);
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  margin-bottom: 44px;
}

.article-body {
  font-size: 16.5px;
  line-height: 2;
  color: var(--ink-soft);
}

.article-body h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  margin: 52px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.article-body h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  margin: 38px 0 14px;
}

.article-body p {
  margin: 18px 0;
}

.article-body strong {
  color: var(--ink);
  font-weight: 700;
}

.article-body a {
  color: var(--accent);
  border-bottom: 1px dotted var(--accent);
  transition: border-bottom-style 0.2s var(--ease);
}

.article-body a:hover {
  border-bottom-style: solid;
}

.article-body ul,
.article-body ol {
  margin: 18px 0;
  padding-left: 26px;
}

.article-body li {
  margin: 8px 0;
}

.article-body li::marker {
  color: var(--accent);
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--card);
  padding: 18px 24px;
  margin: 28px 0;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 4px;
}

.article-body pre {
  background: var(--ink);
  color: var(--paper);
  padding: 20px 22px;
  overflow-x: auto;
  margin: 26px 0;
  border-radius: 6px;
}

.article-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

.article-body hr {
  border: none;
  border-top: 2px dashed var(--line-strong);
  margin: 52px 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
}

.article-body th {
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.article-nav a:hover {
  color: var(--accent);
}

/* ---------- 页脚 ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  background: var(--paper-2);
}

.foot-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .site-head {
    position: static;
  }

  .head-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .head-status {
    display: none;
  }

  .site-nav {
    gap: 16px;
    font-size: 13px;
  }

  .hero {
    padding: 64px 0 52px;
  }

  .hero-title {
    font-size: clamp(48px, 16vw, 78px);
  }

  .section {
    padding: 68px 0;
  }

  .section-head {
    flex-direction: column;
    gap: 8px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .post-link {
    padding: 24px 22px;
  }

  .post-link h3 {
    font-size: 21px;
  }

  .pull-quote {
    font-size: 19px;
    padding: 20px 22px;
  }

  .foot-inner {
    flex-direction: column;
    gap: 6px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal-scroll {
    opacity: 1;
    transform: none;
  }
}
