/*
Theme Name: superzlk 极简
Theme URI: https://superzlk.example
Author: superzlk
Author URI: https://superzlk.example
Description: 极简高级的个人博客主题，参考 Apple / Stripe / Notion 的设计语言。近黑文字、Apple 灰、发丝边框、大留白，前台纯展示（搜索 · 分类 · 阅读），无评论、无注册。
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: superzlk
Tags: blog, minimal, clean, responsive, one-column
*/

/* ===== 设计令牌 ===== */
:root {
  --sz-c-ink: #1D1D1F;
  --sz-c-body: #3A3A3C;
  --sz-c-muted: #6E6E73;
  --sz-c-faint: #86868B;
  --sz-c-accent: #0071E3;
  --sz-c-bg: #FFFFFF;
  --sz-c-bg-soft: #F5F5F7;
  --sz-c-border: #D2D2D7;
  --sz-c-border-strong: #C7C7CC;
  --sz-r-card: 12px;
  --sz-r-pill: 999px;
  --sz-r-input: 12px;
  --sz-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --sz-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05);
  --sz-container: 1120px;
  --sz-container-narrow: 720px;
}

/* ===== 基础 ===== */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sz-font-sans);
  color: var(--sz-c-body);
  background: var(--sz-c-bg);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 仅约束主题外壳，避免覆盖文章内嵌 HTML 的链接、标题、图片样式。 */
.sz-site-header a,
.sz-site-footer a { color: var(--sz-c-accent); text-decoration: none; }
.sz-site-header a:hover,
.sz-site-footer a:hover { text-decoration: underline; }

::selection { background: rgba(0, 113, 227, 0.16); }

.sz-container { max-width: var(--sz-container); margin: 0 auto; padding: 0 24px; }
.sz-container-narrow { max-width: var(--sz-container-narrow); margin: 0 auto; padding: 0 24px; }

.sz-screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}

.sz-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--sz-c-ink); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.sz-skip-link:focus { left: 12px; top: 12px; }

/* ===== 顶部导航 ===== */
.sz-site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sz-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}

.sz-site-logo {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--sz-c-ink);
}
.sz-site-logo:hover { text-decoration: none; }

.sz-site-nav { display: flex; }

.sz-nav-list {
  display: flex; align-items: center; gap: 32px;
  list-style: none; margin: 0; padding: 0;
}
.sz-nav-list a {
  color: var(--sz-c-muted); font-size: 15px; font-weight: 500;
}
.sz-nav-list a:hover { color: var(--sz-c-ink); text-decoration: none; }
.sz-nav-list .current-menu-item > a,
.sz-nav-list .current_page_item > a { color: var(--sz-c-ink); }

.sz-nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 8px;
  background: none; border: none; cursor: pointer;
}
.sz-nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--sz-c-ink); border-radius: 2px; transition: transform .2s, opacity .2s;
}
.sz-nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sz-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.sz-nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 首屏 Hero ===== */
.sz-hero { padding: 96px 0 40px; text-align: center; }

.sz-hero-logo {
  font-size: 60px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--sz-c-ink); line-height: 1.1; margin: 0;
}

.sz-hero-sub { margin: 18px 0 0; font-size: 20px; color: var(--sz-c-muted); font-weight: 400; }

.sz-hero-search { margin: 40px auto 0; max-width: 640px; }

/* ===== 搜索框 ===== */
.sz-search-form { position: relative; }

.sz-search-form input[type="search"] {
  width: 100%; height: 52px; padding: 0 56px 0 20px;
  border: 1px solid var(--sz-c-border); border-radius: var(--sz-r-input);
  font-family: inherit; font-size: 16px; color: var(--sz-c-ink); background: #fff;
  outline: none; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.sz-search-form input[type="search"]::placeholder { color: var(--sz-c-faint); }
.sz-search-form input[type="search"]:focus {
  border-color: var(--sz-c-accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.sz-hero-search .sz-search-form input[type="search"] { height: 60px; font-size: 18px; }

.sz-search-form button {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; border-radius: 10px;
  background: var(--sz-c-accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.sz-search-form button:hover { background: #0077ed; }

/* ===== 分类胶囊 ===== */
.sz-cat-pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.sz-cat-pills--left { justify-content: flex-start; margin-top: 0; }

.sz-cat-pill {
  display: inline-flex; align-items: center;
  padding: 8px 18px; border-radius: var(--sz-r-pill);
  border: 1px solid var(--sz-c-border);
  color: var(--sz-c-muted); font-size: 14px; font-weight: 500; background: #fff;
  transition: color .2s, border-color .2s, background .2s;
}
.sz-cat-pill:hover { color: var(--sz-c-accent); border-color: var(--sz-c-accent); text-decoration: none; }
.sz-cat-pill.is-active { background: var(--sz-c-accent); border-color: var(--sz-c-accent); color: #fff; }
.sz-cat-pill.is-active:hover { color: #fff; }

/* ===== 区块 ===== */
.sz-section { padding: 48px 0 96px; }
/* 首页：分类胶囊紧接最新文章区块，拉近二者间距 */
.sz-hero + .sz-section { padding-top: 12px; }

.sz-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 28px;
}
.sz-section-title { font-size: 26px; font-weight: 700; margin: 0; }
.sz-section-more { font-size: 14px; font-weight: 500; color: var(--sz-c-accent); }

/* ===== 文章卡片 ===== */
.sz-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.sz-post-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  border: 1px solid var(--sz-c-border); border-radius: var(--sz-r-card);
  padding: 26px; background: #fff;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.sz-post-card:hover {
  box-shadow: var(--sz-shadow-card); border-color: var(--sz-c-border-strong);
  transform: translateY(-2px);
}

.sz-cat-tag {
  position: relative; z-index: 2;
  align-self: flex-start;
  font-size: 13px; font-weight: 500; color: var(--sz-c-muted);
}
.sz-cat-tag:hover { color: var(--sz-c-accent); text-decoration: none; }

.sz-card-title { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.sz-card-title a { color: var(--sz-c-ink); }
.sz-card-title a:hover { color: var(--sz-c-accent); text-decoration: none; }

/* 整卡可点：拉伸链接覆盖整张卡片 */
.sz-stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sz-excerpt { font-size: 15px; color: var(--sz-c-muted); margin: 0; line-height: 1.7; }

.sz-meta { font-size: 13px; color: var(--sz-c-faint); margin-top: auto; }

/* ===== 页面头（列表 / 归档 / 搜索） ===== */
.sz-page-head { padding: 72px 0 40px; }
.sz-page-title { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.sz-page-sub { font-size: 17px; color: var(--sz-c-muted); margin: 12px 0 0; }
.sz-list-tools { margin-top: 28px; max-width: 560px; }
.sz-list-tools + .sz-cat-pills { margin-top: 20px; }

/* ===== 文章详情 ===== */
.sz-single-wrap { max-width: var(--sz-container-narrow); margin: 0 auto; padding: 72px 24px 96px; }
/* 仅完整 HTML 工具稿使用宽版画布；普通图文文章继续保持 720px 易读列宽。 */
.sz-single-wrap--tool { max-width: 1000px; }

.sz-post-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--sz-c-accent); font-size: 14px; font-weight: 500; margin-bottom: 32px;
}

.sz-cat-tag--lg { font-size: 14px; }

.sz-post-title { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; margin: 16px 0 12px; }

.sz-post-meta { color: var(--sz-c-muted); font-size: 14px; }

.sz-entry-content { margin-top: 36px; font-size: 17px; color: var(--sz-c-body); }
/* 只为普通 WordPress 内容块提供排版；带 class 的 HTML 组件由其自身 CSS 完整控制。 */
.sz-entry-content > p:not([class]) { margin: 0 0 1.5em; }
.sz-entry-content > h2:not([class]) { font-size: 26px; margin: 2em 0 0.6em; }
.sz-entry-content > h3:not([class]) { font-size: 21px; margin: 1.8em 0 0.5em; }
.sz-entry-content > a:not([class]) { text-decoration: underline; text-underline-offset: 2px; }
.sz-entry-content > ul:not([class]), .sz-entry-content > ol:not([class]) { padding-left: 1.4em; margin: 0 0 1.5em; }
.sz-entry-content > blockquote:not([class]) {
  margin: 1.5em 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--sz-c-border-strong); color: var(--sz-c-muted);
}
.sz-entry-content > img:not([class]) { max-width: 100%; height: auto; border-radius: var(--sz-r-card); }
.sz-entry-content > pre:not([class]) {
  background: var(--sz-c-bg-soft); border: 1px solid var(--sz-c-border);
  border-radius: var(--sz-r-card); padding: 18px; overflow-x: auto; font-size: 14px;
}
.sz-entry-content > pre:not([class]) code { font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; }

/* Gutenberg 会给自定义 HTML 的内联元素补空段落；在 grid/flex 布局中会错误占据一个格子。 */
.sz-entry-content .article .szr-step > p:empty,
.sz-entry-content .article .szr-function > p:empty,
.sz-entry-content .article .szr-stat > p:empty,
.sz-entry-content .article .szr-callout > p:empty,
.sz-entry-content .article .szr-output > p:empty { display: none; }

/* ===== 关于 / 静态页 ===== */
.sz-page-wrap { max-width: var(--sz-container-narrow); margin: 0 auto; padding: 72px 24px 96px; }
.sz-page-wrap--tool { max-width: 1000px; }
.sz-page-wrap .sz-post-title { margin-top: 0; }

/* ===== 关于页（个人介绍模板） ===== */
.sz-about-wrap { max-width: var(--sz-container-narrow); margin: 0 auto; padding: 72px 24px 96px; }

.sz-about-head { margin-bottom: 48px; }
.sz-about-title { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.sz-about-sub { font-size: 17px; color: var(--sz-c-muted); margin: 12px 0 0; }

.sz-about-intro { display: flex; align-items: flex-start; gap: 32px; }

.sz-about-avatar {
  flex: none; width: 96px; height: 96px; border-radius: 50%;
  background: var(--sz-c-bg-soft); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.sz-about-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.sz-about-avatar-mono { font-size: 40px; font-weight: 700; color: var(--sz-c-muted); line-height: 1; }

.sz-about-intro-text { flex: 1; min-width: 0; }
.sz-about-name { font-size: 24px; font-weight: 700; margin: 0 0 10px; }
.sz-about-bio { font-size: 16px; color: var(--sz-c-body); }
.sz-about-bio p { margin: 0 0 1em; }
.sz-about-bio p:last-child { margin-bottom: 0; }

.sz-about-contact { margin-top: 64px; }
.sz-about-contact-title { font-size: 20px; font-weight: 700; margin: 0 0 16px; }

.sz-contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sz-contact-item {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--sz-c-border); border-radius: var(--sz-r-card);
  padding: 15px 20px;
}
.sz-contact-label { flex: none; width: 44px; font-size: 14px; color: var(--sz-c-muted); }
.sz-contact-value { font-size: 15px; color: var(--sz-c-body); word-break: break-all; }
a.sz-contact-value { color: var(--sz-c-accent); }

@media (max-width: 720px) {
  .sz-about-intro { flex-direction: column; align-items: center; text-align: center; }
  .sz-about-intro-text { text-align: center; }
  .sz-about-avatar { width: 80px; height: 80px; }
  .sz-about-avatar-mono { font-size: 32px; }
  .sz-about-title { font-size: 34px; }
  .sz-about-contact { margin-top: 48px; }
}

/* ===== 空状态 ===== */
.sz-empty { color: var(--sz-c-muted); font-size: 16px; padding: 32px 0; }
.sz-not-found { text-align: center; }
.sz-not-found .sz-search-form { max-width: 520px; margin: 28px auto; }
.sz-not-found .sz-back-home { display: inline-flex; margin-top: 8px; }

/* ===== 分页 ===== */
.sz-pagination { margin-top: 56px; }
.sz-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sz-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 12px;
  border: 1px solid var(--sz-c-border); border-radius: 10px;
  color: var(--sz-c-muted); font-size: 14px;
}
.sz-pagination a.page-numbers:hover { border-color: var(--sz-c-accent); color: var(--sz-c-accent); text-decoration: none; }
.sz-pagination .page-numbers.current { background: var(--sz-c-ink); border-color: var(--sz-c-ink); color: #fff; }

/* ===== 页脚 ===== */
.sz-site-footer {
  background: var(--sz-c-bg-soft);
  border-top: 1px solid var(--sz-c-border);
  padding: 56px 0;
  margin-top: 24px;
}
.sz-footer-inner { text-align: center; }
.sz-footer-name { font-size: 16px; font-weight: 600; color: var(--sz-c-ink); }
.sz-footer-note { font-size: 13px; color: var(--sz-c-muted); margin: 10px 0 0; }
.sz-footer-beian { font-size: 13px; margin: 8px 0 0; }
.sz-footer-beian a { color: var(--sz-c-muted); text-decoration: none; }
.sz-footer-beian a:hover { color: var(--sz-c-accent); text-decoration: underline; }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .sz-single-wrap--tool,
  .sz-page-wrap--tool { max-width: var(--sz-container-narrow); }
  .sz-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .sz-hero-logo { font-size: 48px; }
}

@media (max-width: 720px) {
  .sz-nav-toggle { display: flex; }

  .sz-site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--sz-c-border);
    display: none;
  }
  .sz-site-nav.is-open { display: block; }

  .sz-nav-list { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 16px; }
  .sz-nav-list li { width: 100%; }
  .sz-nav-list a { display: block; padding: 12px 0; font-size: 16px; }

  .sz-hero { padding: 72px 0 32px; }
  .sz-hero-logo { font-size: 40px; }
  .sz-hero-sub { font-size: 17px; }

  .sz-posts-grid { grid-template-columns: 1fr; }
  .sz-post-title { font-size: 32px; }
  .sz-page-title { font-size: 34px; }
  .sz-section-head { flex-direction: column; gap: 8px; }
}
