/* ==========================================================================
   昊天网络科技 · 后台管理样式
   ========================================================================== */
:root {
  --a-primary: #135BFF;
  --a-primary-2: #00C6FF;
  --a-ink: #0B1727;
  --a-text: #3F4E63;
  --a-muted: #7A8AA0;
  --a-line: #E5EBF3;
  --a-bg: #F4F7FC;
  --a-side: #0B1B33;
  --a-grad: linear-gradient(120deg, #135BFF 0%, #00C6FF 100%);
  --a-radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--a-text); background: var(--a-bg); line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }
h1, h2, h3, h4 { color: var(--a-ink); font-weight: 700; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: #061024; position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
}
.login-wrap::after {
  content: ""; position: absolute; width: 700px; height: 700px; top: -300px; right: -200px;
  background: radial-gradient(circle, rgba(19,91,255,.42) 0%, transparent 62%);
}
.login-card {
  position: relative; z-index: 2; width: 100%; max-width: 400px;
  background: #fff; border-radius: 18px; padding: 40px 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.login-card__logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-card__mark {
  width: 44px; height: 44px; border-radius: 12px; background: var(--a-grad); color: #fff;
  display: grid; place-items: center; font-size: 20px; font-weight: 800;
}
.login-card h1 { font-size: 20px; }
.login-card .sub { font-size: 12px; color: var(--a-muted); letter-spacing: .1em; }
.login-tip { font-size: 12px; color: var(--a-muted); margin-top: 18px; text-align: center; }

/* ---------- 布局 ---------- */
.admin { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--a-side); color: #93A6BF; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar__mark { width: 36px; height: 36px; border-radius: 10px; background: var(--a-grad); color: #fff; display: grid; place-items: center; font-weight: 800; }
.sidebar__brand b { color: #fff; font-size: 15px; display: block; line-height: 1.3; }
.sidebar__brand span { font-size: 10px; letter-spacing: .14em; color: #64789A; }
.sidebar__menu { padding: 16px 12px; flex: 1; overflow-y: auto; }
.sidebar__label { font-size: 11px; letter-spacing: .16em; color: #56698A; padding: 12px 10px 8px; text-transform: uppercase; }
.sidebar__menu a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px;
  font-size: 14px; color: #9FB3CC; margin-bottom: 4px; transition: all .2s ease;
}
.sidebar__menu a svg { width: 18px; height: 18px; }
.sidebar__menu a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar__menu a.is-active { background: var(--a-grad); color: #fff; font-weight: 600; box-shadow: 0 8px 20px rgba(19,91,255,.3); }
.sidebar__foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #56698A; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--a-line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 17px; }
.topbar__right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--a-muted); }
.content { padding: 26px; flex: 1; }

/* ---------- 卡片 / 表格 ---------- */
.card { background: #fff; border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 24px; }
.card + .card { margin-top: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.card__head h3 { font-size: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 20px; }
.stat-box { background: #fff; border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 22px; }
.stat-box__label { font-size: 13px; color: var(--a-muted); display: flex; align-items: center; gap: 8px; }
.stat-box__label svg { width: 16px; height: 16px; color: var(--a-primary); }
.stat-box__num { font-size: 30px; font-weight: 800; color: var(--a-ink); margin-top: 8px; letter-spacing: -.02em; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
th { background: #F8FAFD; color: var(--a-ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
tbody tr:hover { background: #FAFCFF; }
td .title-cell { display: block; color: var(--a-ink); font-weight: 600; max-width: 420px; }
td .sub { font-size: 12px; color: var(--a-muted); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #EAF0FF; color: var(--a-primary); }
.badge--gray { background: #F1F4F9; color: #64748B; }
.badge--warn { background: #FFF4E5; color: #C77700; }
.badge--ok { background: #EAF9F1; color: #0F8A54; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px; border-radius: 9px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .2s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--a-grad); color: #fff; box-shadow: 0 8px 18px rgba(19,91,255,.22); }
.btn--primary:hover { opacity: .93; }
.btn--ghost { background: #fff; border-color: var(--a-line); color: var(--a-text); }
.btn--ghost:hover { border-color: var(--a-primary); color: var(--a-primary); }
.btn--danger { background: #FFF1F1; color: #D92D20; border-color: #FBD5D1; }
.btn--danger:hover { background: #D92D20; color: #fff; border-color: transparent; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; height: 44px; }
.actions { display: flex; gap: 8px; }

/* ---------- 表单 ---------- */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group > label { display: block; font-size: 13px; font-weight: 600; color: var(--a-ink); margin-bottom: 8px; }
.form-group > label i { color: #D92D20; font-style: normal; }
.form-control {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--a-line);
  background: #FBFCFE; color: var(--a-ink); transition: all .2s ease;
}
textarea.form-control { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.7; resize: vertical; }
.form-control:focus { border-color: var(--a-primary); background: #fff; box-shadow: 0 0 0 3px rgba(19,91,255,.1); }
.form-help { font-size: 12px; color: var(--a-muted); margin-top: 6px; }
.form-actions { display: flex; gap: 12px; padding-top: 6px; }
.radio-group { display: flex; gap: 20px; align-items: center; padding-top: 6px; }
.radio-group label { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; }
.alert--ok { background: #EAF9F1; color: #0F8A54; border: 1px solid #C7EEDA; }
.alert--err { background: #FDF0F0; color: #C0392B; border: 1px solid #F7D5D5; }

.filter-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filter-form .form-control { width: 220px; height: 38px; }

.pagination { margin-top: 22px; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--a-line);
  background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.pagination a:hover { border-color: var(--a-primary); color: var(--a-primary); }
.pagination .active span, .pagination li.active a { background: var(--a-grad); color: #fff; border-color: transparent; }
.empty { text-align: center; padding: 56px 20px; color: var(--a-muted); }

.msg-item { border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 20px; margin-bottom: 16px; background: #fff; }
.msg-item.is-unread { border-left: 4px solid var(--a-primary); }
.msg-item__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.msg-item__who { display: flex; align-items: center; gap: 12px; }
.msg-item__who b { color: var(--a-ink); font-size: 15px; }
.msg-item__body { font-size: 14px; color: var(--a-text); background: #F8FAFD; padding: 14px 16px; border-radius: 10px; }
.msg-item__meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--a-muted); margin-top: 12px; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar__menu { display: flex; flex-wrap: wrap; gap: 6px; }
  .sidebar__label { display: none; }
  .sidebar__foot { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .topbar { padding: 0 18px; }
  .stat-grid { grid-template-columns: 1fr; }
}
