/*
 * Cyber Crayon v4 — Base (编辑风基础层)
 */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-top: 4rem;
  font-family: var(--lc-font-body);
  font-size: var(--lc-text-body-md);
  line-height: 1.6;
  color: var(--lc-on-surface);
  background-color: var(--lc-background);
  overflow-x: hidden;
  cursor: var(--lc-cursor-default);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--lc-bg-texture);
  background-repeat: repeat;
  opacity: var(--lc-bg-texture-opacity);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
  animation-timing-function: ease-out;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

:where(
  input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  textarea
) {
  cursor: var(--lc-cursor-text);
}

:is(
  a[href],
  button:not(:disabled),
  summary,
  label[for],
  select,
  [role="button"]:not([aria-disabled="true"]),
  [role="link"],
  [role="tab"],
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  input[type="checkbox"],
  input[type="radio"]
) {
  cursor: pointer;
}

:is(
  button:disabled,
  [aria-disabled="true"]
) {
  cursor: not-allowed;
}

html[data-lc-color-scheme="dark"] .lc-hero--home .lc-hero__focus {
  color: color-mix(in srgb, var(--lc-on-surface) 62%, transparent);
}

html[data-lc-color-scheme="dark"] .lc-hero--home .lc-hero__desc {
  color: var(--lc-on-surface);
}

html[data-lc-color-scheme="dark"] .lc-bento-card--featured {
  background: #0D0D0D;
}

html[data-lc-color-scheme="dark"] .lc-article-card__cover,
html[data-lc-color-scheme="dark"] .lc-project-card__media {
  background: #0D0D0D;
}

html[data-lc-color-scheme="dark"] .lc-search-inline__kbd {
  background: var(--lc-surface-container-highest);
  color: var(--lc-on-surface);
  border: 1px solid var(--lc-brutal-border-color);
}

html[data-lc-color-scheme="dark"] .lc-toc__title,
html[data-lc-color-scheme="dark"] .lc-toc__link {
  color: var(--lc-on-surface);
}

html[data-lc-color-scheme="dark"] .lc-toc__icon {
  color: var(--lc-primary);
}

html[data-lc-color-scheme="dark"] .lc-badge__label {
  border-right-color: var(--lc-outline-variant);
}

html[data-lc-color-scheme="dark"] .lc-badge {
  border-color: var(--lc-outline-variant);
  box-shadow: var(--lc-shadow-soft);
}

html[data-lc-color-scheme="dark"] .lc-page-header__badge {
  color: var(--lc-chip-on-neon);
}

html[data-lc-color-scheme="dark"] body {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(204, 255, 0, 0.04) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(234, 86, 148, 0.04) 0%, transparent 20%);
}


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

a {
  text-decoration: none;
  transition: color var(--lc-transition);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--lc-font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--lc-on-surface);
  margin: 0 0 0.5em;
}

.lc-display-lg {
  font-family: var(--lc-font-heading);
  font-size: var(--lc-text-display-lg);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.lc-headline-lg {
  font-family: var(--lc-font-heading);
  font-size: var(--lc-text-headline-lg);
  font-weight: 700;
  line-height: 1.2;
}

.lc-headline-md {
  font-family: var(--lc-font-heading);
  font-size: var(--lc-text-headline-md);
  font-weight: 700;
  line-height: 1.3;
}

.lc-body-lg {
  font-size: var(--lc-text-body-lg);
  line-height: 1.6;
}

.lc-body-md {
  font-size: var(--lc-text-body-md);
  line-height: 1.6;
}

.lc-caption {
  font-family: var(--lc-font-caption);
  font-size: var(--lc-text-caption);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lc-label-md {
  font-family: var(--lc-font-ui);
  font-size: var(--lc-text-label-md);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lc-muted {
  color: var(--lc-on-surface-variant);
}

.lc-container {
  width: 100%;
  max-width: var(--lc-max);
  margin-inline: auto;
  padding-inline: var(--lc-gutter);
}

.lc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lc-skip-link {
  position: absolute;
  top: -100%;
  left: var(--lc-gutter);
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--lc-cyber-lime);
  color: var(--lc-ink-black);
  font-weight: 700;
  border: 1px solid var(--lc-border-divider);
}

.lc-skip-link:focus {
  top: 0.5rem;
}

.lc-paint-drip {
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.lc-paint-drip__track {
  position: relative;
  width: 100%;
  height: 3px;
}

/* Three stacked layers share the same jagged top edge, defined by a repeating
   SVG mask tile of a FIXED pixel width (--lc-drip-tile). Because the tile width
   is in px (not a % of the viewport), the drip density stays constant on every
   screen size. v4: the drip is now a thin ~3px accent line sitting on the
   footer's top border — outline (semi-transparent lime) → ink → fill (surface
   color). The wave animation scrolls mask-position by one whole tile, so it
   loops seamlessly regardless of screen width. */
.lc-paint-drip__layer {
  --lc-drip-tile: 260px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='38' viewBox='0 0 260 38' preserveAspectRatio='none'%3E%3Cpath d='M0,20 C20,20 22,2 46,2 C70,2 72,37 96,37 C116,37 120,9 142,9 C164,9 166,30 188,30 C210,30 212,3 236,3 C252,3 254,20 260,20 L260,38 L0,38 Z' fill='black'/%3E%3C/svg%3E") repeat-x top left / var(--lc-drip-tile) 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='38' viewBox='0 0 260 38' preserveAspectRatio='none'%3E%3Cpath d='M0,20 C20,20 22,2 46,2 C70,2 72,37 96,37 C116,37 120,9 142,9 C164,9 166,30 188,30 C210,30 212,3 236,3 C252,3 254,20 260,20 L260,38 L0,38 Z' fill='black'/%3E%3C/svg%3E") repeat-x top left / var(--lc-drip-tile) 100%;
  animation: lc-paint-drip-wave 3s linear infinite;
}

.lc-paint-drip.is-drip-active .lc-paint-drip__layer {
  will-change: mask-position;
}

.lc-paint-drip.is-drip-paused .lc-paint-drip__layer {
  animation: none;
  will-change: auto;
}

.lc-paint-drip__layer--outline {
  background: color-mix(in srgb, var(--lc-cyber-lime) 45%, transparent);
}

.lc-paint-drip__layer--ink {
  top: 1px;
  background: #18181B;
}

.lc-paint-drip__layer--fill {
  top: 2px;
  background: var(--lc-surface);
}

@keyframes lc-paint-drip-wave {
  from {
    -webkit-mask-position: 0 top;
    mask-position: 0 top;
  }
  to {
    -webkit-mask-position: calc(-1 * var(--lc-drip-tile)) top;
    mask-position: calc(-1 * var(--lc-drip-tile)) top;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lc-paint-drip__layer {
    animation: none;
  }
}

.lc-splatter-bg::after {
  content: "";
  position: absolute;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
  z-index: -1;
}

.lc-splatter-bg--lime::after {
  background: radial-gradient(circle at center, rgba(204, 255, 0, 0.32) 0%, transparent 68%);
  top: 8rem;
  left: -6rem;
}

.lc-splatter-bg--pink::after {
  background: radial-gradient(circle at center, rgba(234, 86, 148, 0.32) 0%, transparent 68%);
  top: 18rem;
  right: -6rem;
}

.lc-material-icon {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 1;
  min-width: 1em;
  min-height: 1em;
  opacity: 0;
}

html.lc-icons-ready .lc-material-icon,
html.no-js .lc-material-icon {
  opacity: 1;
  transition: opacity 0.12s ease;
}

.lc-section-divider {
  height: 0;
  margin: 0;
  border: none;
}

.lc-default-content {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
}

/* Global ambient glow orbs — subdued radial gradients */
.lc-glow-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0.35;
}

.lc-glow-bg__orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.lc-glow-bg__orb--pink {
  width: clamp(18rem, 42vw, 32rem);
  height: clamp(22rem, 48vw, 36rem);
  top: 0%;
  right: -10%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--lc-neon-pink) 55%, transparent) 0%,
    transparent 70%
  );
  opacity: 0.55;
}

.lc-glow-bg__orb--lime {
  width: clamp(20rem, 44vw, 34rem);
  height: clamp(20rem, 44vw, 34rem);
  bottom: 4%;
  left: -10%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--lc-cyber-lime) 50%, transparent) 0%,
    transparent 70%
  );
  opacity: 0.42;
}

.lc-glow-bg__orb--purple {
  width: clamp(16rem, 36vw, 28rem);
  height: clamp(18rem, 40vw, 30rem);
  top: 36%;
  left: 32%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--lc-electric-purple) 48%, transparent) 0%,
    transparent 70%
  );
  opacity: 0.32;
}

html[data-lc-color-scheme="dark"] .lc-glow-bg__orb--pink {
  opacity: 0.48;
}

html[data-lc-color-scheme="dark"] .lc-glow-bg__orb--lime {
  opacity: 0.36;
}

html[data-lc-color-scheme="dark"] .lc-glow-bg__orb--purple {
  opacity: 0.38;
}

/* Click splatter */
.lc-click-splatter {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  opacity: 0.48;
  transform: scale(0);
  transition: transform 0.85s ease-out, opacity 0.85s ease-out;
  will-change: transform, opacity;
}

.lc-click-splatter.is-active {
  transform: scale(2.6);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .lc-click-splatter {
    display: none !important;
  }
}

body.lc-menu-open {
  overflow: hidden;
}

/* ── Lazy image blur-up reveal (content images only, skip card backgrounds) ── */
@media (prefers-reduced-motion: no-preference) {
  img[loading="lazy"]:not(.lc-no-reveal):not(.lc-bento-card__bg-shot):not(.lc-article-card__cover-img):not(.lc-comment-tech__avatar):not(.lc-article__author-avatar) {
    opacity: 0;
    filter: blur(12px);
    transform: scale(0.94);
    transition: opacity 0.55s ease, filter 0.55s ease, transform 0.55s ease;
  }

  img[loading="lazy"].is-loaded:not(.lc-no-reveal):not(.lc-bento-card__bg-shot):not(.lc-article-card__cover-img):not(.lc-comment-tech__avatar):not(.lc-article__author-avatar) {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  img[loading="lazy"]:not(.lc-no-reveal) {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* ── Animated link underline (prose bare links) ── */
.lc-article__content a:not([class]) {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1.5px;
  text-decoration: none;
  transition: background-size 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lc-article__content a:not([class]):hover,
.lc-article__content a:not([class]):focus-visible {
  background-size: 100% 1.5px;
}

/* v4 — 卡片基础 */
.lc-card {
  background: var(--lc-surface);
  border: 1px solid var(--lc-border-divider);
  border-radius: var(--lc-radius-card);
  box-shadow: var(--lc-shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.lc-card--hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--lc-shadow-card-hover);
  border-color: color-mix(in srgb, var(--lc-on-surface) 20%, var(--lc-border-divider));
}
/* v4 — 胶囊 chip */
.lc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--lc-radius-pill);
  border: 1px solid transparent;
  font-family: var(--lc-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
