/* ------------------
 * Global style
 * --------------- */
body {
  background-color: #FAFAFA;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #2563EB;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover, a:active {
  color: #1E40AF;
}
pre, code { 
  background: #F3F4F6;
  font-family: "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 0.9em;
}
code { 
  padding: 3px 6px;
  color: #DC2626;
  border-radius: 4px;
  font-weight: 500;
}
pre {
  padding: 16px;
  overflow: auto;
  max-height: 500px;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
  line-height: 1.6;
}
pre code {
  display: block;
  padding: 0;
  color: #374151;
  background: transparent;
  border-radius: 0;
}

/* for block of numbers */
pre code table {
    border:none
}
pre code td.hljs-ln-numbers {
    text-align: center;
    color: #9c9c9c;
    border-right: 0.5px solid #9c9c9c;
    vertical-align: top;
    padding-left: 0.5rem;
    padding-right: 0.8rem;
    border: none;
}
/* for block of code */
pre code td.hljs-ln-code {
    padding-left: 1rem;
    border: none;
}


blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 4px solid #2563EB;
  background: #F9FAFB;
  border-radius: 0 8px 8px 0;
  color: #4B5563;
  font-style: italic;
}

table {
  border: 1px solid #E5E7EB;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}
table th,
table td {
  padding: 12px 16px;
  border-bottom: 1px solid #E5E7EB;
  border-right: 1px solid #E5E7EB;
}
table th:last-child,
table td:last-child {
  border-right: none;
}
table tr:last-child td {
  border-bottom: none;
}
table th {
  background: #F3F4F6;
  color: #111827;
  font-weight: 600;
  text-align: left;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  line-height: 1.4;
  color: #111827;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}
h1 { font-size: 2.25em; }
h2 { font-size: 1.875em; }
h3 { font-size: 1.5em; }
h4 { font-size: 1.25em; }
h5 { font-size: 1.125em; }
h6 { font-size: 1em; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  padding: 10px 14px;
  border: 1px solid #D1D5DB;
  width: 100%;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
textarea {
  resize: vertical;
  min-height: 120px;
}


/* Special link style */
.post-meta a,
.post-content a,
.widget a,
.comment-content a {
  border-bottom: 1px solid #EEE;
}

.post-meta a:hover,
.post-content a:hover,
.widget a:hover,
.comment-content a:hover {
  border-bottom-color: transparent;
}

/* ------------------
 * Header
 * --------------- */

#header {
  padding: 8px 0 0 0;
  background: #FFF;
  border-bottom: 1px solid #E5E7EB;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}
#header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#header .row {
  display: contents;
}

.site-name {
  flex-shrink: 0;
}
#logo {
  color: #111827;
  font-size: 1.3em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
#logo img {
  max-height: 32px;
}

.description {
  display: block;
  margin: 0;
  color: #9CA3AF;
  font-size: 0.8em;
  line-height: 1.2;
}

/* Navigation menu */
#nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 0;
  flex: 0 1 auto;
}
#nav-menu a {
  padding: 6px 14px;
  border-radius: 6px;
  color: #4B5563;
  font-weight: 500;
  font-size: 0.9em;
  white-space: nowrap;
  transition: all 0.2s ease;
}
#nav-menu a:hover {
  background: #F3F4F6;
  color: #111827;
}
#nav-menu .current {
  background: #EEF2FF;
  color: #2563EB;
}

/* Search */
.site-search {
  flex-shrink: 0;
}
.search-toggle {
  width: 32px;
  height: 32px;
  border: none;
  background: #F3F4F6;
  border-radius: 8px;
  cursor: pointer;
  color: #4B5563;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-toggle:hover {
  background: #E5E7EB;
  color: #2563EB;
}
.search-form {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.8);
  padding: 20px;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}
.search-form.active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.search-form input {
  flex: 1;
  max-width: 600px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
}
.search-form input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}
.search-form .submit {
  padding: 12px 24px;
  background: #2563EB;
  color: #FFF;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}
.search-form .submit:hover {
  background: #1D4ED8;
}
.search-close {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 2px solid #FFF;
  color: #FFF;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: all 0.2s ease;
}
.search-close:hover {
  background: #FFF;
  color: #000;
}



/* ------------------
 * Main
 * --------------- */

.post {
  padding: 20px 0;
  border-bottom: 1px solid #E5E7EB;
  transition: transform 0.2s ease;
}
.post:hover {
  transform: translateX(4px);
}
.post-title {
  margin: 0 0 12px;
  font-size: 1.75em;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}
.post-title a {
  color: inherit;
}
.post-title a:hover {
  color: #2563EB;
}
.post-meta {
  margin: 0 0 16px;
  padding: 0;
  color: #6B7280;
  font-size: 0.875em;
}
.post-meta li {
  display: inline-block;
  margin: 0 12px 0 0;
  padding-left: 12px;
  border-left: 1px solid #D1D5DB;
}
.post-meta li:first-child {
  margin-left: 0;
  padding-left: 0;
  border: none;
}
.post-content {
  line-height: 1.8;
  color: #374151;
}
.post .tags {
  clear: both;
  margin-top: 16px;
}

/* 容器样式：Flex布局实现左右对齐 */
.post-near {
    list-style: none;
    margin: 30px 0;
    padding: 0;
    color: #999; /* 非链接文字（如“没有了”）保持灰色 */
    
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
}

/* 列表项通用样式 */
.post-near li {
    width: 48%; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

/* 左对齐上一篇 */
.post-near li:first-child {
    text-align: left;
}

/* 右对齐下一篇 */
.post-near li:last-child {
    text-align: right;
}

/* --- 核心修改：链接颜色改为橙色 --- */
.post-near a {
    text-decoration: none;
    color: #ff6600; /* 橙色 (你可以改成 #ff9900 或 orange) */
    transition: color 0.3s;
    font-weight: 500; /* 可选：稍微加粗一点让橙色更明显 */
}

/* 鼠标悬停时变深色，增加交互感 */
.post-near a:hover {
    color: #cc5200; /* 深橙色 */
    text-decoration: underline; /* 悬停时加下划线 */
}

/* --- 手机端适配 --- */
@media screen and (max-width: 768px) {
    .post-near {
        flex-direction: column;
        gap: 10px;
    }

    .post-near li {
        width: 100%;
        text-align: left !important; /* 手机端全部左对齐 */
        white-space: normal;
    }
}

.archive-title {
  margin: 2em 0 1em;
  padding: 16px 20px;
  background: #F3F4F6;
  border-left: 4px solid #2563EB;
  border-radius: 0 8px 8px 0;
  color: #374151;
  font-size: 1.1em;
  font-weight: 600;
}
.more {
  text-align: center;
  margin: 32px 0;
}
.more a {
  display: inline-block;
  padding: 12px 32px;
  background: #F3F4F6;
  color: #4B5563;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.more a:hover {
  background: #2563EB;
  color: #FFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.protected .text {
  width: 100%;
  max-width: 400px;
}

/* Page nav */

.page-navigator {
  list-style: none;
  margin: 40px 0;
  padding: 0;
  text-align: center;
}
.page-navigator li {
  display: inline-block;
  margin: 0 6px;
}
.page-navigator a {
  display: inline-block;
  padding: 0 16px;
  height: 40px;
  line-height: 40px;
  border-radius: 8px;
  color: #4B5563;
  font-weight: 500;
  transition: all 0.2s ease;
}
.page-navigator a:hover {
  background: #F3F4F6;
  color: #111827;
  text-decoration: none;
  transform: translateY(-2px);
}

.page-navigator .current a {
  color: #FFF;
  background: #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* ------------------
 * Comment list
 * --------------- */
#comments {
  padding-top: 16px;
}
.comment-list, .comment-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment-list li {
  padding: 16px;
  margin-top: 8px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.comment-list li:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.comment-list li.comment-level-odd {
  background: #F9FAFB;
}
.comment-list li.comment-level-even {
  background: #FFF;
}
.comment-list li.comment-by-author {
  background: #FEF3C7;
  border-color: #FCD34D;
}
.comment-list li .comment-reply {
  text-align: right;
  font-size: 0.875em;
}
.comment-list li .comment-reply a {
  color: #2563EB;
  font-weight: 500;
}
.comment-meta a {
  color: #6B7280;
  font-size: 0.875em;
}
.comment-author {
  display: block;
  margin-bottom: 8px;
  color: #111827;
  font-weight: 600;
}
.comment-author .avatar {
  float: left;
  margin-right: 12px;
  border-radius: 50%;
}
.comment-author cite {
  font-weight: 600;
  font-style: normal;
}

/* Comment reply */
.comment-list .respond {
  margin-top: 15px;
  border-top: 1px solid #EEE;
}
.respond .cancel-comment-reply {
  float: right;
  margin-top: 15px;
  font-size: .92857em;
}
.comment-form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 0;
}
.comment-form-field {
  flex: 1;
  margin: 0;
}
.comment-textarea-wrapper {
  position: relative;
}
.emoji-picker-trigger {
  position: absolute;
  right: 10px;
  top: 10px;
  cursor: pointer;
  font-size: 20px;
  user-select: none;
  z-index: 10;
}
.emoji-picker-trigger:hover {
  transform: scale(1.2);
}
.comment-submit-row {
  text-align: right;
  margin-top: 16px;
}
.comment-submit-row .submit {
  padding: 10px 32px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.comment-submit-row .submit:hover {
  background: #1D4ED8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}
.comment-submit-row .submit:active {
  transform: translateY(0);
}
#comment-form label {
  display: block;
  margin-bottom: .5em;
  font-weight: bold;
}
#comment-form .required:after {
  content: " *";
  color: #C00;
}
.emoji-picker-panel {
  position: fixed;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 320px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}
.emoji-item {
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  text-align: center;
  border-radius: 4px;
  transition: background 0.2s;
}
.emoji-item:hover {
  background: #f0f0f0;
}
@media (max-width: 768px) {
  .comment-form-row {
    flex-direction: column;
    gap: 0;
  }
  .comment-form-field {
    margin-bottom: 15px;
  }
  .emoji-picker-panel {
    max-width: 280px;
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ------------------
 * secondary
 * --------------- */
#secondary {
  padding-top: 16px;
  word-wrap: break-word;
}
.widget {
  margin-bottom: 24px;
  padding: 20px;
  background: #FFF;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}
.widget:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.widget h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: #111827;
  font-size: 1.1em;
  font-weight: 700;
  border-bottom: 2px solid #2563EB;
  padding-bottom: 8px;
}
.widget-list {
  list-style: none;
  padding: 0;
}
.widget-list li {
  margin: 8px 0;
  line-height: 1.8;
  transition: transform 0.2s ease;
}
.widget-list li:hover {
  transform: translateX(4px);
}
.widget-list li a {
  color: #4B5563;
}
.widget-list li a:hover {
  color: #2563EB;
}
.widget-list li ul {
  margin-left: 20px;
  margin-top: 8px;
}


/* ------------------
 * Footer 
 * --------------- */
#footer {
  padding: 32px 0;
  margin-top: 40px;
  background: #FFF;
  border-top: 1px solid #E5E7EB;
  line-height: 1.8;
  text-align: center;
  color: #6B7280;
  font-size: 0.9em;
}
#footer a {
  color: #4B5563;
  font-weight: 500;
}
#footer a:hover {
  color: #2563EB;
}


/* -----------------
 * Error page
 * -------------- */
.error-page {
  margin-top: 100px;
  margin-bottom: 100px;
}


/* -----------------
 * Content format
 *--------------- */
.post-content, .comment-content {
  line-height: 1.5;
  word-wrap: break-word;
}
.post-content h2, .comment-content h2 {
  font-size: 1.28571em;
}
.post-content img, .comment-content img,
.post-content video, .comment-content video {
  max-width: 100%;
}
.post-content a img,
.comment-content a img {
  background: #FFF;
  position: relative;
  bottom: -4px;  /* hidden img parent link border  */
}
.post-content hr, .comment-content hr {
  margin: 2em auto;
  width: 100px;
  border: 1px solid #E9E9E9;
  border-width: 2px 0 0 0;
}


/* -----------------
 * Misc
 *--------------- */
.aligncenter, div.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.alignleft {
  float: left;
}
.alignright {
  float: right;
}
img.alignleft {
  margin: 0 15px 0 0;
}
img.alignright {
  margin: 0 0 0 15px;
}


/* -----------------
 * Responsive
 *--------------- */
@media (max-width: 767px) {
  body {
    font-size: 15px;
    padding: 0;
  }
  
  #header {
    padding: 12px 16px;
  }
  
  #header .container {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .site-name {
    order: 1;
    flex: 1;
  }
  
  .site-search {
    order: 2;
    flex-shrink: 0;
  }
  
  #logo {
    font-size: 1.3em;
  }
  
  #nav-menu {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  #nav-menu a {
    padding: 8px 14px;
    font-size: 0.9em;
  }
  
  .post {
    padding: 24px 16px;
  }
  
  .post:hover {
    transform: none;
  }
  
  .post-title {
    font-size: 1.4em;
  }
  
  .post-meta {
    font-size: 0.85em;
  }
  
  .post-meta li {
    margin: 0 8px 0 0;
    padding-left: 8px;
  }
  
  #secondary {
    margin-top: 24px;
    padding: 0 16px;
  }
  
  .widget {
    padding: 20px;
    margin-bottom: 24px;
  }
  
  .page-navigator {
    margin: 32px 0;
  }
  
  .page-navigator a {
    padding: 0 12px;
    height: 36px;
    line-height: 36px;
    font-size: 0.9em;
  }
  
  .comment-list li {
    padding: 16px;
  }
  
  .comment-author .avatar {
    width: 36px;
    height: 36px;
  }
  
  #footer {
    padding: 32px 16px;
    margin-top: 40px;
  }
  
  h1 { font-size: 1.75em; }
  h2 { font-size: 1.5em; }
  h3 { font-size: 1.25em; }
  
  blockquote {
    padding: 12px 16px;
    margin: 1em 0;
  }
  
  pre {
    padding: 12px;
    font-size: 0.85em;
  }
  
  table th,
  table td {
    padding: 8px 12px;
    font-size: 0.9em;
  }
}

@media (max-width: 768px) {
  .post-title,
  .post-meta {
    text-align: center;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 900px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1000px;
  }
}


/*
* Hide from both screenreaders and browsers: h5bp.com/u
*/
.hidden {
  display: none !important;
  visibility: hidden; }

/*
* Hide only visually, but have it available for screenreaders: h5bp.com/v
*/
.sr-only {
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px; }

/*
* Extends the .sr-only class to allow the element to be focusable
* when navigated to via the keyboard: h5bp.com/p
*/
.sr-only.focusable:active,
.sr-only.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto; }

/*
* Hide visually and from screenreaders, but maintain layout
*/
.invisible {
  visibility: hidden; }

pre {
    position: relative;
}

pre:hover .code-copy {
    opacity: 1;
}

pre .code-copy {
    opacity: 0;
    transition: all 0.3s ease-in-out;
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
}

pre .code-copy:hover {
    background-color: #39afd1;
}

pre .code-copy:active {
    opacity: 0.7;
}
