:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --primary: #4361ee;
  --primary-dark: #3751cf;
  --primary-soft: #eef2ff;
  --secondary: #3b82f6;
  --accent: #7c3aed;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 4px 14px rgba(17, 24, 39, 0.05);
  --soft-blue: #f1f5f9;
  --soft-lilac: #f3f4f6;
  --soft-mint: #eef2f7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
}

/* 登录页美化 */
.admin-login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 0% 0%, rgba(79, 70, 229, 0.22) 0%, transparent 60%),
    radial-gradient(900px 520px at 100% 100%, rgba(14, 165, 233, 0.18) 0%, transparent 62%),
    linear-gradient(135deg, #f6f8ff 0%, #eef5ff 45%, #f8fafc 100%);
}

.admin-login-card {
  width: min(460px, 100%);
  padding: 30px 26px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 28px 60px rgba(67, 97, 238, 0.22),
    0 8px 24px rgba(15, 23, 42, 0.08);
}

.admin-login-card h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #1e293b;
  letter-spacing: 0.2px;
}

#admin-login-tip {
  margin-top: 10px;
  margin-bottom: 20px;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.6;
}

.admin-login-form {
  display: grid;
  gap: 14px;
}

.admin-login-form label {
  display: grid;
  gap: 7px;
}

.admin-login-form label span {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
}

.admin-login-form input {
  height: 44px;
  border-radius: 12px;
  border: 1px solid #dbe4ff;
  background: #ffffff;
  padding: 0 12px;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-login-form input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
  transform: translateY(-1px);
}

#admin-login-submit {
  margin-top: 4px;
  height: 44px;
  border-radius: 12px;
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 55%, #0ea5e9 100%);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

#admin-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.34);
}

#admin-login-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, #4361ee 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 14px 0;
  box-shadow: 0 4px 16px rgba(67, 97, 238, 0.3);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  font-size: 1.6rem;
}

.header-avatar {
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.header-avatar:hover {
  opacity: 1;
}

.header-avatar-btn {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.header-avatar-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-username-display {
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-menu {
  position: relative;
}

.admin-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 148px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  padding: 8px;
  z-index: 80;
}

.admin-user-dropdown-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 0.9rem;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.admin-user-dropdown-item:hover {
  background: #f1f5f9;
}

.admin-header h1 {
  font-size: 1.15rem;
  margin: 2px 0;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.admin-header p {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.75);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #e0f2fe;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.back-home-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.status-pill {
  background: rgba(74, 222, 128, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #bbf7d0;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-pill .fa-circle {
  font-size: 0.55rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  width: min(1380px, 94%);
  margin: 14px auto 28px;
}

.admin-sidebar {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 86px);
  overflow-y: auto;
}

.sidebar-header {
  margin-bottom: 16px;
}

.sidebar-title {
  font-weight: 700;
  color: #1f2937;
  font-size: 1rem;
  margin-bottom: 2px;
}

.sidebar-subtitle {
  font-size: 0.82rem;
  color: #9ca3af;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  padding-left: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #4b5563;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
  transition: color 0.2s ease;
}

.nav-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.nav-item:hover i {
  color: var(--primary);
}

.nav-item.is-active {
  background: rgba(67, 97, 238, 0.08);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-item.is-active i {
  color: var(--primary);
}

.admin-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-welcome {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel-soft {
  background: linear-gradient(140deg, #ffffff 0%, #f7f9ff 100%);
  border: 1px solid #e4ebfb;
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.welcome-item {
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e8eefc;
}

.welcome-item h3 {
  margin: 4px 0 8px;
  color: #25325b;
}

.welcome-item p {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.6;
}

.welcome-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #43538a;
  background: var(--soft-blue);
}

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(30, 41, 59, 0.06);
  border: 1px solid #e8ecf4;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef1f6;
}

.panel-header h2 {
  font-size: 1.14rem;
  color: #0f172a;
  margin: 0;
}

.panel-subtitle {
  color: #64748b;
  font-size: 0.86rem;
  margin-top: 4px;
}

form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  color: var(--muted);
  font-size: 0.9rem;
}

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.file-field input[type="file"] {
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #b9cdf6;
  width: 100%;
}

.image-upload-field {
  max-width: 100%;
  width: 100%;
}

.image-upload-field input[type="file"] {
  display: none;
}

.upload-picker {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 20px 16px;
  display: grid;
  gap: 6px;
  text-align: center;
  background: #f9fafb;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-picker:hover {
  border-color: var(--primary);
  background: #f5f7ff;
  box-shadow: none;
  transform: translateY(-1px);
}

.upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto;
}

.upload-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.upload-picker small {
  color: var(--muted);
}

.upload-feedback {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.upload-feedback.is-ready {
  color: #0f172a;
  font-weight: 600;
}

.upload-directory-field {
  margin-bottom: 20px;
}

.directory-selector {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.directory-selector select {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.directory-selector select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.directory-selector button {
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 0.84rem;
}

.upload-progress-container {
  margin: 18px 0;
  padding: 16px;
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  border: 1px solid #d4e0f7;
  border-radius: 10px;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}

.upload-progress-header i {
  color: var(--primary);
}

.progress-bar-wrapper {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, #6366f1 50%, #22c55e 100%);
  border-radius: 999px;
  transition: width 0.15s linear;
  position: relative;
  background-size: 200% 100%;
  will-change: width;
}

.progress-bar.uploading {
  animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.cancel-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.08);
}

.cancel-upload-btn:hover {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #b91c1c;
  border-color: #fca5a5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
}

.cancel-upload-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.12);
}

.cancel-upload-btn i {
  font-size: 0.9rem;
  animation: none;
}

.cancel-upload-btn:hover i {
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.custom-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeInOverlay 0.3s ease-out;
}

@keyframes fadeInOverlay {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(6px); }
}

.custom-confirm-dialog {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 20px;
  padding: 36px 32px 28px;
  max-width: 420px;
  width: 90%;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.25),
    0 10px 25px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: slideUpDialog 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

@keyframes slideUpDialog {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-icon-wrapper {
  margin-bottom: 20px;
}

.confirm-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto;
  position: relative;
}

.confirm-icon.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.25);
  animation: pulseWarning 2s ease-in-out infinite;
}

@keyframes pulseWarning {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.25);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(217, 119, 6, 0.35);
  }
}

.confirm-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.confirm-message {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 28px;
  padding: 0 8px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-confirm {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid transparent;
}

.btn-confirm-secondary {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #475569;
  border-color: #cbd5e1;
}

.btn-confirm-secondary:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #334155;
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(71, 85, 105, 0.18);
}

.btn-confirm-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.btn-confirm-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  border-color: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.4);
}

.btn-confirm:active {
  transform: translateY(0) !important;
}

.upload-progress-details {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 12px;
  background: rgba(248, 250, 252, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.upload-progress-details .progress-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.4);
  transition: all 0.2s ease;
}

.upload-progress-details .progress-item:last-child {
  margin-bottom: 0;
}

.upload-progress-details .progress-item span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
  color: #475569;
  font-weight: 500;
}

.upload-progress-details .progress-item span:last-child {
  flex-shrink: 0;
  font-family: "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 140px;
  text-align: right;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(241, 245, 249, 0.8);
}

.upload-progress-details .progress-item.success {
  background: rgba(220, 252, 231, 0.4);
  border-color: rgba(134, 239, 172, 0.5);
}

.upload-progress-details .progress-item.success span:first-child {
  color: #166534;
}

.upload-progress-details .progress-item.success span:last-child {
  color: #15803d;
  background: rgba(220, 252, 231, 0.8);
}

.upload-progress-details .progress-item.error {
  background: rgba(254, 226, 226, 0.4);
  border-color: rgba(254, 202, 202, 0.5);
}

.upload-progress-details .progress-item.error span:first-child {
  color: #991b1b;
}

.upload-progress-details .progress-item.error span:last-child {
  color: #dc2626;
  background: rgba(254, 226, 226, 0.8);
}

.upload-progress-details .progress-item.skipped {
  background: rgba(254, 249, 195, 0.4);
  border-color: rgba(254, 240, 138, 0.5);
}

.upload-progress-details .progress-item.skipped span:first-child {
  color: #854d0e;
}

.upload-progress-details .progress-item.skipped span:last-child {
  color: #ca8a04;
  background: rgba(254, 249, 195, 0.8);
}

.upload-progress-details .progress-item:not(.success):not(.error):not(.skipped) {
  background: rgba(239, 246, 255, 0.5);
  border-color: rgba(191, 219, 254, 0.5);
}

.upload-progress-details .progress-item:not(.success):not(.error):not(.skipped) span:first-child {
  color: #1e40af;
}

.upload-progress-details .progress-item:not(.success):not(.error):not(.skipped) span:last-child {
  color: #2563eb;
  background: rgba(239, 246, 255, 0.9);
}

.upload-progress-details .progress-item:not(.success):not(.error):not(.skipped) {
  color: var(--primary);
}

.upload-progress-details .progress-item span:last-child {
  font-family: "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  min-width: 140px;
  text-align: right;
}

button {
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(67, 97, 238, 0.28);
}

.multi-select {
  display: grid;
  gap: 12px;
  width: 100%;
}

.multi-group p {
  font-weight: 600;
  margin-bottom: 8px;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-item {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.85rem;
}

.meta-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meta-group {
  width: 100%;
}

.meta-group.full {
  width: 100%;
}

.meta-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.route-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

/* 重复值提示样式 */
.meta-duplicate-hint {
  min-height: 24px;
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  display: none;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.2s ease;
}

.meta-duplicate-hint.is-visible {
  display: flex;
}

.meta-duplicate-hint.is-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #92400e;
}

.meta-duplicate-hint.is-error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid #ef4444;
  color: #991b1b;
}

.meta-duplicate-hint.is-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 1px solid #10b981;
  color: #065f46;
}

.meta-duplicate-hint i {
  font-size: 1rem;
  flex-shrink: 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.route-form input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.routes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-list.routes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.route-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #edf1f7;
  width: 240px;
  min-width: 160px;
  max-width: 260px;
  box-sizing: border-box;
  position: relative;
}

.route-item-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.route-item-info strong {
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  color: #1e293b;
}

.route-item-info span {
  color: var(--muted);
  font-size: 0.85rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* 路径管理自定义Tooltip */
.route-tooltip {
  position: fixed;
  padding: 10px 14px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10000;
  max-width: 400px;
  word-wrap: break-word;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.route-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.route-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #1e293b;
}

.route-tooltip-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.route-tooltip-prefix {
  font-weight: 600;
  color: #60a5fa;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.88rem;
}

.route-tooltip-description {
  color: #cbd5e1;
  font-size: 0.82rem;
}

.meta-form input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f3f4f6;
  gap: 8px;
}

.meta-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1f2937;
}

.meta-item-actions {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-action-button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #dce4f3;
  background: #eef2f7;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
}

.admin-action-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.admin-action-button:hover {
  background: #e6ebf4;
  border-color: #cbd5e1;
}

.admin-action-button.danger:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* 发布模块视觉增强 */
.admin-module[data-module="publish"] {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  border: 1px solid #dfe7fb;
}

.publish-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.publish-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.publish-header-actions {
  display: flex;
  gap: 12px;
}

.download-template-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.download-template-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #1e293b;
  cursor: pointer;
}

.download-template-btn i {
  font-size: 1rem;
}

.admin-module[data-module="publish"] .panel-header h2 {
  font-size: 1.35rem;
  letter-spacing: 0.2px;
}

.publish-step-tips {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.publish-step-tips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf3ff;
  color: #33508f;
  border: 1px solid #d8e4ff;
  font-size: 0.8rem;
  font-weight: 600;
}

.publish-form {
  display: block;
}

.publish-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr);
  gap: 8px;
  align-items: stretch;
}

/* 标签页样式 */
.publish-tabs {
  margin-top: 16px;
}

.publish-tab-buttons {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.publish-tab-button {
  padding: 8px 16px;
  border: none;
  background: none;
  border-radius: 6px 6px 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: none;
}

.publish-tab-button:hover {
  color: #334155;
  background: #f1f5f9;
}

.publish-tab-button.active {
  color: var(--primary);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-bottom: 1px solid #ffffff;
  font-weight: 600;
}

.publish-tab-content {
  display: block;
}

/* Markdown 编辑器样式 */
.markdown-editor-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f4;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 14px rgba(100, 116, 139, 0.06);
}

.markdown-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  flex-wrap: wrap;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.toolbar-btn i {
  font-size: 1rem;
}

.markdown-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 500px;
}

.editor-panel {
  display: flex;
  flex-direction: column;
}

.markdown-textarea {
  flex: 1;
  width: 100%;
  min-height: 480px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  background: #f8fafc;
}

.markdown-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.preview-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.preview-header {
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.preview-header h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.markdown-preview {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #ffffff;
  line-height: 1.6;
}

.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4, .markdown-preview h5, .markdown-preview h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.2;
}

.markdown-preview h1 {
  font-size: 1.8rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.3em;
}

.markdown-preview h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.3em;
}

.markdown-preview h3 {
  font-size: 1.2rem;
}

.markdown-preview p {
  margin: 1em 0;
}

.markdown-preview code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  background: #f1f5f9;
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

.markdown-preview pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 1em 0;
}

.markdown-preview pre code {
  background: none;
  padding: 0;
}

.markdown-preview blockquote {
  border-left: 4px solid var(--primary);
  margin: 1em 0;
  padding: 0.5em 1em;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}

.markdown-preview ul, .markdown-preview ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.markdown-preview li {
  margin: 0.5em 0;
}

.markdown-preview table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

.markdown-preview th, .markdown-preview td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}

.markdown-preview th {
  background: #f8fafc;
  font-weight: 600;
}

.markdown-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1em 0;
}

.markdown-preview a {
  color: var(--primary);
  text-decoration: none;
}

.markdown-preview a:hover {
  text-decoration: underline;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

/* 弹窗样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
}

.modal-cancel {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-cancel:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .markdown-editor {
    grid-template-columns: 1fr;
  }
  
  .publish-tab-buttons {
    flex-direction: column;
  }
  
  .publish-tab-button {
    width: 100%;
    text-align: left;
  }
  
  .modal-content {
    width: 95%;
  }
}

.publish-card {
  background: #ffffff;
  border: 1px solid #e2e8f4;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 6px 14px rgba(100, 116, 139, 0.06);
}

.publish-card-files {
  grid-column: 1 / 2;
  grid-row: 1;
  width: 100%;
  justify-self: stretch;
}

.publish-card-main {
  grid-column: 1 / 2;
  grid-row: 2;
}

.publish-card-side {
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
}

.publish-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: #1e293b;
  margin-bottom: 8px;
}

.publish-card-title i {
  color: var(--primary);
}

.publish-card-body {
  display: grid;
  gap: 8px;
}

.publish-fields-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 8px;
  column-gap: 10px;
}

#markdown-form .field {
  max-width: 100%;
}

#markdown-form .field.field-full,
#markdown-form .publish-attributes-grid.field-full {
  grid-column: 1 / -1;
}

#markdown-form .field span {
  color: #334155;
  font-weight: 600;
  font-size: 0.88rem;
}

#markdown-form .field input,
#markdown-form .field select,
#markdown-form .field textarea {
  background: #ffffff;
  border: 1px solid #dfe5f7;
  min-height: 38px;
  border-radius: 10px;
}

#markdown-form .field input::placeholder,
#markdown-form .field textarea::placeholder {
  color: #94a3b8;
}

#markdown-form .field input:focus,
#markdown-form .field select:focus,
#markdown-form .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.12);
}

#markdown-form .field-summary textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

#markdown-form .field-route-search small {
  color: #64748b;
  font-size: 0.78rem;
}

.route-prefix-input-wrap {
  position: relative;
  width: 100%;
}

.route-prefix-input-wrap input {
  padding-right: 34px;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}

.route-prefix-input-wrap input::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none;
}

.route-prefix-input-wrap input::-ms-expand {
  display: none !important;
}

.input-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: #e8eefc;
  color: #4662a7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.publish-attributes-grid {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.attribute-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  flex-grow: 1;
  min-width: 180px;
}

.attribute-item span {
  white-space: nowrap;
  font-weight: 500;
  color: #334155;
  min-width: 80px;
}

.radio-group {
  display: flex;
  gap: 15px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-weight: 400;
  color: #64748b;
}

.radio-group input[type="radio"] {
  margin: 0;
  accent-color: var(--primary);
}

.edit-form-attributes {
  margin: 10px 0;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
}

.edit-form-attributes div {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-form-attributes div:last-child {
  margin-bottom: 0;
}

.edit-form-attributes span {
  white-space: nowrap;
  min-width: 80px;
}

.edit-form-attributes label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.input-clear-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.input-clear-btn:hover {
  background: #dbe6ff;
  color: #244a9e;
  transform: translateY(-50%);
}

#markdown-form .field-route-search {
  max-width: 100%;
}

#markdown-form .multi-select {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  gap: 10px;
}

#markdown-form .multi-group {
  display: flex;
  flex-direction: column;
  min-height: 208px;
  max-height: 208px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e2e8f0;
}

#markdown-form .multi-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#markdown-form .multi-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

#markdown-form .multi-group p {
  font-size: 0.9rem;
  color: #334155;
  margin-bottom: 0;
}

.meta-search-input {
  width: 56%;
  min-width: 150px;
  border: 1px solid #dfe5f7;
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.meta-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

#markdown-form .options-dropdown {
  max-height: 104px;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 6px;
}

#markdown-form .option-item {
  border: 1px solid #dfe5f7;
  background: #f8fbff;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  line-height: 1.2;
  padding: 5px 9px;
}

#markdown-form .option-item:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.selected-items {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 44px;
  max-height: 76px;
  overflow-y: auto;
  align-content: flex-start;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  color: #2f3f7a;
  background: #ecf2ff;
  border: 1px solid #ccdafb;
}

.selected-chip-remove {
  border: none;
  background: transparent;
  color: #4a5f9f;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1;
  padding: 0;
  box-shadow: none;
}

.selected-chip-remove:hover {
  background: rgba(67, 97, 238, 0.12);
  color: #1f3d8f;
  transform: none;
}

.selected-empty {
  font-size: 0.8rem;
  color: #94a3b8;
}

.publish-files-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#markdown-form .file-field {
  background: #f8fbff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}

#markdown-form .file-field input[type="file"] {
  border: 1px dashed #b9cdf6;
  background: #ffffff;
}

#markdown-form .file-field small {
  color: #64748b;
  margin-top: 2px;
}

.markdown-parse-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

#markdown-form .secondary-button {
  min-height: 38px;
  min-width: 180px;
  background: #e2e8f0;
  color: #1f2937;
  box-shadow: none;
}

#markdown-form .secondary-button:hover {
  background: #cbd5e1;
}

.publish-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

#markdown-form button[type="submit"] {
  min-width: 180px;
  min-height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#markdown-form button[type="submit"]:hover {
  background: linear-gradient(135deg, var(--primary-dark), #6d28d9);
}

#markdown-result,
#image-result {
  margin-top: 12px;
  color: var(--muted);
  word-break: break-all;
}

#markdown-result {
  background: #f8fbff;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

#post-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.post-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 20px 14px;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stats-card {
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px;
}

.stats-card p {
  color: #64748b;
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.stats-card strong {
  font-size: 1.35rem;
  color: #0f172a;
  display: block;
}

.stats-card small {
  margin-top: 6px;
  color: #64748b;
  display: block;
}

.stats-card-wide {
  grid-column: span 1;
}

.stats-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chart-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.chart-card h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: #1e293b;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 260px !important;
}

/* ========== 文件上传模块优化 ========== */
.upload-module-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin-top: 16px;
}

.upload-main-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}

/* 上传选择器优化 */
.upload-picker {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 28px 20px;
  display: block;
  width: 100%;
  text-align: center;
  background: #f9fafb;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-picker:hover {
  border-color: var(--primary);
  background: #f5f7ff;
}

.upload-picker.is-dragover {
  border-color: var(--primary);
  background: #eff6ff;
  border-style: solid;
}

.upload-picker-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto;
}

.upload-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.upload-picker-desc {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
}

.upload-file-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}

.file-type-badge {
  padding: 3px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

/* 上传提交按钮 */
.upload-submit-btn {
  width: 100%;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 12px;
}

.upload-submit-btn:hover {
  background: var(--primary-dark);
}

/* 文件上传记录 */
.image-history {
  margin-top: 0;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5eaf3;
}

.image-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef1f6;
}

.image-history-header h3 {
  margin: 0 0 3px 0;
  font-size: 1rem;
  color: #0f172a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-history-header h3 i {
  color: var(--primary);
}

.refresh-btn {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 文件类型提示卡片 */
.tips-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5eaf3;
}

.tips-card h3 {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 600;
}

.tips-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.tip-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 48px;
  text-align: center;
  background: #e5e7eb;
  color: #374151;
}

.tip-desc {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.4;
}

.tips-note {
  margin-top: 14px;
  padding: 10px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #d1d5db;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.5;
}

.tips-note i {
  flex-shrink: 0;
  margin-top: 2px;
  color: #9ca3af;
}

/* 上传反馈优化 */
.upload-feedback {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.upload-feedback.is-ready {
  color: #0f172a;
  font-weight: 600;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.file-selection-summary {
  margin-bottom: 10px;
  font-weight: 600;
  color: #0f172a;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 0.85rem;
}

.file-item-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.file-item-name {
  flex: 1;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-size {
  color: #6b7280;
  font-size: 0.8rem;
  flex-shrink: 0;
  font-weight: 500;
}

.file-total {
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  font-weight: 600;
  color: #0f172a;
  font-size: 0.85rem;
}

/* 上传结果反馈样式 */
#image-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  display: none;
}

#image-result:not(:empty) {
  display: block;
}

#image-result.upload-progress {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

#image-result.upload-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

#image-result.upload-partial {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

#image-result.upload-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

#image-result i {
  margin-right: 6px;
}

#image-result .upload-links {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

#image-result .upload-links a {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  margin: 3px 3px 3px 0;
  color: inherit;
  text-decoration: none;
  font-size: 0.8rem;
  word-break: break-all;
}

#image-result .upload-links a:hover {
  text-decoration: underline;
}

#image-result .upload-note {
  margin-top: 6px;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* 上传结果反馈样式 */
#image-result {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
}

#image-result:not(:empty) {
  display: block;
}

#image-result.upload-progress {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd;
  color: #1e40af;
}

#image-result.upload-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  color: #166534;
}

#image-result.upload-partial {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  color: #92400e;
}

#image-result.upload-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

#image-result i {
  margin-right: 8px;
}

#image-result .upload-links {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

#image-result .upload-links a {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  margin: 4px 4px 4px 0;
  color: inherit;
  text-decoration: none;
  font-size: 0.85rem;
  word-break: break-all;
  transition: all 0.2s ease;
}

#image-result .upload-links a:hover {
  background: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
}

#image-result .upload-note {
  margin-top: 8px;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* 图片表格优化 */
.image-table {
  display: grid;
  gap: 10px;
}

.image-table-head,
.image-row {
  display: grid;
  grid-template-columns: 160px 1fr 120px 80px;
  align-items: center;
  gap: 12px;
}

.image-table-head {
  font-weight: 600;
  color: #111827;
  font-size: 0.85rem;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.image-row {
  background: #ffffff;
  border: 1px solid #e5eaf3;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
}

.image-row:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.image-links {
  display: grid;
  gap: 4px;
}

.image-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  word-break: break-all;
  padding: 4px 8px;
  background: #f9fafb;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.image-links a:hover {
  background: #f5f7ff;
  border-color: var(--primary);
}

.image-preview {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.image-preview:hover {
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.image-preview.is-file {
  cursor: default;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  text-align: center;
}

.image-preview.is-file:hover {
  box-shadow: none;
}

.image-preview.is-file .file-icon {
  font-size: 1.25rem;
  color: var(--primary);
}

.image-preview.is-file .file-label {
  font-size: 0.7rem;
  color: #9ca3af;
}

.image-row .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #fee2e2;
  background: #fef2f2;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-row .icon-button:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* 图片预览模态框 */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.image-modal.is-open .image-modal-content {
  transform: scale(1);
}

.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  font-size: 1.5rem;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1;
}

.image-modal-close:hover {
  background: #fff;
  transform: rotate(90deg);
}

#image-modal-img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .upload-module-layout {
    grid-template-columns: 1fr;
  }
  
  .upload-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .upload-module-layout {
    gap: 16px;
  }
  
  .upload-card,
  .image-history,
  .tips-card {
    padding: 16px;
  }
  
  .image-table-head,
  .image-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .image-table-head {
    display: none;
  }
  
  .image-row > div {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .image-row > div::before {
    font-weight: 600;
    color: #64748b;
    min-width: 70px;
  }
  
  .image-row > div:nth-child(1)::before {
    content: '时间：';
  }
  
  .image-row > div:nth-child(2)::before {
    content: '链接：';
  }
  
  .image-row > div:nth-child(3)::before {
    content: '预览：';
  }
  
  .image-row > div:nth-child(4)::before {
    content: '操作：';
  }
  
  .image-preview {
    width: 100%;
    height: 120px;
  }
  
  .upload-card-header {
    flex-direction: column;
    text-align: center;
  }
  
  .upload-card-header h3 {
    font-size: 1.1rem;
  }
  
  .image-history-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .refresh-btn {
    align-self: flex-end;
  }
}

.nav-toolbar {
  margin-bottom: 0;
  gap: 8px;
}

.nav-json-field textarea {
  width: 100%;
  min-height: 360px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  background: #f7f8fb;
  color: #1f2937;
  border: 1px solid #d9dee8;
}

.json-editor-container {
  position: relative;
  border: 2px solid #90caf9;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: border-color 0.3s ease;
}

.json-editor-container:hover {
  border-color: #64b5f6;
}

.json-editor-container:focus-within {
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.json-editor-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf6 100%);
  border-bottom: 1px solid #d0d7de;
  gap: 8px;
  flex-wrap: wrap;
}

.json-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f0f4f8;
  border: 1px solid #d1d9e6;
  border-radius: 6px;
  font-size: 13px;
  color: #5a6a7a;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}

.json-action-btn:hover {
  background: #e2e8f0;
  color: #4a5568;
  border-color: #cbd5e1;
}

.json-action-btn:active {
  background: #d4dbe5;
}

.json-action-btn i {
  font-size: 13px;
}

.json-textarea {
  margin: 0;
  width: 100%;
  min-height: 220px;
  max-height: 500px;
  padding: 14px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  overflow: auto;
  border: none;
  outline: none;
  resize: vertical;
  background: #fafafa;
  color: #1f2937;
}

.json-textarea::selection,
.json-textarea *::selection {
  background-color: rgba(191, 219, 254, 0.5);
  color: #1e293b;
}

.json-textarea::-moz-selection,
.json-textarea *::-moz-selection {
  background-color: rgba(191, 219, 254, 0.5);
  color: #1e293b;
}

.json-tree-view {
  width: 100%;
  min-height: 220px;
  max-height: 500px;
  padding: 14px;
  overflow: auto;
  background: #fafafa;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.json-tree-view::selection,
.json-tree-view *::selection {
  background-color: rgba(191, 219, 254, 0.5);
  color: #1e293b;
}

.json-tree-view::-moz-selection,
.json-tree-view *::-moz-selection {
  background-color: rgba(191, 219, 254, 0.5);
  color: #1e293b;
}

.json-tree-node {
  margin-left: 0;
}

.json-tree-node-root {
  margin-left: 0;
}

.json-tree-line {
  display: flex;
  align-items: flex-start;
  padding: 2px 8px;
  border-radius: 4px;
  min-height: 22px;
  line-height: 1.6;
}

.json-tree-line:hover:not(:has(::selection)) {
  background-color: rgba(102, 126, 234, 0.08);
}

.json-tree-toggle {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  color: #666;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-right: 4px;
}

.json-tree-toggle:hover {
  color: #1976d2;
  background: rgba(25, 118, 210, 0.1);
  border-radius: 3px;
}

.json-tree-toggle.collapsed {
  transform: rotate(-90deg);
}

.json-tree-placeholder {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-right: 4px;
}

.json-tree-key {
  color: #881391;
  font-weight: 500;
}

.json-tree-colon {
  color: #666;
  margin: 0 5px;
}

.json-tree-string {
  color: #c41a16;
}

.json-tree-number {
  color: #1c00cf;
}

.json-tree-boolean {
  color: #0d22aa;
}

.json-tree-null {
  color: #808080;
  font-style: italic;
}

.json-tree-bracket {
  color: #333;
  font-weight: 500;
}

.json-tree-children {
  overflow: hidden;
  margin-left: 20px;
}

.json-tree-children.collapsed {
  display: none;
}

.json-tree-preview {
  color: #888;
  font-style: italic;
  font-size: 12px;
  margin-left: 5px;
}

.json-key { color: #1565c0; font-weight: 600; }
.json-string { color: #2e7d32; }
.json-number { color: #e65100; }
.json-boolean { color: #7c3aed; font-weight: 600; }
.json-null { color: #be123c; font-weight: 600; }
.json-punc { color: #6b7280; }
.json-collapsible { cursor: pointer; }
.json-collapsible:hover { opacity: 0.7; }

#nav-json-result {
  margin-top: 8px;
  color: #334155;
}

#nav-json-result.success {
  color: #166534;
}

#nav-json-result.error {
  color: #b91c1c;
}

.nav-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.nav-item-card {
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  display: grid;
  gap: 10px;
}

.nav-item-card .nav-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.nav-item-card .nav-item-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item-card .nav-item-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-item-card .nav-actions {
  display: flex;
  gap: 8px;
}

.nav-item-card .nav-actions button {
  background: #111827;
  padding: 6px 10px;
  border-radius: 8px;
}

.nav-item-card .nav-actions button.delete {
  background: #dc2626;
}

.nav-children-list {
  display: grid;
  gap: 8px;
  padding-left: 12px;
}

.nav-child-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px dashed #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.nav-child-card .nav-item-title {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-child-card .nav-actions button {
  background: #111827;
  padding: 6px 10px;
  border-radius: 8px;
}

.nav-child-card .nav-actions button.delete {
  background: #dc2626;
}

.tips-card h3 {
  margin-bottom: 10px;
}

.image-history {
  margin-top: 18px;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5eaf3;
}

.image-history .panel-header {
  margin-bottom: 12px;
}

.image-table {
  display: grid;
  gap: 10px;
}

.image-table-head,
.image-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(240px, 1.6fr) minmax(140px, 200px) 60px;
  align-items: center;
  gap: 12px;
}

.image-table-head {
  font-weight: 600;
  color: #111827;
  font-size: 0.86rem;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e5eaf3;
  border-radius: 10px;
}

.image-row {
  background: #ffffff;
  border: 1px solid #e5eaf3;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.86rem;
  color: var(--text);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.image-row:hover {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.image-links {
  display: grid;
  gap: 6px;
}

.image-links a {
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 0.85rem;
  word-break: break-all;
}

.image-links a:hover {
  text-decoration: underline;
}

.image-preview {
  width: 88px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-preview:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.image-preview.is-file {
  cursor: default;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  text-align: center;
}

.image-preview.is-file:hover {
  transform: none;
  box-shadow: none;
}

.image-preview.is-file .file-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.image-preview.is-file .file-label {
  font-size: 0.7rem;
  color: #64748b;
}

.image-preview.is-file.is-doc .file-icon {
  background: #fde68a;
  color: #92400e;
}

.image-preview.is-file.is-sheet .file-icon {
  background: #bbf7d0;
  color: #166534;
}

.image-preview.is-file.is-slide .file-icon {
  background: #fecaca;
  color: #991b1b;
}

.image-preview.is-file.is-text .file-icon {
  background: #e0e7ff;
  color: #3730a3;
}

.image-preview.is-file.is-archive .file-icon {
  background: #fbcfe8;
  color: #9d174d;
}

.image-preview.is-file.is-code .file-icon {
  background: #bae6fd;
  color: #0c4a6e;
}

.image-preview.is-file.is-code-md .file-icon {
  background: #fef3c7;
  color: #92400e;
}

.image-preview.is-file.is-code-c .file-icon {
  background: #dbeafe;
  color: #1e40af;
}

.image-preview.is-file.is-code-java .file-icon {
  background: #fee2e2;
  color: #991b1b;
}

.image-preview.is-file.is-code-python .file-icon {
  background: #fef9c3;
  color: #854d0e;
}

.image-preview.is-file.is-code-go .file-icon {
  background: #cffafe;
  color: #155e75;
}

.image-preview.is-file.is-code-html .file-icon {
  background: #ffedd5;
  color: #9a3412;
}

.image-preview.is-file.is-code-js .file-icon {
  background: #fef08a;
  color: #713f12;
}

.image-preview.is-file.is-code-css .file-icon {
  background: #e0e7ff;
  color: #3730a3;
}

.image-preview.is-file.is-code-json .file-icon {
  background: #dcfce7;
  color: #166534;
}

.image-preview.is-file.is-code-yaml .file-icon {
  background: #f3e8ff;
  color: #6b21a8;
}

.image-preview.is-file.is-code-sql .file-icon {
  background: #e2e8f0;
  color: #334155;
}

.image-preview.is-file.is-script .file-icon {
  background: #ddd6fe;
  color: #4c1d95;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-button.danger {
  background: linear-gradient(135deg, #fda4af, #fb7185);
  color: #fff;
  border-radius: 12px;
  width: 38px;
  height: 38px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(251, 113, 133, 0.28);
}

.icon-button.danger::before,
.icon-button.danger::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.icon-button.danger::before {
  transform: rotate(45deg);
}

.icon-button.danger::after {
  transform: rotate(-45deg);
}

.icon-button.danger:hover {
  background: linear-gradient(135deg, #f97316, #ef4444);
  transform: translateY(-1px) scale(1.02);
}

.image-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1200;
}

.image-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}

.image-modal-content {
  position: relative;
  max-width: min(90vw, 920px);
  max-height: 80vh;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
  transform: translateY(16px) scale(0.95);
  transition: transform 0.3s ease;
  z-index: 1;
}

.image-modal.is-open .image-modal-content {
  transform: translateY(0) scale(1);
}

.image-modal-content img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  border-radius: 14px;
}

.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.image-modal-close:hover {
  background: #111827;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-toolbar select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
}

.analytics-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-card {
  border: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.analytics-card > i {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  flex-shrink: 0;
}

.analytics-card:nth-child(2) > i {
  background: linear-gradient(135deg, #10b981, #059669);
}

.analytics-card:nth-child(3) > i {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.analytics-card:nth-child(4) > i {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.analytics-card:nth-child(5) > i {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.analytics-card:nth-child(6) > i {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.analytics-info {
  display: flex;
  flex-direction: column;
}

.analytics-label {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 4px;
}

.analytics-info strong {
  font-size: 1.4rem;
  color: #0f172a;
}

.chart-card-wide {
  grid-column: span 2;
}

.analytics-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.analytics-list-container {
  max-height: 320px;
  overflow-y: auto;
}

.analytics-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

.analytics-list-item:last-child {
  border-bottom: none;
}

.analytics-list-url {
  color: #334155;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 380px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8rem;
}

.analytics-list-count {
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.analytics-table th,
.analytics-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.analytics-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.analytics-table tr:hover td {
  background: #f8fafc;
}

.analytics-table .event-id-cell {
  font-family: Consolas, "Courier New", monospace;
  color: #2563eb;
  font-weight: 600;
  font-size: 0.83rem;
}

.analytics-table .percent-bar-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}

.analytics-table .percent-bar-bg {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.analytics-table .percent-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.analytics-table .percent-text {
  font-weight: 600;
  color: #334155;
  min-width: 48px;
  text-align: right;
  font-size: 0.84rem;
}

.detail-param-cell {
  max-width: 200px;
  word-break: break-all;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  color: #475569;
}

.detail-url-cell {
  max-width: 260px;
  word-break: break-all;
  font-size: 0.8rem;
  color: #2563eb;
}

.loading-hint {
  text-align: center;
  padding: 24px;
  color: #94a3b8;
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .analytics-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-two-col {
    grid-template-columns: 1fr;
  }
  .chart-card-wide {
    grid-column: span 1;
  }
}

#china-map-container canvas,
#china-map-container svg {
  width: 100% !important;
  height: 100% !important;
}

.loading {
  color: var(--muted);
  padding: 12px 0;
}

pre {
  background: #111827;
  color: #e5e7eb;
  padding: 16px;
  border-radius: 12px;
  margin-top: 10px;
  overflow-x: auto;
}

.route-edit-modal,
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.route-edit-modal.is-open,
.confirm-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.route-edit-modal-backdrop,
.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(95, 107, 150, 0.35);
  backdrop-filter: blur(6px);
}

.route-edit-modal-content,
.confirm-modal-content {
  position: relative;
  margin: 9vh auto 0;
  width: min(560px, 92vw);
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid #dfe8fb;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 52px rgba(87, 102, 151, 0.26);
}

.route-edit-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #dbe4f8;
  background: #eff4ff;
  color: #31406f;
  font-size: 1.2rem;
  padding: 0;
}

.route-edit-subtitle {
  color: #64748b;
  margin-top: 8px;
  margin-bottom: 12px;
}

.route-edit-form {
  margin-top: 10px;
}

.confirm-modal-content h4 {
  color: #25325b;
}

.confirm-modal-content p {
  margin-top: 8px;
  color: #64748b;
  line-height: 1.6;
}

.confirm-modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

button.ghost {
  background: #eef3ff;
  color: #2f3d69;
}

button.ghost:hover {
  background: #dfe8ff;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2200;
  display: grid;
  gap: 8px;
}

.toast-message {
  min-width: 220px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e4eaf9;
  box-shadow: 0 14px 28px rgba(83, 99, 145, 0.18);
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  font-size: 0.86rem;
}

.toast-message.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-message.success {
  border-color: #bde8cf;
  background: #f0fbf4;
}

.toast-message.error {
  border-color: #f6c8ce;
  background: #fff4f5;
}

@media (max-width: 900px) {
  .publish-main-grid,
  .publish-fields-grid,
  .publish-files-grid {
    grid-template-columns: 1fr;
  }

  .publish-card-main,
  .publish-card-side,
  .publish-card-files {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }

  .publish-step-tips {
    justify-content: flex-start;
  }

  .meta-search-input {
    width: 100%;
    min-width: 0;
  }

  #markdown-form .multi-group-head {
    flex-direction: column;
    align-items: stretch;
  }

  .publish-actions {
    justify-content: stretch;
  }

  #markdown-form button[type="submit"] {
    width: 100%;
    justify-content: center;
  }

  .admin-welcome {
    grid-template-columns: 1fr;
  }

  .image-table-head,
  .image-row {
    grid-template-columns: 1fr;
  }

  .image-preview {
    width: 100%;
    height: 120px;
  }

  .stats-grid,
  .stats-chart-grid {
    grid-template-columns: 1fr;
  }
}

.friend-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

.friend-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1000px;
}

.friend-table th,
.friend-table td {
  border-bottom: 1px solid #e5eaf3;
  padding: 10px 8px;
  text-align: left;
  font-size: 0.85rem;
}

.friend-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.friend-avatar-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.friend-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.friend-actions button {
  padding: 6px 9px;
  border-radius: 8px;
  background: #111827;
}

.friend-actions button.delete {
  background: #dc2626;
}

#friend-result {
  margin-top: 10px;
  color: #475569;
}

.friend-cards-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.admin-friend-card {
  position: relative;
  background: #fff;
  border: 1px solid #dde3ed;
  border-radius: 13px;
  padding: 10px;
  display: grid;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-friend-card:hover {
  border-color: #c8d1df;
  box-shadow: 0 8px 18px rgba(18, 30, 49, 0.08);
  transform: translateY(-1px);
}

.admin-friend-card.is-self {
  border-color: #cdd8ea;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.admin-friend-card.is-dragging {
  opacity: 0.62;
  transform: scale(0.985);
}

.admin-friend-card.is-drop-target-before::before,
.admin-friend-card.is-drop-target-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 999px;
  background: #6b84b3;
  box-shadow: 0 0 0 3px rgba(107, 132, 179, 0.15);
}

.admin-friend-card.is-drop-target-before::before {
  top: -2px;
}

.admin-friend-card.is-drop-target-after::after {
  bottom: -2px;
}

.admin-friend-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-friend-order {
  font-size: 0.78rem;
  color: #6b7280;
}

.admin-friend-action-icons {
  display: inline-flex;
  gap: 6px;
}

.admin-friend-edit-btn,
.admin-friend-delete-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #d7deea;
  background: #f4f6fa;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-friend-edit-btn:hover,
.admin-friend-delete-btn:hover {
  background: #e9eef6;
  border-color: #c5cfde;
}

.admin-friend-delete-btn:hover {
  background: #fbe8ea;
  border-color: #e7c2c7;
  color: #a23a45;
}

.admin-friend-edit-btn svg,
.admin-friend-delete-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.admin-friend-main {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.admin-friend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #dfe5ef;
}

.admin-friend-avatar-placeholder {
  background: #e9edf4;
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.admin-friend-texts h4 {
  font-size: 0.92rem;
  line-height: 1.25;
  color: #1f2937;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-friend-texts p {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.friend-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.friend-edit-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.friend-edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.friend-edit-modal-content {
  position: relative;
  margin: 7vh auto 0;
  width: min(560px, 92vw);
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.friend-edit-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  padding: 0;
}

.friend-edit-form {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    flex-direction: column;
  }

  .top-category-tabs,
  .meta-list {
    grid-template-columns: 1fr;
  }
}

/* 文章管理模块增强样式 */
.admin-module[data-module="posts"] {
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid #dfe7fb;
}

.posts-toolbar {
  background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
  border: 1px solid #e4ecf7;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
}

.posts-search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
}

.posts-search-box input {
  flex: 1;
  min-width: 200px;
  height: 42px;
  padding: 0 40px 0 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.92rem;
  background: #ffffff;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.posts-search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.12), 0 4px 12px rgba(67, 97, 238, 0.08);
  transform: translateY(-1px);
}

.posts-search-box input::placeholder {
  color: #94a3b8;
}

#posts-clear-search {
  position: absolute;
  right: 110px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  padding: 0;
  font-size: 1rem;
}

#posts-clear-search:hover {
  background: #fee2e2;
  color: #ef4444;
}

#posts-search-button {
  height: 42px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(67, 97, 238, 0.25);
  transition: all 0.25s ease;
  white-space: nowrap;
}

#posts-search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.35);
  background: linear-gradient(135deg, #3b5de7 0%, #5558e6 100%);
}

.icon-button.hidden {
  display: none !important;
}

/* 后台分类筛选样式 */
.admin-category-filters {
  background: linear-gradient(135deg, #fafbff 0%, #f5f8ff 100%);
  border: 1px solid #e4ebf7;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05);
}

.admin-category-filters .category-filters-empty {
  color: #94a3b8;
  font-size: 0.88rem;
  text-align: center;
  padding: 12px;
  display: block;
}

.admin-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-category-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #e2e8f0;
  background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
  color: #475569;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.admin-category-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

.admin-category-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(67, 97, 238, 0.15);
}

.admin-category-chip:hover::before {
  left: 100%;
}

.admin-category-chip.is-active {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.35);
  transform: translateY(-1px) scale(1.03);
}

.admin-category-chip.is-active:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 24px rgba(67, 97, 238, 0.45);
}

.admin-category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 22px;
}

.admin-category-chip.is-active .admin-category-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* 文章卡片网格 */
#post-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.post-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 20px 14px;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.post-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  border-color: #d0d5dd;
}

.post-item .post-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 10px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 0.8rem;
  color: #6b7280;
  flex: 1;
}

.post-info-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.post-info-tag i {
  font-size: 0.78rem;
  opacity: 0.65;
}

.post-cat-label {
  background: #f0f4ff;
  color: #4361a8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}

.post-tag-label {
  background: #f0fdf4;
  color: #16794a;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}

.post-col-label {
  background: #fef9ee;
  color: #a16207;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}

.post-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.post-card-footer .post-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.post-card-footer .post-action-btn:hover {
  background: #f3f4f6;
  color: #4b5563;
}

.post-card-footer .post-action-btn.btn-delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* 文章编辑弹窗 */
.post-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.post-edit-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.post-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 41, 59, 0.38);
  backdrop-filter: blur(3px);
}

.post-edit-dialog {
  position: relative;
  margin: 5vh auto 0;
  width: min(580px, 88vw);
  max-height: 88vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  transition: transform 0.22s ease;
  overflow: hidden;
}

.post-edit-overlay.is-open .post-edit-dialog {
  transform: translateY(0);
}

.post-edit-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.post-edit-dialog-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
}

.post-edit-dialog-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: #94a3b8;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.post-edit-dialog-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.post-edit-dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.post-edit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

.post-edit-grid .field-full {
  grid-column: 1 / -1;
}

.post-edit-form .field {
  max-width: none;
}

.post-edit-form .field span {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
}

.post-edit-form .field input[type="text"] {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.88rem;
  color: #1e293b;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.post-edit-form .field input[type="text"]:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
  background: #fff;
}

.post-edit-form .field textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.88rem;
  color: #1e293b;
  background: #fafafa;
  resize: vertical;
  line-height: 1.55;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.post-edit-form .field textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
  background: #fff;
}

/* 搜索选择器 */
.sp-picker {
  position: relative;
}

.sp-picker-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.86rem;
  color: #1e293b;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sp-picker-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
  background: #fff;
}

.sp-picker-input::placeholder {
  color: #9ca3af;
}

.sp-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  max-height: 180px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  z-index: 20;
  display: none;
}

.sp-picker.is-open .sp-dropdown {
  display: block;
}

.sp-dropdown-item {
  padding: 7px 12px;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-dropdown-item:hover {
  background: #f3f4f6;
}

.sp-dropdown-item.is-selected {
  color: #4f46e5;
  font-weight: 600;
  background: #eef2ff;
}

.sp-dropdown-item .sp-check {
  font-size: 0.7rem;
  opacity: 0;
  width: 14px;
  flex-shrink: 0;
}

.sp-dropdown-item.is-selected .sp-check {
  opacity: 1;
}

.sp-dropdown-empty {
  padding: 10px 12px;
  font-size: 0.83rem;
  color: #9ca3af;
  text-align: center;
}

.sp-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 20px 3px 8px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  position: relative;
}

.sp-chip-remove {
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1;
  color: #818cf8;
  transition: color 0.15s;
  font-weight: 400;
  position: absolute;
  top: 2px;
  right: 4px;
}

.sp-chip-remove:hover {
  color: #dc2626;
}

.sp-single-value {
  margin-top: 4px;
  display: inline-block;
}

.sp-single-value .sp-chip {
  background: #f0f4ff;
  color: #3730a3;
}

.post-edit-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.post-edit-switch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #475569;
}

.post-edit-switch-item > span {
  font-weight: 600;
  white-space: nowrap;
}

.post-edit-switch-item .radio-group {
  display: flex;
  gap: 4px;
}

.post-edit-switch-item .radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 400;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  transition: background 0.15s;
}

.post-edit-switch-item .radio-group label:hover {
  background: #eef2ff;
}

.post-edit-switch-item .radio-group input[type="radio"] {
  accent-color: #6366f1;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.post-edit-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.post-edit-cancel {
  padding: 8px 18px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.post-edit-cancel:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.post-edit-save {
  padding: 8px 22px;
  border: none;
  border-radius: 7px;
  background: #4f46e5;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.post-edit-save:hover {
  background: #4338ca;
}

.post-edit-save:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 500;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px dashed #e2e8f0;
  border-radius: 14px;
  margin: 20px 0;
  grid-column: 1 / -1;
}

.loading::before {
  content: '⏳';
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.95); }
}

/* 响应式优化 */
@media (max-width: 860px) {
  #post-list {
    grid-template-columns: 1fr;
  }

  .post-edit-grid {
    grid-template-columns: 1fr;
  }

  .post-edit-switches {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .posts-toolbar {
    padding: 12px 14px;
  }

  .posts-search-box {
    flex-direction: column;
  }

  .posts-search-box input {
    width: 100%;
  }

  #posts-clear-search {
    right: 80px;
  }

  #posts-search-button {
    width: 100%;
    justify-content: center;
  }

  .admin-category-chips {
    gap: 8px;
  }

  .admin-category-chip {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .post-edit-dialog {
    margin: 2vh auto 0;
    max-height: 94vh;
    width: min(540px, 92vw);
  }
}

/* ============================================
   书签管理模块样式
   ============================================ */

.admin-module[data-module="bookmarks"] .panel-header {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef1f6;
}

/* 书签导入表单 */
.admin-module[data-module="bookmarks"] #bookmark-import-form {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #e5eaf3;
  margin-bottom: 16px;
}

.admin-module[data-module="bookmarks"] #bookmark-import-form .file-field {
  margin-bottom: 14px;
  max-width: 100%;
}

.admin-module[data-module="bookmarks"] #bookmark-import-form .file-field span {
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.admin-module[data-module="bookmarks"] #bookmark-import-form .file-field input[type="file"] {
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #b9cdf6;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.admin-module[data-module="bookmarks"] #bookmark-import-form .file-field input[type="file"]:hover {
  border-color: var(--primary);
  background: #f5f7ff;
}

.admin-module[data-module="bookmarks"] #bookmark-import-form .file-field small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-module[data-module="bookmarks"] #bookmark-import-form button[type="submit"] {
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-module[data-module="bookmarks"] #bookmark-import-form button[type="submit"]:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(67, 97, 238, 0.28);
}

/* 导入结果提示 */
#bookmark-import-result {
  margin-top: 12px;
  min-height: 24px;
}

#bookmark-import-result span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

#bookmark-import-result span[style*="#388e3c"] {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

#bookmark-import-result span[style*="#d32f2f"] {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

#bookmark-import-result span[style*="#1976d2"] {
  background: #dbeafe;
  border: 1px solid #3b82f6;
  color: #1e40af;
}

/* 查看书签按钮 */
.admin-module[data-module="bookmarks"] a.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-module[data-module="bookmarks"] a.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(67, 97, 238, 0.28);
  text-decoration: none;
  color: #fff;
}

/* 响应式 */
@media (max-width: 768px) {
  .admin-module[data-module="bookmarks"] #bookmark-import-form button[type="submit"],
  .admin-module[data-module="bookmarks"] a.primary-button {
    width: 100%;
    justify-content: center;
  }
}

/* Markdown 编辑弹窗 */
.markdown-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.markdown-edit-modal[aria-hidden="true"] {
  display: none;
}

.markdown-edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.markdown-edit-modal-content {
  position: relative;
  width: min(1400px, 95vw);
  height: min(90vh, 900px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.markdown-edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.markdown-edit-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 600;
}

.markdown-edit-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.markdown-edit-modal-close:hover {
  background: var(--soft-blue);
  color: var(--text);
}

.markdown-edit-modal-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.markdown-edit-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  gap: 0;
}

.markdown-edit-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.markdown-edit-panel:last-child {
  border-right: none;
}

.markdown-edit-panel-header {
  padding: 12px 16px;
  background: var(--soft-blue);
  border-bottom: 1px solid var(--border);
}

.markdown-edit-panel-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.markdown-edit-panel-header h4 i {
  color: var(--primary);
}

.markdown-edit-textarea {
  flex: 1;
  width: 100%;
  padding: 16px;
  border: none;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  outline: none;
  background: #fafafa;
  color: var(--text);
  overflow-y: auto;
}

.markdown-edit-textarea:focus {
  background: #fff;
}

.markdown-edit-preview {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  background: #fff;
}

/* 预览区域内容样式调整 */
.markdown-edit-preview .post-content {
  font-size: 0.9rem;
  line-height: 1.7;
  padding-top: 8px;
}

.markdown-edit-preview .post-content h1 {
  font-size: 1.6rem;
  margin-top: 0;
}

.markdown-edit-preview .post-content h2 {
  font-size: 1.35rem;
}

.markdown-edit-preview .post-content h3 {
  font-size: 1.15rem;
}

.markdown-edit-preview .post-content p {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.markdown-edit-preview .post-content ul,
.markdown-edit-preview .post-content ol {
  font-size: 0.9rem;
}

.markdown-edit-preview .post-content code {
  font-size: 0.85rem;
}

.markdown-edit-preview .post-content pre {
  font-size: 0.85rem;
}

.markdown-edit-preview .post-content blockquote {
  font-size: 0.9rem;
}

.markdown-edit-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.markdown-edit-cancel {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.markdown-edit-cancel:hover {
  background: var(--soft-blue);
  border-color: var(--primary);
}

/* 响应式：小屏幕切换为上下布局 */
@media (max-width: 1024px) {
  .markdown-edit-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  
  .markdown-edit-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .markdown-edit-panel:last-child {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  .markdown-edit-modal-content {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .markdown-edit-modal {
    padding: 0;
  }
}
