/* ============================================================
   火华信息 · 后台管理样式
   ============================================================ */
:root {
  --blue-600: #1a56ff;
  --navy: #0a1633;
  --ink: #16223b;
  --gray-600: #5b6b8c;
  --gray-100: #f3f6fc;
  --green: #19c37d;
  --red: #e5484d;
  --grad-primary: linear-gradient(135deg, #1a56ff 0%, #00d4ff 100%);
  --radius: 14px;
  --font: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: #eef2fa; color: var(--ink); font-size: 14px; }
a { text-decoration: none; color: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ---------- 登录页 ---------- */
.login-body { background: var(--grad-primary); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden; }
.login-body::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px); background-size: 44px 44px; }
.login-box { background: #fff; border-radius: 20px; width: 100%; max-width: 400px; padding: 40px 36px; box-shadow: 0 30px 80px rgba(10,22,51,0.35); position: relative; z-index: 1; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.login-logo img { width: 44px; height: 44px; }
.login-box h1 { font-size: 22px; font-weight: 800; text-align: center; margin: 6px 0 4px; }
.login-box .sub { text-align: center; color: var(--gray-600); font-size: 13px; margin-bottom: 26px; }
.login-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-box input { width: 100%; padding: 12px 14px; border: 1.6px solid #dde6f7; border-radius: 10px; margin-bottom: 18px; font-size: 15px; }
.login-box input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(26,86,255,0.1); }
.login-box .btn { width: 100%; padding: 13px; background: var(--grad-primary); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; }
.login-box .btn:hover { opacity: 0.92; }
.login-tip { text-align: center; font-size: 12.5px; color: var(--gray-600); margin-top: 14px; }
.login-err { background: #fdecec; color: var(--red); font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; display: none; }

/* ---------- 布局 ---------- */
.admin-wrap { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--navy); color: #fff; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.side-logo img { width: 38px; height: 38px; }
.side-logo b { font-size: 17px; }
.side-logo span { font-size: 10.5px; color: rgba(255,255,255,0.5); letter-spacing: 1px; display: block; }
.side-menu { flex: 1; padding: 14px 12px; }
.side-menu a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; color: rgba(255,255,255,0.72); font-weight: 500; margin-bottom: 4px; transition: 0.25s; }
.side-menu a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.side-menu a.active { background: var(--grad-primary); color: #fff; box-shadow: 0 8px 20px rgba(26,86,255,0.35); }
.side-menu svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-menu .cnt { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; border-radius: 20px; padding: 1px 8px; }
.side-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: rgba(255,255,255,0.5); }

.main { flex: 1; min-width: 0; }
.topbar { background: #fff; padding: 0 26px; height: 64px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 12px rgba(10,22,51,0.06); position: sticky; top: 0; z-index: 50; }
.topbar h2 { font-size: 18px; font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right .btn { padding: 9px 18px; border-radius: 9px; border: none; font-size: 13px; font-weight: 600; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 9px; border: none; font-size: 13.5px; font-weight: 600; transition: 0.25s; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: 0 6px 16px rgba(26,86,255,0.3); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.4px solid #dde6f7; }
.btn-ghost:hover { border-color: var(--blue-600); color: var(--blue-600); }
.btn-danger { background: #fdecec; color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-green { background: #e6f9f1; color: var(--green); }
.btn-green:hover { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-600); }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

.content { padding: 26px; }

/* ---------- 统计卡 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 22px; display: flex; align-items: center; gap: 16px; box-shadow: 0 4px 14px rgba(10,22,51,0.05); transition: 0.25s; }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(10,22,51,0.1); }
.stat-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; }
.stat-card b { font-size: 26px; font-weight: 800; display: block; line-height: 1.2; }
.stat-card span { font-size: 12.5px; color: var(--gray-600); }

/* ---------- 面板 ---------- */
.panel { background: #fff; border-radius: var(--radius); box-shadow: 0 4px 14px rgba(10,22,51,0.05); margin-bottom: 22px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #eef2fb; flex-wrap: wrap; }
.panel-head h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.panel-head h3::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--grad-primary); }
.panel-body { padding: 22px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1.4px solid #dde6f7; border-radius: 8px; font-size: 13px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--blue-600); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--gray-100); text-align: left; padding: 12px 16px; font-size: 12.5px; color: var(--gray-600); font-weight: 700; white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #eef2fb; font-size: 13.5px; vertical-align: middle; }
.data-table tr:hover td { background: #f8fbff; }
.data-table .thumb { width: 64px; height: 42px; border-radius: 6px; object-fit: cover; background: #eef2fb; }
.row-actions { display: flex; gap: 6px; }
.tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.tag-blue { background: #eef4ff; color: var(--blue-600); }
.tag-green { background: #e6f9f1; color: var(--green); }
.tag-red { background: #fdecec; color: var(--red); }
.tag-gray { background: #eef2f7; color: var(--gray-600); }
.empty { text-align: center; color: var(--gray-600); padding: 40px; font-size: 13.5px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-size: 13px; font-weight: 600; }
.form-item input, .form-item select, .form-item textarea { border: 1.6px solid #dde6f7; border-radius: 9px; padding: 10px 13px; font-size: 13.5px; transition: 0.2s; width: 100%; }
.form-item textarea { resize: vertical; min-height: 90px; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(26,86,255,0.1); }
.form-item input.list { white-space: pre-line; }
.form-hint { font-size: 12px; color: var(--gray-600); }

/* ---------- 消息列表 ---------- */
.msg-card { border: 1px solid #eef2fb; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; background: #fbfdff; }
.msg-card.new { border-left: 4px solid var(--red); }
.msg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.msg-head b { font-size: 14.5px; }
.msg-head .meta { font-size: 12px; color: var(--gray-600); }
.msg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.msg-fields div { background: #fff; border: 1px solid #eef2fb; border-radius: 8px; padding: 8px 12px; }
.msg-fields span { color: var(--gray-600); margin-right: 6px; }
.msg-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(10,22,51,0.55); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.mask.open { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 26px; box-shadow: 0 30px 80px rgba(10,22,51,0.35); }
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Toast ---------- */
.toast { position: fixed; top: 24px; left: 50%; transform: translate(-50%, -90px); background: var(--navy); color: #fff; padding: 12px 24px; border-radius: 40px; font-size: 14px; box-shadow: 0 12px 30px rgba(10,22,51,0.3); transition: 0.4s; z-index: 300; }
.toast.show { transform: translate(-50%, 0); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* ---------- 确认框 ---------- */
.confirm-box { max-width: 380px; text-align: center; }
.confirm-box .cf-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: #fdecec; color: var(--red); display: flex; align-items: center; justify-content: center; }
.confirm-box .cf-icon svg { width: 28px; height: 28px; }
.confirm-box p { color: var(--gray-600); font-size: 13.5px; margin-bottom: 18px; }
.confirm-box .modal-foot { justify-content: center; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -240px; transition: 0.3s; z-index: 100; }
  .sidebar.open { left: 0; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .msg-fields { grid-template-columns: 1fr; }
  .menu-toggle { display: flex !important; }
}
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 9px; background: #fff; border: 1.4px solid #dde6f7; align-items: center; justify-content: center; }
.menu-toggle svg { width: 18px; height: 18px; }
