/* === 后台管理样式 === */
:root {
  --primary: #0a2d5e;
  --primary-light: #1a4d8c;
  --accent: #c89b3c;
  --bg: #f0f2f5;
  --card-bg: #fff;
  --text: #333;
  --text-light: #888;
  --border: #e0e4ea;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC","Microsoft YaHei",Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* === 登录页 === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
}
.login-box {
  background: #fff;
  border-radius: 4px;
  padding: 48px 40px;
  width: 400px;
  max-width: 90vw;
  box-shadow: none;
}
.login-box .logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-box .logo .logo-icon {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  object-fit: cover;
  overflow: hidden;
}
.login-box .logo h1 { font-size: 1.3rem; color: var(--primary); }
.login-box .logo p { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: 0.3s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26,77,140,0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #b88a2e; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d9363e; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* === 登录页账号信息 === */
.login-credentials {
  margin-top: 24px;
  padding: 16px 20px;
  background: #f8faff;
  border: 1px solid #d6e4ff;
  border-radius: 4px;
  text-align: center;
}
.login-credentials .cred-title {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.login-credentials .cred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #e8edf5;
}
.login-credentials .cred-label {
  font-size: 0.82rem;
  color: var(--text-light);
}
.login-credentials .cred-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
}
.login-credentials .cred-tip {
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--warning);
}

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: #fff;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header .logo-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  object-fit: cover;
  overflow: hidden;
}
.sidebar-header h2 { font-size: 1rem; color: #fff; }
.sidebar-header p { font-size: 0.7rem; color: rgba(255,255,255,0.5); }

.sidebar-menu { padding: 12px 0; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: 0.3s;
  border-left: 3px solid transparent;
}
.sidebar-menu a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-menu a.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: var(--accent); }
.sidebar-menu a .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-group-title {
  padding: 16px 24px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}
.sidebar-group-title:first-child {
  border-top: none;
  margin-top: 0;
}

/* 右上角【查看网站前台】按钮 —— 与右侧管理员信息区同色系（白底蓝字细边框，融入顶栏） */
.topbar-front-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
  padding: 7px 14px;
  background: #fff;
  color: var(--primary) !important;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.topbar-front-btn .icon { font-size: 1rem; }
.topbar-front-btn:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--primary);
  color: var(--primary) !important;
}
@media (max-width: 600px) {
  .topbar-front-btn { padding: 6px 10px; font-size: 0.78rem; margin-right: 10px; }
  .topbar-front-btn span:last-child { display: none; }
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 0;
}
.topbar {
  height: 60px;
  background: #fff;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 1.1rem; color: var(--text); }
.topbar .user-info { display: flex; align-items: center; gap: 12px; }
.topbar .user-info .avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}
.topbar .user-info .name { font-size: 0.85rem; }

.content { padding: 24px; }

/* === 卡片 === */
.card {
  background: #fff;
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: none;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 1rem; color: var(--text); }

/* === 统计卡片 === */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card {
  background: #fff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card .stat-icon {
  width: 56px; height: 56px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
}
.stat-card .stat-info h4 { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.stat-card .stat-info p { font-size: 0.82rem; color: var(--text-light); }

/* === 表格 === */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.table th { background: var(--bg); font-weight: 600; color: var(--text); white-space: nowrap; }
.table tr:hover { background: rgba(0,0,0,0.02); }
.table .actions { display: flex; gap: 8px; }

/* === 标签 === */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-success { background: #f6ffed; color: var(--success); border: 1px solid #d9f7be; }
.tag-warning { background: #fffbe6; color: var(--warning); border: 1px solid #fff1b8; }
.tag-danger { background: #fff2f0; color: var(--danger); border: 1px solid #ffccc7; }
.tag-info { background: #e6f7ff; color: #1890ff; border: 1px solid #d6e4ff; }

/* === 搜索栏 === */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-bar input, .search-bar select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
}
.search-bar input { flex: 1; min-width: 200px; }

/* === 编辑器 === */
.editor-container { max-width: 900px; }
.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  flex-wrap: wrap;
}
.editor-toolbar button {
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
}
.editor-toolbar button:hover { background: var(--primary); color: #fff; }
.editor-textarea {
  width: 100%;
  min-height: 400px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 0 0 4px 4px;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.8;
  resize: vertical;
}
.editor-textarea:focus { outline: none; border-color: var(--primary-light); }

/* === 模态框 === */
.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: 4px;
  padding: 32px;
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin-bottom: 20px; font-size: 1.1rem; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* === 提示消息 === */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 12px 24px;
  border-radius: 4px;
  color: #fff;
  font-size: 0.9rem;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === 响应式 === */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
}

/* === 内容审核页面 === */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stats-row .stat-card { text-align: center; display: block; padding: 20px; }
.stats-row .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stats-row .stat-label { font-size: 0.82rem; color: var(--text-light); margin-top: 4px; }

.action-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.action-left { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 4px; }

.status-pending { background: #fffbe6; color: #faad14; }
.status-scheduled { background: #e6f7ff; color: #1890ff; }
.status-published { background: #f6ffed; color: #52c41a; }
.status-rejected { background: #fff2f0; color: #ff4d4f; }

.schedule-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .schedule-grid { grid-template-columns: 1fr; }
}

.btn-danger { background: var(--danger); color: #fff; border: none; cursor: pointer; }
.btn-danger:hover { opacity: 0.85; }

/* ============================================================
   智海国际 · 去 AI 化图标对齐（2026-09-17）
   线性图标用 mask + currentColor 实现，需容器 flex 居中；
   图标尺寸跟随容器 font-size，无需逐一特调。
   ============================================================ */
.sidebar-menu a .icon { display: inline-flex; align-items: center; justify-content: center; }
.stat-card .stat-icon .ic,
.quick-action-icon .ic { --ic-size: 1em; }
