/* ========================================
   天枢GEO CMS - 后台管理样式
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5; color: #333; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ========== 登录页 ========== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1E5BE8 0%, #0A2A6B 100%);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
                    radial-gradient(circle at 80% 70%, rgba(0,194,255,0.15) 0%, transparent 50%);
}
.login-box {
  background: #fff; border-radius: 20px; padding: 48px; width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); position: relative; z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { width: 64px; height: 64px; margin: 0 auto 12px; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: #1E5BE8; }
.login-logo p { font-size: 13px; color: #8A99B5; margin-top: 4px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 8px; }
.login-form input {
  width: 100%; padding: 12px 16px; border: 1px solid #E3EAF5; border-radius: 10px;
  font-size: 14px; transition: all 0.3s;
}
.login-form input:focus { outline: none; border-color: #1E5BE8; box-shadow: 0 0 0 3px rgba(30,91,232,0.1); }
.login-btn {
  width: 100%; padding: 14px; background: linear-gradient(135deg, #1E5BE8, #00C2FF);
  color: #fff; border-radius: 10px; font-size: 16px; font-weight: 700;
  transition: all 0.3s; margin-top: 8px;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30,91,232,0.4); }
.login-tip { text-align: center; font-size: 12px; color: #8A99B5; margin-top: 20px; }
.login-error { color: #EF4444; font-size: 13px; margin-top: 8px; display: none; }
.login-error.show { display: block; }

/* ========== 后台布局 ========== */
.admin-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.admin-sidebar {
  width: 240px; background: #0A1628; color: #fff; position: fixed; top: 0; left: 0;
  bottom: 0; z-index: 100; display: flex; flex-direction: column;
}
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo img { width: 36px; height: 36px; }
.sidebar-logo span { font-size: 16px; font-weight: 700; }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 10px; color: rgba(255,255,255,0.7); font-size: 14px;
  cursor: pointer; transition: all 0.3s; margin-bottom: 4px;
}
.sidebar-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav-item.active { background: linear-gradient(135deg, #1E5BE8, #00C2FF); color: #fff; }
.sidebar-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-nav-group { font-size: 11px; color: rgba(255,255,255,0.4); padding: 16px 16px 8px; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer-btn {
  width: 100%; padding: 10px; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7);
  border-radius: 8px; font-size: 13px; transition: all 0.3s;
}
.sidebar-footer-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* 主内容区 */
.admin-main { flex: 1; margin-left: 240px; min-height: 100vh; }
.admin-header {
  background: #fff; padding: 16px 32px; border-bottom: 1px solid #E3EAF5;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-header h2 { font-size: 20px; font-weight: 700; color: #0F1B2D; }
.admin-header-right { display: flex; align-items: center; gap: 16px; }
.admin-header-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  transition: all 0.3s; display: flex; align-items: center; gap: 6px;
}
.admin-header-btn.primary { background: #1E5BE8; color: #fff; }
.admin-header-btn.primary:hover { background: #0A2A6B; }
.admin-header-btn.outline { border: 1px solid #E3EAF5; color: #4A5A75; }
.admin-header-btn.outline:hover { border-color: #1E5BE8; color: #1E5BE8; }
.admin-content { padding: 32px; }

/* ========== 仪表盘 ========== */
.dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid #EEF3FB;
}
.stat-card-icon {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card-icon svg { width: 24px; height: 24px; }
.stat-card-val { font-size: 32px; font-weight: 800; color: #0F1B2D; line-height: 1; }
.stat-card-label { font-size: 13px; color: #8A99B5; margin-top: 8px; }
.stat-card-trend { font-size: 12px; font-weight: 600; margin-top: 8px; }
.stat-card-trend.up { color: #10B981; }
.stat-card-trend.down { color: #EF4444; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.dashboard-panel {
  background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid #EEF3FB;
}
.dashboard-panel h3 { font-size: 16px; font-weight: 700; color: #0F1B2D; margin-bottom: 20px; }
.recent-list { list-style: none; }
.recent-list li {
  padding: 12px 0; border-bottom: 1px solid #EEF3FB; display: flex;
  align-items: center; justify-content: space-between;
}
.recent-list li:last-child { border-bottom: none; }
.recent-list .rl-title { font-size: 14px; color: #4A5A75; }
.recent-list .rl-time { font-size: 12px; color: #8A99B5; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-action-btn {
  padding: 16px; background: #F5F8FF; border-radius: 12px; text-align: center;
  font-size: 13px; font-weight: 600; color: #1E5BE8; transition: all 0.3s;
}
.quick-action-btn:hover { background: #1E5BE8; color: #fff; transform: translateY(-2px); }

/* ========== 内容编辑 ========== */
.page-editor { background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.editor-section { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid #EEF3FB; }
.editor-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.editor-section-title {
  font-size: 16px; font-weight: 700; color: #0F1B2D; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.editor-section-title::before {
  content: ''; width: 4px; height: 20px; background: linear-gradient(180deg, #1E5BE8, #00C2FF);
  border-radius: 2px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.form-grid.full { grid-template-columns: 1fr; }
.form-item { margin-bottom: 0; }
.form-item label {
  display: block; font-size: 13px; font-weight: 600; color: #4A5A75; margin-bottom: 8px;
}
.form-item label .required { color: #EF4444; }
.form-item input[type="text"],
.form-item input[type="number"],
.form-item input[type="email"],
.form-item input[type="tel"],
.form-item textarea,
.form-item select {
  width: 100%; padding: 10px 14px; border: 1px solid #E3EAF5; border-radius: 8px;
  font-size: 14px; color: #333; transition: all 0.3s; background: #fff;
}
.form-item input:focus, .form-item textarea:focus, .form-item select:focus {
  outline: none; border-color: #1E5BE8; box-shadow: 0 0 0 3px rgba(30,91,232,0.1);
}
.form-item textarea { min-height: 100px; resize: vertical; }
.form-item .form-hint { font-size: 12px; color: #8A99B5; margin-top: 6px; }

/* 图片上传 */
.image-upload {
  border: 2px dashed #E3EAF5; border-radius: 12px; padding: 24px; text-align: center;
  transition: all 0.3s; cursor: pointer; background: #FAFCFF;
}
.image-upload:hover { border-color: #1E5BE8; background: #F5F8FF; }
.image-upload.dragover { border-color: #1E5BE8; background: #EFF4FF; }
.image-upload-icon { width: 48px; height: 48px; margin: 0 auto 12px; color: #8A99B5; }
.image-upload-text { font-size: 14px; color: #4A5A75; font-weight: 600; }
.image-upload-hint { font-size: 12px; color: #8A99B5; margin-top: 4px; }
.image-preview {
  margin-top: 16px; position: relative; border-radius: 10px; overflow: hidden;
  border: 1px solid #E3EAF5;
}
.image-preview img { width: 100%; max-height: 200px; object-fit: cover; }
.image-preview-remove {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  background: rgba(239,68,68,0.9); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  cursor: pointer; transition: all 0.3s;
}
.image-preview-remove:hover { background: #EF4444; transform: scale(1.1); }

/* 列表编辑器 */
.list-editor { border: 1px solid #EEF3FB; border-radius: 12px; overflow: hidden; }
.list-editor-item {
  padding: 16px; background: #fff; border-bottom: 1px solid #EEF3FB;
  display: flex; align-items: flex-start; gap: 12px;
}
.list-editor-item:last-child { border-bottom: none; }
.list-editor-item .lei-content { flex: 1; }
.list-editor-item .lei-actions { display: flex; gap: 8px; flex-shrink: 0; }
.lei-btn {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 14px; transition: all 0.3s;
}
.lei-btn.edit { background: #F5F8FF; color: #1E5BE8; }
.lei-btn.edit:hover { background: #1E5BE8; color: #fff; }
.lei-btn.delete { background: #FEF2F2; color: #EF4444; }
.lei-btn.delete:hover { background: #EF4444; color: #fff; }
.lei-btn.move { background: #F5F8FF; color: #8A99B5; cursor: move; }
.list-editor-add {
  width: 100%; padding: 14px; background: #FAFCFF; color: #1E5BE8;
  font-size: 14px; font-weight: 600; border-top: 1px solid #EEF3FB;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.3s;
}
.list-editor-add:hover { background: #1E5BE8; color: #fff; }

/* ========== 图片库 ========== */
.image-library-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.image-library-item {
  background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #EEF3FB;
  transition: all 0.3s; position: relative;
}
.image-library-item:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.image-library-item .ili-img {
  width: 100%; height: 140px; object-fit: cover; background: #F5F8FF;
}
.image-library-item .ili-info { padding: 12px; }
.image-library-item .ili-name { font-size: 13px; font-weight: 600; color: #0F1B2D; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-library-item .ili-size { font-size: 11px; color: #8A99B5; margin-top: 2px; }
.image-library-item .ili-actions {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 6px;
  opacity: 0; transition: opacity 0.3s;
}
.image-library-item:hover .ili-actions { opacity: 1; }
.ili-action-btn {
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 14px; backdrop-filter: blur(10px);
}
.ili-action-btn.copy { background: rgba(30,91,232,0.9); color: #fff; }
.ili-action-btn.delete { background: rgba(239,68,68,0.9); color: #fff; }
.image-library-empty {
  grid-column: 1 / -1; text-align: center; padding: 60px; color: #8A99B5;
}
.image-library-empty svg { width: 64px; height: 64px; margin: 0 auto 16px; opacity: 0.5; }

/* ========== 模态框 ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 1000; display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 90%; max-width: 600px;
  max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid #EEF3FB;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 700; color: #0F1B2D; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; color: #8A99B5; transition: all 0.3s;
}
.modal-close:hover { background: #F5F8FF; color: #EF4444; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid #EEF3FB;
  display: flex; justify-content: flex-end; gap: 12px;
}

/* ========== 按钮 ========== */
.btn {
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  transition: all 0.3s; display: inline-flex; align-items: center; gap: 6px;
}
.btn.primary { background: #1E5BE8; color: #fff; }
.btn.primary:hover { background: #0A2A6B; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,91,232,0.3); }
.btn.success { background: #10B981; color: #fff; }
.btn.success:hover { background: #059669; }
.btn.danger { background: #EF4444; color: #fff; }
.btn.danger:hover { background: #DC2626; }
.btn.outline { border: 1px solid #E3EAF5; color: #4A5A75; background: #fff; }
.btn.outline:hover { border-color: #1E5BE8; color: #1E5BE8; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.lg { padding: 14px 28px; font-size: 16px; }

/* ========== 提示消息 ========== */
.toast {
  position: fixed; top: 24px; right: 24px; padding: 14px 24px; border-radius: 10px;
  font-size: 14px; font-weight: 600; z-index: 2000; transform: translateX(120%);
  transition: transform 0.3s ease; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateX(0); }
.toast.success { background: #10B981; color: #fff; }
.toast.error { background: #EF4444; color: #fff; }
.toast.info { background: #1E5BE8; color: #fff; }
.toast.warning { background: #F5A623; color: #fff; }

/* ========== 页面选择器 ========== */
.page-selector {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-selector-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: #fff; border: 1px solid #E3EAF5; color: #4A5A75; transition: all 0.3s;
}
.page-selector-btn:hover { border-color: #1E5BE8; color: #1E5BE8; }
.page-selector-btn.active { background: #1E5BE8; color: #fff; border-color: #1E5BE8; }

/* ========== 数据表格 ========== */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.data-table th {
  background: #F5F8FF; padding: 14px 16px; text-align: left; font-size: 13px;
  font-weight: 700; color: #4A5A75; border-bottom: 1px solid #E3EAF5;
}
.data-table td { padding: 14px 16px; font-size: 14px; color: #333; border-bottom: 1px solid #EEF3FB; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #FAFCFF; }

/* ========== 需求管理 ========== */
.consult-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px; padding: 16px; background: #fff; border-radius: 12px;
  border: 1px solid #EEF3FB;
}
.consult-toolbar input[type="text"], .consult-toolbar select {
  padding: 9px 12px; border: 1px solid #E3EAF5; border-radius: 8px;
  font-size: 14px; color: #333; outline: none;
}
.consult-toolbar input[type="text"] { width: 240px; }
.consult-toolbar input:focus, .consult-toolbar select:focus { border-color: #1E5BE8; }
.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.status-badge.pending { background: rgba(245, 166, 35, 0.12); color: #F5A623; }
.status-badge.done { background: rgba(16, 185, 129, 0.12); color: #10B981; }
/* 列表状态文本快捷切换：手型光标 + 悬停提示效果 */
.status-toggle { cursor: pointer; display: inline-block; }
.status-toggle:hover .status-badge { filter: brightness(0.92); }
.consult-pagination {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  margin-top: 16px; font-size: 13px; color: #4A5A75;
}
.consult-pagination button {
  padding: 7px 14px; border: 1px solid #E3EAF5; background: #fff;
  border-radius: 8px; font-size: 13px; color: #4A5A75; cursor: pointer;
}
.consult-pagination button:hover:not(:disabled) { border-color: #1E5BE8; color: #1E5BE8; }
.consult-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.consult-empty { text-align: center; padding: 60px 20px; color: #8A99B5; font-size: 14px; }
.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li {
  display: flex; padding: 10px 0; font-size: 14px;
  border-bottom: 1px dashed #EEF3FB; gap: 16px;
}
.detail-list li:last-child { border-bottom: none; }
.detail-list li .dl-label { width: 80px; flex-shrink: 0; color: #8A99B5; }
.detail-list li .dl-value { flex: 1; color: #0F1B2D; word-break: break-all; white-space: pre-wrap; }

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .image-library-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
  .admin-sidebar { width: 64px; }
  .admin-sidebar .sidebar-logo span,
  .admin-sidebar .sidebar-nav-item span,
  .admin-sidebar .sidebar-nav-group,
  .admin-sidebar .sidebar-footer-btn span { display: none; }
  .admin-sidebar .sidebar-nav-item { justify-content: center; padding: 12px; }
  .admin-main { margin-left: 64px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .image-library-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-content { padding: 16px; }
  .admin-header { padding: 12px 16px; }
  .login-box { width: 90%; padding: 32px 24px; }
}
