/* ================================================================
   桐峻记忆 - 后台管理样式表
   版本: v1.0
   兼容: IE9+ / Chrome / Firefox / Edge / 360浏览器
   配色: #8b7355 主色调, #f5f0e8 背景, #faf8f5 卡片背景
   ================================================================ */

/* ---- Reset & Base ---- */
*, *:before, *:after {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #4a3f35;
  background-color: #f5f0e8;
  height: 100%;
  overflow: hidden;
}
a {
  color: #8b7355;
  text-decoration: none;
}
a:hover {
  color: #6b5b4f;
}

/* ---- Admin Login Page ---- */
.admin-login-page {
  background-color: #f5f0e8;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.login-wrapper {
  width: 100%;
  max-width: 380px;
  padding: 20px;
}
.login-box {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 40px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  -webkit-box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.login-logo {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo h1 {
  font-size: 24px;
  color: #8b7355;
  margin: 0 0 6px;
  font-weight: 600;
}
.login-logo p {
  font-size: 13px;
  color: #a09080;
  margin: 0;
}
.login-error {
  background-color: #fdeaea;
  color: #e74c3c;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid #f5c6cb;
}
.login-form .form-group {
  margin-bottom: 16px;
}
.login-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #6b5b4f;
  font-weight: 500;
}
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e8ddd0;
  border-radius: 8px;
  font-size: 14px;
  background-color: #faf8f5;
  color: #4a3f35;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-transition: border-color 0.2s, box-shadow 0.2s;
}
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  outline: none;
  border-color: #8b7355;
  box-shadow: 0 0 0 3px rgba(139,115,85,0.12);
  -webkit-box-shadow: 0 0 0 3px rgba(139,115,85,0.12);
}

/* ---- Admin Layout ---- */
.admin-body {
  background-color: #f5f0e8;
  height: 100vh;
  overflow: hidden;
}
.admin-layout,
.admin-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  width: 220px;
  background-color: #ffffff;
  border-right: 1px solid #e8ddd0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid #f0ebe2;
}
.sidebar-header h2 {
  font-size: 18px;
  color: #8b7355;
  margin: 0;
  font-weight: 600;
}
.sidebar-header .sidebar-icon {
  font-size: 20px;
  margin-right: 6px;
}
.sidebar-header .sidebar-title {
  font-size: 16px;
  color: #8b7355;
  font-weight: 600;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}
.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-nav li {
  margin: 2px 0;
}
.sidebar-nav li a,
.sidebar-nav .sidebar-item {
  display: block;
  padding: 11px 20px;
  color: #6b5b4f;
  font-size: 14px;
  transition: all 0.2s;
  -webkit-transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover,
.sidebar-nav .sidebar-item:hover {
  background-color: #faf8f5;
  color: #8b7355;
}
.sidebar-nav li.active a,
.sidebar-nav .sidebar-item.active {
  background-color: #faf8f5;
  color: #8b7355;
  border-left-color: #8b7355;
  font-weight: 600;
}
.sidebar-nav .icon {
  display: inline-block;
  width: 22px;
  text-align: center;
  margin-right: 8px;
  font-size: 15px;
}

/* ---- Nav Item (new sidebar structure) ---- */
.sidebar-nav .nav-item {
  display: block;
  padding: 11px 20px;
  color: #6b5b4f;
  font-size: 14px;
  transition: all 0.2s;
  -webkit-transition: all 0.2s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.sidebar-nav .nav-item:hover {
  background-color: #faf8f5;
  color: #8b7355;
}
.sidebar-nav .nav-item.active {
  background-color: #faf8f5;
  color: #8b7355;
  border-left-color: #8b7355;
  font-weight: 600;
}
.sidebar-nav .nav-item .icon {
  display: inline-block;
  width: 22px;
  text-align: center;
  margin-right: 8px;
  font-size: 15px;
}
.sidebar-nav .nav-external {
  color: #8b7355;
  font-weight: 500;
}
.sidebar-nav .nav-external:hover {
  background-color: #f5f0e8;
}
.sidebar-nav .nav-logout {
  color: #c0392b;
}
.sidebar-nav .nav-logout:hover {
  background-color: #fdf0ee;
  color: #e74c3c;
}
.sidebar-nav .nav-divider {
  height: 1px;
  background: #f0ebe2;
  margin: 8px 12px;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 8px;
}
.sidebar-logo-icon {
  font-size: 20px;
}
.sidebar-logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.version-tag {
  font-size: 11px;
  color: #c0b0a0;
}
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid #f0ebe2;
  font-size: 12px;
  color: #a09080;
}
.sidebar-footer .username {
  display: block;
  margin-bottom: 6px;
  color: #6b5b4f;
  font-weight: 500;
}
.sidebar-footer .logout-link,
.sidebar-footer a {
  color: #c0392b;
  font-size: 12px;
}
.sidebar-footer .logout-link:hover,
.sidebar-footer a:hover {
  color: #e74c3c;
}

/* ---- Main Content ---- */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.admin-header {
  background-color: #ffffff;
  padding: 16px 24px;
  border-bottom: 1px solid #e8ddd0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.admin-header h1,
.admin-title {
  font-size: 20px;
  color: #4a3f35;
  margin: 0;
  font-weight: 600;
}
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background-color: #f5f0e8;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  background-color: #e8ddd0;
  color: #6b5b4f;
  transition: all 0.2s;
  -webkit-transition: all 0.2s;
  text-decoration: none;
}
.btn:hover {
  background-color: #ddd5c8;
  color: #4a3f35;
}
.btn-primary {
  background-color: #8b7355;
  color: #ffffff;
  border-color: #8b7355;
}
.btn-primary:hover {
  background-color: #6b5b4f;
  border-color: #6b5b4f;
  color: #ffffff;
}
.btn-secondary {
  background-color: #e8ddd0;
  color: #6b5b4f;
  border-color: #d0c4b8;
}
.btn-secondary:hover {
  background-color: #ddd5c8;
  color: #4a3f35;
}
.btn-danger {
  background-color: #e74c3c;
  color: #ffffff;
  border-color: #e74c3c;
}
.btn-danger:hover {
  background-color: #c0392b;
  border-color: #c0392b;
  color: #ffffff;
}
.btn-success {
  background-color: #27ae60;
  color: #ffffff;
  border-color: #27ae60;
}
.btn-success:hover {
  background-color: #219a52;
  border-color: #219a52;
  color: #ffffff;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 4px;
}
.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 8px;
}
.btn-block {
  display: block;
  width: 100%;
}
.btn-edit {
  background-color: #8b7355;
  color: #ffffff;
}
.btn-edit:hover {
  background-color: #6b5b4f;
  color: #ffffff;
}

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}
.alert-success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}
.alert-danger {
  background-color: #fdeaea;
  color: #c0392b;
  border: 1px solid #f5c6cb;
}
.alert-warning {
  background-color: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b5b4f;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e8ddd0;
  border-radius: 6px;
  font-size: 14px;
  background-color: #ffffff;
  color: #4a3f35;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #8b7355;
  box-shadow: 0 0 0 3px rgba(139,115,85,0.12);
  -webkit-box-shadow: 0 0 0 3px rgba(139,115,85,0.12);
}
.form-group textarea {
  resize: vertical;
  line-height: 1.6;
}
.form-group input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
}
.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e8ddd0;
  border-radius: 6px;
  font-size: 13px;
  background-color: #ffffff;
  color: #4a3f35;
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: #8b7355;
  box-shadow: 0 0 0 3px rgba(139,115,85,0.12);
}
.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #a09080;
  line-height: 1.5;
}
.form-actions {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e8ddd0;
}

/* ---- Color Input Group ---- */
.color-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-input-group input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid #e8ddd0;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.color-input-group input[type="text"] {
  width: 120px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
}

/* ---- Color Grid (Settings) ---- */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}
.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.color-item input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid #e8ddd0;
  border-radius: 4px;
  cursor: pointer;
}
.color-item .color-text {
  width: 90px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  border: 1px solid #e8ddd0;
  border-radius: 4px;
  text-align: center;
}
.color-item .color-label {
  font-size: 11px;
  color: #a09080;
}

/* ---- Settings Form ---- */
.settings-form {
  max-width: 100%;
}

/* ---- Settings Section ---- */
.settings-section {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.settings-section h3 {
  font-size: 16px;
  color: #4a3f35;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0ebe2;
  font-weight: 600;
}
.settings-section-title {
  font-size: 16px;
  color: #4a3f35;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0ebe2;
  font-weight: 600;
}
.settings-section h3 small {
  font-size: 13px;
  margin-left: 8px;
}
.settings-section h4 {
  font-size: 14px;
  color: #6b5b4f;
  margin: 0 0 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f5f0e8;
  gap: 16px;
}
.settings-row:last-child {
  border-bottom: none;
}
.settings-row > div:first-child {
  flex: 1;
  min-width: 0;
}
.settings-label {
  font-size: 14px;
  font-weight: 500;
  color: #4a3f35;
  margin-bottom: 3px;
}
.settings-desc {
  font-size: 12px;
  color: #a09080;
  line-height: 1.4;
}

.settings-col {
  flex: 1;
  min-width: 280px;
}
.settings-col label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b5b4f;
}

/* ---- Preview Box ---- */
.preview-box {
  border: 1px solid #e8ddd0;
  border-radius: 6px;
  padding: 12px;
  min-height: 80px;
  background-color: #faf8f5;
  font-size: 14px;
  overflow: auto;
  max-height: 200px;
}

/* ---- Button Row ---- */
.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ---- Filter Select ---- */
.filter-select {
  padding: 8px 12px;
  border: 1px solid #e8ddd0;
  border-radius: 6px;
  font-size: 13px;
  background-color: #ffffff;
  color: #4a3f35;
  font-family: inherit;
  cursor: pointer;
  min-width: 120px;
}
.filter-select:focus {
  outline: none;
  border-color: #8b7355;
  box-shadow: 0 0 0 3px rgba(139,115,85,0.12);
}

/* ---- Stats Cards ---- */
.stats-cards {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -6px 24px;
}
.stat-card {
  width: 25%;
  padding: 0 6px;
  margin-bottom: 12px;
}
.stat-card-inner {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.stat-icon svg {
  display: block;
  width: 32px;
  height: 32px;
}
.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: #8b7355;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 13px;
  color: #a09080;
}

/* ---- Quick Actions ---- */
.quick-actions {
  margin-bottom: 24px;
}
.quick-actions .btn {
  margin-right: 8px;
  margin-bottom: 8px;
}

/* ---- Data Table ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.data-table thead {
  background-color: #faf8f5;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #6b5b4f;
  border-bottom: 1px solid #f0ebe2;
}
.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: #4a3f35;
  border-bottom: 1px solid #f5f0e8;
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background-color: #faf8f5;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table .text-center {
  text-align: center;
}

/* ---- Post Form ---- */
.post-form {
  max-width: 800px;
}

/* ---- Image Upload Area ---- */
.image-upload-area {
  border: 2px dashed #e8ddd0;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-transition: all 0.2s;
  position: relative;
  background-color: #faf8f5;
}
.image-upload-area:hover {
  border-color: #8b7355;
  background-color: #f8f5f0;
}
.image-upload-area.dragover {
  border-color: #8b7355;
  background-color: #f0ebe2;
}
.image-upload-area .upload-placeholder {
  pointer-events: none;
}
.image-upload-area .upload-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}
.image-upload-area p {
  font-size: 15px;
  color: #6b5b4f;
  margin: 0 0 6px;
  font-weight: 500;
}
.image-upload-area .upload-hint {
  font-size: 12px;
  color: #a09080;
}
.image-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ---- Image Preview List ---- */
.image-preview-list {
  margin-top: 16px;
  overflow: hidden;
}
.image-preview-item {
  position: relative;
  float: left;
  width: 140px;
  height: 140px;
  margin: 0 6px 12px;
  border: 1px solid #e8ddd0;
  border-radius: 6px;
  overflow: hidden;
  background-color: #faf8f5;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}
.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-preview-item .btn-remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  background-color: rgba(231,76,60,0.9);
  color: #fff;
  font-size: 14px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}
.image-preview-item .btn-remove-image:hover {
  background-color: #c0392b;
}
.image-preview-item.uploading {
  border: 2px dashed #8b7355;
  background-color: #f5f0e8;
}
.image-preview-item.uploading img {
  opacity: 0.4;
}
.image-preview-item .upload-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  background-color: rgba(139,115,85,0.9);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}
.image-preview-item.uploaded .upload-status {
  display: none;
}

/* ---- Tag Suggestions ---- */
.tag-suggestions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #f0ebe2;
}
.suggestion-label {
  font-size: 12px;
  color: #a09080;
  margin-bottom: 6px;
}
.tag-suggestion {
  display: inline-block;
  padding: 3px 10px;
  margin: 0 6px 6px 0;
  background-color: #f5f0e8;
  border-radius: 12px;
  font-size: 12px;
  color: #8b7355;
  cursor: pointer;
  transition: background-color 0.2s;
  -webkit-transition: background-color 0.2s;
}
.tag-suggestion:hover {
  background-color: #e8ddd0;
}

/* ---- Status Badge ---- */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.status-publish {
  background-color: #e8f5e9;
  color: #2e7d32;
}
.status-draft {
  background-color: #fff3e0;
  color: #e65100;
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  gap: 4px;
}
.pagination a,
.pagination span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #6b5b4f;
  background-color: #ffffff;
  border: 1px solid #e8ddd0;
  min-width: 36px;
  text-align: center;
}
.pagination a:hover {
  background-color: #faf8f5;
  color: #8b7355;
}
.pagination .current {
  background-color: #8b7355;
  color: #ffffff;
  border-color: #8b7355;
}
.pagination .disabled {
  color: #d0c4b8;
  cursor: not-allowed;
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  overflow: auto;
}
.modal-overlay.show {
  display: flex;
}
.modal {
  background-color: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  position: relative;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0ebe2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #4a3f35;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #a09080;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.modal-close:hover {
  background-color: #f5f0e8;
  color: #4a3f35;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0ebe2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- Editor Toolbar ---- */
.editor-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  padding: 8px;
  background-color: #faf8f5;
  border-radius: 6px;
  border: 1px solid #f0ebe2;
}
.editor-toolbar .btn {
  min-width: 36px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
}

/* ---- Confirm Dialog ---- */
.confirm-dialog {
  text-align: center;
  padding: 8px 4px;
}
.confirm-dialog p {
  margin: 0 0 20px;
  font-size: 15px;
  color: #4a3f35;
  line-height: 1.6;
}
.confirm-dialog .btn {
  margin: 0 6px;
  min-width: 80px;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #a09080;
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.empty-state-text {
  font-size: 16px;
  font-weight: 500;
  color: #6b5b4f;
  margin-bottom: 6px;
}
.empty-state-hint {
  font-size: 13px;
}

/* ---- Text helpers ---- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: #a09080; }
.text-danger { color: #e74c3c; }
.text-success { color: #27ae60; }

/* ---- Clearfix ---- */
.clearfix:before,
.clearfix:after {
  content: " ";
  display: table;
}
.clearfix:after {
  clear: both;
}

/* ---- Responsive ---- */
@media screen and (max-width: 1024px) {
  .stat-card { width: 50%; margin-bottom: 12px; }
  .settings-row { flex-direction: column; align-items: flex-start; }
}
@media screen and (max-width: 768px) {
  .admin-sidebar { width: 60px; }
  .sidebar-header h2,
  .sidebar-title,
  .sidebar-footer .username,
  .sidebar-footer .logout-link,
  .sidebar-nav .icon + *,
  .sidebar-nav li a {
    font-size: 0;
  }
  .sidebar-nav .icon { font-size: 18px; margin: 0; width: auto; }
  .sidebar-nav li a,
  .sidebar-nav .sidebar-item {
    text-align: center;
    padding: 14px 0;
  }
  .admin-content { padding: 16px; }
  .stat-card { width: 50%; }
  .data-table { font-size: 12px; }
  .data-table th,
  .data-table td { padding: 8px 10px; }
  .image-preview-item { width: 100px; height: 100px; }
  .color-grid { gap: 10px; }
  .modal { width: 95%; }
}
@media screen and (max-width: 480px) {
  .stat-card { width: 100%; }
  .admin-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .settings-section { padding: 16px; }
}

/* ---- HTML Editor Toolbar ---- */
.html-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 8px 10px;
  background: #faf7f2;
  border: 1px solid #e8ddd0;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  align-items: center;
}
.html-editor-toolbar .ed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e8ddd0;
  border-radius: 4px;
  background: #fff;
  color: #6b5b4f;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-transition: all 0.15s;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  vertical-align: middle;
}
.html-editor-toolbar .ed-btn:hover {
  background: #8b7355;
  color: #fff;
  border-color: #8b7355;
}
.html-editor-toolbar .ed-btn:active {
  background: #6b5b4f;
}
.html-editor-toolbar .ed-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: #e0d5c8;
  margin: 0 3px;
  vertical-align: middle;
}
.html-editor-toolbar .ed-color-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid #e8ddd0;
  border-radius: 4px;
  cursor: pointer;
  vertical-align: middle;
  padding: 0;
}
.html-editor-toolbar .ed-select {
  height: 30px;
  border: 1px solid #e8ddd0;
  border-radius: 4px;
  background: #fff;
  color: #6b5b4f;
  font-size: 12px;
  padding: 0 6px;
  cursor: pointer;
  vertical-align: middle;
}
.html-editor-textarea {
  border-radius: 0 0 6px 6px !important;
  border-top: 1px solid #e8ddd0 !important;
}

/* ---- Sidebar Toggle Button ---- */
.sidebar-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: #6b5b4f;
  cursor: pointer;
  padding: 4px 8px;
}
@media screen and (max-width: 768px) {
  .sidebar-toggle-btn { display: inline-block; }
  .admin-sidebar {
    position: absolute;
    z-index: 1000;
    height: 100%;
    transition: transform 0.3s;
  }
  .admin-sidebar.sidebar-hidden {
    transform: translateX(-100%);
  }
}

/* ---- Card Title Text (front-end) ---- */
.card-title-text {
  font-size: 15px;
  font-weight: 600;
  color: #4a3f35;
  margin-bottom: 6px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---- Sidebar External Link ---- */
.sidebar-nav .sidebar-external {
  border-top: 1px solid #f0ebe2;
  margin-top: 8px;
  padding-top: 8px;
}
.sidebar-nav .sidebar-section-label {
  padding: 8px 20px 4px;
  font-size: 11px;
  color: #c0b0a0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ================================================================
   v8 追加样式
   ================================================================ */

/* ---- 封面选中高亮（修复问题2） ---- */
.image-preview-item.cover-selected {
  border: 3px solid #8b7355 !important;
  box-shadow: 0 0 0 3px rgba(139,115,85,0.3), 0 4px 16px rgba(139,115,85,0.25) !important;
}
.image-preview-item .cover-badge {
  display: none;
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: linear-gradient(135deg, #8b7355, #6b5b4f);
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  letter-spacing: 1px;
  z-index: 2;
  pointer-events: none;
}
.image-preview-item.cover-selected .cover-badge {
  display: block;
}

/* ---- 操作按钮补充 ---- */
.btn-view {
  background-color: #2980b9;
  color: #ffffff;
}
.btn-view:hover {
  background-color: #2471a3;
  color: #ffffff;
}
.btn-delete {
  background-color: #e74c3c;
  color: #ffffff;
}
.btn-delete:hover {
  background-color: #c0392b;
  color: #ffffff;
}

/* ---- 徽章 ---- */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
  margin-left: 6px;
}
.badge-draft {
  background-color: #fff3e0;
  color: #e65100;
}
.badge-publish {
  background-color: #e8f5e9;
  color: #2e7d32;
}

/* ---- 标签标签 ---- */
.tag-label {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 3px 2px 0;
  background-color: #f5f0e8;
  border-radius: 10px;
  font-size: 12px;
  color: #8b7355;
}

/* ---- 编辑器按钮（修复类名不匹配问题3） ---- */
.html-editor-toolbar .editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e8ddd0;
  border-radius: 4px;
  background: #fff;
  color: #6b5b4f;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-transition: all 0.15s;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  vertical-align: middle;
}
.html-editor-toolbar .editor-btn:hover {
  background: #8b7355;
  color: #fff;
  border-color: #8b7355;
}
.html-editor-toolbar .editor-btn:active {
  background: #6b5b4f;
}
.editor-separator {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: #e0d5c8;
  margin: 0 4px;
  vertical-align: middle;
}

/* ---- 编辑器 Tab 切换（问题3） ---- */
.editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e8ddd0;
  margin-bottom: 0;
}
.editor-tab {
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 500;
  color: #a09080;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-transition: all 0.2s;
  font-family: inherit;
}
.editor-tab:hover {
  color: #8b7355;
}
.editor-tab.active {
  color: #8b7355;
  border-bottom-color: #8b7355;
  font-weight: 600;
}

/* ---- 预览区域（问题3） ---- */
.content-preview-area {
  border: 1px solid #e8ddd0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 24px;
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
  background: #fff;
  font-size: 15px;
  line-height: 1.8;
  color: #4a3f35;
  word-wrap: break-word;
}
.content-preview-area img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}
.content-preview-area h1 { font-size: 24px; margin: 16px 0 8px; }
.content-preview-area h2 { font-size: 20px; margin: 14px 0 8px; }
.content-preview-area h3 { font-size: 17px; margin: 12px 0 6px; }
.content-preview-area p { margin: 8px 0; }
.content-preview-area blockquote {
  border-left: 4px solid #8b7355;
  background: #faf7f2;
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 0 6px 6px 0;
}
.content-preview-area pre {
  background: #f0ebe3;
  padding: 14px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}
.content-preview-area code {
  background: #f0ebe3;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 13px;
}
.content-preview-area ul, .content-preview-area ol {
  padding-left: 24px;
  margin: 8px 0;
}
.content-preview-area li { margin: 4px 0; }
.content-preview-area table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}
.content-preview-area th, .content-preview-area td {
  border: 1px solid #e8ddd0;
  padding: 8px 12px;
  text-align: left;
}
.content-preview-area th {
  background: #faf8f5;
  font-weight: 600;
}
.content-preview-area hr {
  border: none;
  border-top: 1px solid #e8ddd0;
  margin: 16px 0;
}
.content-preview-area a { color: #8b7355; text-decoration: underline; }
.preview-empty-hint {
  text-align: center;
  color: #c0b0a0;
  padding: 60px 20px;
  font-size: 14px;
}

/* ---- 外链图片行 ---- */
.external-image-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.external-image-row .form-input {
  flex: 1;
  font-size: 13px;
}