/* 管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-card h1 {
  text-align: center;
  font-size: 1.5rem;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.login-card .subtitle {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.login-card .form-group {
  margin-bottom: 18px;
}

.login-card label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.login-card input:focus {
  outline: none;
  border-color: #667eea;
}

.login-card .btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-card .btn-login:hover { opacity: 0.9; }
.login-card .btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.login-error {
  color: #e74c3c;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

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

.sidebar {
  width: 220px;
  background: #1a1a2e;
  color: #fff;
  padding: 0;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.sidebar-header p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

.sidebar-nav {
  padding: 12px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(102,126,234,0.2);
  color: #fff;
  border-left: 3px solid #667eea;
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.badge {
  background: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
}

.sidebar-footer a {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-footer a:hover { color: #fff; }

.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 28px 32px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.4rem;
  color: #1a1a2e;
}

.page-header .actions {
  display: flex;
  gap: 10px;
}

/* 按钮 */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: #667eea;
  color: #fff;
}
.btn-primary:hover { background: #5568d3; }

.btn-success {
  background: #27ae60;
  color: #fff;
}
.btn-success:hover { background: #229954; }

.btn-danger {
  background: #e74c3c;
  color: #fff;
}
.btn-danger:hover { background: #c0392b; }

.btn-outline {
  background: transparent;
  border: 1.5px solid #ddd;
  color: #666;
}
.btn-outline:hover { border-color: #667eea; color: #667eea; }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

/* 表格 */
.table-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background: #f8f9fa;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #eee;
}

table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  color: #333;
}

table tr:hover { background: #fafbfc; }

table tr.unread td { font-weight: 600; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-unread { background: #fee; color: #e74c3c; }
.tag-read { background: #f0f0f0; color: #888; }
.tag-industry { background: #e8f0fe; color: #1a73e8; }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
}

.empty-state p { font-size: 0.95rem; margin-top: 12px; }

/* 模态框 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

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

.modal-header h3 { font-size: 1.1rem; color: #1a1a2e; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #aaa;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-close:hover { background: #f0f0f0; color: #333; }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 表单 */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group label .required { color: #e74c3c; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* 图片上传 */
.upload-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.upload-preview {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 2px dashed #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8f9fa;
  flex-shrink: 0;
}

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

.upload-preview .placeholder {
  font-size: 0.75rem;
  color: #aaa;
}

.upload-btn {
  padding: 8px 16px;
  background: #f0f0f0;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #666;
}

.upload-btn:hover { border-color: #667eea; color: #667eea; }

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
}

.stat-card .stat-value.unread { color: #e74c3c; }

/* 留言详情 */
.message-detail {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.message-detail .detail-row {
  display: flex;
  padding: 6px 0;
}

.message-detail .detail-label {
  width: 100px;
  font-weight: 600;
  color: #555;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.message-detail .detail-value {
  color: #333;
  font-size: 0.9rem;
  flex: 1;
}

/* 提示消息 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
}

.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header h2, .sidebar-header p { display: none; }
  .sidebar-nav a span { display: none; }
  .main-content { margin-left: 60px; padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .modal { width: 95%; }
}
