/*
Theme Name: GeneratePress Child - CodePlayer
Theme URI: https://resilence.cn
Description: 现代极简风格子主题，三色主题切换
Author: CodePlayer
Template: generatepress
Version: 1.0.0
*/

/* ========== CSS 变量：三套主题 ========== */
:root,
[data-theme="ink"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.10);
  --line: #334155;
  --tag: #475569;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  --radius: 8px;
}

[data-theme="warm"] {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-hover: #f5f0e8;
  --text: #2d2a24;
  --muted: #8c8273;
  --accent: #c77d3a;
  --accent-soft: rgba(199, 125, 58, 0.08);
  --line: #e8e0d3;
  --tag: #e8e0d3;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="mono"] {
  --bg: #ffffff;
  --surface: #f8f8f8;
  --surface-hover: #eeeeee;
  --text: #1a1a1a;
  --muted: #666666;
  --accent: #333333;
  --accent-soft: rgba(0, 0, 0, 0.05);
  --line: #e5e5e5;
  --tag: #e5e5e5;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ========== 全局基础样式 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  opacity: 0.85;
}

/* ========== 站点容器 ========== */
.site {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== 页头 ========== */
.site-header {
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-branding .site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-branding .site-title a {
  color: var(--text);
}

.site-branding .site-description {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

/* 导航菜单 */
.main-navigation {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.main-navigation li {
  list-style: none;
  display: inline;
}

.main-navigation a {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.92rem;
  color: var(--muted);
  transition: all 0.2s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ========== 首页 Hero ========== */
.home-hero {
  text-align: center;
  padding: 60px 20px 50px;
}

.home-hero .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 20px;
}

.home-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.home-hero .subtitle {
  font-size: 1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 24px;
  line-height: 1.65;
}

.home-hero .hero-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.home-hero .hero-tags span {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  background: var(--tag);
  color: var(--muted);
}

/* ========== 首页双栏布局 ========== */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding-bottom: 60px;
}

/* ========== 文章列表 ========== */
.post-row {
  display: flex;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: all 0.25s;
}

.post-row:last-child {
  border-bottom: none;
}

.post-row:hover {
  padding-left: 8px;
}

.post-row .post-date {
  min-width: 90px;
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.post-row .post-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.post-row .post-info h3 a {
  color: var(--text);
}

.post-row .post-info h3 a:hover {
  color: var(--accent);
}

.post-row .post-info .post-excerpt {
  font-size: 0.88rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-row .post-info .post-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========== 侧栏 ========== */
.sidebar {
  padding-top: 12px;
}

.sidebar .widget {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.sidebar .widget-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar .widget ul {
  list-style: none;
}

.sidebar .widget ul li {
  padding: 6px 0;
  font-size: 0.88rem;
}

.sidebar .widget ul li a {
  color: var(--muted);
  transition: color 0.2s;
}

.sidebar .widget ul li a:hover {
  color: var(--accent);
}

.sidebar .widget ul li .count {
  float: right;
  color: var(--muted);
  font-size: 0.78rem;
  background: var(--tag);
  padding: 1px 8px;
  border-radius: 10px;
}

/* ========== 文章详情页 ========== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  padding-bottom: 60px;
  padding-top: 20px;
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.35;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
}

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 12px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 16px 24px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
}

.article-body pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-body code {
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
  font-size: 0.9em;
}

.article-body :not(pre) > code {
  background: var(--surface);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
}

/* 目录侧栏 */
.article-toc {
  position: sticky;
  top: 32px;
  padding-top: 18px;
}

.article-toc .toc-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-toc ul {
  list-style: none;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.article-toc ul li {
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.article-toc ul li a {
  color: var(--muted);
  transition: color 0.2s;
}

.article-toc ul li a:hover,
.article-toc ul li a.active {
  color: var(--accent);
}

/* ========== 归档页 ========== */
.archive-header {
  text-align: center;
  padding: 40px 20px;
}

.archive-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.archive-header .archive-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.archive-list {
  max-width: 720px;
  margin: 0 auto 60px;
}

/* ========== 分页 ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 40px 0 60px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--surface);
  transition: all 0.2s;
}

.pagination .page-numbers.current {
  background: var(--accent);
  color: #fff;
}

.pagination .page-numbers:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ========== 页脚 - 保留备案信息 ========== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent);
}

/* ========== 主题切换工具栏 ========== */
.theme-switcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.theme-switcher button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  transition: all 0.2s;
  background: transparent;
  color: var(--muted);
}

.theme-switcher button:hover,
.theme-switcher button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ========== 404 页面 ========== */
.error404 .site-content {
  text-align: center;
  padding: 100px 20px;
}

.error404 h1 {
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.05em;
}

.error404 p {
  color: var(--muted);
  margin: 16px 0 32px;
  font-size: 1.05rem;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .home-layout,
  .article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .article-toc {
    position: static;
    order: -1;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
  }

  .post-row {
    flex-direction: column;
    gap: 6px;
  }

  .post-row .post-date {
    min-width: auto;
  }

  .theme-switcher {
    bottom: 16px;
    right: 12px;
    flex-direction: row;
  }

  .site {
    padding: 0 16px;
  }
}

/* 覆盖 GeneratePress 父主题默认样式 */
.separate-containers .inside-article {
  padding: 0;
  background: transparent;
}

.separate-containers .site-main {
  margin: 0;
}

.one-container .site-content {
  padding: 0;
}

.site-content {
  padding: 0 !important;
}

.inside-article {
  padding: 0 !important;
}
