/* 引入Tailwind CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

/* 自定义样式 */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #6366f1;
  --accent: #f43f5e;
  --dark: #1e293b;
  --light: #f8fafc;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}

/* 自定义组件样式 */
.btn {
  @apply px-4 py-2 rounded-lg font-medium transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-offset-2;
}

.btn-primary {
  @apply bg-primary text-white hover:bg-primary-dark focus:ring-primary;
}

.btn-secondary {
  @apply bg-secondary text-white hover:bg-indigo-700 focus:ring-secondary;
}

.btn-outline {
  @apply border border-gray-300 text-gray-700 hover:bg-gray-50 focus:ring-gray-500;
}

.btn-danger {
  @apply bg-danger text-white hover:bg-red-600 focus:ring-danger;
}

.card {
  @apply bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-lg;
}

.card-header {
  @apply p-4 border-b border-gray-200 bg-gray-50;
}

.card-body {
  @apply p-4;
}

.message-card {
  @apply card mb-4 hover:shadow-lg transform hover:-translate-y-1;
}

/* 调试高亮样式 */
.debug-highlight {
  background-color: #fff9c4 !important;
  border: 2px solid #ffeb3b !important;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* 确保Markdown标签正确显示 */
[id^="message-content-"] h1,
[id^="message-content-"] h2,
[id^="message-content-"] h3,
[id^="message-content-"] h4,
[id^="message-content-"] h5,
[id^="message-content-"] h6 {
  color: #333;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

[id^="message-content-"] h1 {
  font-size: 1.8rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.3rem;
}

[id^="message-content-"] h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.2rem;
}

[id^="message-content-"] strong {
  font-weight: bold;
  color: #333;
}

[id^="message-content-"] em {
  font-style: italic;
}

[id^="message-content-"] del {
  text-decoration: line-through;
  color: #666;
}

[id^="message-content-"] ul,
[id^="message-content-"] ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* 代码块样式优化 - 特别针对Markdown 3.7生成的格式 */
[id^="message-content-"] pre {
  background-color: #f8f8f8;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 单行代码样式 */
[id^="message-content-"] code {
  background-color: #f1f1f1;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  color: #e74c3c;
}

/* 代码块内的代码样式 */
[id^="message-content-"] pre > code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  color: #333;
}

/* Python代码块样式 */
[id^="message-content-"] pre > code.language-python {
  color: #3776ab;
}

/* 确保表格样式正确 */
[id^="message-content-"] table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1rem;
}

[id^="message-content-"] th,
[id^="message-content-"] td {
  border: 1px solid #ddd;
  padding: 8px;
}

[id^="message-content-"] th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.form-control {
  @apply w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all;
}

.navbar {
  @apply bg-white shadow-md py-3 px-4 md:px-6 fixed w-full z-50 transition-all duration-300;
}

.navbar.scrolled {
  @apply py-2 shadow-lg;
}

.footer {
  @apply bg-gray-800 text-white py-6 mt-auto;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Markdown编辑器样式 */
#markdownSplitContainer {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

/* 自定义全屏内容容器 */
.content-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 确保消息表单也能铺满宽度 */
.message-form {
  max-width: 100%;
  width: 100%;
}

/* 优化电脑端留言表单宽度 */
@media (min-width: 768px) {
  .landscape-container {
    max-width: 100% !important;
    width: 100% !important;
  }
  
  #mainMessageForm {
    max-width: 100% !important;
    width: 100% !important;
  }
  
  /* 移除容器可能的最大宽度限制 */
  main.content-wrapper.container {
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* 移除所有可能限制内容宽度的容器类 */
.content-fullscreen.container {
  max-width: 100% !important;
}

/* 确保markdown编辑器容器完全适应宽度 */
#markdownSplitContainer {
  max-width: 100%;
}

/* 确保编辑器和预览区在所有设备上都左右分布且占满宽度 */
#markdownSplitContainer .md\:flex {
  display: flex;
  width: 100%;
  height: 100%;
}

#markdownSplitContainer .md\:w-1\/2 {
  flex: 1;
  width: 50% !important;
  height: 100%;
}

/* 适配宽屏的Markdown编辑区 - 确保适应上层框架 */
.markdown-editor-full {
    height: 100%;
    min-height: 600px;
    max-height: none;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 确保markdown编辑器容器铺满全屏并适应各种设备 */
#markdownSplitContainer {
  height: 100%;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0; /* 移除圆角，使其更适合全屏显示 */
}

/* 为编辑器和预览区容器设置自适应高度 */
#markdownEditorContainer {
  margin-bottom: 2rem; /* 增加底部间距，确保不占用下面内容位置 */
}

/* 确保编辑器和预览框内容区占满空间，保持左右分布 */
#markdownSplitContainer .md\:flex {
  height: auto !important;
  display: flex;
}

/* Markdown编辑器全屏样式 */
#markdownSplitContainer:fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 9999;
  background-color: white;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

#markdownSplitContainer:-webkit-full-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 9999;
  background-color: white;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

#markdownSplitContainer:-moz-full-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 9999;
  background-color: white;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

/* 全屏状态下的编辑器和预览区 */
#markdownSplitContainer:fullscreen .md\:flex {
  height: calc(100vh - 41px); /* 减去标题栏高度 */
}

#markdownSplitContainer:-webkit-full-screen .md\:flex {
  height: calc(100vh - 41px);
}

#markdownSplitContainer:-moz-full-screen .md\:flex {
  height: calc(100vh - 41px);
}

/* 全屏按钮样式 */
#markdownFullscreenBtn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#markdownFullscreenBtn:hover {
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* 确保编辑器和预览框内容区占满空间 */
#markdownEditor {
  width: 100%;
  height: auto;
  min-height: 200px;
  max-height: none;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  margin: 0;
  resize: vertical;
  background-color: white;
  transition: height 0.3s ease;
}

#markdownPreview {
  width: 100%;
  height: auto;
  min-height: 200px;
  max-height: none;
  padding: 1rem;
  margin: 0;
  overflow-y: auto;
  flex-grow: 1;
}

/* 确保编辑器和预览区域的容器适应父容器高度 */
#markdownSplitContainer .p-4 {
    padding: 0 !important;
    height: auto;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    border: none;
}

/* 增加留言表单section与下方内容的间距 */
section.message-form {
  margin-bottom: 3rem !important;
  padding-bottom: 2rem;
}

/* 确保在所有设备上都保持左右分布布局 */
@media (max-width: 768px) {
  .content-fullscreen {
    padding: 0 !important;
  }
  
  #markdownSplitContainer {
    height: auto;
    min-height: 600px; /* 为移动设备设置足够的最小高度 */
  }
}

#markdownSplitContainer:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

/* Markdown编辑器textarea样式 */
#markdownEditor {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    resize: vertical;
    min-height: 200px;
    height: auto;
    background-color: white;
}

/* Markdown预览区域 */
#markdownPreview {
  height: auto;
  min-height: 200px;
}

#markdownEditor:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Markdown预览区域 */
#markdownPreview {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #1e293b;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

#markdownPreview::-webkit-scrollbar {
  width: 6px;
}

#markdownPreview::-webkit-scrollbar-track {
  background: #f8fafc;
}

#markdownPreview::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#markdownPreview::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 预览区域内容样式优化 */
#markdownPreview h1, #markdownPreview h2, #markdownPreview h3, #markdownPreview h4, #markdownPreview h5, #markdownPreview h6 {
  color: #0f172a;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

#markdownPreview h1 {
  font-size: 1.8rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.3rem;
}

#markdownPreview h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.2rem;
}

#markdownPreview p {
  margin-bottom: 1rem;
  color: #334155;
}

#markdownPreview a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

#markdownPreview a:hover {
  color: #2563eb;
  text-decoration: underline;
}

#markdownPreview ul, #markdownPreview ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  color: #334155;
}

#markdownPreview li {
  margin-bottom: 0.5rem;
}

#markdownPreview code {
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  background-color: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.875em;
  color: #e74c3c;
}

#markdownPreview pre {
  background-color: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

#markdownPreview pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

#markdownPreview blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1rem;
  color: #64748b;
  font-style: italic;
}

/* 响应式调整 - 保持左右分布布局 */
@media (max-width: 768px) {
  #markdownEditor {
    min-height: 200px;
    font-size: 14px; /* 为小屏幕优化字体大小 */
  }
  
  #markdownPreview {
    min-height: 200px;
    font-size: 14px; /* 为小屏幕优化字体大小 */
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 响应式断点优化 */
@media (max-width: 640px) {
  .container {
    @apply px-4;
  }
  
  .navbar {
    @apply px-3;
  }
}

/* 加载动画 */
.loader {
  @apply border-4 border-gray-200 border-t-primary rounded-full w-8 h-8 animate-spin;
}

/* 阴影和深度 */
.shadow-depth {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

/* 文本渐变 */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 按钮脉冲效果 */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* 确保内容区域在导航栏下方 */
.content-wrapper {
  padding-top: 70px;
  min-height: 100vh;
}

/* 留言表单样式 */
.message-form {
  @apply mb-8;
}

.message-form textarea {
  @apply min-h-[120px] resize-y;
}

/* 管理员面板样式 */
.admin-section {
  @apply mb-8 p-4 bg-white rounded-xl shadow-md;
}

/* 状态指示器 */
.status-indicator {
  @apply inline-block w-2 h-2 rounded-full mr-2;
}

.status-online {
  @apply bg-success;
}

.status-offline {
  @apply bg-gray-400;
}

/* 点赞按钮样式 */
.like-btn {
  @apply flex items-center space-x-1 text-gray-500 hover:text-red-500 transition-colors;
}

/* 卡片悬停效果 */
.card-hover {
  @apply transition-all duration-300 hover:shadow-lg hover:-translate-y-1;
}

/* 模态框样式 */
.modal-backdrop {
  @apply fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center;
}

.modal-content {
  @apply bg-white rounded-xl shadow-2xl p-6 max-w-md w-full mx-4;
}

/* 工具提示样式 */
.tooltip {
  @apply relative inline-block;
}

.tooltip .tooltip-text {
  @apply invisible absolute bg-gray-800 text-white text-xs rounded py-1 px-2 z-10 w-max opacity-0 transition-opacity duration-300;
}

.tooltip:hover .tooltip-text {
  @apply visible opacity-100;
}

/* 富文本编辑器样式 - Word风格 */
.editor-toolbar-wrapper {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.editor-toolbar-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    padding: 2px 4px;
}

.editor-toolbar-row.bg-gray-50 {
    background: #f8f9fa;
}

.editor-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-right: 8px;
}

.editor-group-label {
    display: none; /* 在Word风格中不显示标签 */
}

.editor-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #333;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    font-size: 14px;
    padding: 0 4px;
}

.editor-btn:hover {
    background: #f1f3f4;
    border-color: #d1d5db;
}

.editor-btn.active {
    background: #e8f0fe;
    border-color: #2563eb;
    color: #1d4ed8;
}

.editor-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Word风格颜色选择器 */
.editor-color-picker {
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    z-index: 1000;
    min-width: 200px;
    padding: 12px;
}

.editor-color-picker span {
    transition: transform 0.1s ease;
    width: 24px;
    height: 24px;
    display: inline-block;
    border-radius: 2px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    margin: 1px;
}

.editor-color-picker span:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.editor-color-picker input[type="color"] {
    border: 1px solid #d1d5db;
    cursor: pointer;
    width: 100%;
    height: 32px;
    margin-top: 8px;
    border-radius: 2px;
}

/* 下拉菜单样式 - Word风格 */
.editor-btn select {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 2px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.editor-btn select:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.editor-btn select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* 分隔线样式 */
.editor-toolbar-row .h-6 {
    height: 24px;
    width: 1px;
    background: #e0e0e0;
    margin: 0 4px;
}

/* Word风格文档区域 */
#htmlEditorContainer .relative {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 文档标题栏 */
#htmlEditorContainer .bg-white.border-gray-200 {
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    padding: 8px 16px;
    border-bottom: none;
}

/* 文档容器 */
#htmlEditorContainer .border-gray-200.rounded-b-lg.shadow-md {
    border: 1px solid #e0e0e0;
    border-top: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 0 0 4px 4px;
}

/* 页眉页脚样式 */
#htmlEditorContainer .border-b.border-gray-200,
#htmlEditorContainer .border-t.border-gray-200 {
    border-color: #e0e0e0;
    background: #f8f9fa;
    font-size: 12px;
    color: #6b7280;
    padding: 8px 16px;
}

/* 编辑内容区域 */
#htmlEditorContainer .p-8 {
    padding: 2rem;
}

/* A4纸张样式 */
.editor-page {
    background: white;
    max-width: 210mm;
    margin: 2rem auto;
    padding: 2cm;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.editor-page:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid #e0e0e0;
    pointer-events: none;
}

/* 编辑内容区域 */
#htmlEditor {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    min-height: 600px;
    padding: 2rem;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
    resize: vertical;
    overflow-y: auto;
}

#htmlEditor:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* 富文本编辑器内容样式 - Word风格美化 */
#htmlEditor h1,
#htmlEditor h2,
#htmlEditor h3,
#htmlEditor h4,
#htmlEditor h5,
#htmlEditor h6 {
    color: #1a1a1a;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}

#htmlEditor h1 {
    font-size: 2.25rem;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3rem;
}

#htmlEditor h2 {
    font-size: 1.875rem;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.25rem;
}

#htmlEditor h3 {
    font-size: 1.5rem;
}

#htmlEditor h4 {
    font-size: 1.25rem;
}

#htmlEditor h5 {
    font-size: 1.125rem;
}

#htmlEditor h6 {
    font-size: 1rem;
    color: #6b7280;
}

#htmlEditor p {
    margin-bottom: 1rem;
    text-align: justify;
    hyphens: auto;
}

#htmlEditor a {
    color: #0066cc;
    text-decoration: none;
    transition: all 0.2s ease;
}

#htmlEditor a:hover {
    color: #0052a3;
    text-decoration: underline;
}

#htmlEditor ul,
#htmlEditor ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

#htmlEditor ul li,
#htmlEditor ol li {
    margin-bottom: 0.5rem;
}

#htmlEditor ul {
    list-style-type: disc;
}

#htmlEditor ol {
    list-style-type: decimal;
}

#htmlEditor ul.task-list {
    list-style-type: none;
    padding-left: 1.5rem;
}

#htmlEditor ul.task-list li {
    position: relative;
    padding-left: 1.5rem;
}

#htmlEditor ul.task-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 18px;
    height: 18px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: white;
}

#htmlEditor ul.task-list li.checked:before {
    background-color: #2563eb;
    border-color: #2563eb;
}

#htmlEditor ul.task-list li.checked:after {
    content: '✓';
    position: absolute;
    left: 3px;
    top: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

#htmlEditor blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #4b5563;
    font-style: italic;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0 4px 4px 0;
}

#htmlEditor code {
    background: #f3f4f6;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d946ef;
}

#htmlEditor pre {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
}

#htmlEditor pre code {
    background: transparent;
    padding: 0;
    color: #333;
}

#htmlEditor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
}

#htmlEditor table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

#htmlEditor th,
#htmlEditor td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

#htmlEditor th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

#htmlEditor tr:nth-child(even) {
    background: #f8fafc;
}

#htmlEditor tr:hover {
    background: #f1f5f9;
}

#htmlEditor hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* 全屏编辑样式 - Word风格 */
.editor-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: white;
    display: flex;
    flex-direction: column;
}

.editor-fullscreen .editor-toolbar-wrapper {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.editor-fullscreen #htmlEditor {
    flex: 1;
    border-radius: 0;
    border: none;
    min-height: auto;
}

/* 响应式调整 - Word风格适配 */
@media (max-width: 1024px) {
    #htmlEditor {
        padding: 1.5rem;
        min-height: 500px;
    }
    
    .editor-toolbar-row {
        flex-wrap: wrap;
    }
    
    .editor-toolbar-group {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    #htmlEditor {
        padding: 1rem;
        min-height: 400px;
        font-size: 15px;
    }
    
    .editor-btn {
        min-width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .editor-toolbar-row {
        padding: 2px;
    }
    
    .editor-btn select {
        min-width: 80px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    #htmlEditor {
        padding: 1rem;
        min-height: 300px;
    }
    
    .editor-toolbar-wrapper {
        font-size: 12px;
    }
    
    .editor-btn {
        min-width: 24px;
        height: 24px;
        padding: 2px;
    }
    
    .editor-btn select {
        min-width: 60px;
        font-size: 11px;
        padding: 2px 4px;
    }
    
    #htmlEditorContainer .p-8 {
        padding: 1rem;
    }
    
    /* 移动设备上的颜色选择器调整 */
    .editor-color-picker {
        max-width: 280px;
        right: 0;
        left: auto;
    }
    
    .editor-color-picker .grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    /* 移动设备上的文档标题栏调整 */
    #htmlEditorContainer .bg-white.border-gray-200 {
        padding: 6px 12px;
    }
}

/* 编辑器动画效果 */
#htmlEditor {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 滚动条美化 */
#htmlEditor::-webkit-scrollbar {
    width: 6px;
}

#htmlEditor::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#htmlEditor::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#htmlEditor::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 文件上传功能已移除，相关样式已完全删除 */

/* PDF链接样式 */
.pdf-link {
    display: inline-block;
    padding: 8px 12px;
    margin: 5px 0;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pdf-link:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    color: #007bff;
    text-decoration: none;
}

/* 字数统计样式 */
.word-count {
    font-size: 12px;
    color: #6b7280;
    background: #f8fafc;
    border-top: 1px solid #e0e0e0;
    padding: 4px 16px;
    text-align: right;
}