/*
Theme Name: 郎中志
Theme URI: https://findme.my.id
Author: findme
Description: 参照 veryjack.com 设计语言的单栏极简博客主题：白底蓝点缀、悬浮玻璃胶囊导航、双列文章卡片、分类横向轨道、自动目录、深色模式、完整移动端适配。
Version: 1.0.1
Requires at least: 5.9
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: langzhong
Tags: blog, two-columns, custom-menu, featured-images, translation-ready
*/

/* =====================================================
   1. 设计变量（改这里即可全站换色）
   ===================================================== */
:root {
  --bg: #fdfdfa;
  --bg-soft: #f6f6f2;
  --card: #ffffff;
  --ink: #293241;
  --ink-soft: #5c6672;
  --ink-faint: #98a1ab;
  --accent: #477ea2;
  --accent-soft: #7db9de;
  --line: #e8e8e2;
  --radius: 24px;
  --radius-sm: 14px;
  --nav-h: 64px;
  --wrap: 1120px;
  --font: "Avenir Next", "Avenir", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --shadow: 0 10px 40px rgba(41, 50, 65, 0.08);
  --shadow-lift: 0 16px 48px rgba(41, 50, 65, 0.14);
  --glass: rgba(255, 255, 255, 0.72);
}

/* 深色模式 */
html.dark {
  --bg: #171b21;
  --bg-soft: #1d232b;
  --card: #212832;
  --ink: #e6e9ee;
  --ink-soft: #a7b0bb;
  --ink-faint: #6d7783;
  --accent-soft: #5e93b8;
  --line: #2c3440;
  --glass: rgba(29, 35, 43, 0.72);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* =====================================================
   2. 基础重置
   ===================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.8;
  transition: background 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
::selection { background: var(--accent-soft); color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

/* =====================================================
   3. 阅读进度条
   ===================================================== */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  z-index: 200; transition: width 0.1s linear;
  border-radius: 0 3px 3px 0;
}

/* =====================================================
   4. 悬浮玻璃胶囊导航
   ===================================================== */
.site-header {
  position: fixed; top: 18px; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: center; pointer-events: none;
}
.nav-shell {
  pointer-events: auto;
  display: flex; align-items: center; gap: 22px;
  width: min(920px, calc(100% - 40px));
  height: var(--nav-h);
  padding: 0 12px 0 20px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--card);
  box-shadow: 0 2px 8px rgba(41, 50, 65, 0.15);
}
.brand-avatar-placeholder {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: 0.02em; white-space: nowrap; }

.nav-menu { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-menu ul { display: flex; align-items: center; gap: 2px; }
.nav-menu a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-size: 14.5px; color: var(--ink-soft); font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.nav-menu a:hover, .nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
  color: var(--ink); background: rgba(125, 185, 222, 0.14);
}

.nav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); transition: background 0.2s, color 0.2s;
}
.nav-btn:hover { background: rgba(125, 185, 222, 0.16); color: var(--ink); }
.nav-btn svg { width: 18px; height: 18px; }

.menu-toggle { display: none; }

/* 移动端导航 */
@media (max-width: 760px) {
  .nav-shell { height: 56px; gap: 10px; padding: 0 8px 0 14px; }
  .brand-name { font-size: 15px; }
  .menu-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-lift);
    padding: 10px; margin-left: 0;
  }
  .nav-menu.open { display: block; }
  .nav-menu ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-menu a { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 15px; }
  .nav-shell { position: relative; }
}

/* =====================================================
   5. 搜索浮层
   ===================================================== */
.search-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(23, 27, 33, 0.45);
  backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 15vh 20px 0;
}
.search-overlay.open { display: flex; }
.search-box {
  width: min(560px, 100%);
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); overflow: hidden;
  border: 1px solid var(--line);
}
.search-box form { display: flex; align-items: center; padding: 6px 8px 6px 20px; }
.search-box input[type="search"] {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 17px; color: var(--ink); padding: 14px 8px;
}
.search-box button[type="submit"] {
  background: var(--accent); color: #fff; border-radius: 999px;
  padding: 10px 22px; font-size: 14px; font-weight: 600;
  transition: opacity 0.2s;
}
.search-box button[type="submit"]:hover { opacity: 0.88; }
.search-hint {
  padding: 10px 20px 14px; font-size: 12px; color: var(--ink-faint);
  border-top: 1px solid var(--line);
}
.search-hint kbd {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; font-size: 11px; margin: 0 2px;
}

/* =====================================================
   6. 首页 Hero
   ===================================================== */
.hero { padding: 170px 0 40px; }
.hero-grid {
  display: flex; align-items: center; gap: 56px;
}
.hero-text { flex: 1; min-width: 0; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.08em; margin-bottom: 18px;
}
.hero-kicker::before {
  content: ""; width: 26px; height: 2px; background: var(--accent-soft);
  border-radius: 2px;
}
.hero-title {
  font-size: clamp(34px, 5vw, 54px); font-weight: 800;
  line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 18px;
}
.hero-title span { color: var(--accent); }
.hero-sub {
  font-size: 16.5px; color: var(--ink-soft); max-width: 560px;
  line-height: 2;
}
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px;
  font-size: 15px; font-weight: 600; transition: all 0.25s ease;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--accent-soft); color: var(--accent); }

.hero-avatar-card {
  flex-shrink: 0; transform: rotate(3deg);
  transition: transform 0.4s ease;
}
.hero-avatar-card:hover { transform: rotate(0deg) scale(1.02); }
.hero-avatar-card img, .hero-avatar-card .ph {
  width: 250px; height: 250px; border-radius: var(--radius);
  object-fit: cover; box-shadow: var(--shadow-lift);
  border: 6px solid var(--card);
}
.hero-avatar-card .ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff; font-size: 56px; font-weight: 800;
}
@media (max-width: 860px) {
  .hero { padding: 140px 0 24px; }
  .hero-grid { flex-direction: column-reverse; gap: 36px; text-align: center; }
  .hero-text { display: flex; flex-direction: column; align-items: center; }
  .hero-avatar-card { transform: rotate(-2deg); }
  .hero-avatar-card img, .hero-avatar-card .ph { width: 190px; height: 190px; }
}

/* =====================================================
   7. 板块标题
   ===================================================== */
.section { padding: 42px 0; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 26px; }
.section-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.section-link { margin-left: auto; font-size: 14px; color: var(--ink-faint); transition: color 0.2s; }
.section-link:hover { color: var(--accent); }

/* =====================================================
   8. 双列文章卡片
   ===================================================== */
.post-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px;
}
@media (max-width: 760px) { .post-grid { grid-template-columns: 1fr; gap: 20px; } }

.post-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: transparent; }
.post-card-thumb {
  aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft);
}
.post-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.post-card-thumb-none {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--accent-soft) 130%);
  display: flex; align-items: center; justify-content: center;
}
.post-card-thumb-none span {
  color: #fff; font-size: 26px; font-weight: 800; opacity: 0.85;
}
.post-card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card-cat {
  font-size: 12.5px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.06em; margin-bottom: 8px;
}
.post-card-title { font-size: 19px; font-weight: 700; line-height: 1.5; margin-bottom: 10px; }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt {
  font-size: 14.5px; color: var(--ink-soft); line-height: 1.9;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  margin-top: auto; padding-top: 16px;
  display: flex; align-items: center; gap: 14px;
  font-size: 12.5px; color: var(--ink-faint);
}
.post-card-meta svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }

/* =====================================================
   9. 分类横向滚动轨道
   ===================================================== */
.cat-rail {
  display: flex; gap: 18px; overflow-x: auto;
  padding: 6px 4px 18px; cursor: grab; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.cat-rail::-webkit-scrollbar { display: none; }
.cat-rail.dragging { cursor: grabbing; scroll-snap-type: none; }
.cat-tile {
  flex: 0 0 220px; scroll-snap-align: start;
  border-radius: var(--radius); padding: 24px 22px;
  min-height: 130px; display: flex; flex-direction: column;
  color: #fff; position: relative; overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.cat-tile:nth-child(4n+1) { background: linear-gradient(135deg, #7db9de, #477ea2); }
.cat-tile:nth-child(4n+2) { background: linear-gradient(135deg, #8fbf9f, #4e8a63); }
.cat-tile:nth-child(4n+3) { background: linear-gradient(135deg, #e8b98a, #b0713c); }
.cat-tile:nth-child(4n+4) { background: linear-gradient(135deg, #b9a7d9, #6f5b9c); }
.cat-tile-name { font-size: 19px; font-weight: 800; }
.cat-tile-count { margin-top: auto; font-size: 13px; opacity: 0.85; }

/* =====================================================
   10. 列表页 / 归档
   ===================================================== */
.page-head { padding: 150px 0 10px; }
.page-title { font-size: clamp(30px, 4vw, 42px); font-weight: 800; margin-bottom: 10px; }
.page-desc { color: var(--ink-soft); font-size: 15.5px; }
.breadcrumbs { font-size: 13px; color: var(--ink-faint); margin-bottom: 8px; }
.breadcrumbs a:hover { color: var(--accent); }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 44px 0 20px; }
.pagination .page-numbers {
  min-width: 42px; height: 42px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 14.5px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft);
  transition: all 0.2s;
}
.pagination .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pagination .page-numbers:hover:not(.current) { border-color: var(--accent-soft); color: var(--accent); }

/* =====================================================
   11. 文章详情
   ===================================================== */
.single-wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.single-head { padding: 150px 0 30px; text-align: center; }
.single-cat { font-size: 13.5px; color: var(--accent); font-weight: 600; letter-spacing: 0.08em; margin-bottom: 14px; }
.single-title { font-size: clamp(28px, 4.5vw, 40px); font-weight: 800; line-height: 1.35; margin-bottom: 18px; }
.single-meta {
  display: flex; justify-content: center; align-items: center; gap: 18px;
  font-size: 13.5px; color: var(--ink-faint); flex-wrap: wrap;
}
.single-meta .meta-author { display: flex; align-items: center; gap: 7px; }
.single-meta img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

.single-thumb { margin: 34px 0 0; }
.single-thumb img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }

/* 目录卡片 */
.toc-card {
  margin: 40px 0 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; display: flex; gap: 26px;
}
.toc-card-title {
  writing-mode: vertical-lr; letter-spacing: 0.35em;
  font-size: 14px; font-weight: 800; color: var(--accent);
  border-right: 1px solid var(--line); padding-right: 20px; flex-shrink: 0;
}
.toc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; flex: 1; }
.toc-list a {
  display: block; font-size: 14px; color: var(--ink-soft);
  padding: 5px 0; line-height: 1.6; transition: color 0.2s;
}
.toc-list a:hover { color: var(--accent); }
.toc-list a .toc-num {
  color: var(--accent); font-weight: 700; margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .toc-card { flex-direction: column; gap: 14px; padding: 20px; }
  .toc-card-title { writing-mode: horizontal-tb; border-right: none; padding-right: 0; letter-spacing: 0.2em; }
  .toc-list { grid-template-columns: 1fr; }
}

/* 正文排版（veryjack 同款） */
.entry-content { padding: 30px 0 20px; font-size: 16px; line-height: 2.05; color: var(--ink); }
.entry-content > * + * { margin-top: 1.15em; }
.entry-content p { margin-top: 1.15em; }
.entry-content h2 {
  font-size: 23px; font-weight: 800; line-height: 1.5; margin-top: 2.2em;
  padding-bottom: 10px; position: relative;
}
.entry-content h2::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 44px; height: 3px; border-radius: 3px;
  background: var(--accent-soft);
}
.entry-content h3 { font-size: 19px; font-weight: 700; margin-top: 1.9em; }
.entry-content a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.entry-content a:hover { color: var(--accent-soft); }
.entry-content blockquote {
  border-left: 3px solid var(--accent-soft);
  background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 22px; color: var(--ink-soft); font-size: 15px;
}
.entry-content ul, .entry-content ol { padding-left: 26px; }
.entry-content ul li { list-style: disc; margin: 6px 0; }
.entry-content ol li { list-style: decimal; margin: 6px 0; }
.entry-content li::marker { color: var(--accent-soft); font-weight: 700; }
.entry-content img { border-radius: var(--radius-sm); margin: 1.6em auto; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { text-align: center; font-size: 13px; color: var(--ink-faint); margin-top: 8px; }
.entry-content code {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 7px; font-size: 14px;
  font-family: "JetBrains Mono", Consolas, monospace;
}
.entry-content pre {
  background: #1d232b; color: #dce3ec; border-radius: var(--radius-sm);
  padding: 22px 24px; overflow-x: auto; line-height: 1.7;
}
.entry-content pre code { background: none; border: none; color: inherit; padding: 0; }
.entry-content hr { border: none; border-top: 1px solid var(--line); margin: 2.5em 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.entry-content th { background: var(--bg-soft); font-weight: 700; }

/* 标签 & 上下篇 */
.single-tags { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 0 30px; }
.single-tags a {
  font-size: 13px; color: var(--ink-soft);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px; transition: all 0.2s;
}
.single-tags a:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 10px 0 60px; }
.post-nav a {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 22px;
  transition: all 0.25s; display: block;
}
.post-nav a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-nav .next { text-align: right; }
.post-nav .label { font-size: 12px; color: var(--ink-faint); display: block; margin-bottom: 5px; }
.post-nav .title { font-size: 15px; font-weight: 700; line-height: 1.5; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }

/* =====================================================
   12. 页面 / 评论
   ===================================================== */
.page-content { padding: 26px 0 60px; }
.comments-area { margin: 30px 0 70px; }
.comment-list .comment {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 22px; margin-bottom: 14px;
}
.comment-list .children { margin-left: 34px; }
.comment-form textarea, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"] {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink); padding: 12px 16px;
  font-size: 14.5px; outline: none; transition: border-color 0.2s;
}
.comment-form textarea:focus, .comment-form input:focus { border-color: var(--accent-soft); }
.comment-form .submit {
  background: var(--ink); color: var(--bg); border-radius: 999px;
  padding: 12px 30px; font-weight: 600; font-size: 14.5px; transition: background 0.2s;
}
.comment-form .submit:hover { background: var(--accent); color: #fff; }
.comment-reply-title, .comments-title { font-size: 18px; font-weight: 800; margin-bottom: 14px; }

/* =====================================================
   13. 页脚
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px;
  padding: 40px 0 110px; text-align: center;
}
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.footer-social { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft);
  transition: all 0.2s;
}
.footer-social a:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.footer-social svg { width: 17px; height: 17px; }
.footer-text { font-size: 13px; color: var(--ink-faint); line-height: 2; }
.footer-text a:hover { color: var(--accent); }

/* 回到顶部 */
.back-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all 0.3s ease;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { background: var(--accent); color: #fff; }
.back-top svg { width: 18px; height: 18px; }

/* 404 */
.error-404 { text-align: center; padding: 170px 0 90px; }
.error-404 .code { font-size: 90px; font-weight: 800; color: var(--accent-soft); line-height: 1; }
.error-404 p { color: var(--ink-soft); margin: 18px 0 26px; }

/* 搜索结果/归档提示 */
.no-results { padding: 30px 0 60px; color: var(--ink-soft); }
