/**
 * 微信 Markdown 排版工具 v2.0 - 样式表
 */

/* ═══════════════════════════════════════════
   基础重置与变量
═══════════════════════════════════════════ */
:root {
  --primary: #c8553d;
  --primary-light: #e07a5f;
  --primary-dark: #a0442f;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border: #e8e8e8;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* ═══════════════════════════════════════════
   文章列表面板
═══════════════════════════════════════════ */
.article-panel {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.article-panel.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
}

.article-panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-panel-title {
  font-weight: 600;
  font-size: 15px;
}

.article-panel-header-actions {
  display: flex;
  gap: 8px;
}

.article-panel-new-btn,
.article-panel-toggle-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.article-panel-new-btn:hover,
.article-panel-toggle-btn:hover {
  background: var(--primary);
  color: white;
}

.article-panel-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.article-panel-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
}

.article-panel-search input:focus {
  border-color: var(--primary);
}

.article-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.ap-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.ap-card {
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  margin-bottom: 4px;
}

.ap-card:hover {
  background: var(--bg);
}

.ap-card.active {
  background: rgba(200, 85, 61, 0.08);
}

.ap-card-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.ap-card-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
  border-radius: 4px;
}

.ap-card:hover .ap-card-del {
  opacity: 1;
}

.ap-card-del:hover {
  background: #ffebee;
  color: #c62828;
}

.article-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════
   主内容区
═══════════════════════════════════════════ */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ═══════════════════════════════════════════
   顶部操作栏
═══════════════════════════════════════════ */
.action-bar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
}

.action-bar-left,
.action-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tab-switcher {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
}

.tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.render-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.render-dot {
  width: 6px;
  height: 6px;
  background: #4caf50;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.save-status {
  font-size: 12px;
  color: var(--text-tertiary);
  min-width: 50px;
}

.save-status.saving {
  color: #ff9800;
}

.save-status.saved {
  color: #4caf50;
}

.action-btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.action-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.action-btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.action-btn-primary {
  background: var(--primary);
  color: white;
}

.action-btn-primary:hover {
  background: var(--primary-dark);
}

.settings-gear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.settings-gear-btn:hover,
.settings-gear-btn.active {
  background: var(--bg);
  color: var(--text);
}

/* ═══════════════════════════════════════════
   标题输入
═══════════════════════════════════════════ */
.title-input-row {
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

#articleTitle {
  width: 100%;
  font-size: 20px;
  font-weight: 600;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
}

#articleTitle::placeholder {
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════
   工作区
═══════════════════════════════════════════ */
.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ═══════════════════════════════════════════
   编辑器面板
═══════════════════════════════════════════ */
.editor-pane,
.preview-pane,
.visual-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  background: var(--surface);
}

.pane-header {
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pane-header-icon {
  font-size: 14px;
}

.pane-header-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.pane-header-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.pane-header-btn:hover {
  background: var(--bg);
}

#editor {
  flex: 1;
  width: 100%;
  padding: 20px;
  border: none;
  outline: none;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  line-height: 1.8;
  resize: none;
  background: var(--surface);
  color: var(--text);
  tab-size: 2;
}

/* 拖拽上传提示 */
.editor-drag-overlay {
  position: absolute;
  top: 44px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: rgba(200, 85, 61, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  border-radius: 12px;
}

.editor-drag-overlay.show {
  opacity: 1;
  visibility: visible;
}

.editor-drag-overlay-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounce 1s infinite;
}

.editor-drag-overlay-text {
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.editor-drag-overlay-hint {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 8px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ═══════════════════════════════════════════
   分隔线
═══════════════════════════════════════════ */
.divider {
  width: 6px;
  background: var(--border);
  cursor: col-resize;
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 30px;
  background: var(--text-tertiary);
  border-radius: 1px;
  opacity: 0.5;
}

.divider:hover,
.divider.dragging {
  background: var(--primary);
}

.divider:hover::before,
.divider.dragging::before {
  background: white;
  opacity: 1;
}

/* ═══════════════════════════════════════════
   预览面板
═══════════════════════════════════════════ */
.preview-scroll {
  flex: 1;
  overflow: auto;
  padding: 20px;
  background: #f0f0f0;
  display: flex;
  justify-content: center;
}

/* 设备外壳 */
.device-shell {
  transition: var(--transition);
}

.device-shell[data-device="iphone-se"] .device-bezel { width: 375px; height: 667px; }
.device-shell[data-device="iphone-14"] .device-bezel { width: 390px; height: 844px; }
.device-shell[data-device="iphone-15-pro"] .device-bezel { width: 393px; height: 852px; }
.device-shell[data-device="iphone-15-pm"] .device-bezel { width: 430px; height: 932px; }
.device-shell[data-device="pixel"] .device-bezel { width: 412px; height: 915px; }
.device-shell[data-device="ipad"] .device-bezel { width: 768px; height: 1024px; transform: scale(0.85); }
.device-shell[data-device="full"] .device-bezel { width: 100%; height: auto; max-width: 800px; }

.device-bezel {
  background: #1a1a1a;
  border-radius: 40px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
}

.device-screen {
  background: white;
  border-radius: 32px;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.device-statusbar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.statusbar-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #1a1a1a;
  border-radius: 20px;
}

.phone-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.device-home-indicator {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-indicator-bar {
  width: 134px;
  height: 5px;
  background: #1a1a1a;
  border-radius: 3px;
}

/* 空预览状态 */
.empty-preview {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-preview-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-preview-text {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-preview-subtext {
  font-size: 13px;
}

/* ═══════════════════════════════════════════
   可视化编辑面板
═══════════════════════════════════════════ */
.visual-pane {
  display: none;
}

.visual-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
}

.visual-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.visual-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.visual-empty-text {
  font-size: 16px;
  margin-bottom: 8px;
}

.visual-empty-subtext {
  font-size: 13px;
}

/* ═══════════════════════════════════════════
   状态栏
═══════════════════════════════════════════ */
.status-bar {
  height: 32px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════
   设置面板（抽屉）
═══════════════════════════════════════════ */
.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  overflow-y: auto;
}

.settings-drawer.show {
  transform: translateX(0);
}

.settings-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-drawer-title {
  font-weight: 600;
  font-size: 16px;
}

.settings-drawer-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.settings-drawer-close:hover {
  background: var(--bg);
}

.settings-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.sidebar-label .dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

/* 设备选择芯片 */
.device-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.device-chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.device-chip:hover {
  border-color: var(--primary);
}

.device-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 字段组 */
.field-group {
  margin-bottom: 12px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.theme-picker-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.theme-picker-btn:hover {
  border-color: var(--primary);
}

.theme-picker-name {
  font-size: 13px;
}

.theme-picker-icon {
  font-size: 12px;
  color: var(--text-tertiary);
}

.style-select,
.code-theme-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  cursor: pointer;
  outline: none;
}

.style-select:focus,
.code-theme-select:focus {
  border-color: var(--primary);
}

.variable-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
}

.variable-input:focus {
  border-color: var(--primary);
}

.variable-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 8px;
  line-height: 1.5;
}

.variable-hint code {
  background: var(--bg);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

/* 开关 */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.toggle-row:last-child {
  margin-bottom: 0;
}

.toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-switch.on {
  background: var(--primary);
}

.toggle-knob {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.on .toggle-knob {
  transform: translateX(20px);
}

/* 按钮组 */
.btn-group {
  display: flex;
  gap: 8px;
}

.sidebar-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.sidebar-btn-secondary {
  background: var(--bg);
  color: var(--text);
}

.sidebar-btn-secondary:hover {
  background: var(--border);
}

.sidebar-btn-primary {
  background: var(--primary);
  color: white;
}

.sidebar-btn-primary:hover {
  background: var(--primary-dark);
}

/* ═══════════════════════════════════════════
   主题选择弹窗
═══════════════════════════════════════════ */
.theme-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--transition);
}

.theme-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.theme-modal {
  width: 900px;
  max-width: 90vw;
  height: 600px;
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.theme-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-modal-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-modal-title {
  font-size: 20px;
  font-weight: 600;
}

.theme-modal-title em {
  color: var(--primary);
  font-style: normal;
}

.theme-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 24px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-modal-close:hover {
  background: var(--bg);
}

.theme-modal-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.theme-modal-left {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.theme-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.theme-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.theme-card:hover {
  border-color: var(--primary-light);
}

.theme-card.selected {
  border-color: var(--primary);
}

.theme-card-info {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.theme-card-name {
  font-size: 14px;
  font-weight: 500;
}

.theme-card-preview {
  padding: 12px;
  background: var(--bg);
}

.theme-card-phone {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.theme-card-phone-status {
  height: 20px;
  background: #1a1a1a;
  position: relative;
}

.theme-card-phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 16px;
  background: #1a1a1a;
  border-radius: 0 0 8px 8px;
}

.theme-card-phone-body {
  padding: 12px;
  min-height: 120px;
}

.theme-card-phone-home {
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-card-phone-home-bar {
  width: 60px;
  height: 3px;
  background: #1a1a1a;
  border-radius: 2px;
}

.theme-card-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.theme-card-use-btn {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.theme-card-use-btn:hover {
  background: var(--primary);
  color: white;
}

.theme-modal-preview {
  width: 360px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.theme-preview-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-preview-title {
  font-weight: 600;
}

.theme-preview-use-btn {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.theme-preview-use-btn:hover {
  background: var(--primary-dark);
}

.theme-preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
}

.theme-preview-phone {
  background: white;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.theme-preview-phone-status {
  height: 44px;
  background: #1a1a1a;
  position: relative;
}

.theme-preview-phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 30px;
  background: #1a1a1a;
  border-radius: 0 0 16px 16px;
}

.theme-preview-phone-body {
  padding: 16px;
  min-height: 400px;
}

.theme-preview-phone-home {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-preview-phone-home-bar {
  width: 134px;
  height: 5px;
  background: #1a1a1a;
  border-radius: 3px;
}

/* ═══════════════════════════════════════════
   通用弹窗样式
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 图片效果弹窗 */
.image-effect-modal {
  width: 700px;
}

.image-effect-section {
  margin-bottom: 24px;
}

.image-effect-section:last-child {
  margin-bottom: 0;
}

.image-effect-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.image-effect-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.image-effect-item {
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
}

.image-effect-item:hover {
  border-color: var(--primary-light);
  background: rgba(200, 85, 61, 0.05);
  transform: translateY(-2px);
}

.image-effect-item.selected {
  border-color: var(--primary);
  background: rgba(200, 85, 61, 0.1);
}

.image-effect-preview {
  width: 60px;
  height: 45px;
  margin: 0 auto 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
}

.image-effect-name {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 图库布局弹窗 */
.gallery-layout-modal {
  width: 500px;
}

.gallery-layout-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.gallery-layout-item {
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.gallery-layout-item:hover {
  border-color: var(--primary-light);
}

.gallery-layout-item.selected {
  border-color: var(--primary);
  background: rgba(200, 85, 61, 0.05);
}

.gallery-layout-preview {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.gallery-layout-preview.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-layout-preview.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-layout-preview.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-layout-preview .preview-item {
  aspect-ratio: 1;
  background: var(--bg);
  border-radius: 4px;
}

.gallery-layout-name {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* 图库组件配置弹窗 */
.gallery-config-modal {
  width: 520px;
}

.gallery-config-section {
  margin-bottom: 24px;
}

.gallery-config-section:last-child {
  margin-bottom: 0;
}

.gallery-config-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
}

/* 布局选项 */
.gallery-layout-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.gallery-layout-option {
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.gallery-layout-option:hover {
  border-color: var(--primary-light);
}

.gallery-layout-option.active {
  border-color: var(--primary);
  background: rgba(200, 85, 61, 0.05);
}

.gallery-layout-option .gallery-layout-preview {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  justify-content: center;
}

.gallery-layout-option .layout-cell {
  width: 28px;
  height: 28px;
  background: var(--bg);
  border-radius: 3px;
  border: 1px solid var(--border);
}

.gallery-layout-option.active .layout-cell {
  background: rgba(200, 85, 61, 0.2);
  border-color: var(--primary-light);
}

.gallery-layout-option .layout-1 {
  grid-template-columns: 1fr;
}

.gallery-layout-option .layout-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-layout-option .layout-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-layout-option .layout-4 {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-layout-option .layout-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.gallery-layout-option.active .layout-label {
  color: var(--primary);
  font-weight: 500;
}

/* 样式选项 */
.gallery-style-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gallery-style-option {
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.gallery-style-option:hover {
  border-color: var(--primary-light);
}

.gallery-style-option.active {
  border-color: var(--primary);
  background: rgba(200, 85, 61, 0.05);
}

.gallery-style-preview {
  width: 60px;
  height: 45px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
  position: relative;
}

.gallery-style-option.active .gallery-style-preview {
  background: linear-gradient(135deg, rgba(200, 85, 61, 0.3) 0%, rgba(224, 122, 95, 0.2) 100%);
}

.gallery-style-preview.style-default {
  border-radius: 4px;
}

.gallery-style-preview.style-shadow {
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-style-preview.style-border {
  border-radius: 4px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gallery-style-preview.style-phone {
  border-radius: 8px;
  border: 3px solid #333;
}

.gallery-style-preview.style-macos {
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.gallery-style-preview.style-macos::before {
  content: '● ● ●';
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 6px;
  color: #999;
  letter-spacing: 2px;
}

.gallery-style-preview.style-polaroid {
  background: white;
  padding: 4px 4px 12px 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: rotate(-2deg);
}

.gallery-style-preview.style-polaroid::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 12px;
  background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
}

/* 扩展的样式预览 */
.gallery-style-preview.style-shadow-lg {
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.gallery-style-preview.style-border-colored {
  border-radius: 4px;
  border: 3px solid #07c160;
  box-shadow: 0 2px 8px rgba(7,193,96,0.2);
}

.gallery-style-preview.style-rounded {
  border-radius: 12px;
}

.gallery-style-preview.style-circle {
  border-radius: 50%;
  width: 45px;
  height: 45px;
  margin: 0 auto 10px;
}

.gallery-style-preview.style-grayscale {
  border-radius: 4px;
  filter: grayscale(100%);
}

.gallery-style-preview.style-sepia {
  border-radius: 4px;
  filter: sepia(60%);
}

.gallery-style-option .style-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.gallery-style-option.active .style-label {
  color: var(--primary);
  font-weight: 500;
}

/* 组件选择弹窗 */
.component-modal {
  width: 600px;
}

/* 组件样式配置弹窗 */
.component-style-modal {
  width: 480px;
}

.component-style-section {
  margin-bottom: 20px;
}

.component-style-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
}

.component-style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.component-style-option {
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.component-style-option:hover {
  border-color: var(--primary-light);
}

.component-style-option.active {
  border-color: var(--primary);
  background: rgba(200, 85, 61, 0.05);
}

.component-style-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.component-style-info {
  flex: 1;
}

.component-style-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.component-style-option.active .component-style-name {
  color: var(--primary);
}

.component-style-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.component-card {
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.component-card:hover {
  border-color: var(--primary-light);
  background: rgba(200, 85, 61, 0.05);
}

.component-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.component-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.component-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* HTML 编辑器弹窗 */
.html-editor-modal {
  width: 700px;
  height: 500px;
}

.html-editor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.html-editor-tab {
  padding: 8px 16px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.html-editor-tab.active {
  background: var(--primary);
  color: white;
}

.html-editor-textarea {
  width: 100%;
  height: 280px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  resize: none;
  outline: none;
}

.html-editor-textarea:focus {
  border-color: var(--primary);
}

.html-editor-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* 推荐管理弹窗 */
.recommend-modal {
  width: 600px;
  height: 500px;
}

.recommend-settings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.recommend-setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recommend-setting-row label {
  font-size: 12px;
  color: var(--text-secondary);
}

.recommend-setting-row input,
.recommend-setting-row select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
}

.recommend-list-header {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.recommend-article-list {
  max-height: 280px;
  overflow-y: auto;
}

.recommend-article-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.recommend-article-item:hover {
  background: var(--bg);
}

.recommend-article-title {
  flex: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommend-article-actions {
  display: flex;
  gap: 8px;
}

.recommend-article-actions button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.recommend-article-actions button:hover {
  background: var(--border);
}

.recommend-article-actions button.active {
  background: var(--primary);
  color: white;
}

/* ═══════════════════════════════════════════
   查找替换弹窗
═══════════════════════════════════════════ */
.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--transition);
}

.search-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-modal {
  width: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-modal-title {
  font-weight: 600;
}

.search-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
}

.search-modal-body {
  padding: 20px;
}

.search-field {
  margin-bottom: 16px;
}

.search-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.search-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}

.search-field input:focus {
  border-color: var(--primary);
}

.search-options {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.search-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.search-results {
  padding: 12px;
  border-radius: var(--radius);
  font-size: 13px;
  min-height: 40px;
}

.search-results.has-match {
  background: #e8f5e9;
  color: #2e7d32;
}

.search-results.no-match {
  background: #ffebee;
  color: #c62828;
}

.search-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ═══════════════════════════════════════════
   Toast 提示
═══════════════════════════════════════════ */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  left: auto;
  transform: translateX(0) translateY(-100px);
  padding: 12px 24px;
  background: #333;
  color: white;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(0) translateY(0);
  opacity: 1;
}

.toast.error {
  background: #c62828;
}

.toast.success {
  background: #2e7d32;
}

/* ═══════════════════════════════════════════
   图片效果样式 - 20+ 种
═══════════════════════════════════════════ */

/* 阴影效果 (5种) */
.img-shadow {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.img-shadow-sm {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.img-shadow-lg {
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.img-shadow-colored {
  box-shadow: 0 8px 30px rgba(7,193,96,0.25);
}
.img-shadow-neon {
  box-shadow: 0 0 20px rgba(100,200,255,0.5), 0 0 40px rgba(100,200,255,0.3);
}

/* 圆角效果 (4种) */
.img-rounded {
  border-radius: 12px;
}
.img-rounded-sm {
  border-radius: 6px;
}
.img-rounded-lg {
  border-radius: 24px;
}
.img-circle {
  border-radius: 50%;
}

/* 边框效果 (4种) */
.img-border {
  border: 2px solid #e0e0e0;
}
.img-border-thick {
  border: 4px solid #333;
}
.img-border-dashed {
  border: 2px dashed #999;
  padding: 4px;
}
.img-border-colored {
  border: 3px solid #07c160;
  padding: 4px;
}

/* 设备框架 (5种) */
.img-macos {
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border: 1px solid #e0e0e0;
}
.img-ios {
  border-radius: 20px;
  border: 8px solid #1a1a1a;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.img-android {
  border-radius: 16px;
  border: 6px solid #333;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.img-browser {
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.img-phone {
  border-radius: 30px;
  border: 12px solid #222;
  box-shadow: 0 15px 50px rgba(0,0,0,0.3);
}

/* 装饰效果 (4种) */
.img-polaroid {
  background: #fff;
  padding: 10px 10px 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transform: rotate(-2deg);
}
.img-tape {
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.img-tape::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 80px;
  height: 24px;
  background: rgba(255,255,255,0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.img-pin {
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.img-pin::after {
  content: '📌';
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: 24px;
  transform: rotate(15deg);
  pointer-events: none;
}
.img-clip {
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.img-clip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 20px;
  width: 30px;
  height: 10px;
  background: #666;
  border-radius: 0 0 5px 5px;
}

/* 滤镜效果 (6种) */
.img-grayscale {
  filter: grayscale(100%);
}
.img-sepia {
  filter: sepia(100%);
}
.img-blur {
  filter: blur(2px);
}
.img-brightness {
  filter: brightness(1.2);
}
.img-contrast {
  filter: contrast(1.3);
}
.img-vintage {
  filter: sepia(30%) contrast(1.1) brightness(1.1) saturate(0.9);
}

/* ═══════════════════════════════════════════
   图库布局样式
═══════════════════════════════════════════ */
.gallery {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.gallery-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* ═══════════════════════════════════════════
   响应式适配
═══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .theme-modal {
    width: 95vw;
    height: 85vh;
  }
  
  .theme-modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .theme-modal-preview {
    display: none;
  }
}

@media (max-width: 768px) {
  .article-panel {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
  }
  
  .article-panel.show {
    transform: translateX(0);
  }
  
  .workspace {
    flex-direction: column;
  }
  
  .editor-pane,
  .preview-pane {
    flex: none;
    height: 50%;
  }
  
  .divider {
    width: 100%;
    height: 6px;
    cursor: row-resize;
  }
  
  .divider::before {
    width: 30px;
    height: 2px;
  }
  
  .device-bezel {
    transform: scale(0.8);
  }
  
  .settings-drawer {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════
   推荐组件样式
═══════════════════════════════════════════ */
.recommend-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e8e8e8;
}

.recommend-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}

.recommend-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recommend-item {
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.recommend-item:hover {
  background: #f8f9fa;
}

.recommend-image {
  flex-shrink: 0;
  width: 100px;
  height: 70px;
  border-radius: 6px;
  overflow: hidden;
}

.recommend-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recommend-content {
  flex: 1;
  min-width: 0;
}

.recommend-item-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommend-excerpt {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recommend-date {
  font-size: 12px;
  color: #aaa;
  margin-top: 6px;
  display: block;
}

/* Grid layout */
.recommend-grid .recommend-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.recommend-item-grid {
  flex-direction: column;
  padding: 0;
}

.recommend-item-grid .recommend-image {
  width: 100%;
  height: 120px;
  border-radius: 8px 8px 0 0;
}

.recommend-item-grid .recommend-content {
  padding: 12px;
}

/* Card layout */
.recommend-card .recommend-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.recommend-item-card {
  flex-direction: column;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
}

.recommend-item-card .recommend-image {
  width: 100%;
  height: 140px;
}

.recommend-item-card .recommend-content {
  padding: 16px;
}

/* ═══════════════════════════════════════════
   可视化编辑样式
═══════════════════════════════════════════ */
/* 可视化块容器 */
.visual-block {
  position: relative;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  transition: all 0.2s ease;
  overflow: hidden;
}

.visual-block:hover {
  border-color: #c8553d;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 块头部 */
.visual-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.visual-block-type {
  font-size: 13px;
  font-weight: 500;
  color: #666;
}

/* 块操作按钮 */
.visual-block-actions {
  display: flex;
  gap: 6px;
}

.visual-block-actions button {
  width: 28px;
  height: 28px;
  border: none;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.visual-block-actions button:hover:not(:disabled) {
  background: #c8553d;
  color: #fff;
}

.visual-block-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 块内容区域 */
.visual-block-content {
  padding: 16px;
}

/* 文本块样式 */
.visual-block-text .visual-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
}

.visual-block-text .visual-textarea:focus {
  outline: none;
  border-color: #c8553d;
}

/* 引用块样式 */
.visual-block-quote .visual-block-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.visual-quote-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.visual-block-quote .visual-textarea {
  flex: 1;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  background: #fafafa;
  border-left: 3px solid #c8553d;
}

.visual-block-quote .visual-textarea:focus {
  outline: none;
  border-color: #c8553d;
  background: #fff;
}

/* 图片块样式 */
.visual-block-image .visual-image-wrapper {
  text-align: center;
}

.visual-block-image img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  transition: all 0.3s;
}

/* 图片效果 */
.visual-block-image img[data-effect="shadow"] {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.visual-block-image img[data-effect="rounded"] {
  border-radius: 16px;
}

.visual-block-image img[data-effect="circle"] {
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
}

.visual-block-image img[data-effect="border"] {
  border: 3px solid #e8e8e8;
  padding: 4px;
}

.visual-block-image img[data-effect="polaroid"] {
  background: #fff;
  padding: 10px 10px 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transform: rotate(-2deg);
}

.visual-block-image img[data-effect="macos"] {
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.visual-image-controls {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.visual-image-controls select {
  padding: 8px 16px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  min-width: 120px;
}

.visual-image-controls select:focus {
  outline: none;
  border-color: #c8553d;
}

/* 图库块样式 */
.visual-gallery-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.visual-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.visual-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.visual-gallery-item:hover img {
  transform: scale(1.05);
}

.visual-gallery-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transition: all 0.2s;
}

.visual-gallery-item:hover .visual-gallery-remove {
  opacity: 1;
}

.visual-gallery-remove:hover {
  background: #ff4d4f;
}

.visual-gallery-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.visual-gallery-controls select {
  padding: 8px 16px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

.visual-gallery-controls button {
  padding: 8px 16px;
  border: 1px dashed #c8553d;
  background: #fff;
  color: #c8553d;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.visual-gallery-controls button:hover {
  background: #c8553d;
  color: #fff;
}

/* 空状态 */
.visual-empty {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}

.visual-empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.visual-empty-text {
  font-size: 18px;
  font-weight: 500;
  color: #666;
  margin-bottom: 8px;
}

.visual-empty-subtext {
  font-size: 14px;
  line-height: 1.6;
}

/* 添加块按钮 */
.visual-add-block {
  padding: 24px;
  text-align: center;
  border: 2px dashed #e8e8e8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.visual-add-block:hover {
  border-color: #c8553d;
  background: rgba(200, 85, 61, 0.02);
}

/* ═══════════════════════════════════════════
   滚动条样式
═══════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* ═══════════════════════════════════════════
   选中文字样式
═══════════════════════════════════════════ */
::selection {
  background: rgba(200, 85, 61, 0.2);
}

/* ═══════════════════════════════════════════
   加载动画
═══════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   移动端文章面板遮罩
═══════════════════════════════════════════ */
.article-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 140;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.article-panel-overlay.show {
  opacity: 1;
  visibility: visible;
}
