* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: #0f1420;
  color: #d7dce5;
  font-size: 14px;
}
a { color: #5aa8ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 24px;
  background: #161d2e; padding: 0 24px; height: 56px;
  border-bottom: 1px solid #232d44;
}
.topbar .brand { font-size: 17px; font-weight: 700; color: #fff; }
.topbar .brand span { font-size: 12px; font-weight: 400; color: #8b94a7; margin-left: 8px; }
.topbar nav { display: flex; gap: 18px; flex: 1; }
.topbar nav a { color: #b7c0d4; padding: 4px 2px; }
.topbar nav a:hover { color: #fff; text-decoration: none; border-bottom: 2px solid #5aa8ff; }
.who { color: #8b94a7; margin-right: 10px; font-size: 13px; }

.container { max-width: 1180px; margin: 24px auto; padding: 0 20px; }
h2 { color: #fff; margin: 0 0 18px; }
h3 { color: #e6eaf2; margin: 28px 0 12px; }
.muted { color: #8b94a7; }

/* 按钮 */
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 6px;
  background: #232d44; color: #d7dce5; border: 1px solid #303b57;
  cursor: pointer; font-size: 14px; text-decoration: none;
}
.btn:hover { background: #2b3652; text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn-primary:hover { background: #3f7dff; }
.btn-danger { background: #b3382f; border-color: #b3382f; color: #fff; }
.btn-danger:hover { background: #c9443a; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.inline { display: inline; }

/* 表单 */
input, select {
  background: #0f1625; border: 1px solid #303b57; color: #e6eaf2;
  border-radius: 6px; padding: 9px 12px; font-size: 14px; outline: none;
}
input:focus, select:focus { border-color: #5aa8ff; }
.input-sm { width: 90px; padding: 5px 8px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-bar input[type=text] { width: 240px; }
.form-card {
  background: #161d2e; border: 1px solid #232d44; border-radius: 10px;
  padding: 24px; max-width: 560px;
}
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { color: #b7c0d4; font-weight: 600; }
.form-row small { color: #8b94a7; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #161d2e; border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid #232d44; text-align: left; }
.table th { background: #1b2438; color: #aeb8cc; font-weight: 600; font-size: 13px; }
.table tr:hover td { background: #1a2236; }
.table .empty { text-align: center; color: #8b94a7; padding: 26px; }
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: .3px; }
.nowrap { white-space: nowrap; }

/* 状态标签 */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; background: #2b3652; color: #b7c0d4;
}
.tag-unused { background: #2b3652; color: #9fb2d8; }
.tag-active { background: #143d2b; color: #4ade80; }
.tag-expired { background: #3d2f14; color: #fbbf24; }
.tag-disabled { background: #3d1815; color: #f87171; }

.alert {
  background: #3d1815; border: 1px solid #7f2a23; color: #fca5a5;
  padding: 10px 14px; border-radius: 6px; margin-bottom: 16px;
}

/* 概览卡片 */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat {
  background: #161d2e; border: 1px solid #232d44; border-radius: 10px;
  padding: 18px 16px;
}
.stat .num { font-size: 28px; font-weight: 700; color: #fff; }
.stat .lbl { color: #8b94a7; margin-top: 4px; font-size: 13px; }
.stat.warn .num { color: #fbbf24; }
.stat.ok .num { color: #4ade80; }

/* 详情 */
.detail-card { background: #161d2e; border: 1px solid #232d44; border-radius: 10px; padding: 22px; max-width: 760px; }
.big-key { font-size: 22px; color: #fff; margin-bottom: 16px; }
.kv { width: 100%; }
.kv th { width: 180px; color: #8b94a7; text-align: left; padding: 7px 0; font-weight: 400; }
.kv td { padding: 7px 0; }
.actions { margin-top: 18px; display: flex; gap: 12px; align-items: center; }
.renew { display: inline-flex; gap: 6px; align-items: center; }
.chip { margin: 2px 0; }
.chip small { color: #8b94a7; }

/* 在线点 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot-online { background: #4ade80; box-shadow: 0 0 6px #4ade8088; }
.dot-offline { background: #6b7280; }

.pager { margin-top: 16px; display: flex; gap: 10px; }

/* 登录页 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: #161d2e; border: 1px solid #232d44; border-radius: 14px;
  padding: 36px 32px; width: 340px;
}
.login-card h1 { color: #fff; text-align: center; margin: 0; font-size: 24px; }
.login-card .subtitle { text-align: center; color: #8b94a7; margin: 6px 0 24px; }
.login-card label { display: block; margin: 12px 0 6px; color: #b7c0d4; }
.login-card input { width: 100%; }
.login-card .btn { margin-top: 22px; }
