/* ========== Articles & Categories ========== */
/* ========== Category Picker (Inline Tree) ========== */
.cp-picker-card {
  margin-bottom: 20px;
}
.cp-picker-body {
  padding: 0;
  overflow: hidden;
}

/* ── Selected path in card header ── */
.cp-selected-path {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: #bbb;
}
.cp-selected-path.selected {
  color: #e4393c;
  font-weight: 500;
}

.cp-required-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  background: #e4393c;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

/* ── Breadcrumb ── */
.cp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 12px 20px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
}
.cp-crumb-item {
  color: #666;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.cp-crumb-item:hover {
  background: #f5f5f5;
  color: #e4393c;
}
.cp-crumb-current {
  color: #1a1a1a;
  font-weight: 600;
  cursor: default;
}
.cp-crumb-current:hover {
  background: transparent;
  color: #1a1a1a;
}
.cp-crumb-sep {
  color: #d9d9d9;
  margin: 0 2px;
  user-select: none;
}

/* ── List ── */
.cp-list {
  overflow-y: auto;
  padding: 8px 12px;
  max-height: 320px;
}
.cp-list-item {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  gap: 8px;
  margin-bottom: 2px;
}
.cp-list-item:hover {
  background: #f8f8f8;
}
.cp-list-item.cp-back {
  color: #e4393c;
  font-weight: 500;
}
.cp-list-item.cp-back svg {
  width: 18px;
  height: 18px;
  fill: #e4393c;
}
.cp-list-item.cp-selected {
  background: #fff5f5;
  color: #e4393c;
  font-weight: 600;
}
.cp-item-name {
  flex: 1;
  font-size: 14px;
}
.cp-item-arrow {
  width: 18px;
  height: 18px;
  fill: #ccc;
  flex-shrink: 0;
}
.cp-list-item:hover .cp-item-arrow {
  fill: #999;
}
.cp-item-check {
  width: 18px;
  height: 18px;
  fill: #e4393c;
  flex-shrink: 0;
}
.cp-empty {
  justify-content: center;
  color: #bbb;
  cursor: default;
}
.cp-empty:hover {
  background: transparent;
}

/* ========== Article Manage & Add Shared Styles ========== */

/* ---------- Article Manage List ---------- */
.am-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
  gap: 12px;
}
.am-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.am-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.am-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #333;
  transition: all 0.2s;
  white-space: nowrap;
}
.am-btn:hover {
  border-color: #e2383e;
  color: #e2383e;
}
.am-btn-primary {
  background: #e2383e;
  color: #fff;
  border-color: #e2383e;
}
.am-btn-primary:hover {
  background: #c62a2f;
  border-color: #c62a2f;
  color: #fff;
}
.am-btn svg {
  width: 15px;
  height: 15px;
}
.am-search {
  display: flex;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.am-search:focus-within {
  border-color: #e2383e;
  box-shadow: 0 0 0 2px rgba(226,56,62,0.12);
}
.am-search input {
  border: none;
  outline: none;
  padding: 7px 12px;
  font-size: 13px;
  width: 220px;
  color: #333;
}
.am-search input::placeholder { color: #bbb; }
.am-search-btn {
  padding: 7px 14px;
  background: #f5f5f5;
  border: none;
  border-left: 1px solid #d9d9d9;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: #666;
  transition: all 0.2s;
}
.am-search-btn:hover { background: #e2383e; color: #fff; }
.am-search-btn svg { width: 15px; height: 15px; }

/* Filter row */
.am-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}
.am-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
}
.am-filter-item label { white-space: nowrap; }
.am-filter-item select,
.am-filter-item input {
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
}
.am-filter-item select:focus,
.am-filter-item input:focus {
  border-color: #e2383e;
  box-shadow: 0 0 0 2px rgba(226,56,62,0.08);
}

/* Stats */
.am-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 20px 0px;
}
.am-stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.am-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.am-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.am-stat-icon svg { width: 22px; height: 22px; fill: #fff; }
.am-stat-icon.all { background: linear-gradient(135deg, #e2383e, #ff6b6b); }
.am-stat-icon.published { background: linear-gradient(135deg, #10b981, #34d399); }
.am-stat-icon.draft { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.am-stat-icon.review { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.am-stat-icon.rejected { background: linear-gradient(135deg, #6b7280, #9ca3af); }
.am-stat-info {}
.am-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}
.am-stat-label {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

/* Table */
.am-table-wrap {
  padding-bottom: 24px;
}
.am-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.am-table thead th {
  background: #fafafa;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}
.am-table tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: #333;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}
.am-table tbody tr:hover { background: #fffbfb; }
.am-table tbody tr:last-child td { border-bottom: none; }

/* Article info cell */
.am-article-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.am-article-thumb {
  width: 60px;
  height: 42px;
  border-radius: 4px;
  background: #f5f5f5;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.am-article-thumb svg { width: 24px; height: 24px; fill: #ccc; }
.am-article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.am-article-text {}
.am-article-title {
  font-weight: 500;
  color: #333;
  margin-bottom: 3px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.am-article-id {
  font-size: 12px;
  color: #bbb;
}

/* Status tags */
.am-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.am-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.am-status.published { background: #f0fdf4; color: #16a34a; }
.am-status.published .am-status-dot { background: #16a34a; }
.am-status.draft { background: #fffbeb; color: #d97706; }
.am-status.draft .am-status-dot { background: #d97706; }
.am-status.review { background: #eff6ff; color: #2563eb; }
.am-status.review .am-status-dot { background: #2563eb; }
.am-status.rejected { background: #fef2f2; color: #dc2626; }
.am-status.rejected .am-status-dot { background: #dc2626; }

/* Category tag */
.am-category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #f5f5f5;
  color: #666;
}

/* Action links */
.am-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.am-action-link {
  color: #e2383e;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.am-action-link:hover { background: #fff1f1; }
.am-action-link.disabled { color: #ccc; cursor: default; }
.am-action-link.disabled:hover { background: transparent; }
.am-action-sep { color: #e8e8e8; font-size: 12px; }

/* Checkbox */
.am-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #e2383e;
  cursor: pointer;
}

/* Batch bar */
.am-batch {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #fff5f5, #fee2e2);
  border-bottom: 1px solid #fecaca;
  font-size: 13px;
  color: #333;
}
.am-batch.show { display: flex; }
.am-batch-count { color: #e2383e; font-weight: 600; }
.am-batch-btn {
  padding: 5px 14px;
  border-radius: 4px;
  border: 1px solid #e2383e;
  background: #fff;
  color: #e2383e;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.am-batch-btn:hover { background: #e2383e; color: #fff; }
.am-batch-btn.danger { border-color: #dc2626; color: #dc2626; }
.am-batch-btn.danger:hover { background: #dc2626; color: #fff; }

/* Pagination */
.am-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 13px;
  color: #999;
}
.am-pagination-info span { color: #e2383e; font-weight: 600; }
.am-pagination-btns {
  display: flex;
  gap: 4px;
}
.am-page-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0 8px;
}
.am-page-btn:hover { border-color: #e2383e; color: #e2383e; }
.am-page-btn.active {
  background: #e2383e;
  color: #fff;
  border-color: #e2383e;
}
.am-page-btn.disabled { color: #ccc; cursor: default; }
.am-page-btn.disabled:hover { border-color: #d9d9d9; color: #ccc; }

/* Delete modal */
.am-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.am-modal-overlay.show { display: flex; }
.am-modal {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.am-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fef2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.am-modal-icon svg { width: 24px; height: 24px; fill: #e2383e; }
.am-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  text-align: center;
  margin-bottom: 8px;
}
.am-modal-desc {
  font-size: 13px;
  color: #999;
  text-align: center;
  margin-bottom: 24px;
}
.am-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.am-modal-btn {
  padding: 8px 28px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #333;
}
.am-modal-btn:hover { border-color: #999; }
.am-modal-btn.danger {
  background: #e2383e;
  color: #fff;
  border-color: #e2383e;
}
.am-modal-btn.danger:hover { background: #c62a2f; }

/* ---------- Article Add Page ---------- */
.aa-breadcrumb {
  padding: 12px 24px;
  font-size: 13px;
  color: #999;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.aa-breadcrumb a { color: #666; text-decoration: none; transition: color 0.2s; }
.aa-breadcrumb a:hover { color: #e2383e; }
.aa-breadcrumb span { margin: 0 6px; color: #ccc; }
.aa-breadcrumb .current { color: #333; font-weight: 500; }

.aa-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.aa-page-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}
.aa-page-title svg { width: 22px; height: 22px; fill: #e2383e; }
.aa-header-actions { display: flex; gap: 10px; }

.aa-form-wrap { padding: 24px 0; }
.aa-form-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 20px;
  overflow: hidden;
}
.aa-form-card-header {
  padding: 16px 24px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aa-form-card-header svg { width: 18px; height: 18px; fill: #e2383e; }
.aa-form-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.aa-form-card-body { padding: 24px; }

/* Form row */
.aa-form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.aa-form-row:last-child { margin-bottom: 0; }
.aa-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.aa-form-group.half { flex: 0 0 calc(50% - 10px); }
.aa-form-group.full { flex: 0 0 100%; }
.aa-form-label {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.aa-form-label .required { color: #e2383e; }
.aa-form-input,
.aa-form-select,
.aa-form-textarea {
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  color: #333;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.aa-form-input:focus,
.aa-form-select:focus,
.aa-form-textarea:focus {
  border-color: #e2383e;
  box-shadow: 0 0 0 2px rgba(226,56,62,0.1);
}
.aa-form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.aa-form-input.error,
.aa-form-select.error,
.aa-form-textarea.error {
  border-color: #e2383e;
  background: #fff5f5;
}
.aa-form-error {
  font-size: 12px;
  color: #e2383e;
  margin-top: 4px;
  display: none;
}
.aa-form-error.show { display: block; }
.aa-form-hint {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* Tags input */
.aa-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  min-height: 40px;
  align-items: center;
  transition: border-color 0.2s;
  cursor: text;
}
.aa-tags-wrap:focus-within {
  border-color: #e2383e;
  box-shadow: 0 0 0 2px rgba(226,56,62,0.1);
}
.aa-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #fff1f1;
  color: #e2383e;
  border-radius: 4px;
  font-size: 12px;
}
.aa-tag-item .aa-tag-remove {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.aa-tag-item .aa-tag-remove:hover { opacity: 1; }
.aa-tags-input {
  border: none;
  outline: none;
  font-size: 13px;
  flex: 1;
  min-width: 80px;
  color: #333;
}
.aa-tags-input::placeholder { color: #bbb; }

/* Cover upload */
.aa-cover-upload {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.aa-cover-area {
  width: 200px;
  height: 130px;
  border: 2px dashed #d9d9d9;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
  position: relative;
  overflow: hidden;
}
.aa-cover-area:hover {
  border-color: #e2383e;
  background: #fff5f5;
}
.aa-cover-area svg { width: 32px; height: 32px; fill: #ccc; transition: fill 0.2s; }
.aa-cover-area:hover svg { fill: #e2383e; }
.aa-cover-area span { font-size: 12px; color: #999; }
.aa-cover-preview {
  width: 200px;
  height: 130px;
  border-radius: 8px;
  object-fit: cover;
  display: none;
  border: 2px solid #f0f0f0;
}
.aa-cover-tip {
  font-size: 12px;
  color: #999;
  line-height: 1.8;
  padding-top: 4px;
}

/* Editor toolbar */
.aa-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  background: #fafafa;
  border: 1px solid #d9d9d9;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  flex-wrap: wrap;
}
.aa-editor-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}
.aa-editor-btn:hover { background: #fff1f1; color: #e2383e; }
.aa-editor-btn.active { background: #fff1f1; color: #e2383e; }
.aa-editor-sep {
  width: 1px;
  height: 20px;
  background: #e8e8e8;
  margin: 0 4px;
}
.aa-editor-body {
  border: 1px solid #d9d9d9;
  border-radius: 0 0 6px 6px;
  min-height: 360px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
}
.aa-editor-body:focus { border-color: #e2383e; }
.aa-editor-body h2 { font-size: 20px; font-weight: 600; margin: 16px 0 8px; }
.aa-editor-body h3 { font-size: 17px; font-weight: 600; margin: 14px 0 6px; }
.aa-editor-body p { margin: 8px 0; }
.aa-editor-body ul, .aa-editor-body ol { padding-left: 24px; margin: 8px 0; }
.aa-editor-body blockquote {
  border-left: 4px solid #e2383e;
  padding: 8px 16px;
  margin: 12px 0;
  background: #fafafa;
  color: #666;
}

/* Footer action bar */
.aa-footer-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  z-index: 10;
}

/* Switch */
.aa-switch-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.aa-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #d9d9d9;
  cursor: pointer;
  transition: background 0.3s;
}
.aa-switch.active { background: #e2383e; }
.aa-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.3s;
}
.aa-switch.active::after { transform: translateX(20px); }
.aa-switch-label { font-size: 13px; color: #666; }

/* Responsive */
@media (max-width: 1200px) {
  .am-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .am-stats { grid-template-columns: repeat(2, 1fr); }
  .aa-form-row { flex-direction: column; }
  .aa-form-group.half { flex: 0 0 100%; }
}
@media (max-width: 640px) {
  .am-stats { grid-template-columns: 1fr; }
  .am-toolbar { flex-direction: column; align-items: stretch; }
  .am-toolbar-right { justify-content: flex-end; }
}
