/* 乘风客户前台 — 自定义增强样式
   配色 / 字体见 base.html 的 tailwind.config
   绝大部分样式走 Tailwind 工具类，这里只补 scroll reveal / 动效 / 文章排版
*/

/* ========== Alpine.js x-cloak（防 Alpine init 前元素闪现）========== */
[x-cloak] { display: none !important; }

/* ========== Google Identity Services 按钮容器（视觉对齐 Editorial Tech）========== */
.gsi-pill {
  /* 容器外微微悬浮，让 Google iframe 不孤立浮在页面上 */
  filter: drop-shadow(0 2px 8px rgba(11, 18, 32, 0.10));
  transition: filter 0.2s ease, transform 0.2s ease;
}
.gsi-pill:hover {
  filter: drop-shadow(0 6px 16px rgba(11, 18, 32, 0.18));
  transform: translateY(-1px);
}
/* GSI iframe 自带圆角；这里只做容器层面的过渡 */
.gsi-pill > div { border-radius: 999px; overflow: hidden; }

/* ========== Scroll Reveal ========== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.16,.84,.32,1),
              transform .9s cubic-bezier(.16,.84,.32,1);
  transition-delay: var(--delay, 0s);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Latency chart line draw ========== */
.latency-line {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw-line 1.6s cubic-bezier(.65,.0,.35,1) .25s forwards;
}
@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

.latency-node {
  opacity: 0;
  transform-origin: center;
  animation: pop-in .35s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(.4); }
  60%  { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* ========== Selection / scrollbar ========== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(11,18,32,.18);
  border-radius: 999px;
  border: 2px solid #FAFAF7;
}
::-webkit-scrollbar-thumb:hover { background: rgba(11,18,32,.32); }

/* 防 line-clamp tailwind CDN 不带的兜底 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 文章正文排版 (Markdown rendered) ========== */
.article-content {
  font-size: 16.5px;
  line-height: 1.85;
  color: #0B1220;
  font-family: "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}
.article-content h1, .article-content h2, .article-content h3 {
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  letter-spacing: -0.02em;
}
.article-content h1 { font-size: 32px; font-weight: 900; margin: 1.6em 0 0.7em; }
.article-content h2 { font-size: 24px; font-weight: 700; margin: 1.6em 0 0.7em; }
.article-content h3 { font-size: 19px; font-weight: 700; margin: 1.3em 0 0.5em; }
.article-content p { margin: 1em 0; }
.article-content a { color: #2F6BFF; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-content a:hover { color: #1E4ED8; }
.article-content ul, .article-content ol { padding-left: 1.5em; margin: 1em 0; }
.article-content li { margin: 0.4em 0; }
.article-content blockquote {
  border-left: 3px solid #2F6BFF;
  padding: 0.2em 0 0.2em 1.2em;
  color: #475569;
  margin: 1.2em 0;
  font-style: italic;
}
.article-content code {
  background: #F4F7FB;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: #1E4ED8;
  font-family: "DM Mono", ui-monospace, monospace;
}
.article-content pre {
  background: #0B1220;
  color: #F1F5F9;
  padding: 1.1em 1.3em;
  border-radius: 12px;
  overflow-x: auto;
}
.article-content pre code { background: transparent; color: inherit; padding: 0; }
.article-content img { max-width: 100%; border-radius: 12px; margin: 1.2em 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.article-content th, .article-content td {
  border: 1px solid #E2E8F0;
  padding: 0.5em 0.75em;
  text-align: left;
}
.article-content th { background: #F4F7FB; font-weight: 700; }

/* 占位封面（保留旧契约） */
.cover-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #F4F7FB, #E0F2FE);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-placeholder::before {
  content: "乘风";
  color: #94A3B8;
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.1em;
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .latency-line { stroke-dashoffset: 0; animation: none; }
  .latency-node { opacity: 1; animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
