/* ============================================================
   CSR Club 博客 —— 样式表
   中性单色 + 细边框 + 大留白，不使用渐变与发光
   纯手写，无外部依赖
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  --bg:        #0b0b0c;
  --bg-soft:   #0f0f11;
  --panel:     #121214;

  --line:      rgba(255, 255, 255, .10);
  --line-soft: rgba(255, 255, 255, .06);

  --text:      #ecebe8;
  --muted:     #9b9a97;
  --dim:       #6a6966;

  /* 全站唯一的强调色：低饱和琥珀金 */
  --accent:      #d8a65c;
  --accent-hi:   #e5b978;                        /* 悬停时略亮 */
  --accent-soft: rgba(216, 166, 92, .12);        /* 淡淡的底色 */
  --accent-line: rgba(216, 166, 92, .35);        /* 悬停边框 */

  --radius:    14px;
  --radius-sm: 10px;

  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Courier New", monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);

  --maxw: 1080px;
  --padx: clamp(20px, 5vw, 56px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 极淡的网格，只作为肌理存在，不抢视觉 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right,  rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 25%, transparent 75%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }

/* 选中文字时用强调色 */
::selection {
  background: var(--accent);
  color: #14100a;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -.02em;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  padding-top: 22px;
  padding-bottom: 22px;
  /* 宽屏时和正文左边缘精确对齐 */
  padding-left:  max(var(--padx), calc((100vw - var(--maxw)) / 2 + var(--padx)));
  padding-right: max(var(--padx), calc((100vw - var(--maxw)) / 2 + var(--padx)));

  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease),
              padding .3s var(--ease), backdrop-filter .3s var(--ease);
}

.site-header.is-scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(11, 11, 12, .78);
  border-bottom-color: var(--line-soft);
  backdrop-filter: saturate(120%) blur(16px);
  -webkit-backdrop-filter: saturate(120%) blur(16px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.brand-mark {
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: .04em;
}
.brand-text { color: var(--muted); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
  font-size: 14px;
  color: var(--muted);
}
.nav a {
  position: relative;
  padding: 4px 0;
  transition: color .25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 130px var(--padx) 90px;
}

.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 30px;
  animation: fade-up .8s var(--ease) both;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.14;
  letter-spacing: -.035em;
  font-weight: 680;
  animation: fade-up .9s .08s var(--ease) both;
}

/* 只有这一处强调色，且是纯色 */
.accent { color: var(--accent); }

.hero-sub {
  margin-top: 28px;
  max-width: 580px;
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--muted);
  animation: fade-up .9s .16s var(--ease) both;
}

.typed {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.caret {
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -.16em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 44px;
  animation: fade-up .9s .24s var(--ease) both;
}

/* ---------- 按钮：纯色、无阴影 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 550;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), transform .25s var(--ease);
}

.btn-solid {
  background: var(--accent);
  color: #14100a;
  border-color: var(--accent);
}
.btn-solid:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  transform: translateY(-1px);
}

.btn-outline {
  color: var(--text);
  border-color: var(--line);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* 首屏底部提示 */
.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-hint span {
  width: 2px; height: 6px;
  border-radius: 1px;
  background: var(--accent);
  animation: scroll-dot 1.9s var(--ease) infinite;
}
@keyframes scroll-dot {
  0%   { opacity: 0; transform: translateY(0); }
  35%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(11px); }
}

/* ---------- 通用区块 ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 128px) var(--padx);
}

.section-head { margin-bottom: clamp(32px, 4.5vw, 52px); }

.section-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--dim);
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -.025em;
}

/* 标题下的一小段强调色短线 */
.section-head h2::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 18px;
  background: var(--accent);
}

.section-head p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 空状态 ---------- */
.empty {
  padding: clamp(40px, 6vw, 64px) clamp(24px, 4vw, 44px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.empty-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--dim);
  margin-bottom: 18px;
}
.empty-title {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text);
  letter-spacing: -.01em;
}
.empty-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

/* 正文里的文字链接 */
.inline-link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-line);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.inline-link:hover {
  color: var(--accent-hi);
  border-bottom-color: var(--accent-hi);
}

/* ---------- 文章卡片（留给以后用） ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.post {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color .3s var(--ease), background .3s var(--ease),
              transform .3s var(--ease);
}
.post:hover {
  border-color: var(--accent-line);
  background: var(--panel);
  transform: translateY(-3px);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--dim);
  font-family: var(--mono);
}

.tag {
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  letter-spacing: .04em;
  border: 1px solid var(--line);
  color: var(--muted);
}

.post h3 {
  font-size: 17px;
  line-height: 1.55;
  font-weight: 600;
}
.post h3 a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .35s var(--ease);
}
.post:hover h3 a { background-size: 100% 1px; }

.post p {
  font-size: 14.5px;
  color: var(--muted);
  flex: 1;
}

.post-more {
  font-size: 13.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .3s var(--ease), gap .3s var(--ease);
}
.post-more i {
  font-style: normal;
  transition: transform .3s var(--ease);
}
.post:hover .post-more { color: var(--text); gap: 10px; }
.post:hover .post-more i { transform: translateX(3px); }

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: start;
}

.about-copy p {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: 15.5px;
}
.about-copy strong {
  color: var(--text);
  font-weight: 600;
}

.about-list {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}
.about-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  color: var(--text);
  transition: padding-left .3s var(--ease), color .3s var(--ease);
}
.about-list li:hover {
  padding-left: 8px;
  color: var(--accent);
}
.about-list li span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  flex: none;
}

.about-cards {
  display: grid;
  gap: 14px;
}

.mini {
  padding: 22px 22px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  transition: border-color .3s var(--ease), background .3s var(--ease),
              transform .3s var(--ease);
}
.mini:hover {
  border-color: var(--accent-line);
  background: var(--panel);
  transform: translateX(3px);
}
.mini h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 7px;
}
.mini p {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 加入 ---------- */
.cta-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(44px, 6.5vw, 72px) clamp(24px, 5vw, 56px);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--bg-soft);
  text-align: center;
}
.cta-inner h2 {
  font-size: clamp(1.4rem, 2.9vw, 1.95rem);
  letter-spacing: -.025em;
  margin-bottom: 14px;
}
.cta-inner p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
}
.cta-inner p + p { margin-top: 14px; }
.cta-inner strong {
  color: var(--text);
  font-weight: 600;
}
.cta-inner .hero-actions { margin-top: 32px; }
.cta-inner .section-label { margin-bottom: 22px; }

/* ---------- 友链 ---------- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 24px 52px 22px 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color .3s var(--ease), background .3s var(--ease),
              transform .3s var(--ease);
}
.link-card:hover {
  border-color: var(--accent-line);
  background: var(--panel);
  transform: translateY(-3px);
}

.link-name {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
}
.link-url {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
}
.link-desc {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}
.link-arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 15px;
  color: var(--dim);
  transition: color .3s var(--ease), transform .3s var(--ease);
}
.link-card:hover .link-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ---------- 页脚 ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: center;
  padding: 32px var(--padx) 44px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--dim);
}
.site-footer a {
  color: var(--dim);
  transition: color .25s var(--ease);
}
.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 入场动画 ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 只有 html 上有 .js 类（脚本真的跑起来了）时才隐藏内容。
   否则脚本失败会导致整页空白——这是必须防的。 */
.reveal {
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.about-cards .reveal:nth-child(1) { transition-delay: .00s; }
.about-cards .reveal:nth-child(2) { transition-delay: .08s; }
.about-cards .reveal:nth-child(3) { transition-delay: .16s; }

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

@media (max-width: 560px) {
  .site-header { padding-left: 18px; padding-right: 18px; }
  .nav { gap: 16px; font-size: 13.5px; }
  .hero { min-height: 92vh; min-height: 92svh; }
  .scroll-hint { display: none; }
  .cta-inner { padding-left: 22px; padding-right: 22px; }
}

/* ---------- 尊重「减少动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
