/* ═══════════════════════════════════════════════════════════════
   soggy.cn — Dark tech restyle v5 (refined build)
   电影感轮播（暗角/颗粒/幽灵序号）· 精修排版节奏 · 全局细节打磨
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0c10;
  --surface-1: #10131a;
  --surface-2: #161a23;
  --surface-inset: #07080b;

  --text-1: #f0f2f7;
  --text-2: #c6cbd8;
  --text-3: #9098ab;
  --text-4: #5b6172;

  --link: #8ab4ff;
  --link-hover: #22d3ee;
  --accent-a: #6d8bff;
  --accent-b: #22d3ee;
  --grad: linear-gradient(90deg, var(--accent-a), var(--accent-b));

  --mono: "SF Mono", ui-monospace, Cascadia Code, Consolas, monospace;
  --sans: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Noto Serif SC", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 基础 ───────────────────────────────────────────────── */
* { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
  animation: site-fade 0.55s ease both;
}
@keyframes site-fade { from { opacity: 0; } to { opacity: 1; } }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(620px 400px at 12% -6%, rgba(109, 139, 255, 0.085), transparent 70%),
    radial-gradient(700px 460px at 106% 106%, rgba(34, 211, 238, 0.055), transparent 70%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
}

h1, h2, h3, h4, h5 {
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.01em;
  line-height: 1.4;
}

::selection { background: var(--accent-a); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-a); outline-offset: 3px; border-radius: 4px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #1b1e29; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-a); }
::-webkit-scrollbar-track { background: var(--bg); }

/* ── 阅读进度条 ─────────────────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--grad);
  z-index: 300;
  box-shadow: 0 0 14px rgba(109, 139, 255, 0.55);
  transition: width 0.1s linear;
}

/* ── 玻璃导航 ───────────────────────────────────────────── */
#masthead {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 12, 16, 0.7);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.site-header a, #header-menu a { color: #cdd3e0; transition: color 0.2s ease; }
.site-header a:hover, #header-menu a:hover { color: #fff; }

/* ── 站名 ───────────────────────────────────────────────── */
#branding { border-bottom: 1px solid rgba(255,255,255,.07); position: relative; }
#branding::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--grad);
  opacity: 0.6;
}
#site-text .site-title {
  font-size: 2.2em;
  font-weight: 800;
  background: linear-gradient(95deg, #ffffff 30%, #9db4ff 75%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 46px;
  display: inline-block;
  letter-spacing: 0.02em;
}
#site-text .site-description {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 14px;
}

/* 首页隐藏全屏照片 hero */
.home #header-image-main,
.home #header-image-main-inside,
.home #header-overlay,
.home #header-page-title,
.home #header-page-title-inside { display: none !important; }

/* 文章页标题恢复 */
body.single #header-page-title,
body.page #header-page-title,
body.archive #header-page-title { display: block !important; }
#header-page-title-inside { padding: 46px 0 12px; }
#header-page-title h1,
#header-page-title .title { color: var(--text-1); font-size: 2.0em; max-width: 26em; }
#header-page-title .byline { color: var(--accent-b); }

/* ── 链接 ───────────────────────────────────────────────── */
a {
  color: #cdd3e0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transition: color 0.22s ease, border-color 0.22s ease;
}
a:hover { color: var(--link-hover); border-color: var(--link-hover); }
a.no-underline { border-bottom: none; }

/* ── 分类胶囊 + 元信息 ──────────────────────────────────── */
.cat, .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-b);
  border: 1px solid rgba(34, 211, 238, 0.32);
  background: rgba(34, 211, 238, 0.05);
  padding: 2px 10px;
  border-radius: 999px;
  transition: all 0.22s ease;
}
.cat:hover, .tag:hover { background: var(--accent-b); color: #06121f; border-color: var(--accent-b); }
.entry-meta, .post-meta, .comments-link, .meta, .byline, .date {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ══════════════════════════════════════════════════════════
   照片轮播 v3（电影感）
   暗角 + 颗粒 + 幽灵序号 + 衬线字幕 + 呼吸进度条
   ══════════════════════════════════════════════════════════ */
.hero-carousel {
  position: relative;
  height: 460px;
  border-radius: 18px;
  overflow: hidden;
  margin: 36px 0 30px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--surface-1);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 2px 0 rgba(255, 255, 255, 0.03) inset;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  will-change: opacity;
  transition: opacity 1.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-slide.active {
  opacity: 1;
  animation: kenburns 11s ease-out both;
}
@keyframes kenburns {
  from { transform: scale(1.05) translateY(0.6%); }
  to { transform: scale(1.002) translateY(-0.4%); }
}
/* 暗角 + 颗粒（电影感核心） */
.hero-carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 130% at 50% 46%, transparent 52%, rgba(5, 6, 8, 0.55) 100%),
    linear-gradient(180deg, rgba(8,9,12,0.08) 0%, rgba(8,9,12,0.06) 42%, rgba(8,9,12,0.62) 100%),
    linear-gradient(90deg, rgba(8,9,12,0.38) 0%, transparent 48%);
}
.hero-carousel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
/* 幽灵大序号（编辑感） */
.hero-ghost {
  position: absolute;
  right: 30px;
  bottom: 18px;
  z-index: 3;
  font-family: var(--serif);
  font-size: 110px;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.075);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  transition: opacity 0.6s ease;
}
/* 字幕：标签 + 衬线标题 */
.hero-caption {
  position: absolute;
  left: 30px;
  bottom: 36px;
  z-index: 4;
  max-width: 62%;
  pointer-events: none;
}
.hero-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent-b);
  border: 1px solid rgba(34, 211, 238, 0.42);
  background: rgba(6, 12, 18, 0.45);
  backdrop-filter: blur(4px);
  padding: 4px 12px 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s var(--ease) 0.2s;
}
.hero-caption-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.75);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.85s ease 0.3s, transform 0.85s var(--ease) 0.3s;
}
.hero-slide.active .hero-tag,
.hero-slide.active .hero-caption-title { opacity: 1; transform: none; }
/* 右上角计数器 */
.hero-counter {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 4;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 10px rgba(0,0,0,.7);
}
.hero-counter b { color: #fff; font-weight: 600; }
/* 进度条（呼吸式） */
.hero-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.07);
  z-index: 4;
}
.hero-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.75);
}
@keyframes hero-fill { from { width: 0%; } to { width: 100%; } }
/* 箭头 */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 8, 12, 0.4);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.hero-carousel:hover .hero-arrow { opacity: 1; }
.hero-arrow:hover { background: var(--grad); border-color: transparent; color: #071018; }
.hero-arrow.prev { left: 18px; }
.hero-arrow.next { right: 18px; }
/* 指示器 */
.hero-dots {
  position: absolute;
  bottom: 15px;
  right: 22px;
  display: flex;
  gap: 7px;
  z-index: 4;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  transition: width 0.4s var(--ease), background 0.3s ease, box-shadow 0.3s ease;
}
.hero-dot:hover { background: rgba(255, 255, 255, 0.55); }
.hero-dot.active {
  width: 28px;
  background: var(--accent-b);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.65);
}
@media (max-width: 720px) {
  .hero-carousel { height: 280px; border-radius: 14px; margin: 22px 0 24px; }
  .hero-caption { left: 20px; bottom: 26px; }
  .hero-caption-title { font-size: 16px; }
  .hero-ghost { display: none; }
  .hero-arrow { display: none; }
  .hero-counter { top: 12px; right: 14px; font-size: 10px; }
}

/* ── 文章列表区块标签 ───────────────────────────────────── */
.post-list-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 0 22px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-3);
}
.post-list-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(109,139,255,.4), transparent);
}
.post-list-label b { color: #fff; font-weight: 600; }

/* ── 文章卡 ─────────────────────────────────────────────── */
article.post, .post, .page-header {
  opacity: 0;
  transform: translateY(16px);
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  margin-bottom: 24px;
  overflow: hidden;
  transition: transform 0.32s var(--ease), border-color 0.32s ease, box-shadow 0.32s ease, opacity 0.6s ease;
}
article.post.visible, .post.visible, .page-header.visible {
  opacity: 1;
  transform: none;
}
article.post:hover, .post:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(109, 139, 255, 0.14);
}
.post-image, .post .thumbnail { overflow: hidden; }
.post-image img, .thumbnail img {
  width: 100%;
  display: block;
  filter: saturate(0.9) brightness(0.97);
  transform: scale(1.004);
  transition: transform 0.8s var(--ease), filter 0.5s ease;
}
article.post:hover .post-image img,
.post:hover .thumbnail img {
  transform: scale(1.025);
  filter: saturate(1.04) brightness(1);
}
/* 标题链接：默认亮白可读 */
.post-title a,
.entry-title a,
.page-header .title,
.page-header a,
.wp-block-latest-posts__post-title,
.wp-block-post-title__link,
a[class*="post-title"] {
  color: var(--text-1) !important;
  border-bottom: none !important;
  text-decoration: none;
  transition: color 0.22s ease;
}
.post-title a:hover,
.entry-title a:hover,
.page-header a:hover,
.wp-block-latest-posts__post-title:hover,
a[class*="post-title"]:hover {
  color: var(--link-hover) !important;
  border-bottom: none;
}
.post:hover .post-title a,
article.post:hover .post-title a {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background 0.35s ease;
}

/* ── 文档排版系统（精修版） ─────────────────────────────── */
.entry-content {
  max-width: 45em;
  font-size: 17.5px;
  line-height: 1.95;
  letter-spacing: 0.016em;
  color: var(--text-2);
  word-break: break-word;
}
.entry-content p { margin: 0 0 1.55em; }
.entry-content p:last-child { margin-bottom: 0; }
.entry-content h2 {
  color: var(--text-1);
  font-size: 1.48em;
  margin: 2.4em 0 0.8em;
  padding-top: 0.5em;
  line-height: 1.5;
}
.entry-content h2::before {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--grad);
  margin-bottom: 14px;
}
.entry-content h3 { color: var(--text-1); font-size: 1.18em; margin: 2em 0 0.6em; }
.entry-content h4 { color: var(--text-1); margin: 1.7em 0 0.5em; font-size: 1.02em; }
.entry-content a { color: var(--link); border-bottom-color: rgba(138, 180, 255, 0.4); }
.entry-content a:hover { color: var(--link-hover); border-color: var(--link-hover); }
.entry-content ul, .entry-content ol { margin: 0 0 1.55em; padding-left: 1.5em; }
.entry-content li { margin-bottom: 0.55em; }
.entry-content li::marker { color: var(--accent-a); font-family: var(--mono); }
.entry-content blockquote {
  border-left: 2px solid var(--accent-a);
  background: linear-gradient(90deg, rgba(109, 139, 255, 0.06), transparent 70%);
  border-radius: 0 12px 12px 0;
  margin: 2.2em 0;
  padding: 0.9em 1.5em;
  color: var(--text-3);
  font-size: 1.02em;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content code {
  font-family: var(--mono);
  font-size: 0.87em;
  color: #9db4ff;
  background: rgba(109, 139, 255, 0.08);
  border: 1px solid rgba(109, 139, 255, 0.14);
  padding: 1px 6px;
  border-radius: 5px;
}
.entry-content pre {
  background: var(--surface-inset) !important;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  color: #dbe0ea;
  font-size: 0.92em;
  line-height: 1.75;
}
.entry-content pre code { background: none; border: none; color: inherit; padding: 0; font-size: 1em; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: 0.95em; }
.entry-content th, .entry-content td { border: 1px solid rgba(255, 255, 255, 0.09); padding: 9px 13px; text-align: left; }
.entry-content th { background: var(--surface-2); color: var(--text-1); }
.entry-content img, .wp-block-image img { border-radius: 12px; max-width: 100%; }
.entry-content hr { border: none; border-top: 1px solid rgba(255,255,255,.07); margin: 2.8em 0; }

/* ── 侧栏小工具 ─────────────────────────────────────────── */
.widget-area, .widget-container {
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}
.widget h4, .widget-title {
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}
.widget h4::before, .widget-title::before { content: "// "; color: var(--text-4); }
.widget a { color: #cdd3e0; }
.widget a:hover { color: var(--link-hover); }

/* 搜索框 */
.wp-block-search__input {
  background: var(--surface-inset) !important;
  border: 1px solid rgba(255,255,255,.07) !important;
  color: var(--text-2) !important;
  border-radius: 8px !important;
}
.wp-block-search__input::placeholder { color: var(--text-4); }
.wp-block-search__input:focus {
  border-color: var(--accent-a) !important;
  box-shadow: 0 0 0 3px rgba(109, 139, 255, 0.14);
}
.wp-block-search__button {
  background: var(--grad) !important;
  color: #071018 !important;
  border: none !important;
  border-radius: 8px !important;
  font-family: var(--mono);
  font-weight: 600;
}

/* ── 按钮 ───────────────────────────────────────────────── */
.button,
input[type="submit"],
.comment-submit-wrap input,
.wp-block-button__link {
  background: var(--grad) !important;
  color: #071018 !important;
  border: none !important;
  border-radius: 8px !important;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 6px 22px rgba(109, 139, 255, 0.22);
  transition: filter 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.button:hover, input[type="submit"]:hover, .wp-block-button__link:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(109, 139, 255, 0.3);
}

/* ── 评论 ───────────────────────────────────────────────── */
#comments, .commentlist { border-top-color: rgba(255,255,255,.07); }
.commentlist li { border-bottom-color: rgba(255,255,255,.07); }
.commentlist cite, .commentlist .fn { color: var(--text-1); font-style: normal; }
#commentform input, #commentform textarea {
  background: var(--surface-inset) !important;
  border: 1px solid rgba(255,255,255,.07) !important;
  color: var(--text-2) !important;
  border-radius: 8px !important;
}
#commentform input:focus, #commentform textarea:focus {
  border-color: var(--accent-a) !important;
  box-shadow: 0 0 0 3px rgba(109, 139, 255, 0.14);
}
.comment-reply-link, #cancel-comment-reply-link { color: var(--accent-b); }

/* ── 翻页 ───────────────────────────────────────────────── */
.nav-links a, .pagination a {
  background: var(--surface-1);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-2);
  padding: 8px 18px;
  transition: all 0.22s ease;
}
.nav-links a:hover, .pagination a:hover {
  border-color: var(--accent-a);
  color: var(--accent-b);
}

/* ── 页脚 ───────────────────────────────────────────────── */
#footer {
  border-top: 1px solid rgba(255,255,255,.07);
  position: relative;
  color: var(--text-3) !important;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 80px;
  padding-top: 34px;
}
#footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  background: var(--grad);
  opacity: 0.5;
}
#footer a { color: var(--text-3); border-bottom-color: rgba(144, 152, 171, 0.28); }
#footer a:hover { color: var(--accent-b); }
.site-generator { display: none; }

/* ── 回到顶部 ───────────────────────────────────────────── */
#toTop { display: none !important; }
#totop {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 19, 26, 0.85);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  font-family: var(--mono);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.3s var(--ease), border-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
#totop:hover { border-color: var(--accent-a); color: var(--accent-b); transform: translateY(-3px); }
#totop.shown { opacity: 1; pointer-events: auto; }

/* ── 自适应 ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  #site-text .site-title { font-size: 1.6em; margin-top: 28px; }
  .entry-content { font-size: 16px; }
  article.post:hover { transform: none; }
}