/* press.css — 编辑器布局 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f5; }

.hidden { display: none !important; }
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-primary:hover { background: #1557b0; }
.btn-secondary { background: #e8eaed; color: #333; }
.btn-secondary:hover { background: #d2d4d7; }

/* 头部 */
.press-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: #fff; border-bottom: 1px solid #e0e0e0; }
.press-header h1 { font-size: 20px; }
.header-actions { display: flex; gap: 8px; }

/* 草稿列表 */
#draft-list { padding: 24px; max-width: 800px; margin: 0 auto; }

/* 语法提示栏 */
.syntax-bar { padding: 8px 16px; background: #fff; border-bottom: 1px solid #e0e0e0; font-size: 12px; color: #666; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: 0; z-index: 10; }
.syntax-bar code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; cursor: pointer; }
.syntax-bar code:hover { background: #d0d0d0; }
.syntax-bar .sep { width: 1px; height: 16px; background: #ddd; }

/* 编辑器容器 */
.editor-container { display: flex; height: calc(100vh - 100px); }
.editor-left { flex: 1; border-right: 1px solid #e0e0e0; }
.editor-left textarea { width: 100%; height: 100%; padding: 16px; border: none; outline: none; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 14px; line-height: 1.6; resize: none; }
.editor-right { flex: 1; overflow-y: auto; background: #fff; display: flex; justify-content: center; padding: 16px; }
.preview-area { width: 1080px; transform-origin: top center; background: #fff; padding: 40px; }

/* 底部栏 */
.editor-footer { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-top: 1px solid #e0e0e0; }
.editor-footer select { padding: 6px 10px; border: 1px solid #d0d0d0; border-radius: 4px; }
#save-status { font-size: 12px; color: #999; margin-right: auto; }

/* 草稿列表 */
.draft-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #fff; border-radius: 8px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.draft-info { display: flex; flex-direction: column; gap: 4px; }
.draft-title { font-size: 15px; font-weight: 600; }
.draft-meta { font-size: 12px; color: #888; }
.draft-actions { display: flex; gap: 6px; }
.draft-actions .btn { padding: 5px 10px; font-size: 12px; }

/* Data search panel */
#data-search-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 100; display: flex; align-items: center; justify-content: center; }
.data-search-panel { background: #fff; border-radius: 12px; width: 400px; max-width: 90vw; max-height: 70vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.data-search-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #eee; font-weight: 600; }
#data-search-input { margin: 12px 16px; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; }
#data-search-input:focus { border-color: #1a73e8; }
#data-search-results { overflow-y: auto; padding: 0 8px 12px; max-height: 50vh; }
.data-search-item { padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.data-search-item:hover { background: #f0f4ff; }
.data-search-item .sub { font-size: 12px; color: #888; margin-top: 2px; }
.data-search-empty { text-align: center; color: #999; padding: 24px; font-size: 14px; }

/* Mobile */
@media (max-width: 768px) {
  .press-header { flex-direction: column; gap: 12px; padding: 12px 16px; }
  .press-header h1 { font-size: 18px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .editor-container { flex-direction: column; height: auto; min-height: calc(100vh - 140px); }
  .editor-left { border-right: none; border-bottom: 1px solid #e0e0e0; }
  .editor-left textarea { min-height: 40vh; }
  .editor-right { min-height: 40vh; }
  .preview-area { width: 100%; padding: 16px; }
  .editor-footer { flex-wrap: wrap; gap: 8px; }
  .editor-footer select { flex: 1; min-width: 120px; }
  .syntax-bar { overflow-x: auto; flex-wrap: nowrap; }
  .syntax-bar code { white-space: nowrap; }
  #draft-list { padding: 16px; }
  .draft-item { flex-direction: column; gap: 8px; align-items: flex-start; }
  .draft-actions { width: 100%; justify-content: flex-end; }
}
