/* 管理后台样式 */

/* 登录表单 */
.auth-container {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 管理面板头部 */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

/* 模态对话框 */
.modal {
  display: flex;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 5px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-lg {
  max-width: 800px;
}

.close-modal,
.close-preview-modal {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
}

.close-modal:hover,
.close-preview-modal:hover {
  color: #666;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.status-message {
  margin-top: 15px;
  padding: 8px;
  border-radius: 4px;
  text-align: center;
}

.status-message.success {
  background-color: #d4edda;
  color: #155724;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
}

.md-preview {
  max-height: 400px;
  overflow-y: auto;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 10px;
  background-color: #f9f9f9;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  margin: 0;
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-color);
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-color);
}

.auth-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
}

.auth-form button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.error-message {
  color: var(--danger-color);
  margin-top: 15px;
  text-align: center;
}

/* 管理面板样式 */
.admin-panel {
  width: 100%;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-header h2 {
  margin: 0;
}

/* 文章表格样式 */
.articles-table-container {
  overflow-x: auto;
}

.articles-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.articles-table th,
.articles-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.articles-table th {
  background-color: var(--light-bg);
  font-weight: 600;
  color: var(--text-color);
}

.articles-table tr:hover {
  background-color: var(--light-bg);
}

.articles-table .article-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.articles-table .status-published {
  background-color: var(--success-color);
  color: white;
}

.articles-table .status-draft {
  background-color: var(--warning-color);
  color: white;
}

.articles-table .article-actions {
  display: flex;
  gap: 10px;
}

.articles-table .action-btn {
  padding: 5px 10px;
  font-size: 12px;
}

.articles-table .edit-btn {
  background-color: var(--primary-color);
  color: white;
}

.articles-table .delete-btn {
  background-color: var(--danger-color);
  color: white;
}

/* 编辑器样式 */
.editor-container {
  display: block;
  padding-top: 20px;
}

.auth-required {
  text-align: center;
  padding: 50px 0;
}

.editor-panel {
  width: 100%;
}

.editor-header {
  margin-bottom: 20px;
  background-color: var(--light-bg);
  padding: 20px;
  border-radius: 8px;
}

.editor-header .form-group {
  margin-bottom: 15px;
}

.editor-header label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.editor-header input,
.editor-header textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
}

.editor-header textarea {
  height: 80px;
  resize: vertical;
}

.editor-header small {
  display: block;
  margin-top: 5px;
  color: var(--lighter-text);
}

.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-group input {
  width: auto;
  margin-right: 10px;
}

.editor-main {
  margin-bottom: 20px;
}

#markdown-editor {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.editor-status {
  color: var(--light-text);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .articles-table th,
  .articles-table td {
    padding: 8px 10px;
  }
  
  .editor-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .editor-footer button {
    width: 100%;
  }
}