* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1a2332; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.logo { padding: 20px; font-size: 18px; font-weight: bold; border-bottom: 1px solid #2a3544; }
nav { flex: 1; padding: 12px 0; }
.nav-item { display: block; padding: 12px 20px; color: #aab; text-decoration: none; font-size: 14px; transition: .2s; }
.nav-item:hover, .nav-item.active { background: #243044; color: #fff; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #2a3544; font-size: 13px; }
.sidebar-footer button { margin-top: 8px; width: 100%; padding: 8px; background: transparent; border: 1px solid #556; color: #aab; border-radius: 4px; cursor: pointer; }
.sidebar-footer button:hover { border-color: #fff; color: #fff; }
.content { flex: 1; padding: 24px; overflow-y: auto; }
.page-title { font-size: 22px; margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-card .num { font-size: 32px; font-weight: bold; color: #1a7fc1; }
.stat-card .label { color: #999; font-size: 13px; margin-top: 4px; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 20px; margin-bottom: 20px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.articles-toolbar {
  display: block;
  margin-bottom: 20px;
}
.articles-toolbar-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.articles-search {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}
.search-input {
  flex: 1;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  font-size: 15px;
  background: #fafbfc;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-input:focus {
  outline: none;
  border-color: #1a7fc1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 127, 193, .12);
}
.search-input::placeholder { color: #9aa4b2; }
.articles-search .btn {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 15px;
  white-space: nowrap;
}
.articles-search .btn:not(.btn-primary) {
  background: #eef2f6;
  color: #4b5563;
}
.articles-search .btn:not(.btn-primary):hover {
  background: #e2e8f0;
}

.pagination-wrap {
  margin-top: 24px;
  padding: 16px 18px;
  border-top: none;
  background: linear-gradient(180deg, #f8fafc 0%, #f3f6f9 100%);
  border: 1px solid #e8edf2;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.pagination-meta {
  color: #5f6b7a;
  font-size: 14px;
  line-height: 1.5;
}
.pagination-meta strong {
  color: #1a7fc1;
  font-weight: 600;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.page-btn {
  min-width: 40px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 14px;
  transition: all .18s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.page-btn:hover:not(:disabled):not(.active) {
  border-color: #1a7fc1;
  color: #1a7fc1;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(26, 127, 193, .12);
}
.page-btn.active {
  background: linear-gradient(180deg, #1f8fd0 0%, #1a7fc1 100%);
  border-color: #1a7fc1;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(26, 127, 193, .28);
}
.page-btn.nav-btn {
  min-width: auto;
  padding: 0 14px;
  font-weight: 500;
}
.page-btn:disabled {
  color: #b8c0cc;
  cursor: not-allowed;
  background: #f5f7fa;
  border-color: #e5eaf0;
  box-shadow: none;
  transform: none;
}
.page-ellipsis {
  min-width: 28px;
  text-align: center;
  color: #94a3b8;
  user-select: none;
  font-size: 16px;
  line-height: 38px;
}
@media (max-width: 768px) {
  .pagination-wrap { justify-content: center; }
  .pagination-meta { width: 100%; text-align: center; }
  .pagination { width: 100%; justify-content: center; }
}
.btn { padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn-primary { background: #1a7fc1; color: #fff; }
.btn-primary:hover { background: #156aa3; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
th { background: #fafafa; font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-published { background: #e8f5e9; color: #2e7d32; }
.badge-draft { background: #fff3e0; color: #e65100; }
.badge-unread { background: #fce4ec; color: #c62828; }
.badge-read { background: #e8f5e9; color: #2e7d32; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;
}
.form-group textarea { min-height: 200px; resize: vertical; font-family: inherit; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions a, .actions button { margin-right: 6px; }
.empty { text-align: center; padding: 40px; color: #999; }
.tip { background: #e3f2fd; padding: 12px 16px; border-radius: 4px; font-size: 13px; color: #1565c0; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid label { display: block; font-size: 13px; color: #555; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  display: block; width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;
}
.form-grid textarea { font-family: Consolas, monospace; resize: vertical; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal-panel { position: relative; z-index: 1001; width: min(920px, 100%); background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.18); padding: 24px; pointer-events: auto; }
.modal-panel h3 { margin-bottom: 16px; }
.modal-panel.wide { width: min(1100px, 96%); }
.input-with-btn { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.input-with-btn input { flex: 1; }
.cover-preview { margin-top: 8px; max-width: 220px; max-height: 160px; border: 1px solid #eee; border-radius: 4px; display: none; }
.editor-label { grid-column: 1 / -1; }
.editor-label .tox-tinymce { margin-top: 6px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }

