/* ============================================================
   Stefano's AI Lab · 昆仑玉京 v2「淡墨绢云」
   宣纸为底，淡墨远山，一缕流雾，一方朱砂印。
   留白即仙气；动画只此三处：雾移、印浮、卡微倾。
   ============================================================ */
:root {
  --paper: #f8f6f1;         /* 宣纸 */
  --paper-2: #f3f0e9;
  --ink: #26282e;           /* 墨 */
  --ink-2: #55575e;         /* 淡墨 */
  --ink-3: #8b8d94;         /* 宿墨 */
  --line: #e4e0d6;
  --cinnabar: #b5432f;      /* 朱砂 */
  --card: #fdfcf9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161b;       /* 墨夜 */
    --paper-2: #101318;
    --ink: #e6e3da;         /* 月白字 */
    --ink-2: #a9a79e;
    --ink-3: #7a7870;
    --line: #262a31;
    --cinnabar: #c9604a;
    --card: #191c22;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.85;
  font-size: 16px;
  overflow-x: hidden;
}

h1, h2, .post-title {
  font-family: "KaiTi", "STKaiti", "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  letter-spacing: .04em;
}

/* 双语显隐（与 v1 同机制） */
html[lang="en"] [lang="zh"] { display: none !important; }
html[lang="zh"] [lang="en"] { display: none !important; }

a { color: inherit; text-decoration: none; }

/* ---------- 天幕：一缕流雾 + 两抹远山 ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky .mist {
  position: absolute; height: 46vh; border-radius: 50%;
  background: radial-gradient(closest-side, #ffffffd9, transparent 72%);
  filter: blur(46px); opacity: .5; will-change: transform;
}
@media (prefers-color-scheme: dark) {
  .sky .mist { background: radial-gradient(closest-side, #232b33, transparent 72%); opacity: .38; }
}
.sky .m1 { width: 72vw; left: -16vw; top: 4vh;  animation: mistDrift 120s ease-in-out infinite alternate; }
.sky .m2 { width: 58vw; left: 34vw; top: 30vh; opacity: .34; animation: mistDrift 160s ease-in-out infinite alternate-reverse; }
@keyframes mistDrift { from { transform: translate3d(-4vw, 0, 0); } to { transform: translate3d(7vw, 2vh, 0); } }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 920px; margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: block;
  border: 1px solid var(--line);
}
.brand-text {
  font-family: "Segoe Script", "Brush Script MT", "KaiTi", cursive;
  font-style: italic; font-size: 20px;
  color: var(--ink); letter-spacing: .3px;
}
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--ink-2); }
.nav-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.ic { width: 16px; height: 16px; display: block; }
@media (prefers-color-scheme: light) { .ic.inv { filter: invert(1); } }
.langbtn {
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink-2);
  padding: 4px 14px; font-size: 13px; cursor: pointer;
}
.langbtn:hover { border-color: var(--cinnabar); color: var(--cinnabar); }

/* ---------- 布局 ---------- */
.container { max-width: 800px; margin: 0 auto; padding: 0 20px; position: relative; }

/* ---------- Hero：远山、流雾、团扇、竖题 ---------- */
.hero-wrap { position: relative; overflow: hidden; }

.mountains { position: absolute; left: 0; right: 0; bottom: -2px; pointer-events: none; }
.mountains svg { display: block; width: 100%; height: 150px; }

.hero {
  position: relative;
  max-width: 920px; margin: 0 auto; padding: 84px 20px 120px;
  display: flex; align-items: center; gap: 44px;
}
.hero-main { flex: 1; min-width: 0; }
.hero h1 {
  font-size: 42px; line-height: 1.38; margin: 0 0 18px;
  letter-spacing: .06em; font-weight: 700;
}
.hero .sub { color: var(--ink-2); font-size: 17px; margin: 0; }
.signature {
  font-family: "Segoe Script", "Brush Script MT", "KaiTi", cursive;
  font-style: italic; font-size: 25px; color: var(--ink-2); margin: 22px 0 0;
  display: flex; align-items: center; gap: 14px;
}
/* 朱砂小印 */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 4px;
  background: var(--cinnabar); color: #fdf8f2;
  font-family: "KaiTi", "STKaiti", serif; font-size: 15px; line-height: 1.05;
  letter-spacing: 0; font-style: normal;
  transform: rotate(2.5deg);
  box-shadow: 0 2px 10px #b5432f3d;
  writing-mode: vertical-rl; padding: 2px;
}
.slogan { color: var(--cinnabar); }

/* 团扇：涡旋图卡在细墨环里，极缓浮动 */
.logo-orb { flex: none; position: relative; }
.logo-orb::before {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  border: 1px solid var(--line);
}
.logo-orb::after {
  content: ""; position: absolute; inset: -26px; border-radius: 50%;
  border: 1px solid var(--line); opacity: .5;
}
.hero-logo {
  width: 196px; height: 196px; border-radius: 50%; display: block;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px #26282e14;
  animation: fanFloat 7s ease-in-out infinite;
}
@keyframes fanFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }


/* ---------- 博客卡片：宣纸卡 + 微倾 ---------- */
.card {
  --mx: 50%; --my: 50%;
  display: block; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card);
  padding: 22px 24px; margin: 18px 0; color: var(--ink);
  transition: border-color .3s ease, box-shadow .3s ease;
  will-change: transform;
}
.card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--cinnabar); transform: scaleX(0); transform-origin: left;
  transition: transform .45s ease;
}
.card:hover { border-color: #d8d2c4; box-shadow: 0 14px 34px #26282e12; text-decoration: none; }
.card:hover::after { transform: scaleX(1); }
.card .kicker { color: var(--ink-3); font-size: 13px; letter-spacing: .06em; }
.card .title { font-size: 19px; font-weight: 700; margin: 4px 0 6px; }
.card .desc { color: var(--ink-2); font-size: 14.5px; margin: 0; }

/* ---------- 文章 ---------- */
.post-title { font-size: 34px; line-height: 1.35; margin: 48px 0 10px; }
.meta { color: var(--ink-3); font-size: 14px; margin-bottom: 28px; }
.meta .sep { margin: 0 8px; }
h2 { font-size: 23px; margin: 46px 0 14px; }
h3 { font-size: 18px; margin: 30px 0 8px; }
p { margin: 12px 0; }

.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--ink); font-size: 14px;
}
.pill:hover { border-color: var(--cinnabar); color: var(--cinnabar); text-decoration: none; }
.pill.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill.primary:hover { opacity: .86; color: var(--paper); }

/* 册页式配图（点击放大） */
figure { margin: 28px 0; }
figure img {
  width: 100%; display: block;
  border: 1px solid var(--line); border-radius: 6px;
  cursor: zoom-in; transition: box-shadow .3s ease;
}
figure img:hover { box-shadow: 0 10px 30px #26282e14; }
figcaption { color: var(--ink-3); font-size: 13.5px; text-align: center; margin-top: 8px; }
.duo { display: flex; gap: 14px; }
.duo figure { flex: 1; margin: 28px 0; }

/* 特性清单：朱砂圈码 */
.features { padding-left: 0; list-style: none; counter-reset: f; }
.features li { counter-increment: f; margin: 18px 0; padding-left: 46px; position: relative; }
.features li::before {
  content: counter(f, cjk-ideographic);
  position: absolute; left: 0; top: 2px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--cinnabar); color: var(--cinnabar);
  font-family: "KaiTi", "STKaiti", serif; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.features b { display: block; }

table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 14.5px; }
th, td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
th { background: var(--paper-2); }
code { background: var(--paper-2); border-radius: 5px; padding: 1.5px 6px; font-size: 14px; }

/* ---------- 页脚（合规信息区） ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 76px; padding: 30px 0 46px; color: var(--ink-3); font-size: 14px; }
.footer .beian-line { margin: 5px 0; font-size: 13px; }
.footer .beian-sep { margin: 0 10px; color: var(--line); }
.footer a.beian { color: var(--ink-3); text-decoration: none; }
.footer a.beian:hover { color: var(--ink); text-decoration: underline; }
.footer .beian .beian-icon { display: inline-block; width: 18px; height: 20px; vertical-align: -6px; margin-right: 6px; }

/* ---------- 滚动渐显 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 灯箱 ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 99;
  background: #14161bd9; backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center;
  cursor: zoom-out; padding: 4vh 4vw;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 6px; border: 1px solid #ffffff22; }

/* ---------- 响应式与动效偏好 ---------- */
@media (max-width: 680px) {
  .hero { flex-direction: column-reverse; text-align: center; padding: 56px 20px 96px; gap: 28px; }
  .hero-logo { width: 150px; height: 150px; }
  .hero h1 { font-size: 31px; }
  .post-title { font-size: 26px; }
  .nav-links { gap: 10px; }
  .signature { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .sky .mist, .hero-logo { animation: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
