/* ===== 代码高亮样式 ===== */
.post-content pre,
.post-content code {
  font-family: var(--font-family-mono);
}

.post-content code {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-glow-color);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.post-content pre {
  background: #1a1a2e;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 0;
  margin: var(--spacing-lg) 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.post-content pre code {
  background: none;
  border: none;
  padding: var(--spacing-lg);
  display: block;
  overflow-x: auto;
  color: #e5e7eb;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 代码块头部 */
.code-header {
  background: rgba(0, 0, 0, 0.3);
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.code-language {
  color: var(--accent-glow-color);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-copy-btn {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--accent-glow-color);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.code-copy-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  transform: translateY(-1px);
}

.code-copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

/* Rouge 语法高亮主题 (类似 Code Buddy 风格) */
.highlight {
  background: #1a1a2e;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.highlight .c { color: #6b7280; font-style: italic; } /* Comment */
.highlight .err { color: #ef4444; } /* Error */
.highlight .k { color: #8b5cf6; font-weight: bold; } /* Keyword */
.highlight .l { color: #f59e0b; } /* Literal */
.highlight .n { color: #e5e7eb; } /* Name */
.highlight .o { color: #06b6d4; } /* Operator */
.highlight .p { color: #9ca3af; } /* Punctuation */
.highlight .cm { color: #6b7280; font-style: italic; } /* Comment.Multiline */
.highlight .cp { color: #8b5cf6; font-weight: bold; } /* Comment.Preproc */
.highlight .c1 { color: #6b7280; font-style: italic; } /* Comment.Single */
.highlight .cs { color: #6b7280; font-weight: bold; font-style: italic; } /* Comment.Special */
.highlight .gd { color: #ef4444; } /* Generic.Deleted */
.highlight .ge { font-style: italic; } /* Generic.Emph */
.highlight .gr { color: #ef4444; } /* Generic.Error */
.highlight .gh { color: #e5e7eb; font-weight: bold; } /* Generic.Heading */
.highlight .gi { color: #22c55e; } /* Generic.Inserted */
.highlight .go { color: #9ca3af; } /* Generic.Output */
.highlight .gp { color: #9ca3af; } /* Generic.Prompt */
.highlight .gs { font-weight: bold; } /* Generic.Strong */
.highlight .gu { color: #06b6d4; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #ef4444; } /* Generic.Traceback */
.highlight .kc { color: #8b5cf6; font-weight: bold; } /* Keyword.Constant */
.highlight .kd { color: #8b5cf6; font-weight: bold; } /* Keyword.Declaration */
.highlight .kn { color: #8b5cf6; font-weight: bold; } /* Keyword.Namespace */
.highlight .kp { color: #8b5cf6; } /* Keyword.Pseudo */
.highlight .kr { color: #8b5cf6; font-weight: bold; } /* Keyword.Reserved */
.highlight .kt { color: #f59e0b; font-weight: bold; } /* Keyword.Type */
.highlight .ld { color: #22c55e; } /* Literal.Date */
.highlight .m { color: #f59e0b; } /* Literal.Number */
.highlight .s { color: #22c55e; } /* Literal.String */
.highlight .na { color: #06b6d4; } /* Name.Attribute */
.highlight .nb { color: #f59e0b; } /* Name.Builtin */
.highlight .nc { color: #f59e0b; font-weight: bold; } /* Name.Class */
.highlight .no { color: #ef4444; } /* Name.Constant */
.highlight .nd { color: #06b6d4; } /* Name.Decorator */
.highlight .ni { color: #ec4899; } /* Name.Entity */
.highlight .ne { color: #ef4444; font-weight: bold; } /* Name.Exception */
.highlight .nf { color: #06b6d4; font-weight: bold; } /* Name.Function */
.highlight .nl { color: #f59e0b; font-weight: bold; } /* Name.Label */
.highlight .nn { color: #f59e0b; } /* Name.Namespace */
.highlight .nx { color: #e5e7eb; } /* Name.Other */
.highlight .py { color: #e5e7eb; } /* Name.Property */
.highlight .nt { color: #ec4899; font-weight: bold; } /* Name.Tag */
.highlight .nv { color: #06b6d4; } /* Name.Variable */
.highlight .ow { color: #8b5cf6; font-weight: bold; } /* Operator.Word */
.highlight .w { color: #6b7280; } /* Text.Whitespace */
.highlight .mf { color: #f59e0b; } /* Literal.Number.Float */
.highlight .mh { color: #f59e0b; } /* Literal.Number.Hex */
.highlight .mi { color: #f59e0b; } /* Literal.Number.Integer */
.highlight .mo { color: #f59e0b; } /* Literal.Number.Oct */
.highlight .sb { color: #22c55e; } /* Literal.String.Backtick */
.highlight .sc { color: #22c55e; } /* Literal.String.Char */
.highlight .sd { color: #22c55e; font-style: italic; } /* Literal.String.Doc */
.highlight .s2 { color: #22c55e; } /* Literal.String.Double */
.highlight .se { color: #f59e0b; } /* Literal.String.Escape */
.highlight .sh { color: #22c55e; } /* Literal.String.Heredoc */
.highlight .si { color: #f59e0b; } /* Literal.String.Interpol */
.highlight .sx { color: #22c55e; } /* Literal.String.Other */
.highlight .sr { color: #22c55e; } /* Literal.String.Regex */
.highlight .s1 { color: #22c55e; } /* Literal.String.Single */
.highlight .ss { color: #ec4899; } /* Literal.String.Symbol */
.highlight .bp { color: #f59e0b; } /* Name.Builtin.Pseudo */
.highlight .vc { color: #06b6d4; } /* Name.Variable.Class */
.highlight .vg { color: #06b6d4; } /* Name.Variable.Global */
.highlight .vi { color: #06b6d4; } /* Name.Variable.Instance */
.highlight .il { color: #f59e0b; } /* Literal.Number.Integer.Long */

/* 表格样式 */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-lg) 0;
  background: rgba(17, 24, 39, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.post-content th,
.post-content td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.post-content th {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-glow-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.post-content td {
  color: var(--primary-text-color);
}

.post-content tr:hover {
  background: rgba(0, 212, 255, 0.05);
}

/* 图片样式 */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--spacing-lg) 0;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--glass-border);
}

/* 分隔线样式 */
.post-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--accent-glow-color), 
    transparent
  );
  margin: var(--spacing-xl) 0;
  border-radius: 1px;
}

/* 键盘按键样式 */
.post-content kbd {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 0.2em 0.4em;
  font-family: var(--font-family-mono);
  font-size: 0.875em;
  color: var(--primary-text-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 标记文本样式 */
.post-content mark {
  background: rgba(236, 72, 153, 0.3);
  color: var(--primary-text-color);
  padding: 0.1em 0.2em;
  border-radius: 2px;
}

/* 删除线样式 */
.post-content del {
  color: var(--secondary-text-color);
  text-decoration: line-through;
  opacity: 0.7;
}

/* 下划线样式 */
.post-content ins {
  color: var(--accent-glow-color);
  text-decoration: underline;
  text-decoration-color: rgba(0, 212, 255, 0.5);
}

/* 上标和下标 */
.post-content sup,
.post-content sub {
  font-size: 0.75em;
  color: var(--secondary-text-color);
}

/* 响应式代码块 */
@media (max-width: 768px) {
  .post-content pre code {
    font-size: 0.75rem;
    padding: var(--spacing-md);
  }
  
  .code-header {
    padding: var(--spacing-xs) var(--spacing-sm);
  }
  
  .code-copy-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
  
  .post-content table {
    font-size: 0.875rem;
  }
  
  .post-content th,
  .post-content td {
    padding: var(--spacing-xs) var(--spacing-sm);
  }
}