@charset "UTF-8";

/*!
Theme Name: ZiYouKan
Theme URI: https://www.ziyoukan.cn
Author: 林刚
Author URI: https://www.ziyoukan.cn
Description: ZiYouKan 是一个高级个人博客 WordPress 主题，专为内容创作者设计。主题支持代码高亮、响应式设计和完整的SEO优化，适用于个人博客、技术分享、创意作品展示等场景。
Version: 5.1
Requires at least: 5.9
Tested up to: 6.8
Requires PHP: 7.4
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: ziyoukan
Tags: blog, technology, code-highlighting, seo, full-site-editing, block-styles, translation-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, block-patterns, sticky-post, threaded-comments, rtl-language-support, responsive-layout

This theme, like WordPress, is licensed under the GPL.
Use this file to manage the main styles that make your theme unique.
*/

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: inherit; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: var(--wp--preset--color--foreground, #333);
  background-color: var(--wp--preset--color--background, #fff);
}

header a,
footer a {
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  clear: both;
  line-height: 1.4;
  font-weight: 700;
  margin-top: 0.8em;
  margin-bottom: 0.6em;
}

ul {
  list-style: disc; }

ol {
  list-style: decimal; }

li > ul,
li > ol {
  margin-bottom: 0;
  margin-left: 0; }

dt {
  font-weight: 700; }

dd {
  margin: 0 1.5em 1.5em; }

table {
  width: 100%;
  border-spacing: 0; }

th, td {
  padding: 5px;
  text-align: center; }

table td,
table tr,
table th {
  border: 1px solid #ddd; }

/* Make sure embeds and iframes fit their containers. */
embed,
iframe,
object {
  max-width: 100%; }

img, .wp-block-image img {
  height: auto;
  max-width: 100%;
  vertical-align: middle; }

figure {
  margin: 1em 0; }

dfn,
cite,
em,
i {
  font-style: italic; }

blockquote {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  border-left: 4px solid var(--wp--preset--color--primary);
  background-color: #f8f9fa;
  color: #5a6872;
  font-style: italic; }

address {
  margin: 0 0 1.5em; }

pre {
  margin-bottom: 1.6em;
  max-width: 100%;
  overflow: auto;
  padding: 1.6em; }

/* 默认特色图片样式控制 */
.ziyoukan-default-thumbnail {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.ziyoukan-default-thumbnail--thumb {
  max-width: 150px;
  max-height: 150px;
}

.ziyoukan-default-thumbnail--medium {
  max-width: 250px;
  max-height: 250px;
}

.ziyoukan-default-thumbnail--large {
  max-width: 100%;
  max-height: 300px;
}

.ziyoukan-default-thumbnail--default {
  max-width: 100%;
  max-height: 200px;
}

code,
kbd,
tt,
var {
  font-size: 17px; }

/* 技术博客专用样式 */
/* 代码块样式优化 */
pre[class*="language-"] {
  margin: 1.5em 0;
  padding: 1.2em;
  border-radius: 8px;
  overflow: auto;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

code[class*="language-"],
pre[class*="language-"] {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  text-shadow: none;
}

/* 行号样式 */
.line-numbers .line-numbers-rows {
  border-right: 1px solid #999;
}

.line-numbers-rows > span:before {
  color: #999;
}

/* 技术文档页面样式 */
.tech-documentation .wp-block-post-title {
  margin-bottom: 1.2em;
  color: #2c3e50;
  font-weight: 600;
}

.tech-documentation .wp-block-post-content {
  font-size: 17px;
  line-height: 1.7;
}

.tech-documentation .wp-block-post-content h2 {
  margin-top: 2em;
  margin-bottom: 1em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid #eee;
  color: #2c3e50;
}

.tech-documentation .wp-block-post-content h3 {
  margin-top: 1.5em;
  margin-bottom: 1em;
  color: #34495e;
}

/* FAQ页面样式 */
.faq-page .wp-block-details {
  margin-bottom: 1.5em;
  padding: 1.2em;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.faq-page .wp-block-details[open] {
  border-color: #007cba;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-page summary {
  font-weight: 600;
  font-size: 18px;
  color: #2c3e50;
  cursor: pointer;
  outline: none;
  padding: 0.5em 0;
}

.faq-page summary:hover {
  color: #007cba;
}

.faq-page .wp-block-details[open] summary {
  color: #007cba;
}

.faq-page .wp-block-details p {
  margin-top: 1em;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #34495e;
}

/* 技术博客文章样式 */
.tech-blog-post .wp-block-post-title {
  margin-bottom: 0.8em;
  color: #2c3e50;
  font-weight: 600;
}

.tech-blog-post .wp-block-post-content {
  font-size: 17px;
  line-height: 1.7;
}

.tech-blog-post .wp-block-post-content h2 {
  margin-top: 1.8em;
  margin-bottom: 1em;
  color: #2c3e50;
  padding-left: 0.5em;
  border-left: 4px solid #007cba;
}

.tech-blog-post .wp-block-post-content h3 {
  margin-top: 1.5em;
  margin-bottom: 1em;
  color: #34495e;
}

/* 代码内联样式 */
:not(pre) > code[class*="language-"] {
  padding: 0.2em 0.4em;
  border-radius: 4px;
  background-color: #f6f8fa;
  color: #24292e;
  font-size: 85%;
}

/* 表格样式优化 */
.tech-blog-post table,
.tech-documentation table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  font-size: 16px;
}

.tech-blog-post th,
.tech-documentation th {
  background-color: #f1f8ff;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  border: 1px solid #c8e1ff;
}

.tech-blog-post td,
.tech-documentation td {
  padding: 12px 15px;
  border: 1px solid #e1e8ed;
}

.tech-blog-post tr:nth-child(even),
.tech-documentation tr:nth-child(even) {
  background-color: #f6f8fa;
}

/* 引用块样式 */
.tech-blog-post blockquote,
.tech-documentation blockquote {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  border-left: 4px solid #007cba;
  background-color: #f8f9fa;
  color: #5a6872;
  font-style: italic;
}

/* 列表样式 */
.tech-blog-post ul,
.tech-documentation ul,
.tech-blog-post ol,
.tech-documentation ol {
  margin: 1.2em 0;
  padding-left: 1.5em;
}

.tech-blog-post li,
.tech-documentation li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

/* 图片样式 */
.tech-blog-post .wp-block-image,
.tech-documentation .wp-block-image {
  margin: 1.5em 0;
  text-align: center;
}

.tech-blog-post .wp-block-image figcaption,
.tech-documentation .wp-block-image figcaption {
  margin-top: 0.5em;
  font-size: 14px;
  color: #777;
  font-style: italic;
}

/* 其他基本样式 */
abbr,
acronym {
  border-bottom: 1px dotted #ddd;
  cursor: help; }

mark,
ins {
  background: #ddd;
  text-decoration: none; }

big {
  font-size: 125%; }

select,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="range"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"],
input[type="color"],
textarea {
  border-radius: 0;
  box-sizing: border-box;
  display: block;
  font-size: 17px;
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  line-height: 1.75;
  padding: 7px 15px;
  color: #1c1c1c;
}

p a {
  text-decoration: underline;
}

textarea {
  width: 100%;
  height: 120px;
  padding: 15px 20px; }

input[type="checkbox"] {
  display: inline; }

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #cacaca; }

input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
  color: #c3c3c3; }

input::-moz-placeholder,
textarea::-moz-placeholder {
  color: #a3a2a2; }

hr {
  background-color: #999;
  border: 0;
  height: 1px;
  margin-bottom: 1.5em; }

/* 响应式设计优化 */
@media (max-width: 768px) {
  .tech-blog-post .wp-block-post-content,
  .tech-documentation .wp-block-post-content {
    font-size: 16px;
  }
  
  .faq-page summary {
    font-size: 16px;
  }
  
  pre[class*="language-"] {
    font-size: 14px;
    padding: 1em;
  }
  
  .tech-blog-post table,
  .tech-documentation table {
    font-size: 14px;
  }
  
  .tech-blog-post th,
  .tech-documentation th,
  .tech-blog-post td,
  .tech-documentation td {
    padding: 8px 10px;
  }
}

/* 链接样式 */
a {
  color: var(--wp--preset--color--primary);
  outline: 0 !important;
}

.widget a:not(.wp-block-button__link),
.entry-summery a:not(.wp-block-button__link),
.entry-content a:not(.wp-block-button__link) {
  text-underline-offset: 3px;
  text-decoration-skip-ink: all;
  text-decoration-thickness: 1px;
  text-decoration: underline;
}

.widget a:not(.wp-block-button__link):hover,
.entry-summery a:not(.wp-block-button__link):hover,
.entry-content a:not(.wp-block-button__link):hover {
  color: var(--wp--preset--color--primary);
}

a:focus-visible, a:focus {
  outline: thin dotted !important;
}

a:hover, a:active, a:hover {
  outline: 0;
  color: var(--wp--preset--color--primary);
}

/* 对齐样式 */
.alignfull {
  margin: 0 !important;
  width: auto !important;
}

h1, h2, h3, h4, h5, h6 {
  color: #000;
}

/* 技术博客页面专用样式 */
.tech-blog-page {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.tech-blog-page .wp-block-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tech-blog-page .wp-block-cover__inner-container {
  max-width: 800px;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.tech-blog-page .wp-block-cover .wp-block-heading {
  margin-bottom: 1rem;
}

.tech-blog-page .wp-block-cover .wp-block-paragraph {
  margin-bottom: 2rem;
}

.tech-blog-list {
  margin-top: 4rem;
}

.tech-blog-grid {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tech-blog-grid .wp-block-group {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tech-blog-grid .wp-block-post-title {
  margin-top: 0;
  margin-bottom: 1rem;
}

.tech-blog-grid .wp-block-post-excerpt {
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.tech-blog-grid .wp-block-post-date,
.tech-blog-grid .wp-block-post-terms {
  font-size: 0.9rem;
  color: var(--wp--preset--color--muted-text);
}

.tech-blog-grid .wp-block-post-featured-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

/* 归档页面样式 */
.tech-blog-archive .wp-block-post-template {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tech-blog-archive .wp-block-group {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tech-blog-archive .wp-block-group:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* 搜索结果页面样式 */
.tech-blog-search-results .wp-block-group {
  transition: border-color 0.3s ease;
}

.tech-blog-search-results .wp-block-group:hover {
  border-color: var(--wp--preset--color--primary) !important;
}

/* 博客文章页面样式 */
.tech-blog-post .wp-block-post-content {
  margin-top: 2rem;
}

.tech-blog-post .wp-block-post-content p {
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.tech-blog-post .wp-block-post-content h2,
.tech-blog-post .wp-block-post-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.tech-blog-post .wp-block-categories {
  margin-top: 2rem;
}

/* 代码块样式优化 */
.tech-blog-post pre,
.tech-blog-post code {
  font-family: var(--wp--preset--font-family--monospace);
  background: var(--wp--preset--color--background-secondary);
  padding: 0.5rem;
  border-radius: 5px;
  overflow-x: auto;
}

.tech-blog-post pre {
  padding: 1rem;
  margin: 1.5rem 0;
}

/* 引用样式 */
.tech-blog-post blockquote {
  border-left: 4px solid var(--wp--preset--color--primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--wp--preset--color--foreground);
}

/* 表格样式 */
.tech-blog-post table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.tech-blog-post table th,
.tech-blog-post table td {
  padding: 0.75rem;
  border: 1px solid var(--wp--preset--color--background-secondary);
  text-align: left;
}

.tech-blog-post table th {
  background: var(--wp--preset--color--background-secondary);
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tech-blog-page .wp-block-cover__inner-container {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .tech-blog-list {
    margin-top: 2rem;
  }
  
  .tech-blog-grid .wp-block-post-featured-image {
    margin-bottom: 1rem;
  }
}

/* 通用响应式设计 */
@media (max-width: 768px) {
  .tech-blog-page .wp-block-cover__inner-container {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .tech-blog-list {
    margin-top: 2rem;
  }
  
  .tech-blog-grid .wp-block-post-featured-image {
    margin-bottom: 1rem;
  }
}