/* Markdown编辑器页面样式 */

.markdown-editor-page {
  background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  min-height: 100vh;
}

.main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* 编辑器工具栏 */
.editor-toolbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.toolbar-section {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-btn {
  background: linear-gradient(135deg, #2751a0 0%, #1e3f7a 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(39, 81, 160, 0.3);
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(39, 81, 160, 0.4);
  background: linear-gradient(135deg, #1e3f7a 0%, #2751a0 100%);
}

.toolbar-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(39, 81, 160, 0.3);
}

.toolbar-btn strong {
  font-weight: 700;
}

.toolbar-btn em {
  font-style: italic;
}

.toolbar-btn del {
  text-decoration: line-through;
}

.toolbar-btn code {
  font-family: 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 4px;
  border-radius: 3px;
}

/* 编辑器容器 */
.editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  height: 700px;
}

.editor-section,
.preview-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  height: 700px;
  display: flex;
  flex-direction: column;
}

.section-header {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.section-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
}

.section-controls {
  display: flex;
  gap: 10px;
}

.control-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* 编辑器文本区域 */
#markdown-editor {
  width: 100%;
  flex: 1;
  border: none;
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  background: #f8f9fa;
  color: #2c3e50;
  outline: none;
  overflow-y: auto;
}

#markdown-editor:focus {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(39, 81, 160, 0.3);
}

/* CodeMirror 编辑器适配 */
.editor-section .CodeMirror {
  flex: 1;
  height: 100%;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: #f8f9fa;
}

.editor-section .CodeMirror pre {
  line-height: 1.6;
}

.editor-section .CodeMirror-gutters {
  background: #f0f3f6;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

/* 当前行高亮 */
.editor-section .CodeMirror-activeline-background {
  background: rgba(39, 81, 160, 0.08) !important;
}

/* 文本行线（横向网格线，随行高） */
.editor-section .CodeMirror-scroll {
  background-image: linear-gradient(to bottom, rgba(39, 81, 160, 0.08) 1px, transparent 1px);
  background-size: 100% 1.6em;
}

/* 预览区域 - 参考articles页面样式 */
.preview-content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
  color: #2c3e50;
  line-height: 1.8;
  font-family: 'Noto Serif SC', serif;
}

/* 标题样式 - 参考articles页面 */
.preview-content h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid rgba(17, 82, 166, 0.3);
  font-weight: 700;
}

.preview-content h2 {
  font-size: 2rem;
  color: #34495e;
  margin: 1.8rem 0 1rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid rgba(17, 82, 166, 0.2);
  font-weight: 600;
}

.preview-content h3 {
  font-size: 1.5rem;
  color: #34495e;
  margin: 1.5rem 0 0.8rem 0;
  font-weight: 600;
}

.preview-content h4 {
  font-size: 1.3rem;
  color: #34495e;
  margin: 1.3rem 0 0.6rem 0;
  font-weight: 600;
}

.preview-content h5 {
  font-size: 1.1rem;
  color: #34495e;
  margin: 1.1rem 0 0.5rem 0;
  font-weight: 600;
}

.preview-content h6 {
  font-size: 1rem;
  color: #34495e;
  margin: 1rem 0 0.4rem 0;
  font-weight: 600;
}

/* 段落样式 */
.preview-content p {
  margin: 1rem 0;
  text-align: justify;
}

/* 列表样式 */
.preview-content ul,
.preview-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.preview-content li {
  margin: 0.5rem 0;
}

/* 图片样式 - 参考articles页面 */
.preview-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.preview-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 引用块样式 */
.preview-content blockquote {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-left: 4px solid #2751a0;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #495057;
}

/* 代码样式 */
.preview-content code {
  background: #1a202c;
  color: #e2e8f0;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid #2d3748;
}

.preview-content pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #2d3748;
}

.preview-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.6;
  border: none;
}

/* 代码高亮语法颜色覆盖 */
.preview-content .hljs {
  background: #1a202c !important;
  color: #e2e8f0 !important;
}

.preview-content .hljs-keyword {
  color: #ff6b6b !important;
}

.preview-content .hljs-string {
  color: #51cf66 !important;
}

.preview-content .hljs-number {
  color: #74c0fc !important;
}

.preview-content .hljs-comment {
  color: #868e96 !important;
  font-style: italic;
}

.preview-content .hljs-function {
  color: #ffd43b !important;
}

.preview-content .hljs-variable {
  color: #e2e8f0 !important;
}

.preview-content .hljs-operator {
  color: #ff6b6b !important;
}

.preview-content .hljs-punctuation {
  color: #e2e8f0 !important;
}

.preview-content .hljs-property {
  color: #74c0fc !important;
}

.preview-content .hljs-class {
  color: #ffd43b !important;
}

.preview-content .hljs-built_in {
  color: #ffd43b !important;
}

.preview-content .hljs-title {
  color: #ffd43b !important;
}

.preview-content .hljs-params {
  color: #e2e8f0 !important;
}

.preview-content .hljs-literal {
  color: #74c0fc !important;
}

.preview-content .hljs-regexp {
  color: #51cf66 !important;
}

.preview-content .hljs-symbol {
  color: #ffd43b !important;
}

.preview-content .hljs-tag {
  color: #ff6b6b !important;
}

.preview-content .hljs-name {
  color: #ff6b6b !important;
}

.preview-content .hljs-attr {
  color: #74c0fc !important;
}

.preview-content .hljs-value {
  color: #51cf66 !important;
}

/* 表格样式 - 参考articles页面 */
.preview-content table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
}

.preview-content th {
  background: linear-gradient(135deg, #2751a0, #1e3f7a);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #1e3f7a;
}

.preview-content td {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  vertical-align: top;
}

.preview-content tr:hover {
  background: #f8f9fa;
}

.preview-content tr:last-child td {
  border-bottom: none;
}

/* 文本格式化 */
.preview-content strong {
  font-weight: 700;
  color: #2c3e50;
}

.preview-content em {
  font-style: italic;
  color: #34495e;
}

.preview-content del {
  color: #6c757d;
  text-decoration: line-through;
}

/* 链接样式 */
.preview-content a {
  color: #2751a0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.3s ease;
}

.preview-content a:hover {
  border-bottom: 1px solid #2751a0;
}

/* 水平分割线样式 */
.preview-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(17, 82, 166, 0.5), transparent);
  margin: 2rem 0;
}

/* 任务列表样式 */
.preview-content .task-list {
  list-style: none;
  padding-left: 0;
}

.preview-content .task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.preview-content .task-item input[type="checkbox"] {
  margin-top: 0.2rem;
  transform: scale(1.2);
}

.preview-content .task-item.completed span {
  text-decoration: line-through;
  color: #6c757d;
}

/* 脚注样式 */
.preview-content .footnotes {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #dee2e6;
}

.preview-content .footnotes h3 {
  color: #495057;
  margin-bottom: 1rem;
}

.preview-content .footnote {
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
}

.preview-content .footnote-link {
  color: #2751a0;
  text-decoration: none;
  font-weight: bold;
}

.preview-content .footnote-link:hover {
  text-decoration: underline;
}

.preview-content .footnote-text {
  margin-left: 0.5rem;
}

.preview-content .footnote-ref {
  color: #2751a0;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.8em;
  vertical-align: super;
}

.preview-content .footnote-ref:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (min-width: 1600px) {
  .main-content {
    max-width: 1800px;
  }
  
  .editor-container {
    gap: 30px;
    height: 800px;
  }
  
  .editor-section,
  .preview-section {
    height: 800px;
  }
}

@media (max-width: 868px) {
  .editor-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .editor-section,
  .preview-section {
    height: 600px;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 10px;
  }
  
  .editor-toolbar {
    padding: 15px;
    gap: 10px;
  }
  
  .toolbar-section {
    gap: 5px;
  }
  
  .toolbar-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-width: 35px;
  }
  
  .section-header {
    padding: 12px 15px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .section-controls {
    width: 100%;
    justify-content: flex-end;
  }
  
  .control-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .editor-section,
  .preview-section {
    height: 500px;
  }
  
  #markdown-editor,
  .preview-content {
    padding: 15px;
    font-size: 13px;
  }
  
  .preview-content h1 {
    font-size: 2rem;
  }
  
  .preview-content h2 {
    font-size: 1.6rem;
  }
  
  .preview-content h3 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .toolbar-btn {
    padding: 6px 10px;
    font-size: 11px;
    min-width: 30px;
  }
  
  .editor-section,
  .preview-section {
    height: 400px;
  }
  
  #markdown-editor,
  .preview-content {
    padding: 10px;
    font-size: 12px;
  }
  
  .section-header h3 {
    font-size: 1rem;
  }
  
  .control-btn {
    padding: 4px 8px;
    font-size: 10px;
  }
  .markdown-editor-page header .header-content h1 { font-size: 2.0rem; }
  .markdown-editor-page #typing-text { font-size: 1.0rem; }
}

/* 全屏模态框样式 */
.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.fullscreen-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { 
    transform: scale(0.8);
    opacity: 0;
  }
  to { 
    transform: scale(1);
    opacity: 1;
  }
}

.fullscreen-modal button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 10000;
  transition: background 0.3s ease;
}

.fullscreen-modal button:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .fullscreen-modal {
    padding: 10px;
  }
  
  .fullscreen-modal img {
    max-width: 95vw;
    max-height: 95vh;
  }
}

/* Mermaid图表样式 */
.mermaid-chart {
  margin: 2rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.chart-container {
  overflow-x: auto;
  text-align: center;
}

.mermaid {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 全景照片样式 */
.panorama-container {
  margin: 2rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.panorama-header {
  margin-bottom: 1rem;
  text-align: center;
}

.panorama-header h4 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  font-size: 1.2rem;
}

.panorama-header p {
  margin: 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.panorama-viewer {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  height: 400px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panorama-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  z-index: 10;
}

.panorama-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.panorama-loading p {
  margin: 0;
  color: #ecf0f1;
  font-size: 14px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 图片容器样式 */
.mdx-image-container {
  margin: 1.5rem 0;
  text-align: center;
}

.mdx-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.mdx-image:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
} 