/* myhugo — Nunito Sans（圆润易读）+ Noto Sans SC；浅色模式为白底中性灰 */

/* -------------------------------------------------------------------------
   全局字体与抗锯齿（略增行高，减轻「尖锐」感）
   ------------------------------------------------------------------------- */
html {
  font-family:
    "Nunito Sans",
    "Noto Sans SC",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  line-height: 1.65;
}

/* 展示标题（导航站点名、文章 h1）：与正文同族，略收紧字距即可 */
nav .container a.text-lg,
#dream-single-post-main.prose h1 {
  font-family: "Nunito Sans", "Noto Sans SC", sans-serif;
}

/* -------------------------------------------------------------------------
   浅色：白底 — 去掉彩光，仅保留极淡点阵（可选）
   ------------------------------------------------------------------------- */
html.light #dream-global-bg {
  background: #ffffff;
}

html.light #dream-global-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Ccircle cx='1' cy='1' r='0.5' fill='%23000' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 72px 72px;
  pointer-events: none;
  opacity: 0.5;
}

/* -------------------------------------------------------------------------
   深色：保持一定层次（略收敛彩光）
   ------------------------------------------------------------------------- */
html.dark #dream-global-bg {
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, oklch(0.42 0.14 280 / 0.2), transparent 52%),
    radial-gradient(ellipse 80% 50% at 0% 30%, oklch(0.35 0.1 165 / 0.25), transparent 55%),
    linear-gradient(168deg, oklch(0.2 0.045 165) 0%, oklch(0.14 0.05 175) 55%, oklch(0.1 0.04 195) 100%);
}

html.dark #dream-global-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Ccircle cx='1' cy='1' r='0.5' fill='%23fff' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 72px 72px;
  pointer-events: none;
  opacity: 0.5;
}

/* -------------------------------------------------------------------------
   浅色导航：白底、浅灰边、深色字（不用渐变字）
   ------------------------------------------------------------------------- */
html.light nav.sticky {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

html.light nav .container {
  max-width: min(72rem, 100vw - 1.5rem) !important;
  margin-left: auto;
  margin-right: auto;
  padding: 0.65rem 1.15rem !important;
  border-radius: 9999px;
  border: 1px solid #e8e8e8;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

html.light nav .container a.text-lg {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  color: #171717 !important;
  -webkit-text-fill-color: currentColor !important;
}

html.light nav .container section.flex > div:last-child .text-sm {
  margin-top: 0.35rem;
  padding-left: 0.65rem;
  border-left: 2px solid #d4d4d4;
  font-size: 0.72rem !important;
  line-height: 1.55 !important;
  max-width: min(28rem, 72vw) !important;
  color: #525252 !important;
  opacity: 1 !important;
}

html.light nav .avatar .h-10.rounded-full {
  padding: 2px;
  border-radius: 9999px;
  background: #e5e5e5;
}

html.light nav .avatar .h-10.rounded-full img {
  border-radius: 9999px;
  border: 2px solid #ffffff;
}

html.light nav .btn {
  border-radius: 9999px;
}

/* 深色导航：沿用玻璃与渐变字 */
html.dark nav.sticky {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

html.dark nav .container {
  max-width: min(72rem, 100vw - 1.5rem) !important;
  margin-left: auto;
  margin-right: auto;
  padding: 0.65rem 1.15rem !important;
  border-radius: 9999px;
  border: 1px solid color-mix(in oklch, var(--bc) 35%, transparent);
  background: color-mix(in oklch, var(--b1) 55%, transparent);
  backdrop-filter: blur(18px) saturate(1.65);
  -webkit-backdrop-filter: blur(18px) saturate(1.65);
  box-shadow:
    0 8px 32px oklch(0.05 0.03 200 / 0.45),
    0 1px 0 oklch(1 0 0 / 0.06) inset;
}

html.dark nav .container a.text-lg {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
  background: linear-gradient(115deg, oklch(0.82 0.1 265), oklch(0.85 0.12 175), oklch(0.78 0.14 200));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

html.dark nav .container section.flex > div:last-child .text-sm {
  margin-top: 0.35rem;
  padding-left: 0.65rem;
  border-left: 2px solid color-mix(in oklch, var(--p) 55%, transparent);
  font-size: 0.72rem !important;
  line-height: 1.55 !important;
  max-width: min(28rem, 72vw) !important;
  opacity: 0.88;
}

html.dark nav .avatar .h-10.rounded-full {
  padding: 2px;
  border-radius: 9999px;
  background: linear-gradient(135deg, oklch(0.65 0.2 280), oklch(0.6 0.2 165), oklch(0.55 0.18 200));
}

html.dark nav .avatar .h-10.rounded-full img {
  border-radius: 9999px;
  border: 2px solid var(--b1);
}

html.dark nav .btn {
  border-radius: 9999px;
}

/* -------------------------------------------------------------------------
   浅色首页卡片：白底、灰边、悬停浅阴影（去掉彩边）
   ------------------------------------------------------------------------- */
html.light .dream-grid a.card.bg-base-100 {
  position: relative;
  overflow: hidden;
  border-radius: 1.15rem !important;
  border: 1px solid #e8e8e8 !important;
  background: #ffffff !important;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.22s ease;
}

html.light .dream-grid a.card.bg-base-100::before {
  display: none;
}

html.light .dream-grid a.card.bg-base-100:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.12);
  border-color: #d4d4d4;
}

html.light .dream-grid a.card figure {
  overflow: hidden;
  border-radius: 0.85rem 0.85rem 0 0;
}

html.light .dream-grid a.card figure img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

html.light .dream-grid a.card:hover figure img {
  transform: scale(1.04);
}

html.light .dream-grid a.card .card-body {
  padding-top: 1.1rem;
}

html.light .dream-grid a.card .card-title {
  font-family: "Nunito Sans", "Noto Sans SC", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: #171717;
}

/* 深色首页卡片 */
html.dark .dream-grid a.card.bg-base-100 {
  position: relative;
  overflow: hidden;
  border-radius: 1.15rem !important;
  border: 1px solid color-mix(in oklch, var(--bc) 35%, transparent) !important;
  background: linear-gradient(
    145deg,
    color-mix(in oklch, var(--b1) 100%, transparent) 0%,
    color-mix(in oklch, var(--b2) 80%, transparent) 100%
  ) !important;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.22s ease;
}

html.dark .dream-grid a.card.bg-base-100::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, oklch(0.65 0.2 280 / 0.35), oklch(0.55 0.18 165 / 0.2), transparent 60%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.65;
}

html.dark .dream-grid a.card.bg-base-100:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 24px 56px -16px oklch(0 0 0 / 0.55),
    0 0 0 1px color-mix(in oklch, var(--p) 35%, transparent);
}

html.dark .dream-grid a.card figure img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

html.dark .dream-grid a.card:hover figure img {
  transform: scale(1.06);
}

html.dark .dream-grid a.card .card-body {
  padding-top: 1.1rem;
}

html.dark .dream-grid a.card .card-title {
  font-family: "Nunito Sans", "Noto Sans SC", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

/* -------------------------------------------------------------------------
   文章页
   ------------------------------------------------------------------------- */
#dream-single-post-main.prose {
  font-size: 1.0625rem;
  line-height: 1.85;
}

#dream-single-post-main.prose h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem !important;
}

html.light #dream-single-post-main.prose h1::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin-top: 0.85rem;
  border-radius: 9999px;
  background: #d4d4d4;
}

html.dark #dream-single-post-main.prose h1::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  margin-top: 0.85rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, oklch(0.72 0.14 280), oklch(0.7 0.12 165));
}

#dream-single-post-main.prose p {
  margin-top: 1em;
  margin-bottom: 1em;
}

/* -------------------------------------------------------------------------
   页脚
   ------------------------------------------------------------------------- */
html.light footer {
  border-top: 1px solid #eeeeee;
  margin-top: 1rem;
}

html.dark footer {
  border-top: 1px solid color-mix(in oklch, var(--bc) 35%, transparent);
  margin-top: 1rem;
}

footer a {
  text-underline-offset: 0.2em;
}

footer a:hover {
  text-decoration-thickness: 2px;
}

/* -------------------------------------------------------------------------
   浅色：正文区与卡片组件偏白（减轻 emerald 底色的绿感）
   ------------------------------------------------------------------------- */
html.light .bg-base-100 {
  background-color: #ffffff !important;
}

html.light .border-base-content\/30 {
  border-color: #e5e5e5 !important;
}

/* -------------------------------------------------------------------------
   About 翻面：整页单栏时背面可滚动，避免内容被 flip 区域裁切
   ------------------------------------------------------------------------- */
.flip-container .back {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* -------------------------------------------------------------------------
   About 翻卡页：ion-icon（Web Component）在 typography .prose 内需强制尺寸，否则可能不可见
   ------------------------------------------------------------------------- */
.dream-grid-about .about-prose ion-icon {
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  color: var(--p);
  vertical-align: -0.2em;
  flex-shrink: 0;
}

.dream-grid-about .about-prose ion-icon.text-2xl {
  width: 1.6rem;
  height: 1.6rem;
  min-width: 1.6rem;
  min-height: 1.6rem;
}

.dream-grid-about .about-prose .not-prose + p,
.dream-grid-about .about-prose .not-prose + ul {
  margin-top: 0.35rem;
}

html.light .dream-grid-about .about-prose .not-prose.border-base-content\/10 {
  border-color: #e8e8e8;
}

/* -------------------------------------------------------------------------
   动效偏好
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .dream-grid a.card:hover figure img {
    transform: none;
  }
}
