/* ============================================================
   OnePage Illusion 主题 v2 · 按 aizexintong/illusion 演示站复刻
   全屏壁纸 + 暖白蒙层 / 玻璃卡片 / 暖粉橘色系 / hero 双卡 / 滚动入场
   设计令牌来源：illusion.azxt.org /css/style.min.css 的 :root 与 [data-theme=dark]
   ============================================================ */

/* ---------- 设计令牌（亮色） ---------- */
:root {
  --il-primary: #D07058;         /* c-primary-500 */
  --il-primary-hover: #B05840;   /* c-primary-600 */
  --il-primary-light: #E8927C;   /* c-primary-400 */
  --il-accent: #E8B870;          /* c-accent-400 */
  --il-gradient: linear-gradient(135deg, #E8927C 0%, #F0A888 50%, #E8B870 100%);
  --il-bg: #FDF8F5;
  --il-surface: #FFFCFA;
  --il-surface-glass: rgba(255, 252, 250, 0.72);
  --il-text: #2E2825;
  --il-text-2: #5E524C;
  --il-text-3: #7E6E66;
  --il-border: #E8DED6;
  --il-overlay: rgba(253, 248, 245, 0.4);
  --il-shadow: 0 4px 14px rgba(208, 112, 88, 0.08);
  --il-shadow-lg: 0 10px 30px rgba(208, 112, 88, 0.10);
  --il-blur: 16px;
  --il-logout: 1rem;
}
html.dark {
  --il-primary: #F0A890;
  --il-primary-hover: #F5B8A0;
  --il-primary-light: #E8927C;
  --il-accent: #E8B870;
  --il-gradient: linear-gradient(135deg, #E8927C 0%, #F0A888 50%, #E8B870 100%);
  --il-bg: #0E0A08;
  --il-surface: #1C1410;
  --il-surface-glass: rgba(28, 20, 16, 0.68);
  --il-text: #F0E8E2;
  --il-text-2: #C8B8AE;
  --il-text-3: #9A8880;
  --il-border: #3A2C24;
  --il-overlay: rgba(14, 10, 8, 0.45);
  --il-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  --il-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ---------- 基础 ---------- */
html { background: var(--il-bg); }
body {
  background: transparent; color: var(--il-text);
  isolation: isolate;   /* 让负 z-index 的壁纸层画在 body 背景之上、内容之下 */
  font: 16px/1.8 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}
::selection { background: rgba(232, 146, 124, .3); }
a { color: inherit; text-decoration: none; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
h1, h2, h3, h4 { color: var(--il-text); }

/* ---------- 全屏壁纸层（bg-layer / bg-overlay-layer） ---------- */
.il-bg-layer {
  position: fixed; top: 0; left: 0; width: 100%;
  /* 超采样 + svh：移动端地址栏收放不再引起壁纸缩放抖动 */
  height: 100vh; height: 110svh;
  top: -5vh; top: -5svh;
  z-index: -2; pointer-events: none;
  /* 渐变兜底：壁纸加载失败/缓慢时也有暖色背景 */
  background: linear-gradient(160deg, #F5D4C0 0%, #F0B8A0 45%, #E8C090 100%);
}
html.dark .il-bg-layer {
  background: linear-gradient(160deg, #2E1C14 0%, #1C1210 50%, #2E2018 100%);
}
.il-bg-image { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.il-bg-overlay {
  position: fixed; top: 0; left: 0; width: 100%;
  height: 100vh; height: 110svh;
  top: -5vh; top: -5svh;
  z-index: -1; pointer-events: none;
  background: var(--il-overlay);
}

/* ---------- 玻璃卡片 ---------- */
.il-card {
  background: var(--il-surface-glass);
  -webkit-backdrop-filter: blur(var(--il-blur)); backdrop-filter: blur(var(--il-blur));
  border: 1px solid var(--il-border);
  border-radius: var(--il-logout, 1rem);
  box-shadow: var(--il-shadow);
  transition: box-shadow .3s ease, transform .3s ease;
}

/* ---------- 导航（site-header 玻璃条） ---------- */
.il-header {
  position: sticky; top: .75rem; z-index: 50;
  width: min(87.5rem, calc(100% - 2rem));
  margin: .75rem auto 0;
  background: rgba(248, 240, 236, .75);
  -webkit-backdrop-filter: blur(var(--il-blur)); backdrop-filter: blur(var(--il-blur));
  border: 1px solid var(--il-border);
  border-radius: 1rem;
  box-shadow: 0 6px 24px rgba(208, 112, 88, .10);
}
html.dark .il-header { background: rgba(22, 18, 16, .75); }
.il-header-inner {
  padding: 0 clamp(1rem, 3vw, 1.5rem);
  height: 3.6rem; display: flex; align-items: center; gap: 1rem;
}
.il-brand { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.il-nav-avatar {
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; background: var(--il-surface);
  border: 1px solid var(--il-border);
}
.il-site-title { font-weight: 700; font-size: 1.05rem; color: var(--il-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.il-site-title:hover { color: var(--il-primary); }
.il-site-sub { font-size: .78rem; color: var(--il-text-3); white-space: nowrap; }
.il-nav { display: flex; gap: .2rem; margin-left: auto; flex-wrap: nowrap; }
.il-nav-link { padding: .4rem .75rem; border-radius: .75rem; font-size: .9rem; color: var(--il-text-2); white-space: nowrap; }
.il-nav-link:hover { background: rgba(208, 112, 88, .08); color: var(--il-primary); }
.il-dark-toggle {
  border: none; background: none; cursor: pointer;
  padding: .35rem .55rem; border-radius: .6rem; line-height: 0; color: var(--il-text-2);
  display: inline-flex;
}
.il-dark-toggle svg { width: 1.15rem; height: 1.15rem; }
.il-dark-toggle:hover { background: rgba(208, 112, 88, .08); }
.ff-icon-dark { display: none; }
html.dark .ff-icon-light { display: none; }
html.dark .ff-icon-dark { display: inline; }

/* ---------- Hero（居中排版，无卡片） ---------- */
.il-hero {
  min-height: calc(100vh - 5.2rem);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem clamp(1rem, 4vw, 2.5rem) 2.5rem;
}
.il-hero-post { min-height: 52vh; }
.il-hero-center {
  width: 100%; max-width: 56rem; margin: 0 auto;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.il-hero-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: clamp(.85rem, 1.8vw, 1rem); color: var(--il-text);
  border: 1px solid var(--il-border); border-radius: 999px;
  padding: .45rem 1.4rem; margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(232,146,124,.16) 0%, rgba(240,168,136,.08) 100%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.il-hero-title { margin: 0 0 1.4rem; }
.il-hero-hello {
  display: block;
  font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700;
  color: var(--il-text); line-height: 1.3; margin-bottom: .6rem;
  text-shadow: 0 1px 10px rgba(255, 255, 255, .35);
}
html.dark .il-hero-hello { text-shadow: 0 1px 10px rgba(0, 0, 0, .4); }
/* 渐变流光大字 + 底部主色横线（演示站样式） */
.il-hero-name {
  position: relative; display: inline-block; padding-bottom: .4rem;
  font-size: clamp(2.6rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: .02em;
  background: var(--il-gradient); background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: il-gradient-flow 8s ease infinite;
  filter: drop-shadow(0 2px 8px rgba(208, 112, 88, .25));
}
.il-hero-name::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 72%; height: 4px; border-radius: 2px; background: var(--il-gradient);
}
@keyframes il-gradient-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
/* 终端打字机行：>_ 文案 | */
.il-hero-term {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, Consolas, monospace;
  font-size: clamp(1.15rem, 2.8vw, 1.7rem); font-weight: 600;
  color: var(--il-text); margin: 0 0 1.4rem; min-height: 1.5em;
}
.il-term-prompt { color: var(--il-primary); font-weight: 800; }
.il-term-cursor {
  color: var(--il-primary); font-weight: 400;
  animation: il-blink 1s steps(1) infinite;
}
@keyframes il-blink { 50% { opacity: 0; } }
.il-hero-desc { color: var(--il-text-2); font-size: clamp(1rem, 2vw, 1.15rem); margin: 0 0 2rem; max-width: 42rem; }
.il-hero-pills { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; }
.il-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.35rem; border-radius: 999px; font-size: .95rem; font-weight: 500;
  border: 1px solid var(--il-border); color: var(--il-text-2);
  background: var(--il-surface-glass);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.il-pill:hover { border-color: var(--il-primary); color: var(--il-primary); transform: translateY(-1px); }
.il-pill-primary {
  background: var(--il-gradient); color: #fff; border: none;
  box-shadow: 0 4px 14px rgba(208, 112, 88, .25);
}
.il-pill-primary:hover { color: #fff; filter: brightness(1.05); }
.il-hero-sub-inline { color: var(--il-text-2); font-size: 1rem; margin: 0; }
.il-hero-cat { color: var(--il-primary); text-decoration: underline; text-underline-offset: 3px; }
#il-posts { scroll-margin-top: 5.5rem; }
@media (min-width: 992px) {
  .il-hero { min-height: calc(100vh - 4.4rem); }
}

/* ---------- 滚动入场动画（AOS fade-up 等效） ---------- */
.il-in { opacity: 0; transform: translateY(1.25rem); }
.il-in.il-in-view {
  animation: il-fade-up .6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.il-in.delay-0.il-in-view { animation-delay: 0ms; }
.il-in.delay-1.il-in-view { animation-delay: 100ms; }
.il-in.delay-2.il-in-view { animation-delay: 200ms; }
@keyframes il-fade-up {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .il-in { opacity: 1; transform: none; animation: none !important; }
  * { transition: none !important; }
}

/* ---------- 内容区 ---------- */
.il-main { position: relative; }
.il-container {
  max-width: 87.5rem; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 2.5rem;
}

/* ---------- 滚动入场动画（AOS fade-up 等效） ---------- */
.il-in { opacity: 0; transform: translateY(1.25rem); }
.il-in.il-in-view {
  animation: il-fade-up .6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.il-in.delay-0.il-in-view { animation-delay: 0ms; }
.il-in.delay-1.il-in-view { animation-delay: 100ms; }
.il-in.delay-2.il-in-view { animation-delay: 200ms; }
@keyframes il-fade-up {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .il-in { opacity: 1; transform: none; animation: none !important; }
  * { transition: none !important; }
}

/* ---------- 文章卡片 ---------- */
.ff-post-list { display: flex; flex-direction: column; gap: 1.25rem; }
.il-postcard { display: flex; gap: 1.1rem; padding: 1.25rem 1.4rem; }
.il-postcard:hover { transform: translateY(-3px); box-shadow: var(--il-shadow-lg); }
.ff-postcard-body { flex: 1; min-width: 0; }
.il-postcard-title {
  font-size: 1.25rem; font-weight: 700; line-height: 1.45; margin: 0 0 .5rem; color: var(--il-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.il-postcard:hover .il-postcard-title { color: var(--il-primary); }
.il-postcard-meta { display: flex; align-items: center; gap: 1rem; font-size: .85rem; color: var(--il-text-3); flex-wrap: wrap; }
.il-meta-item { white-space: nowrap; }
.ff-postcard-desc {
  margin: .55rem 0 0; color: var(--il-text-2); font-size: .93rem; line-height: 1.75;
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere; word-break: break-word; min-width: 0;
}
.il-postcard-cover {
  width: 30%; min-width: 30%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: .8rem; align-self: center;
}
.il-empty { padding: 2.4rem; text-align: center; color: var(--il-text-3); }

/* ---------- 分类栏 / 分页（平台组件主题化） ---------- */
.nb-cats { padding: 0 0 1.2rem; }
.nb-cats .nb-cat { background: var(--il-surface-glass); border: 1px solid var(--il-border); }
.nb-cat-active { color: #fff !important; background: var(--il-primary) !important; border-color: var(--il-primary); box-shadow: none; font-weight: 600; }
.nb-pager { padding: 1.8rem 0 1rem; }
.nb-pager-link { border-color: var(--il-border); background: var(--il-surface-glass); }
.nb-pager-link:hover { opacity: 1; color: var(--il-primary); border-color: var(--il-primary); }
.nb-pager-info { color: var(--il-text-3); }

/* ---------- 文章页 ---------- */
.il-article { padding: 2rem clamp(1.3rem, 4vw, 2.6rem) 2.4rem; }
.il-draft {
  background: rgba(232, 146, 124, .12); color: var(--il-primary);
  border-radius: .6rem; padding: .5rem 1rem; font-size: .88rem; margin-bottom: 1.2rem; text-align: center;
}
.ff-around { display: flex; gap: 1rem; margin-top: 1.4rem; }
.ff-around-card { flex: 1; min-width: 0; padding: .9rem 1.2rem; display: flex; flex-direction: column; gap: .25rem; }
.ff-around-card:hover { color: var(--il-primary); }
.ff-around-right { text-align: right; }
.ff-around-label { font-size: .78rem; color: var(--il-text-3); }
.ff-around-title { font-weight: 600; color: var(--il-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-around-card:hover .ff-around-title { color: var(--il-primary); }

/* ---------- 正文块（nb-*） ---------- */
.post-body { font-size: 1rem; }
.post-body h2, .nb-h2 { font-size: 1.45rem; margin: 1.8rem 0 .8rem; scroll-margin-top: 5rem; }
.post-body h3, .nb-h3 { font-size: 1.2rem; margin: 1.5rem 0 .7rem; scroll-margin-top: 5rem; }
.post-body h4, .nb-h4 { font-size: 1.05rem; margin: 1.2rem 0 .6rem; scroll-margin-top: 5rem; }
.nb-p { margin: .9rem 0; line-height: 1.85; color: var(--il-text); }
.nb-p code, .post-body li code, .post-body h2 code, .post-body h3 code {
  background: rgba(208, 112, 88, .1); color: var(--il-primary-hover);
  border-radius: .4rem; padding: .12em .45em; font-size: .88em;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, Consolas, monospace;
}
.nb-quote {
  margin: 1.1rem 0; padding: .7rem 1.2rem; color: var(--il-text-2);
  border-left: 4px solid var(--il-primary);
  background: linear-gradient(135deg, rgba(232,146,124,.08) 0%, rgba(240,168,136,.04) 100%);
  border-radius: .55rem;
}
.nb-code {
  background: #221A16 !important; color: #F0E8E2;
  border-radius: .8rem; padding: 1rem 1.2rem; margin: 1.2rem 0;
  overflow-x: auto; font-size: .88rem; line-height: 1.65;
}
html.dark .nb-code { background: #120D0A !important; }
.nb-code code { background: none; color: inherit; padding: 0; font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; }
.nb-code code[data-lang]::before {
  content: attr(data-lang); display: block; color: rgba(240, 232, 226, .5);
  font-size: .75rem; margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .08em;
}
.nb-list { padding-left: 1.5em; margin: .9rem 0; }
.nb-list li { margin: .3rem 0; }
.nb-list li::marker { color: var(--il-primary); }
.nb-image { margin: 1.4rem 0; text-align: center; }
.nb-image img { max-width: 100%; border-radius: .8rem; }
.nb-image figcaption { color: var(--il-text-3); font-size: .82rem; margin-top: .5rem; }
.nb-link {
  display: flex; flex-direction: column; gap: .15rem; margin: 1.1rem 0;
  padding: .8rem 1.1rem; border: 1px solid var(--il-border); border-radius: .75rem;
}
.nb-link:hover { border-color: var(--il-primary); }
.nb-link-title { color: var(--il-primary); font-weight: 500; }
.nb-link-url { color: var(--il-text-3); font-size: .82rem; }
.nb-table-wrap { overflow-x: auto; margin: 1.2rem 0; -webkit-overflow-scrolling: touch; }
.nb-table { border-collapse: collapse; width: 100%; font-size: .93em; }
.nb-table th, .nb-table td { border: 1px solid var(--il-border); padding: .5em .85em; text-align: left; vertical-align: top; }
.nb-table th { background: rgba(208, 112, 88, .08); font-weight: 600; color: var(--il-text); }
.post-body code, .nb-quote code, .nb-list code {
  background: rgba(208, 112, 88, .1); border-radius: .35em; padding: .08em .4em;
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: .88em;
}
.post-body pre code, .nb-code code { background: none; padding: 0; }

/* ---------- 评论（与主题同风格） ---------- */
.nb-comments { margin-top: 1.8rem; border-top: 1px solid var(--il-border); padding-top: 1.5rem; }
.nb-comments-title {
  position: relative; font-size: 1.15rem; font-weight: 700; color: var(--il-text);
  padding-left: .8rem; margin-bottom: 1rem;
}
.nb-comments-title::before {
  content: ""; position: absolute; left: 0; top: .22em; bottom: .18em;
  width: 4px; border-radius: 2px; background: var(--il-primary);
}
.nb-comment-hint { color: var(--il-text-3); font-size: .92rem; }
.nb-comment { display: flex; gap: .75rem; padding: .9rem 0; border-bottom: 1px dashed var(--il-border); }
.nb-comment:last-child { border-bottom: none; }
.nb-comment-avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.nb-comment-avatar-ph { display: inline-block; background: rgba(208, 112, 88, .12); }
.nb-comment-body { flex: 1; min-width: 0; }
.nb-comment-head { display: flex; align-items: baseline; gap: .55rem; font-size: .92rem; }
.nb-comment-head b { color: var(--il-text); }
.nb-comment-time { color: var(--il-text-3); font-size: .78rem; }
.nb-comment-content { margin-top: .3rem; color: var(--il-text-2); white-space: pre-wrap; word-break: break-word; font-size: .95rem; }
.nb-comment-del { border: none; background: none; color: var(--il-text-3); font-size: .78rem; cursor: pointer; padding: 0; margin-left: auto; }
.nb-comment-del:hover { color: #D06060; }
.nb-comment-form { margin-top: 1.1rem; }
.nb-comment-form textarea {
  display: block; width: 100%;
  background: var(--il-surface-glass); color: var(--il-text);
  border: 1px solid var(--il-border); border-radius: .8rem;
  padding: .8rem 1rem; font: inherit; font-size: .95rem; resize: vertical; min-height: 5.5rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nb-comment-form textarea:focus {
  outline: none; border-color: var(--il-primary);
  box-shadow: 0 0 0 3px rgba(208, 112, 88, .15);
}
.nb-comment-form textarea::placeholder { color: var(--il-text-3); }
.nb-comment-btn {
  margin-top: .65rem; padding: .5rem 1.5rem;
  border: none; border-radius: 999px; cursor: pointer;
  background: var(--il-gradient); color: #fff; font-weight: 600; font-size: .9rem;
  transition: filter .15s ease, transform .15s ease;
}
.nb-comment-btn:hover { filter: brightness(1.06); }
.nb-comment-btn:active { transform: scale(.97); }
.nb-comment-login {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem 1.2rem; border-radius: 999px; font-size: .9rem;
  background: rgba(208, 112, 88, .1); color: var(--il-primary);
}
.nb-comment-login:hover { background: rgba(208, 112, 88, .16); }

/* ---------- 页脚 ---------- */
.il-footer {
  text-align: center; padding: 1.6rem 1rem 2.2rem; color: var(--il-text-3); font-size: .88rem;
  display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap;
}
.il-footer-link { color: var(--il-primary); }
.il-footer-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 移动端 ---------- */
@media (max-width: 767px) {
  .il-hero { min-height: calc(100vh - 4.4rem); padding: 1.5rem .9rem 2rem; }
  .il-hero-post { min-height: 44vh; }
  .il-hero-badge { margin-bottom: 1.3rem; padding: .35rem 1rem; font-size: .8rem; }
  .il-hero-title { margin-bottom: 1rem; }
  .il-hero-term { font-size: 1.1rem; margin-bottom: 1.1rem; }
  .il-hero-desc { font-size: .95rem; margin-bottom: 1.5rem; }
  .il-hero-pills { gap: .55rem; }
  .il-pill { padding: .45rem 1rem; font-size: .86rem; }
  .il-header { top: .5rem; width: calc(100% - 1rem); margin-top: .5rem; border-radius: .85rem; }
  .il-header-inner { padding: 0 .8rem; gap: .5rem; height: 3.2rem; }
  .il-site-title { font-size: .95rem; }
  .il-nav { gap: 0; }
  .il-nav-link { padding: .3rem .45rem; font-size: .8rem; white-space: nowrap; }
  .il-postcard { flex-direction: column-reverse; }
  .il-postcard-cover { width: 100%; min-width: 0; }
  .ff-around { flex-direction: column; }
  .ff-around-right { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .il-in { opacity: 1; transform: none; }
}
