/*
Theme Name: CardPress
Theme URI: https://example.com/cardpress
Author: CardPress Dev
Author URI: https://example.com
Description: 一款原创的现代清爽风格 WordPress 主题，内置卡片式首页、明暗双主题、用户中心、文章点赞与打赏、阅读进度条、自动目录、代码高亮、热门文章等特性，适合内容站与资源站使用。
Version: 1.1.0
Requires at least: 5.9
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cardpress
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, translation-ready, threaded-comments
*/

/* ============================================================
   设计变量（明亮 / 暗黑 双主题）
   ============================================================ */
:root {
  --cp-bg: #f5f6fa;
  --cp-surface: #ffffff;
  --cp-surface-2: #f0f2f5;
  --cp-text: #24292f;
  --cp-muted: #6b7280;
  --cp-border: #e5e7eb;
  --cp-primary: #3b82f6;
  --cp-primary-2: #7c3aed;
  --cp-primary-soft: rgba(59, 130, 246, 0.12);
  --cp-grad: linear-gradient(135deg, var(--cp-primary), var(--cp-primary-2));
  --cp-grad-soft: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(124, 58, 237, 0.10));
  --cp-header-bg: rgba(255, 255, 255, 0.82);
  --cp-accent: #f59e0b;
  --cp-danger: #ef4444;
  --cp-radius: 14px;
  --cp-radius-sm: 10px;
  --cp-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  --cp-shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.10);
  --cp-header-h: 60px;
  --cp-max: 1200px;
}
html[data-theme="dark"] {
  --cp-bg: #101318;
  --cp-surface: #1a1e26;
  --cp-surface-2: #222833;
  --cp-text: #e5e7eb;
  --cp-muted: #9ca3af;
  --cp-border: #2b3240;
  --cp-primary: #60a5fa;
  --cp-primary-2: #a78bfa;
  --cp-primary-soft: rgba(96, 165, 250, 0.16);
  --cp-grad-soft: linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(167, 139, 250, 0.14));
  --cp-header-bg: rgba(26, 30, 38, 0.85);
  --cp-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  --cp-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   基础
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--cp-text);
  background: var(--cp-bg);
  transition: background 0.25s ease, color 0.25s ease;
}
a { color: var(--cp-primary); text-decoration: none; transition: opacity 0.15s ease; }
a:hover { opacity: 0.85; }
img { max-width: 100%; height: auto; }
/* 全局滚动条（科技感细条，跟随主题色） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cp-border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--cp-primary); }
/* 输入框聚焦呼吸环 */
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--cp-primary);
  box-shadow: 0 0 0 3px var(--cp-primary-soft);
}
blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 4px solid var(--cp-primary);
  background: var(--cp-primary-soft);
  border-radius: 0 var(--cp-radius-sm) var(--cp-radius-sm) 0;
  color: var(--cp-muted);
}
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--cp-border); padding: 8px 12px; text-align: left; }
hr { border: none; border-top: 1px solid var(--cp-border); }

.container { max-width: var(--cp-max); margin: 0 auto; padding: 0 16px; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}

/* ============================================================
   阅读进度条
   ============================================================ */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--cp-primary), var(--cp-accent));
  z-index: 9999; transition: width 0.08s linear; pointer-events: none;
}

/* ============================================================
   顶栏
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: var(--cp-header-bg);
  border-bottom: 1px solid var(--cp-border);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  height: var(--cp-header-h);
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.site-title {
  font-size: 20px; font-weight: 800; color: var(--cp-text);
  letter-spacing: 0.5px;
  background: var(--cp-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.custom-logo { max-height: 40px; width: auto; }
.main-nav { flex: 1; min-width: 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a {
  position: relative;
  display: block; padding: 8px 14px; border-radius: var(--cp-radius-sm);
  color: var(--cp-text); font-weight: 500; font-size: 14.5px;
  transition: color 0.2s ease, background 0.2s ease;
}
.main-nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
  border-radius: 2px; background: var(--cp-grad);
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.25s ease;
}
.main-nav a:hover, .main-nav .current-menu-item > a {
  background: var(--cp-primary-soft); color: var(--cp-primary);
}
.main-nav a:hover::after, .main-nav .current-menu-item > a::after { transform: scaleX(1); }
.main-nav .sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 160px;
  background: var(--cp-surface); border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius-sm); box-shadow: var(--cp-shadow-lg);
  display: none; flex-direction: column; padding: 6px;
}
.main-nav li:hover > .sub-menu { display: flex; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--cp-border); background: transparent;
  color: var(--cp-text); cursor: pointer; transition: background 0.15s;
}
.icon-btn:hover { background: var(--cp-primary-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.header-avatar img { width: 32px; height: 32px; border-radius: 50%; display: block; }
.menu-toggle { display: none; }
.header-search { display: none; border-top: 1px solid var(--cp-border); padding: 12px 0; }
.header-search.open { display: block; }

/* ============================================================
   布局
   ============================================================ */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px; padding-top: 24px; padding-bottom: 48px; align-items: start;
}
.content { min-width: 0; }
.sidebar { position: sticky; top: calc(var(--cp-header-h) + 16px); }

/* ============================================================
   首页卡片流
   ============================================================ */
.card-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 992px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
.post-card {
  position: relative;
  background: var(--cp-surface); border-radius: var(--cp-radius);
  overflow: hidden; box-shadow: var(--cp-shadow);
  border: 1px solid var(--cp-border);
  display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.post-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  border-radius: var(--cp-radius);
  padding: 1px;
  background: var(--cp-grad);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.25s ease;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--cp-shadow-lg); }
.post-card:hover::before { opacity: 0.9; }
.post-card-thumb { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--cp-surface-2); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.06); }
.post-card-new {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 2px 9px; border-radius: 8px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
}
.post-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.post-card-cat {
  font-size: 12px; color: var(--cp-primary); background: var(--cp-primary-soft);
  border: 1px solid var(--cp-primary-soft);
  padding: 2px 10px; border-radius: 99px; align-self: flex-start;
}
.post-card-title {
  margin: 0; font-size: 16px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-title a { color: var(--cp-text); }
.post-card-excerpt {
  margin: 0; color: var(--cp-muted); font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-meta {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--cp-muted); font-size: 12px; padding-top: 10px;
  border-top: 1px solid var(--cp-border);
}
.pcm-date { letter-spacing: 0.2px; }
.pcm-stats { display: flex; align-items: center; gap: 12px; }
.pcm-item { display: inline-flex; align-items: center; gap: 4px; }
.pcm-item svg { width: 14px; height: 14px; opacity: 0.75; }
.pcm-item:hover { color: var(--cp-primary); }

/* ============================================================
   列表页头 / 分页
   ============================================================ */
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; }
.page-head p { margin: 0; color: var(--cp-muted); }
.pagination { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: var(--cp-radius-sm); background: var(--cp-surface);
  border: 1px solid var(--cp-border); color: var(--cp-text); font-size: 14px;
}
.pagination .page-numbers.current { background: var(--cp-primary); border-color: var(--cp-primary); color: #fff; }

/* ============================================================
   文章页
   ============================================================ */
.post-single {
  background: var(--cp-surface); border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius); box-shadow: var(--cp-shadow);
  padding: 28px;
}
.breadcrumb { font-size: 13px; color: var(--cp-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--cp-muted); }
.breadcrumb a:hover { color: var(--cp-primary); }
.post-title { margin: 0 0 12px; font-size: 26px; line-height: 1.35; }
.post-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--cp-muted); font-size: 13px; }
.post-meta a { color: var(--cp-muted); }
.post-thumb { margin: 18px 0; border-radius: var(--cp-radius-sm); overflow: hidden; }
.post-content { margin-top: 18px; font-size: 15.5px; }
.post-content h2, .post-content h3, .post-content h4 { margin: 1.6em 0 0.6em; line-height: 1.4; }
.post-content h2 { font-size: 21px; padding-left: 12px; border-left: 4px solid var(--cp-primary); }
.post-content h3 { font-size: 18px; }
.post-content p { margin: 0.8em 0; }
.post-content pre {
  background: var(--cp-surface-2); border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius-sm); padding: 14px; overflow-x: auto; font-size: 13.5px;
}
.post-content code { background: var(--cp-surface-2); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.post-content pre code { background: none; padding: 0; }
.post-content img { border-radius: var(--cp-radius-sm); }
.post-content ul, .post-content ol { padding-left: 1.4em; }

.post-tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a {
  font-size: 12.5px; color: var(--cp-muted);
  border: 1px solid var(--cp-border); border-radius: 99px; padding: 3px 12px;
}
.post-tags a:hover { color: var(--cp-primary); border-color: var(--cp-primary); }

.post-actions { margin-top: 22px; display: flex; gap: 12px; justify-content: center; }
.action-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 99px; border: 1px solid var(--cp-border);
  background: var(--cp-surface); color: var(--cp-text);
  font-size: 14px; cursor: pointer; transition: all 0.15s ease;
}
.action-btn svg { width: 17px; height: 17px; }
.action-btn:hover { border-color: var(--cp-primary); color: var(--cp-primary); }
.action-btn.liked { background: var(--cp-primary-soft); border-color: var(--cp-primary); color: var(--cp-primary); }
.action-btn.tip-btn:hover { border-color: var(--cp-accent); color: var(--cp-accent); }

/* 打赏弹窗 */
.tip-modal {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5); align-items: center; justify-content: center; padding: 16px;
}
.tip-modal.open { display: flex; }
.tip-modal-inner {
  background: var(--cp-surface); border-radius: var(--cp-radius);
  padding: 26px; max-width: 460px; width: 100%; text-align: center;
  box-shadow: var(--cp-shadow-lg); position: relative;
}
.tip-modal-close {
  position: absolute; top: 10px; right: 10px; border: none; background: none;
  font-size: 20px; cursor: pointer; color: var(--cp-muted);
}
.tip-qr-wrap { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.tip-qr-item img { width: 170px; height: 170px; object-fit: contain; border-radius: var(--cp-radius-sm); border: 1px solid var(--cp-border); }
.tip-qr-item p { margin: 6px 0 0; font-size: 13px; color: var(--cp-muted); }
.tip-empty { color: var(--cp-muted); font-size: 14px; padding: 10px 0 4px; }

/* 作者框 & 相关文章 */
.author-box {
  margin-top: 26px; display: flex; gap: 16px; align-items: center;
  background: var(--cp-surface-2); border-radius: var(--cp-radius-sm); padding: 18px;
}
.author-box img { width: 60px; height: 60px; border-radius: 50%; }
.author-box h3 { margin: 0 0 4px; font-size: 16px; }
.author-box p { margin: 0; color: var(--cp-muted); font-size: 13.5px; }
.related-posts { margin-top: 26px; }
.related-posts h3, .comments-title { font-size: 18px; }
/* 单排横向滑动（悬浮箭头导航） */
.related-wrap { position: relative; margin-top: 12px; }
.related-scroll {
  display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
}
.related-scroll::-webkit-scrollbar { display: none; }
.related-nav {
  position: absolute; top: 50%; z-index: 5;
  transform: translateY(-50%) scale(0.85);
  width: 38px; height: 38px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: var(--cp-text);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.related-nav svg { width: 18px; height: 18px; }
.related-nav-prev { left: -14px; }
.related-nav-next { right: -14px; }
.related-wrap:hover .related-nav { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }
.related-nav:hover { background: var(--cp-primary); color: #fff; }
.related-nav[disabled] { opacity: 0 !important; pointer-events: none; }
.related-card { flex: 0 0 220px; scroll-snap-align: start; }
.related-card-media {
  position: relative; display: block; aspect-ratio: 10 / 7; overflow: hidden;
  border-radius: var(--cp-radius-sm); background: var(--cp-surface-2);
}
.related-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.related-card:hover .related-card-media img { transform: scale(1.08); }
.related-card-mask {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.18) 42%, transparent 65%);
}
.related-card-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px;
  color: #fff; display: flex; flex-direction: column; gap: 4px;
  transform: translateY(6px); transition: transform 0.3s ease;
}
.related-card:hover .related-card-info { transform: translateY(0); }
.related-card-title { font-size: 13px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-card-meta {
  display: flex; gap: 10px; font-size: 11.5px; opacity: 0.85;
  opacity: 0; transform: translateY(6px); transition: all 0.3s ease;
}
.related-card:hover .related-card-meta { opacity: 0.9; transform: translateY(0); }

/* ============================================================
   侧栏 / 小工具
   ============================================================ */
.widget {
  background: var(--cp-surface); border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius); box-shadow: var(--cp-shadow);
  padding: 18px; margin-bottom: 18px;
}
.widget-title {
  position: relative;
  font-size: 15.5px; font-weight: 700; margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--cp-border);
}
.widget-title::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 42px; height: 2.5px;
  border-radius: 2px; background: var(--cp-grad);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-bottom: 1px dashed var(--cp-border); font-size: 14px; }
.widget li:last-child { border-bottom: none; }
.hot-item { display: flex; gap: 10px; align-items: flex-start; }
.hot-index {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px;
  background: var(--cp-primary-soft); color: var(--cp-primary);
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center; margin-top: 3px;
}
.hot-item:nth-child(1) .hot-index, .hot-item:nth-child(2) .hot-index, .hot-item:nth-child(3) .hot-index {
  background: var(--cp-danger); color: #fff;
}
.hot-item a { color: var(--cp-text); flex: 1; font-size: 13.5px; line-height: 1.5; }
.hot-item .hot-views { color: var(--cp-muted); font-size: 12px; flex-shrink: 0; margin-top: 4px; }

/* ---------- 热门文章（TOP1 大图 + TOP2+ 小图行） ---------- */
.hot-list { display: flex; flex-direction: column; }
.hot-hero { position: relative; border-radius: var(--cp-radius-sm); overflow: hidden; }
.hot-hero-media { position: relative; display: block; aspect-ratio: 5 / 3; overflow: hidden; background: var(--cp-surface-2); }
.hot-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.hot-hero:hover .hot-hero-media img { transform: scale(1.06); }
.hot-hero-mask { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,23,42,.78) 0%, rgba(15,23,42,.12) 45%, transparent 68%); }
.hot-hero-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px; color: #fff; display: flex; flex-direction: column; gap: 6px; }
.hot-hero-badge {
  align-self: flex-start; font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: var(--cp-primary); color: #fff;
}
.hot-hero-title { font-size: 13.5px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hot-row { position: relative; display: flex; gap: 10px; margin-top: 14px; }
.hot-row-thumb { flex: 0 0 96px; display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--cp-radius-sm); background: var(--cp-surface-2); }
.hot-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.hot-row:hover .hot-row-thumb img { transform: scale(1.07); }
.hot-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.hot-row-title { color: var(--cp-text); font-size: 13px; font-weight: 500; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hot-row:hover .hot-row-title { color: var(--cp-primary); }
.hot-row-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--cp-muted); font-size: 11.5px; }
.hot-top {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 11px; font-weight: 700; font-style: normal;
  padding: 2px 7px; border-radius: 7px; color: #fff;
  background: linear-gradient(135deg, #64748b, #475569);
}
.hot-hero .hot-top { top: 10px; left: 10px; font-size: 13px; padding: 3px 9px; border-radius: 9px; }
.hot-top1 { background: linear-gradient(135deg, #f97316, #ef4444); }
.hot-top2 { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.hot-top3 { background: linear-gradient(135deg, #f59e0b, #ea580c); }

/* ---------- 标签云（子比风格彩色胶囊） ---------- */
.cp-tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-tag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px 12px; border-radius: 99px; font-size: 12.5px;
  border: 1px solid var(--cp-border); color: var(--cp-text);
  transition: all 0.2s ease;
}
.cp-tag .cp-tag-count { font-size: 10.5px; opacity: 0.75; }
.cp-tag:hover { transform: translateY(-2px); color: #fff !important; border-color: transparent; }
.cp-tag.c-blue   { color: #2563eb; } .cp-tag.c-blue:hover   { background: #3b82f6; }
.cp-tag.c-green  { color: #059669; } .cp-tag.c-green:hover  { background: #10b981; }
.cp-tag.c-purple { color: #7c3aed; } .cp-tag.c-purple:hover { background: #8b5cf6; }
.cp-tag.c-red    { color: #dc2626; } .cp-tag.c-red:hover    { background: #ef4444; }
.cp-tag.c-yellow { color: #b45309; } .cp-tag.c-yellow:hover { background: #f59e0b; }
.cp-tag.c-blue2   { color: #0284c7; } .cp-tag.c-blue2:hover   { background: #0ea5e9; }
.cp-tag.c-green2  { color: #16a34a; } .cp-tag.c-green2:hover  { background: #22c55e; }
.cp-tag.c-purple2 { color: #9333ea; } .cp-tag.c-purple2:hover { background: #a855f7; }
.cp-tag.c-red2    { color: #e11d48; } .cp-tag.c-red2:hover    { background: #f43f5e; }
[data-theme="dark"] .cp-tag { border-color: rgba(148, 163, 184, 0.25); }

/* ---------- 统一渐变按钮体系 ---------- */
.load-more-btn,
.fav-btn:not(.fav-active),
.like-btn,
.search-form button[type="submit"],
#commentform input[type="submit"],
.checkin-btn {
  border: none; color: #fff !important;
  background: var(--cp-grad);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
  transition: all 0.22s ease;
}
.load-more-btn:hover,
.fav-btn:not(.fav-active):hover,
.like-btn:hover,
.search-form button[type="submit"]:hover,
#commentform input[type="submit"]:hover,
.checkin-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

/* ---------- 加载更多 ---------- */
.load-more-wrap { margin-top: 26px; text-align: center; }
.load-more-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 220px; padding: 11px 36px; border-radius: 99px;
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.load-more-btn.loading { opacity: 0.65; pointer-events: none; }
.load-more-btn.done {
  pointer-events: none; color: var(--cp-muted) !important;
  background: var(--cp-surface-2); box-shadow: none;
}

/* 目录导航 */
.toc-nav { max-height: 420px; overflow-y: auto; font-size: 13.5px; }
.toc-nav ul { list-style: none; margin: 0; padding: 0; }
.toc-nav .toc-h3 { padding-left: 16px; }
.toc-nav a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--cp-muted); }
.toc-nav a:hover, .toc-nav a.active { color: var(--cp-primary); background: var(--cp-primary-soft); }

/* ============================================================
   评论区
   ============================================================ */
.comments-area { margin-top: 24px; background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: var(--cp-radius); padding: 24px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { border-bottom: 1px solid var(--cp-border); padding: 14px 0; }
.comment-list .children { list-style: none; padding-left: 40px; }
.comment-author img { width: 40px; height: 40px; border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.comment-meta { font-size: 12.5px; color: var(--cp-muted); margin-top: 4px; }
.comment-content { margin-top: 8px; font-size: 14.5px; }
.comment-reply-link { font-size: 13px; }
.comment-form p { margin: 0 0 14px; }
/* 昵称 + 邮箱并排一行 */
.cp-cf-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cp-cf-row .comment-form-author, .cp-cf-row .comment-form-email {
  flex: 1 1 150px; margin: 0 0 14px;
}
.cp-cf-row .comment-form-author label, .cp-cf-row .comment-form-email label { display: block; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"],
.comment-form textarea, .search-form input, .wp-login-form input {
  width: 100%; padding: 10px 14px; border-radius: var(--cp-radius-sm);
  border: 1px solid var(--cp-border); background: var(--cp-surface-2);
  color: var(--cp-text); font-size: 14px; outline: none;
}
.comment-form input:focus, .comment-form textarea:focus, .search-form input:focus { border-color: var(--cp-primary); }
.comment-form .submit, .btn-primary, input[type="submit"] {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cp-primary); color: #fff; border: none;
  padding: 10px 24px; border-radius: var(--cp-radius-sm);
  font-size: 14px; cursor: pointer; transition: opacity 0.15s;
}
.comment-form .submit:hover, .btn-primary:hover, input[type="submit"]:hover { opacity: 0.88; }

/* 搜索表单 */
.search-form { display: flex; gap: 8px; }
.search-form .search-field { flex: 1; }

/* ============================================================
   用户中心
   ============================================================ */
.uc-hero {
  background: var(--cp-surface); border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius); box-shadow: var(--cp-shadow);
  padding: 26px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.uc-hero img.uc-avatar { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--cp-primary-soft); }
.uc-hero h1 { margin: 0 0 4px; font-size: 20px; }
.uc-hero .uc-email { color: var(--cp-muted); font-size: 13.5px; }
.uc-badges { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.uc-badge { font-size: 12px; background: var(--cp-primary-soft); color: var(--cp-primary); padding: 2px 10px; border-radius: 99px; }
.uc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin-top: 18px; }
.uc-stat {
  background: var(--cp-surface); border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius-sm); padding: 16px; text-align: center;
}
.uc-stat strong { display: block; font-size: 22px; color: var(--cp-primary); }
.uc-stat span { font-size: 13px; color: var(--cp-muted); }
.uc-panel { background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: var(--cp-radius); padding: 20px; margin-top: 18px; }
.uc-panel h2 { margin: 0 0 12px; font-size: 16px; }
.uc-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.uc-login-wrap { max-width: 380px; margin: 40px auto; background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: var(--cp-radius); padding: 28px; }
.login-remember { margin-top: 10px; font-size: 13.5px; }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  position: relative;
  margin-top: 30px; border-top: none;
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
  padding: 26px 0;
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--cp-grad);
}
.footer-inner { text-align: center; color: #94a3b8; font-size: 13.5px; }
.footer-inner a { color: #94a3b8; }
.footer-inner a:hover { color: #e2e8f0; opacity: 1; }
.footer-menu { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; list-style: none; padding: 0; }
.back-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 800;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--cp-grad); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all 0.25s ease;
}
.back-top:hover { filter: brightness(1.1); transform: translateY(-2px); }
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top svg { width: 18px; height: 18px; }

/* 网盘下载卡片（子比风格 · 渐变美化，配色跟随风格系统） */
.download-box {
  margin-top: 28px;
  background:
    linear-gradient(135deg, var(--cp-primary-soft), transparent 65%),
    var(--cp-surface-2);
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.download-box::before {
  content: "";
  position: absolute; top: -60px; right: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.14), transparent 70%);
  pointer-events: none;
}
.download-box-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px; font-size: 17px; font-weight: 700;
  background: linear-gradient(120deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  width: fit-content;
}
html[data-theme="dark"] .download-box-title {
  background: linear-gradient(120deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text; background-clip: text;
}
.download-box-title svg { width: 20px; height: 20px; color: var(--cp-primary); -webkit-text-fill-color: currentColor; }
.dl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dl-item {
  position: relative;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 12px;
  padding: 13px 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}
.dl-item::after {
  content: "";
  position: absolute; right: -34px; bottom: -34px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.13), transparent 70%);
  opacity: 0; transition: opacity 0.3s ease;
  pointer-events: none;
}
.dl-item:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.16);
}
.dl-item:hover::after { opacity: 1; }
.dl-icon {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: #fff; font-weight: 700; font-size: 16px;
  background: linear-gradient(135deg, #64748b, #94a3b8);
  box-shadow: 0 4px 10px rgba(100, 116, 139, 0.32);
  transition: transform 0.25s ease;
}
.dl-item:hover .dl-icon { transform: rotate(-6deg) scale(1.06); }
.dl-icon svg { width: 20px; height: 20px; color: #fff; }
.dl-pan-quark .dl-icon  { background: linear-gradient(135deg, #3d7eff, #00c6fb); box-shadow: 0 4px 12px rgba(61, 126, 255, 0.42); }
.dl-pan-baidu .dl-icon  { background: linear-gradient(135deg, #2196f3, #00b8a9); box-shadow: 0 4px 12px rgba(33, 150, 243, 0.40); }
.dl-pan-aliyun .dl-icon { background: linear-gradient(135deg, #6a5cff, #e552ff); box-shadow: 0 4px 12px rgba(106, 92, 255, 0.42); }
.dl-pan-lanzou .dl-icon { background: linear-gradient(135deg, #22c55e, #0ea5e9); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.40); }
.dl-pan-ctfile .dl-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.38); }
.dl-pan-magnet .dl-icon { background: linear-gradient(135deg, #475569, #1e293b); box-shadow: 0 4px 12px rgba(30, 41, 59, 0.40); }
.dl-name { font-weight: 700; font-size: 14.5px; }
.dl-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  padding: 8px 22px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
html[data-theme="dark"] .dl-btn { background: linear-gradient(135deg, #60a5fa, #a78bfa); box-shadow: 0 4px 14px rgba(96, 165, 250, 0.30); }
.dl-btn:hover {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.08);
  box-shadow: 0 7px 20px rgba(139, 92, 246, 0.45);
}
.dl-btn svg { width: 14px; height: 14px; transition: transform 0.25s ease; }
.dl-btn:hover svg { transform: translate(2px, -2px); }
.dl-pwd { color: var(--cp-muted); font-size: 13.5px; }
.dl-pwd code { background: var(--cp-surface-2); padding: 2px 8px; border-radius: 6px; }
.dl-copy {
  margin-left: 6px; border: 1px solid var(--cp-border); background: var(--cp-surface);
  color: var(--cp-muted); border-radius: 6px; padding: 2px 10px;
  font-size: 12px; cursor: pointer; transition: all 0.2s ease;
}
.dl-copy:hover { color: #8b5cf6; border-color: #8b5cf6; }
.dl-tip {
  margin: 14px 0 0; font-size: 12.5px; color: var(--cp-muted);
  display: flex; align-items: center; gap: 6px;
}
.dl-tip::before {
  content: ""; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}
.dl-locked {
  text-align: center; padding: 14px;
  border: 1px dashed var(--cp-border); border-radius: var(--cp-radius-sm);
  background: var(--cp-surface);
}
.dl-locked p { color: var(--cp-muted); font-size: 14px; }

/* 404 */
.error-404 { text-align: center; padding: 70px 16px; }
.error-404 .code { font-size: 90px; font-weight: 800; color: var(--cp-primary); line-height: 1; }
.error-404 p { color: var(--cp-muted); }
.error-404 .search-form { max-width: 380px; margin: 20px auto 0; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 992px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .menu-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; top: var(--cp-header-h); left: 0; right: 0;
    background: var(--cp-surface); border-bottom: 1px solid var(--cp-border);
    box-shadow: var(--cp-shadow-lg); padding: 10px 16px 16px;
  }
  .main-nav.open {
    display: block;
    max-height: calc(100vh - var(--cp-header-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .main-nav ul { flex-direction: column; gap: 2px; }
  /* 手机端子菜单默认收起，点击父级展开/收起 */
  .main-nav .sub-menu { position: static; display: none; box-shadow: none; border: none; padding-left: 14px; }
  .main-nav li.sub-open > .sub-menu { display: block; }
  .main-nav li.menu-item-has-children > a { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .main-nav li.menu-item-has-children > a::after {
    content: "▸"; position: static; width: auto; height: auto; left: auto; right: auto; bottom: auto;
    background: none; transform: none; transition: transform 0.2s ease; font-size: 13px; color: var(--cp-muted);
  }
  .main-nav li.sub-open > a::after { transform: rotate(90deg); }
  /* 菜单展开时锁定背景页面滚动 */
  body.cp-nav-lock { overflow: hidden; }
  /* 全屏遮罩：点菜单外区域收起（置于吸顶头之下，保证汉堡按钮可点） */
  .cp-nav-overlay {
    display: none; position: fixed; inset: 0; top: var(--cp-header-h);
    background: rgba(0, 0, 0, 0.45); z-index: 899;
  }
  .cp-nav-overlay.show { display: block; }
  /* 禁用双击缩放对点击的拦截（真机连点汉堡/菜单项时常见吞点击） */
  .menu-toggle, .main-nav a { touch-action: manipulation; }
}
}
@media (max-width: 560px) {
  .post-single { padding: 18px; }
  .post-title { font-size: 21px; }
  .card-grid { grid-template-columns: 1fr; }
  .header-actions .hide-sm { display: none; }
}

/* ============================================================
 * P0 商业闭环样式（购买面板 / 弹窗登录 / Toast）
 * ========================================================== */
.cp-lock-box {
	background: var(--card-bg, #fff);
	border: 1px dashed var(--border-color, #d0d7de);
	border-radius: 12px;
	padding: 36px 24px;
	text-align: center;
	margin: 24px 0;
}
.cp-lock-icon { font-size: 34px; margin-bottom: 8px; }
.cp-lock-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.cp-lock-tip { font-size: 12.5px; color: var(--text-muted, #6b7280); margin-top: 12px; }
.cp-buy-options { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cp-buy-msg { font-size: 13px; color: #d97706; margin-top: 10px; min-height: 1em; }
.btn-primary {
	display: inline-block;
	background: var(--primary-color, #2563eb);
	color: #fff !important;
	border: none;
	border-radius: 8px;
	padding: 10px 22px;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	transition: opacity .2s;
}
.btn-primary:hover { opacity: .88; }
.btn-secondary {
	display: inline-block;
	background: transparent;
	color: var(--primary-color, #2563eb) !important;
	border: 1px solid var(--primary-color, #2563eb);
	border-radius: 8px;
	padding: 10px 22px;
	font-size: 14px;
	cursor: pointer;
	transition: background .2s;
}
.btn-secondary:hover { background: rgba(37, 99, 235, .08); }

/* 弹窗登录 */
.cp-auth-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.cp-auth-modal[hidden] { display: none; }
.cp-auth-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.cp-auth-inner {
	position: relative;
	background: var(--card-bg, #fff);
	color: var(--text-color, #1f2937);
	border-radius: 14px;
	padding: 28px 28px 20px;
	width: min(92vw, 380px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	animation: cp-pop .25s ease;
}
@keyframes cp-pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cp-auth-close {
	position: absolute; top: 10px; right: 14px;
	background: none; border: none; font-size: 22px; line-height: 1;
	cursor: pointer; color: var(--text-muted, #6b7280);
}
.cp-auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border-color, #e5e7eb); }
.cp-auth-tab {
	flex: 1; background: none; border: none; padding: 10px 0;
	font-size: 15px; font-weight: 600; cursor: pointer;
	color: var(--text-muted, #6b7280);
	border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.cp-auth-tab.active { color: var(--primary-color, #2563eb); border-bottom-color: var(--primary-color, #2563eb); }
.cp-auth-form { display: none; }
.cp-auth-form.active { display: block; }
.cp-auth-field { margin-bottom: 14px; }
.cp-auth-field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-muted, #6b7280); }
.cp-auth-field input {
	width: 100%; box-sizing: border-box;
	padding: 10px 12px; font-size: 14px;
	border: 1px solid var(--border-color, #d0d7de); border-radius: 8px;
	background: var(--input-bg, #fff); color: var(--text-color, #1f2937);
}
.cp-auth-field input:focus { outline: none; border-color: var(--primary-color, #2563eb); }
.cp-auth-msg { font-size: 13px; color: #dc2626; min-height: 1.2em; margin: 0 0 8px; }
.cp-auth-submit { width: 100%; padding: 11px; font-size: 15px; }
.cp-auth-tip { text-align: center; font-size: 12px; color: var(--text-muted, #6b7280); margin: 10px 0 0; }

/* Toast 提示 */
.cp-toast {
	position: fixed; top: 24px; left: 50%;
	transform: translate(-50%, -16px);
	z-index: 100000;
	padding: 12px 22px;
	border-radius: 10px;
	font-size: 14px;
	color: #fff;
	opacity: 0;
	transition: all .35s ease;
	pointer-events: none;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.cp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.cp-toast-ok { background: #16a34a; }
.cp-toast-err { background: #dc2626; }
.cp-toast-warn { background: #d97706; }

/* 暗黑模式适配 */
[data-theme="dark"] .cp-lock-box { background: var(--card-bg, #1e293b); border-color: var(--border-color, #334155); }
[data-theme="dark"] .cp-auth-inner { background: var(--card-bg, #1e293b); }
[data-theme="dark"] .cp-auth-field input { background: var(--input-bg, #0f172a); border-color: var(--border-color, #334155); }

/* ============================================================
 * P1 用户体验样式（v1.3.0，原创代码）
 * ========================================================== */

/* ---------- 图片灯箱 ---------- */
.cp-lightbox { position: fixed; inset: 0; z-index: 100010; background: rgba(10, 12, 18, .92); display: flex; align-items: center; justify-content: center; }
.cp-lightbox[hidden] { display: none; }
.cp-lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 12px 60px rgba(0, 0, 0, .5); }
.cp-lb-close, .cp-lb-prev, .cp-lb-next { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 24px; line-height: 44px; cursor: pointer; transition: background .2s; }
.cp-lb-close:hover, .cp-lb-prev:hover, .cp-lb-next:hover { background: rgba(255, 255, 255, .28); }
.cp-lb-close { top: 20px; right: 20px; }
.cp-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.cp-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.cp-lb-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .85); font-size: 13.5px; }
.post-content img.cp-lb-zoom { cursor: zoom-in; }
.cp-lightbox img.cp-lb-zoom { cursor: zoom-out; }

/* ---------- AJAX 翻页加载态 ---------- */
.card-grid.cp-loading { opacity: .45; pointer-events: none; transition: opacity .2s; }

/* ---------- 收藏按钮 ---------- */
.fav-btn.fav-active { color: var(--cp-danger); border-color: var(--cp-danger); background: rgba(239, 68, 68, .08); }

/* ---------- 用户中心：签到 ---------- */
.uc-checkin-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.uc-checkin-streak { margin: 0 0 4px; font-size: 15px; }
.uc-checkin-streak strong { color: var(--cp-primary); font-size: 20px; }
.uc-checkin-tip { margin: 0; color: var(--cp-muted); font-size: 13px; }
#cpCheckinBtn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 用户中心：积分流水 ---------- */
.uc-log-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.uc-log-table th { text-align: left; color: var(--cp-muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--cp-border); }
.uc-log-table td { padding: 9px 10px; border-bottom: 1px solid var(--cp-border); }
.uc-log-table tr:last-child td { border-bottom: 0; }
.uc-log-in { color: #16a34a; font-weight: 600; }
.uc-log-out { color: var(--cp-danger); font-weight: 600; }
[data-theme="dark"] .uc-log-in { color: #4ade80; }

/* ---------- 评论表情包 ---------- */
.cp-emoji-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; margin-bottom: 10px; border: 1px solid var(--cp-border); border-radius: var(--cp-radius-sm); background: var(--cp-primary-soft); }
.cp-emoji { border: 0; background: transparent; font-size: 19px; padding: 4px 6px; cursor: pointer; border-radius: 6px; transition: transform .15s; }
.cp-emoji:hover { transform: scale(1.25); background: rgba(59, 130, 246, .15); }
.cp-comment-msg { min-height: 18px; }

/* ---------- 折叠块 ---------- */
.cp-collapse { border: 1px solid var(--cp-border); border-radius: var(--cp-radius-sm); margin: 20px 0; overflow: hidden; background: var(--cp-surface); }
.cp-collapse-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: transparent; border: 0; cursor: pointer; font-size: 15px; font-weight: 600; color: inherit; }
.cp-collapse-head svg { width: 18px; height: 18px; transition: transform .25s; flex-shrink: 0; }
.cp-collapse.open .cp-collapse-head svg { transform: rotate(180deg); }
.cp-collapse-body { border-top: 1px solid var(--cp-border); }
.cp-collapse-inner { padding: 14px 18px; }

/* ---------- TAB 块 ---------- */
.cp-tabs { border: 1px solid var(--cp-border); border-radius: var(--cp-radius-sm); margin: 20px 0; overflow: hidden; background: var(--cp-surface); }
.cp-tabs-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--cp-border); background: var(--cp-primary-soft); }
.cp-tab-btn { border: 0; background: transparent; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--cp-muted); border-radius: 8px 8px 0 0; transition: all .2s; }
.cp-tab-btn:hover { color: var(--cp-text); }
.cp-tab-btn.active { background: var(--cp-surface); color: var(--cp-primary); box-shadow: 0 -2px 0 var(--cp-primary) inset; }
.cp-tab-pane[hidden] { display: none; }
.cp-tab-pane.active .cp-tab-inner { padding: 16px 18px; }

/* ---------- 专题 ---------- */
.cp-topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cp-topic-chip { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--cp-primary-soft); color: var(--cp-primary); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.cp-topic-chip:hover { background: var(--cp-primary); color: #fff; }
.topic-hero { position: relative; border-radius: var(--cp-radius); background: var(--cp-surface); border: 1px solid var(--cp-border); box-shadow: var(--cp-shadow); padding: 34px 30px; margin-bottom: 24px; overflow: hidden; }
.topic-hero.has-cover { background-size: cover; background-position: center; }
.topic-hero.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 23, 42, .25), rgba(15, 23, 42, .65)); }
.topic-hero-inner { position: relative; z-index: 1; color: var(--cp-text); }
.topic-hero.has-cover .topic-hero-inner { color: #fff; }
.topic-hero h1 { margin: 0 0 8px; font-size: 26px; }
.topic-hero p { margin: 0 0 8px; opacity: .85; font-size: 14px; }
.topic-hero-count { display: inline-block; font-size: 12.5px; padding: 3px 12px; border-radius: 999px; background: var(--cp-primary-soft); color: var(--cp-primary); font-weight: 600; }
.topic-hero.has-cover .topic-hero-count { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- 菜单图标徽章 ---------- */
.main-nav .cp-menu-icon { margin-right: 4px; }
.main-nav .cp-menu-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--cp-danger); color: #fff; font-size: 10.5px; font-weight: 700; vertical-align: super; line-height: 1.5; }

/* ============================================================
 * P2 增长体系样式（v1.4.0）
 * ========================================================== */

/* 铃铛 */
.header-bell { position: relative; }
.bell-dot {
	position: absolute; top: -2px; right: -2px;
	min-width: 16px; height: 16px; padding: 0 4px;
	background: var(--cp-danger, #ef4444); color: #fff;
	font-size: 10px; line-height: 16px; border-radius: 8px;
	text-align: center; font-weight: 600;
}

/* 等级 / 认证徽章 */
.cp-level-badge {
	display: inline-block; padding: 1px 7px; margin-left: 4px;
	color: #fff; font-size: 11px; font-weight: 600;
	border-radius: 999px; vertical-align: middle; white-space: nowrap;
}
.cp-verified-badge {
	display: inline-block; padding: 1px 7px; margin-left: 4px;
	background: #1d9bf0; color: #fff; font-size: 11px; font-weight: 600;
	border-radius: 999px; vertical-align: middle; white-space: nowrap;
}

/* 用户中心通用 */
.uc-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.uc-panel-head h2 { margin: 0; }
.btn-link { background: none; border: none; color: var(--cp-primary, #2563eb); cursor: pointer; font-size: 13px; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* VIP 卡片 */
.cp-vip-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.cp-vip-card {
	border: 1.5px solid var(--border-color, #e2e8f0); border-radius: 12px;
	padding: 16px; position: relative; overflow: hidden;
	background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(245,158,11,.02));
}
.cp-vip-card h3 { margin: 0 0 6px; font-size: 15px; }
.cp-vip-card.owned { border-color: #f59e0b; }
.cp-vip-card.owned::after {
	content: '✓'; position: absolute; top: 10px; right: 12px;
	color: #f59e0b; font-weight: 700; font-size: 16px;
}
.cp-vip-price { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.cp-vip-points { font-size: 12.5px; font-weight: 400; color: var(--cp-muted, #64748b); }
.cp-vip-desc { font-size: 12.5px; color: var(--cp-muted, #64748b); margin: 0 0 12px; }
.cp-vip-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-vip-btn { font-size: 12.5px; padding: 6px 12px; }
.cp-vip-tip, .cp-lock-tip { font-size: 12.5px; color: var(--cp-muted, #64748b); margin: 8px 0 0; }
.uc-vip-state { font-size: 12.5px; color: #f59e0b; font-weight: 600; }

/* 卡密 */
.uc-key-redeem { display: flex; gap: 8px; }
.uc-key-redeem input { flex: 1; padding: 8px 10px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; }
.cp-goods-list { display: flex; flex-direction: column; gap: 8px; }
.cp-goods-item {
	display: flex; align-items: center; justify-content: space-between;
	border: 1px solid var(--border-color, #e2e8f0); border-radius: 10px; padding: 10px 12px;
}
.cp-goods-btns { display: flex; gap: 6px; }
.cp-goods-btns .btn-secondary { font-size: 12.5px; padding: 5px 10px; }

/* 钱包 */
.uc-wallet-balance { font-size: 13px; color: var(--cp-muted, #64748b); }
.uc-wallet-balance strong { color: var(--cp-primary, #2563eb); font-size: 15px; }
.uc-wallet-charge { display: flex; gap: 8px; margin-bottom: 12px; }
.uc-wallet-charge input { flex: 1; padding: 8px 10px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; }

/* 推广 */
.uc-ref-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.uc-ref-stats .uc-stat strong { display: block; font-size: 16px; }
.uc-ref-stats .uc-stat span { font-size: 11.5px; color: var(--cp-muted, #64748b); }
.uc-ref-link { display: flex; gap: 8px; margin-bottom: 6px; }
.uc-ref-link input { flex: 1; padding: 8px 10px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; font-size: 12.5px; color: var(--cp-muted, #64748b); }
.uc-ref-withdraw { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.uc-ref-withdraw input, .uc-ref-withdraw select { padding: 8px 10px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; }

/* 消息 */
.uc-msg-list { list-style: none; margin: 0; padding: 0; }
.uc-msg { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-color, #e2e8f0); align-items: flex-start; }
.uc-msg:last-child { border-bottom: none; }
.uc-msg.unread { background: rgba(37,99,235,.04); margin: 0 -8px; padding: 10px 8px; border-radius: 8px; }
.uc-msg-icon { font-size: 18px; line-height: 1.4; }
.uc-msg-body { flex: 1; min-width: 0; }
.uc-msg-title { margin: 0; font-weight: 600; font-size: 13.5px; }
.uc-msg-content { margin: 2px 0 0; font-size: 12.5px; color: var(--cp-muted, #64748b); word-break: break-all; }
.uc-msg-time { margin: 2px 0 0; font-size: 11.5px; color: var(--cp-muted, #64748b); }

/* 投稿表单 */
.cp-post-form .req { color: var(--cp-danger, #ef4444); }
.cp-post-form input[type="text"], .cp-post-form input[type="url"], .cp-post-form select, .cp-post-form textarea {
	padding: 8px 10px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; background: var(--input-bg, #fff);
}
.cp-post-pans { border: 1px dashed var(--border-color, #e2e8f0); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.cp-post-pans legend { font-size: 13px; padding: 0 6px; }
.cp-post-pan-row { display: grid; grid-template-columns: 110px 1fr 100px; gap: 6px; margin-bottom: 6px; }
.cp-post-tip { font-size: 12.5px; color: var(--cp-muted, #64748b); }

/* 分类解锁面板 */
.cp-cat-lock { text-align: center; padding: 34px 20px; }

/* 响应式 */
@media (max-width: 640px) {
	.cp-vip-cards { grid-template-columns: 1fr; }
	.uc-ref-stats { grid-template-columns: repeat(2, 1fr); }
	.cp-post-pan-row { grid-template-columns: 1fr; }
}

/* 暗黑模式适配 */
[data-theme="dark"] .cp-vip-card { background: linear-gradient(135deg, rgba(245,158,11,.10), rgba(245,158,11,.03)); }
[data-theme="dark"] .uc-msg.unread { background: rgba(37,99,235,.10); }
[data-theme="dark"] .uc-key-redeem input,
[data-theme="dark"] .uc-wallet-charge input,
[data-theme="dark"] .uc-ref-link input,
[data-theme="dark"] .uc-ref-withdraw input,
[data-theme="dark"] .uc-ref-withdraw select,
[data-theme="dark"] .cp-post-form input,
[data-theme="dark"] .cp-post-form select,
[data-theme="dark"] .cp-post-form textarea { background: var(--input-bg, #0f172a); color: var(--text-color, #e2e8f0); }

/* ============================================================
 * P3 样式（v1.5.0）
 * ========================================================== */

/* ---------- 公告栏 ---------- */
.cp-notice-bar { background: linear-gradient(90deg, var(--cp-primary, #2563eb), #4f8bff); color: #fff; overflow: hidden; }
.cp-notice-inner { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: 14px; }
.cp-notice-tag { flex-shrink: 0; font-weight: 600; }
.cp-notice-viewport { flex: 1; height: 40px; overflow: hidden; position: relative; }
.cp-notice-track { position: absolute; inset: 0 auto auto 0; width: 100%; }
.cp-notice-item { height: 40px; line-height: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-notice-item a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 实时搜索下拉 ---------- */
.cp-livesearch { position: absolute; z-index: 9999; top: 100%; margin-top: 8px; width: min(560px, 92vw); background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.14); overflow: hidden; }
.header-search { position: relative; }
.cp-ls-hot { padding: 12px 16px; font-size: 13px; color: var(--text-secondary, #6b7280); border-bottom: 1px solid var(--border-color, #f0f0f0); }
.cp-ls-hot a { display: inline-block; margin: 2px 6px; padding: 2px 10px; border-radius: 999px; background: var(--bg-secondary, #f3f4f6); color: var(--text-color, #374151); text-decoration: none; }
.cp-ls-item { display: flex; gap: 12px; padding: 10px 16px; text-decoration: none; color: inherit; align-items: center; }
.cp-ls-item:hover { background: var(--bg-secondary, #f8fafc); }
.cp-ls-item img { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cp-ls-item b { display: block; font-size: 14px; color: var(--text-color, #111827); }
.cp-ls-item mark { background: transparent; color: var(--cp-primary, #2563eb); font-weight: 700; }
.cp-ls-item span { display: block; font-size: 12px; color: var(--text-secondary, #9ca3af); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.cp-ls-item i { font-style: normal; font-size: 11px; color: #c0c4cc; }
.cp-ls-empty { padding: 16px; font-size: 13px; color: var(--text-secondary, #9ca3af); text-align: center; }

/* ---------- 圈子 ---------- */
.forum-hero-wrap { margin-top: 24px; }
.forum-hero { display: flex; gap: 24px; background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 16px; padding: 24px; align-items: flex-start; }
.forum-hero-cover img { width: 160px; height: 160px; object-fit: cover; border-radius: 12px; }
.forum-hero-info { flex: 1; }
.forum-hero-info h1 { margin: 0 0 8px; font-size: 24px; }
.forum-hero-meta { display: flex; gap: 16px; color: var(--text-secondary, #6b7280); font-size: 13px; margin-bottom: 10px; }
.forum-hero-desc { color: var(--text-secondary, #4b5563); font-size: 14px; }
.forum-hero-join { min-width: 220px; border-left: 1px dashed var(--border-color, #e5e7eb); padding-left: 20px; }
.cp-forum-state { text-align: center; }
.cp-forum-price { font-size: 22px; font-weight: 700; color: var(--cp-primary, #2563eb); margin: 6px 0; }
.cp-forum-days { font-size: 13px; color: var(--text-secondary, #6b7280); }
.cp-forum-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cp-forum-joined { color: #16a34a; }
.cp-forum-joined small { display: block; color: var(--text-secondary, #6b7280); margin-top: 4px; }
.forum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.forum-grid-compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.forum-card { display: block; background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.forum-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.forum-card-cover img { width: 100%; height: 130px; object-fit: cover; }
.forum-card-body { padding: 14px; }
.forum-card-body h3 { margin: 0 0 6px; font-size: 16px; }
.forum-card-body p { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary, #6b7280); }
.forum-card-price { font-size: 13px; font-weight: 700; color: var(--cp-primary, #2563eb); }
.forum-post-form { background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; padding: 18px; margin-bottom: 20px; }
.forum-post-form h2 { margin-top: 0; font-size: 18px; }
.forum-post-form input, .forum-post-form textarea { width: 100%; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--border-color, #d1d5db); border-radius: 8px; background: var(--bg-secondary, #fafafa); color: var(--text-color, #111827); font-size: 14px; }
.forum-post-actions { display: flex; align-items: center; gap: 12px; }
.forum-post-msg { font-size: 13px; color: var(--text-secondary, #6b7280); }
.forum-post-item { background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.forum-post-title { font-size: 15px; font-weight: 600; color: var(--text-color, #111827); text-decoration: none; }
.forum-post-title:hover { color: var(--cp-primary, #2563eb); }
.forum-post-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-secondary, #9ca3af); }
.forum-post-meta img { border-radius: 50%; }
.forum-post-excerpt { font-size: 13px; color: var(--text-secondary, #4b5563); margin: 8px 0 0; }
.forum-empty { color: var(--text-secondary, #9ca3af); text-align: center; padding: 24px 0; }
.cp-forum-lock { text-align: center; padding: 40px 20px; }

/* ---------- 首页模块 ---------- */
.cp-home-module { margin-bottom: 32px; }
.cp-module-head h2 { font-size: 20px; margin: 0 0 14px; }
.cp-cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.cp-cat-card { background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 10px; padding: 14px; text-decoration: none; color: inherit; transition: border-color .2s; }
.cp-cat-card:hover { border-color: var(--cp-primary, #2563eb); }
.cp-cat-card h3 { margin: 0 0 4px; font-size: 15px; }
.cp-cat-card span { font-size: 12px; color: var(--text-secondary, #9ca3af); }
.cp-topic-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cp-topic-card { position: relative; display: block; border-radius: 12px; overflow: hidden; text-decoration: none; color: #fff; background: #1e293b; }
.cp-topic-card img { width: 100%; height: 130px; object-fit: cover; display: block; opacity: .75; }
.cp-topic-card-body { position: absolute; inset: auto 0 0 0; padding: 10px 14px; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.cp-topic-card-body h3 { margin: 0 0 2px; font-size: 15px; }
.cp-topic-card-body span { font-size: 12px; opacity: .85; }
.cp-tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-tag-cloud a { padding: 4px 14px; border-radius: 999px; background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb); font-size: 13px; color: var(--text-secondary, #4b5563); text-decoration: none; }
.cp-tag-cloud a:hover { border-color: var(--cp-primary, #2563eb); color: var(--cp-primary, #2563eb); }

/* ---------- 分享海报弹窗 ---------- */
.cp-poster-inner { max-width: 420px; max-height: 88vh; overflow: auto; }
.cp-poster-canvas-wrap { margin: 12px 0; text-align: center; }
.cp-poster-canvas-wrap canvas { max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.cp-poster-tip { font-size: 12px; color: var(--text-secondary, #9ca3af); }
#cpPosterBtn { cursor: pointer; }

/* 暗黑模式 */
[data-theme="dark"] .cp-notice-bar { background: linear-gradient(90deg, #1d4ed8, #2563eb); }
[data-theme="dark"] .forum-hero, [data-theme="dark"] .forum-card, [data-theme="dark"] .forum-post-form,
[data-theme="dark"] .forum-post-item, [data-theme="dark"] .cp-cat-card, [data-theme="dark"] .cp-tag-cloud a,
[data-theme="dark"] .cp-livesearch { background: var(--card-bg, #1e293b); border-color: var(--border-color, #334155); }
[data-theme="dark"] .cp-ls-hot a { background: var(--bg-secondary, #0f172a); }

/* ============================================================
   注册邮箱验证码
   ============================================================ */
.cp-code-row { display: flex; gap: 8px; }
.cp-code-row input { flex: 1; min-width: 0; letter-spacing: 4px; font-family: Consolas, Menlo, monospace; }
.cp-code-btn {
  flex-shrink: 0; border: none; cursor: pointer;
  padding: 0 14px; border-radius: var(--cp-radius-sm);
  background: var(--cp-grad); color: #fff;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: opacity 0.15s ease;
}
.cp-code-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ============================================================
   拖动滑块验证（仿子比）
   ============================================================ */
.cp-slider {
  position: relative; display: block; height: 44px;
  border-radius: var(--cp-radius-sm); overflow: hidden;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--cp-border);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.cp-slider-track-text {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--cp-text-2, #64748b);
  pointer-events: none; transition: opacity 0.2s ease;
}
.cp-slider.is-active .cp-slider-track-text { opacity: 0.4; }
.cp-slider-progress {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 0;
  width: 0; background: var(--cp-primary-soft);
}
.cp-slider-handle {
  position: absolute; left: 0; top: 0; z-index: 2;
  width: 44px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--cp-grad); color: #fff;
  cursor: grab; border-radius: inherit;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: background 0.2s ease;
}
.cp-slider.is-active .cp-slider-handle { cursor: grabbing; }
.cp-slider-handle::before { content: "\00BB"; font-size: 22px; font-weight: 700; line-height: 1; }
.cp-slider.is-done { border-color: var(--cp-primary); }
.cp-slider.is-done .cp-slider-handle { background: var(--cp-primary); box-shadow: none; cursor: default; }
.cp-slider.is-done .cp-slider-handle::before { content: "\2713"; }
.cp-slider.is-done .cp-slider-track-text {
  opacity: 1; color: var(--cp-primary); font-weight: 600;
}

/* ============================================================
   找回密码入口链接
   ============================================================ */
.cp-forgot-row {
  margin: -6px 0 10px; text-align: right;
}
.cp-forgot {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 13px; color: var(--cp-primary);
}
.cp-forgot:hover { text-decoration: underline; }

/* ============================================================
   移动端自适应（仿子比移动端布局）≤768px
   —— 单列信息流（缩略图左 内容右）、隐藏侧栏、紧凑头部、
      触屏禁用悬浮动效、弹窗/文章页/页脚适配
   ============================================================ */
@media (max-width: 768px) {
  /* —— 全局 —— */
  body { -webkit-tap-highlight-color: transparent; }
  .container { padding: 0 12px; }
  .layout {
    grid-template-columns: 1fr; gap: 0;
    padding-top: 12px; padding-bottom: 24px;
  }
  /* 子比移动端不渲染侧栏内容，直接隐藏 */
  .sidebar { display: none; }

  /* —— 头部：52px 紧凑栏 —— */
  .header-inner { height: 52px; gap: 10px; }
  :root { --cp-header-h: 52px; }
  .site-title { font-size: 18px; }
  .brand-logo img.custom-logo { max-height: 30px; width: auto; }
  .icon-btn { width: 34px; height: 34px; }
  .header-avatar img { width: 28px; height: 28px; }
  .header-search { padding: 10px 0; }

  /* —— 首页：子比式横向列表卡片（缩略图左 · 内容右） —— */
  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .post-card { flex-direction: row; align-items: stretch; }
  .post-card-thumb { width: 38%; max-width: 150px; flex-shrink: 0; aspect-ratio: 4 / 3; }
  .post-card-body { padding: 10px 12px; gap: 6px; min-width: 0; }
  .post-card-cat { display: none; }
  .post-card-title { font-size: 15px; }
  .post-card-excerpt { display: none; }
  .post-card-meta { padding-top: 6px; font-size: 11.5px; gap: 6px; }
  .pcm-stats { gap: 8px; }
  .post-card-new { top: 6px; right: 6px; padding: 1px 7px; font-size: 10px; }
  /* 触屏关闭悬浮位移动效（避免粘滞） */
  .post-card:hover { transform: none; box-shadow: var(--cp-shadow); }
  .post-card:hover .post-card-thumb img { transform: none; }

  /* —— 加载更多 —— */
  .load-more-wrap { margin-top: 16px; }
  .load-more-btn { min-width: 0; width: 100%; padding: 11px 16px; }

  /* —— 文章页 —— */
  .post-single { padding: 14px 14px 18px; border-radius: 12px; margin-bottom: 14px; }
  .post-title { font-size: 20px; line-height: 1.4; }
  .post-meta { gap: 10px; font-size: 12px; }
  .post-content { font-size: 15px; line-height: 1.8; }
  .post-content pre,
  .post-content table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .post-actions { flex-wrap: wrap; gap: 8px; }

  /* —— 相关推荐：隐藏悬浮箭头，改手势滑动 —— */
  .related-nav { display: none; }
  .related-card { flex: 0 0 62%; }

  /* —— 下载卡片 —— */
  .download-box { padding: 16px 14px; margin-top: 20px; }
  .download-box-title { font-size: 15px; }

  /* —— 登录/注册/找回弹窗 —— */
  .cp-auth-inner {
    width: calc(100vw - 24px);
    max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 20px 18px 16px;
  }
  .cp-auth-tabs { margin-bottom: 14px; }

  /* —— 页脚 —— */
  .site-footer { padding: 18px 0; margin-top: 16px; }
  .footer-inner { font-size: 12.5px; }

  /* —— Toast / 提示 —— */
  .cp-toast { width: calc(100vw - 32px) !important; }
}

/* 平板窄屏（769–992px）：双列卡片过渡 */
@media (min-width: 769px) and (max-width: 992px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
