/* ============================================================
   Sokach Blog · style.css
   亮 / 暗双主题 · 移动端适配 · 零依赖
   ============================================================ */

:root {
  --bg: #f4f5f9;
  --bg-soft: #eceef4;
  --card: #ffffff;
  --card-2: #f7f8fc;
  --text: #2c3345;
  --muted: #7c869c;
  --line: #e6e9f0;
  --accent: #ff7d54;
  --accent-2: #ffb35c;
  --accent-soft: rgba(255, 125, 84, 0.12);
  --shadow: 0 6px 24px rgba(31, 45, 80, 0.08);
  --shadow-lg: 0 14px 40px rgba(31, 45, 80, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.82);
  --wave-fill: var(--bg);
  --code-bg: #eef0f6;
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
}
html.dark {
  --bg: #15171c;
  --bg-soft: #1a1d24;
  --card: #1f232b;
  --card-2: #232833;
  --text: #e4e8f0;
  --muted: #98a2b8;
  --line: #2c323e;
  --accent: #ff8a63;
  --accent-2: #ffbf6e;
  --accent-soft: rgba(255, 138, 99, 0.16);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(21, 23, 28, 0.82);
  --code-bg: #14161b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
svg { width: 1em; height: 1em; vertical-align: -0.14em; }

/* ---------------- 顶部导航 ---------------- */
#nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
body.scrolled #nav, body:not(.at-hero) #nav {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 18px rgba(20, 30, 60, 0.1);
}
.nav-avatar img {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease;
}
.nav-avatar:hover img { transform: rotate(12deg) scale(1.08); }
.nav-links {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav-links a {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 15px; color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: background 0.25s, color 0.25s;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.22); }
.nav-links a.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  text-shadow: none;
  font-weight: 600;
}
body.scrolled .nav-links a, body:not(.at-hero) .nav-links a {
  color: var(--text); text-shadow: none;
}
body.scrolled .nav-links a:hover, body:not(.at-hero) .nav-links a:hover { background: var(--accent-soft); }
body.scrolled .nav-links a.active, body:not(.at-hero) .nav-links a.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  width: 38px; height: 38px; border: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
  background: rgba(255, 255, 255, 0.16);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: background 0.25s, transform 0.25s;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }
body.scrolled .nav-btn, body:not(.at-hero) .nav-btn {
  color: var(--text); background: var(--card-2); text-shadow: none;
}
body.scrolled .nav-btn:hover, body:not(.at-hero) .nav-btn:hover { background: var(--accent-soft); }
.nav-burger { display: none; }

/* 移动端抽屉 */
#drawerMask {
  position: fixed; inset: 0; z-index: 94;
  background: rgba(10, 14, 24, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
#drawer {
  position: fixed; top: 0; right: -280px; z-index: 95;
  width: 260px; height: 100dvh; padding: 84px 18px 24px;
  background: var(--card); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 4px;
  transition: right 0.32s cubic-bezier(0.22, 0.8, 0.36, 1);
  overflow-y: auto;
}
body.drawer-open #drawerMask { opacity: 1; pointer-events: auto; }
body.drawer-open #drawer { right: 0; }
body.drawer-open { overflow: hidden; }
#drawer a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px;
  font-size: 15.5px; color: var(--text);
}
#drawer a:hover, #drawer a.active { background: var(--accent-soft); color: var(--accent); }
.drawer-socials { margin-top: auto; display: flex; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.drawer-socials a { padding: 8px; border-radius: 50%; }
.drawer-socials svg { font-size: 19px; }

/* ---------------- 首页大横幅 ---------------- */
.hero, .page-hero {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: #fff;
}
.hero { height: 100svh; min-height: 560px; }
.page-hero { height: 46svh; min-height: 300px; }
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.04);
  animation: heroZoom 14s ease-in-out infinite alternate;
}
@keyframes heroZoom { from { transform: scale(1.02); } to { transform: scale(1.12); } }
.hero-mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.34), rgba(10, 14, 26, 0.16) 45%, rgba(10, 14, 26, 0.45));
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 0 20px;
  animation: rise 0.9s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.hero-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 18px;
  transition: transform 0.4s ease;
}
.hero-avatar:hover { transform: scale(1.06) rotate(8deg); }
.hero-title {
  font-size: clamp(1.9rem, 5.2vw, 3rem);
  font-weight: 700; letter-spacing: 0.04em;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}
.hero-motto {
  margin-top: 12px; font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  opacity: 0.92; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.hero-socials {
  margin-top: 20px; display: flex; justify-content: center; gap: 14px;
}
.hero-socials a {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  transition: background 0.25s, transform 0.25s;
}
.hero-socials a:hover { background: var(--accent); transform: translateY(-3px); }
.hero-scroll {
  position: absolute; z-index: 2; left: 50%; bottom: 96px;
  transform: translateX(-50%);
  width: 34px; height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: bounce 1.8s infinite;
}
.hero-scroll span {
  width: 8px; height: 8px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-2px, -2px);
}
@keyframes bounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 9px); } }

.wave {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: -1px;
  width: 100%; height: clamp(60px, 10vw, 120px);
  color: var(--wave-fill);
  display: block;
}

/* ---------------- 容器与卡片 ---------------- */
.container {
  max-width: 880px; margin: 0 auto;
  padding: 46px clamp(16px, 4vw, 28px) 70px;
  display: flex; flex-direction: column; gap: 26px;
}
.profile-card {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(120deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  border: 3px solid var(--accent-soft);
  outline: 3px solid transparent;
}
.profile-info h3 { font-size: 1.25rem; }
.profile-info > p { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
.profile-stats {
  display: flex; gap: 18px; margin-top: 10px;
  font-size: 0.9rem; color: var(--muted);
}
.profile-stats b { color: var(--accent); font-size: 1.05rem; margin-right: 3px; }

.post-card {
  display: grid; grid-template-columns: 280px 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.post-cover { display: block; overflow: hidden; }
.post-cover img {
  width: 100%; height: 100%; min-height: 190px; object-fit: cover;
  transition: transform 0.5s ease;
}
.post-card:hover .post-cover img { transform: scale(1.06); }
.post-body { padding: 22px 26px; display: flex; flex-direction: column; }
.post-title { font-size: 1.22rem; line-height: 1.45; }
.post-title a { transition: color 0.25s; }
.post-title a:hover { color: var(--accent); }
.post-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  margin: 10px 0 8px;
  font-size: 0.86rem; color: var(--muted);
}
.post-meta span, .meta-cat { display: inline-flex; align-items: center; gap: 5px; }
.meta-cat { color: var(--accent); }
.post-excerpt {
  color: var(--muted); font-size: 0.94rem; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-more {
  margin-top: 12px; align-self: flex-start;
  font-size: 0.9rem; color: var(--accent); font-weight: 600;
}
.post-more:hover { letter-spacing: 0.5px; }
.home-end { text-align: center; color: var(--muted); font-size: 0.92rem; padding-top: 6px; }
.home-end a { color: var(--accent); }

/* ---------------- 文章页 ---------------- */
.page-hero-content { position: relative; z-index: 2; text-align: center; padding: 0 24px; animation: rise 0.8s ease both; }
.page-hero-content h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.45);
}
.page-hero-content p { margin-top: 10px; opacity: 0.94; font-size: 0.98rem; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }

.post-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4.5vw, 44px);
  box-shadow: var(--shadow);
  font-size: 1.02rem;
  overflow-wrap: break-word;
}
.post-content p { margin: 14px 0; }
.post-content h2, .post-content h3, .post-content h4, .post-content h5 {
  margin: 30px 0 14px; line-height: 1.4;
}
.post-content h2 { font-size: 1.42rem; padding-left: 12px; border-left: 4px solid var(--accent); }
.post-content h3 { font-size: 1.18rem; color: var(--accent); }
.post-content h4 { font-size: 1.05rem; }
.post-content ul, .post-content ol { margin: 12px 0 12px 26px; display: grid; gap: 6px; }
.post-content blockquote {
  margin: 18px 0; padding: 12px 18px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  color: var(--text);
}
.post-content blockquote p { margin: 0; }
.post-content code {
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 7px; border-radius: 6px;
  color: var(--accent);
}
.post-content pre {
  margin: 16px 0; padding: 18px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.6;
}
.post-content pre code { background: none; padding: 0; color: var(--text); font-size: 0.88rem; }
.post-content hr { border: none; border-top: 1px dashed var(--line); margin: 26px 0; }
.post-content img { border-radius: 12px; margin: 10px 0; box-shadow: var(--shadow); cursor: zoom-in; }
.post-content a { color: var(--accent); border-bottom: 1px dashed var(--accent); }
.post-content table { border-collapse: collapse; margin: 16px 0; width: 100%; font-size: 0.94rem; }
.post-content th, .post-content td { border: 1px solid var(--line); padding: 9px 14px; text-align: left; }
.post-content th { background: var(--card-2); }

.post-nav { display: flex; justify-content: space-between; gap: 14px; }
.post-nav .pn {
  flex: 1; max-width: 48%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 3px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.post-nav .pn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-nav .pn small { color: var(--muted); font-size: 0.8rem; }
.post-nav .pn span { font-size: 0.92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-nav .next { text-align: right; margin-left: auto; }

/* ---------------- 时间轴 ---------------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(var(--accent), var(--accent-2), var(--line));
  border-radius: 2px;
}
.tl-year { margin: 26px 0 12px; }
.tl-year:first-child { margin-top: 0; }
.tl-year span {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 1.15rem;
  padding: 3px 18px; border-radius: 999px;
  box-shadow: var(--shadow);
}
.tl-item {
  position: relative;
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px 12px; border-radius: 10px;
  transition: background 0.25s, transform 0.25s;
}
.tl-item:hover { background: var(--card); transform: translateX(4px); }
.tl-dot {
  position: absolute; left: -26px; top: 50%;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--accent);
  transform: translateY(-50%);
}
.tl-date { color: var(--muted); font-size: 0.86rem; white-space: nowrap; font-family: Consolas, monospace; }
.tl-title { font-weight: 600; }
.tl-item:hover .tl-title { color: var(--accent); }

/* ---------------- 分类 ---------------- */
.cat-cloud { display: flex; flex-wrap: wrap; gap: 12px; }
.cat-chip {
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); border-radius: 999px;
  padding: 9px 20px; font-size: 0.98rem;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: var(--shadow);
  transition: all 0.25s;
}
.cat-chip small { color: var(--muted); }
.cat-chip:hover, .cat-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent; transform: translateY(-2px);
}
.cat-chip:hover small, .cat-chip.active small { color: rgba(255, 255, 255, 0.85); }

/* ---------------- 相册 ---------------- */
.album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.album-item {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: zoom-in; aspect-ratio: 16/9.6;
}
.album-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.album-item:hover img { transform: scale(1.07); }
.album-item figcaption {
  position: absolute; inset: auto 0 0 0;
  padding: 34px 16px 12px;
  background: linear-gradient(transparent, rgba(8, 12, 24, 0.78));
  color: #fff; display: flex; justify-content: space-between; align-items: baseline;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
}
.album-item:hover figcaption { opacity: 1; transform: none; }
.album-item figcaption b { font-size: 1rem; }
.album-item figcaption span { font-size: 0.82rem; opacity: 0.85; }

/* ---------------- 说说 / 留言 ---------------- */
.say-card { display: flex; gap: 14px; }
.say-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--accent-soft); box-shadow: var(--shadow);
}
.say-bubble {
  position: relative; flex: 1;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  padding: 14px 18px; box-shadow: var(--shadow);
}
.say-bubble::before {
  content: ""; position: absolute; left: -7px; top: 14px;
  width: 12px; height: 12px;
  background: var(--card);
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.say-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; }
.say-head time { color: var(--muted); font-size: 0.82rem; }
.say-bubble p { margin: 6px 0 0; font-size: 0.98rem; }
.say-mood { position: absolute; right: 14px; bottom: 10px; font-size: 1.25rem; }

.msg-form-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.msg-form-head { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.msg-form-card input, .msg-form-card textarea {
  font-family: inherit; font-size: 0.98rem; color: var(--text);
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  resize: vertical;
}
.msg-form-card input:focus, .msg-form-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.msg-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.msg-form-foot small { color: var(--muted); max-width: 68%; line-height: 1.5; }
#msgSubmit {
  border: none; border-radius: 999px; padding: 10px 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 0.98rem; font-weight: 600;
  box-shadow: 0 6px 16px rgba(255, 125, 84, 0.35);
  transition: transform 0.25s, box-shadow 0.25s;
}
#msgSubmit:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255, 125, 84, 0.45); }
.msg-empty {
  text-align: center; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 34px;
}

/* ---------------- 友链 ---------------- */
.friend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.friend-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.28s, box-shadow 0.28s;
}
.friend-card:hover { transform: translateY(-4px) rotate(-0.4deg); box-shadow: var(--shadow-lg); }
.friend-card img {
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid var(--accent-soft);
}
.friend-card b { display: block; font-size: 1.02rem; }
.friend-card span { color: var(--muted); font-size: 0.88rem; }
.friend-tip {
  display: flex; align-items: center; gap: 12px;
  background: var(--accent-soft); border: 1px dashed var(--accent);
  border-radius: var(--radius); padding: 16px 20px;
  color: var(--text); font-size: 0.94rem;
}
.friend-tip svg { font-size: 20px; color: var(--accent); flex-shrink: 0; }
.friend-tip a { color: var(--accent); font-weight: 600; }

/* ---------------- 页脚 ---------------- */
#footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 34px 18px 40px;
  color: var(--muted); font-size: 0.9rem;
  display: flex; flex-direction: column; gap: 6px;
}
.footer-motto { color: var(--text); font-weight: 600; letter-spacing: 0.06em; }

/* ---------------- 搜索弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 14, 24, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 14vh 18px 18px;
}
.search-box {
  width: min(640px, 100%);
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise 0.28s ease both;
}
.search-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.search-input-row svg { font-size: 19px; color: var(--muted); }
#searchInput {
  flex: 1; border: none; outline: none; background: none;
  font-size: 1.05rem; color: var(--text); font-family: inherit;
}
#searchClose {
  border: 1px solid var(--line); background: var(--card-2);
  color: var(--muted); font-size: 0.75rem;
  padding: 4px 10px; border-radius: 8px;
}
#searchResults { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-tip { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 0.92rem; }
.search-hit {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: 12px;
}
.search-hit:hover { background: var(--accent-soft); }
.search-hit b { font-size: 0.98rem; }
.search-hit span { color: var(--muted); font-size: 0.85rem; }

/* ---------------- 灯箱 ---------------- */
#lightbox {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(8, 10, 18, 0.86);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 12px; box-shadow: var(--shadow-lg); }

/* ---------------- 回到顶部 ---------------- */
#backTop {
  position: fixed; right: 26px; bottom: 30px; z-index: 80;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 18px;
  box-shadow: 0 8px 22px rgba(255, 125, 84, 0.4);
  opacity: 0; pointer-events: none; transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s;
}
#backTop.show { opacity: 1; pointer-events: auto; transform: none; }
#backTop:hover { transform: translateY(-3px); }

/* ---------------- 公开评论（Giscus / Waline） ---------------- */
.comment-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px 30px;
}
.comment-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
  margin-bottom: 18px;
}
.comment-title svg { color: var(--accent); font-size: 1.15rem; }
.comment-hint {
  background: var(--accent-soft);
  border: 1.5px dashed var(--accent);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.8;
}
.comment-hint code {
  background: var(--code-bg); padding: 1px 7px;
  border-radius: 6px; font-size: 0.86em;
}
.giscus-holder, #waline-holder { min-height: 60px; }
#waline-holder { --waline-theme-color: var(--accent); --waline-active-color: var(--accent-2); }
#waline-holder .wl-panel { border-radius: 12px; }

/* ---------------- 入场动画 ---------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* hidden 属性优先级最高（否则被 display:flex 覆盖导致弹窗常开） */
[hidden] { display: none !important; }

/* ---------------- 移动端 ---------------- */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .hero-scroll { bottom: 80px; }
  .container { gap: 20px; padding-top: 30px; }
  .post-card { grid-template-columns: 1fr; }
  .post-cover img { height: 190px; min-height: 0; }
  .post-body { padding: 18px 20px 20px; }
  .profile-card { flex-direction: column; text-align: center; padding: 24px 20px; }
  .profile-stats { justify-content: center; }
  .album-grid { grid-template-columns: 1fr; }
  .friend-grid { grid-template-columns: 1fr; }
  .post-nav { flex-direction: column; }
  .post-nav .pn { max-width: 100%; }
  .post-nav .next { text-align: left; }
  .msg-form-foot { flex-direction: column; align-items: stretch; }
  .msg-form-foot small { max-width: 100%; }
  #backTop { right: 16px; bottom: 20px; }
  .hero-avatar { width: 80px; height: 80px; }
}

/* ---------------- 文章管理器（#/admin） ---------------- */
.admin-wrap { max-width: 980px; margin: 0 auto; padding: 96px 20px 80px; }
.admin-head h1 { font-size: 30px; margin: 0 0 6px; }
.admin-head p { color: var(--muted); margin: 0 0 10px; font-size: 14px; }
.admin-head a { color: var(--accent); text-decoration: none; }
.admin-chip { display: inline-block; font-size: 12px; padding: 3px 12px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }
.admin-chip.ok { color: #1a8a4a; border-color: rgba(26,138,74,.35); background: rgba(26,138,74,.08); }
.admin-chip.warn { color: #b3541e; border-color: rgba(179,84,30,.35); background: rgba(179,84,30,.08); }
.admin-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 6px; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.admin-btn { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 9px 18px; border-radius: 12px; font-size: 14px; transition: .18s; }
.admin-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.admin-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; font-weight: 600; box-shadow: 0 4px 14px var(--accent-soft); }
.admin-btn.primary:hover { color: #fff; filter: brightness(1.05); }
.admin-btn.ghost { background: transparent; }
.admin-btn.sm { padding: 5px 12px; font-size: 12.5px; border-radius: 9px; }
.admin-btn.danger:hover { border-color: #d9483b; color: #d9483b; }
.admin-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.admin-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 18px; transition: .18s; }
.admin-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.admin-item-main b { display: block; font-size: 15px; }
.admin-item-main span { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.admin-item-act { display: flex; gap: 8px; flex: none; }
.admin-empty { text-align: center; color: var(--muted); padding: 30px; background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }
.admin-note { font-size: 12.5px; color: var(--muted); margin-top: 16px; line-height: 1.7; }
.admin-settings { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; margin: 4px 0 14px; }
.admin-settings summary { cursor: pointer; padding: 10px 0; font-size: 14px; color: var(--text); font-weight: 600; }
.admin-settings-body { padding: 4px 0 16px; display: flex; flex-direction: column; gap: 12px; }
.admin-grid3 { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 10px; }
.admin-grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; }
.admin-form { display: flex; flex-direction: column; gap: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.admin-form label, .admin-settings-body label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.admin-form input, .admin-form textarea, .admin-settings-body input {
  font-family: var(--font); font-size: 14px; color: var(--text); background: var(--card-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none; transition: .15s; width: 100%;
}
.admin-form input:focus, .admin-form textarea:focus, .admin-settings-body input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.admin-form textarea { resize: vertical; line-height: 1.7; min-height: 220px; }
.admin-ck { flex-direction: row !important; align-items: center; gap: 8px !important; }
.admin-ck input { width: auto !important; }
.admin-preview-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-top: 14px; }
.admin-preview-card > b { font-size: 13px; color: var(--muted); display: block; margin-bottom: 8px; }
.admin-preview { padding: 0; }
.admin-loading { text-align: center; color: var(--muted); padding: 80px 0; }
.admin-toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 11px 22px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 999; max-width: 86vw; }
.admin-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.footer-admin { color: var(--muted); text-decoration: none; }
.footer-admin:hover { color: var(--accent); }
@media (max-width: 720px) {
  .admin-grid3, .admin-grid2 { grid-template-columns: 1fr; }
  .admin-item { flex-direction: column; align-items: flex-start; }
  .admin-head h1 { font-size: 24px; }
  .admin-wrap { padding: 84px 14px 60px; }
}
