.admin-body {
  background: #f0f2f5;
}

.admin-header {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.admin-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}

.admin-header .brand img {
  width: 34px;
  height: 34px;
}

.admin-header .user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.admin-header .user-box a {
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  padding: 3px 14px;
  transition: all 0.2s;
}

.admin-header .user-box a:hover {
  background: rgba(255, 255, 255, 0.18);
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* 登录 */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 34px 32px;
}

.login-card h2 {
  text-align: center;
  color: var(--red-dark);
  margin-bottom: 4px;
}

.login-card .login-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 22px;
}

.login-card .field {
  margin-bottom: 16px;
}

.login-card label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.login-card input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.login-card input:focus {
  border-color: var(--red);
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-success {
  background: #1a7f37;
  color: #fff;
}

.btn-success:hover {
  background: #14632c;
}

.btn-danger {
  background: #d33;
  color: #fff;
}

.btn-danger:hover {
  background: #b22;
}

.btn-sm {
  padding: 3px 10px;
  font-size: 12.5px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-msg {
  min-height: 20px;
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
}

.form-msg.error {
  color: var(--red);
}

.form-msg.ok {
  color: #1a7f37;
}

/* 管理面板 */
.admin-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.admin-tabs {
  display: flex;
  border-bottom: 2px solid var(--red);
  background: #fff;
}

.admin-tabs .tab {
  padding: 13px 26px;
  font-size: 15px;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.admin-tabs .tab:hover {
  color: var(--red);
}

.admin-tabs .tab.active {
  color: var(--red);
  font-weight: 600;
  border-bottom-color: var(--red);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #eee;
}

.panel-head .filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-head .filter-btn {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}

.panel-head .filter-btn:hover {
  color: var(--red);
  border-color: var(--red);
}

.panel-head .filter-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: #fafafa;
  color: var(--text-light);
  font-weight: 600;
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: #fdf7f7;
}

.admin-table .title-cell {
  max-width: 340px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-table .title-cell a:hover {
  color: var(--red);
}

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.badge-published {
  background: #e6f4ea;
  color: #1a7f37;
}

.badge-draft {
  background: #f0f0f0;
  color: #666;
}

.badge-review {
  background: #fff4e0;
  color: #b26a00;
}

.badge-deleted {
  background: #fde8e8;
  color: #c00;
}

.badge-top {
  background: #fff4e0;
  color: #b26a00;
}

.badge-disabled {
  background: #fde8e8;
  color: #c00;
}

.op-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sort-input {
  width: 60px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  font-size: 12.5px;
}

.pager-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-light);
}

.empty-tip {
  padding: 36px;
  text-align: center;
  color: var(--text-muted);
}

/* 编辑器 */
.editor-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  padding: 24px 26px;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--red);
}

.editor-head h2 {
  font-size: 18px;
  color: var(--red-dark);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-item label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.form-item label .req {
  color: var(--red);
}

.form-item input[type="text"],
.form-item input[type="number"],
.form-item textarea,
.form-item select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-item input:focus,
.form-item textarea:focus,
.form-item select:focus {
  border-color: var(--red);
}

.form-item textarea {
  resize: vertical;
  line-height: 1.7;
}

.form-item .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.cover-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cover-row .cover-preview {
  width: 120px;
  height: 68px;
  border-radius: 4px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: #f5f5f5;
  flex: none;
}

.cat-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 0;
}

.cat-checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}

.cat-checkboxes .child-cat {
  padding-left: 22px;
}

.status-radios {
  display: flex;
  gap: 18px;
  padding: 8px 0;
}

.status-radios label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  cursor: pointer;
}

.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.editor-actions .btn {
  min-width: 110px;
}

.markdown-tip {
  font-size: 12px;
  color: var(--text-muted);
}

/* 栏目表单 */
.cat-form {
  display: none;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  padding: 16px 18px;
}

.cat-form.open {
  display: block;
}

.cat-form .form-grid {
  grid-template-columns: repeat(4, 1fr);
}

.cat-form .full {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .form-grid,
  .cat-form .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-header .brand {
    font-size: 15px;
  }
}
