/* 阿莱录屏 · 后台样式（蓝白） */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-deep: #16264a;
  --bg: #f4f7fd;
  --card: #ffffff;
  --text: #1b2440;
  --muted: #6b7690;
  --line: #e6ebf5;
  --green: #12a150;
  --red: #d93a3a;
  --orange: #d97706;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(23, 43, 99, .07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

/* ------------------------------------------------------------- 侧边栏 */
.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  background: linear-gradient(170deg, #16264a 0%, #1b3a7a 55%, #1d4ed8 100%);
  color: #eaf0ff;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700;
  color: #fff;
}
.brand b { display: block; font-size: 15px; letter-spacing: .3px; }
.brand small { color: rgba(234, 240, 255, .62); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(234, 240, 255, .82);
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item i {
  font-style: normal;
  width: 18px; text-align: center;
  opacity: .8;
  font-size: 13px;
}
.nav-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active {
  background: #fff;
  color: var(--blue-dark);
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(9, 20, 60, .18);
}
.nav-item.active i { opacity: 1; }

.side-foot {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .13);
  display: flex; flex-direction: column; gap: 6px;
}
.side-link {
  color: rgba(234, 240, 255, .8);
  font-size: 12.5px;
  padding: 3px 0;
}
.side-link:hover { color: #fff; }
.side-meta {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(234, 240, 255, .45);
}

/* --------------------------------------------------------------- 主区 */
.main { margin-left: 224px; min-height: 100vh; }

.topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: .2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.warn-chip {
  background: #fff7e6;
  color: var(--orange);
  border: 1px solid #ffe2b3;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
}
.user-chip {
  background: #eef3ff;
  color: var(--blue-dark);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}

.content { padding: 22px 26px 40px; }

/* --------------------------------------------------------------- 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #eef2fa;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 {
  font-size: 15px; margin: 0; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.card-head h2::before {
  content: ""; width: 3px; height: 14px;
  background: var(--blue); border-radius: 3px;
}
.card-head .hint { color: var(--muted); font-size: 12.5px; }

/* 统计卡 */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #eef2fa;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute; right: -18px; top: -18px;
  width: 66px; height: 66px; border-radius: 50%;
  background: rgba(37, 99, 235, .07);
}
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 2px; letter-spacing: .5px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat.blue .v { color: var(--blue); }
.stat.green .v { color: var(--green); }
.stat.gray .v { color: #7b8598; }
.stat.orange .v { color: var(--orange); }

/* --------------------------------------------------------------- 表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); }
.field .tip { font-size: 11.5px; color: #9aa3b8; }

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  border: 1px solid #dbe3f2;
  background: #fbfcff;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  background: #fff;
}
textarea { resize: vertical; min-height: 70px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid #dbe3f2;
  background: #fff;
  color: var(--text);
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #b9c8e6; background: #f7faff; }
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1a43b8); color: #fff; }
.btn-danger { color: var(--red); border-color: #f3cfcf; background: #fff8f8; }
.btn-danger:hover { background: #fdecec; border-color: #eab6b6; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

input:disabled, select:disabled, textarea:disabled {
  background: #f1f4fa;
  color: #9aa3b8;
  cursor: not-allowed;
  border-color: #e4e9f4;
}

/* 工具条 */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.toolbar .grow { flex: 1; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select { width: auto; min-width: 150px; }

/* --------------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
table.data th {
  background: #f5f8ff;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f4fa;
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #f9fbff; }
.mono {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: .3px;
}
.key-cell { display: flex; align-items: center; gap: 8px; }
.key-cell b { font-weight: 600; }
.remark { color: var(--muted); font-size: 12px; }
.empty { text-align: center; color: #9aa3b8; padding: 40px 0; }

/* 徽章 */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-blue { background: #e9f0ff; color: #2563eb; }
.badge-green { background: #e6f8ee; color: #0f8c46; }
.badge-gray { background: #eef1f6; color: #7b8598; }
.badge-red { background: #fdecec; color: #cf3535; }
.badge-orange { background: #fff4e5; color: #c2720a; }

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; font-size: 13px;
}
.pager-btns { display: flex; gap: 6px; }
.pager-btns a {
  min-width: 32px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  color: var(--text);
  font-size: 12.5px;
}
.pager-btns a:hover { border-color: #b9c8e6; }
.pager-btns a.cur {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}

/* 提示条 */
.alert {
  padding: 11px 15px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid transparent;
}
.alert.ok { background: #eafaf1; color: #0f8c46; border-color: #c9efd9; }
.alert.err { background: #fdeeee; color: #c53030; border-color: #f6d0d0; }
.alert.info { background: #eef4ff; color: #1d4ed8; border-color: #d5e2ff; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.row-actions .btn { padding: 5px 9px; }

/* 生成的卡密结果 */
.key-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px;
  background: #f7faff;
  border: 1px dashed #cfdcf5;
  border-radius: 10px;
  margin-top: 12px;
}
.key-list code {
  font-family: ui-monospace, Consolas, monospace;
  background: #fff;
  border: 1px solid #e4ebf9;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12.5px;
  letter-spacing: .4px;
  user-select: all;
}

/* --------------------------------------------------------------- 登录页 */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 15% 10%, #e8f0ff 0%, transparent 60%),
    radial-gradient(700px 400px at 85% 80%, #e6f4ff 0%, transparent 55%),
    #f4f7fd;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(22, 38, 74, .12);
  padding: 34px 30px 28px;
  border: 1px solid #eef2fa;
}
.login-logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .28);
}
.login-card h1 { font-size: 19px; margin: 0 0 4px; }
.login-card p.sub { color: var(--muted); font-size: 12.5px; margin: 0 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; margin-top: 6px; padding: 11px; }
.login-foot {
  margin-top: 18px; text-align: center;
  font-size: 12px; color: #9aa3b8;
}
.login-foot a { color: var(--blue); }

/* 响应式 */
@media (max-width: 860px) {
  .side {
    position: static; width: auto; flex-direction: row; align-items: center;
    padding: 12px 14px; gap: 12px; overflow-x: auto;
  }
  .brand { padding: 0; }
  .nav { flex-direction: row; }
  .side-foot { display: none; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}
