/* 北望知识回声台 —— 控制台样式
   浅色 / 克制 / 信息密度优先。不引任何外部字体与图标库。 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f5f6f8;
  color: #1f1f1f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

a { color: #2f54eb; text-decoration: none; }

/* ---------------- 布局 ---------------- */
.app { display: flex; flex-direction: column; height: 100%; }

.topbar {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid #f0f0f0;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  background: #2f54eb; position: relative; top: 1px;
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: #8c8c8c; letter-spacing: 1px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who { color: #8c8c8c; }
.who b { color: #1f1f1f; font-weight: 600; }

.layout { flex: 1; display: flex; min-height: 0; }

.sidebar {
  flex: 0 0 180px;
  background: #ffffff;
  border-right: 1px solid #f0f0f0;
  overflow-y: auto;
}
.nav { padding: 8px 0; }
.nav-group-title {
  padding: 10px 16px 4px; font-size: 11px; color: #bfbfbf; letter-spacing: 1px;
}
.nav-item {
  display: block; width: 100%; text-align: left;
  padding: 0 16px; height: 34px; line-height: 34px;
  border: 0; border-left: 3px solid transparent;
  background: transparent; color: #1f1f1f; font-size: 13px;
  font-family: inherit; cursor: pointer;
}
.nav-item:hover { background: #fafafa; }
.nav-item.active {
  color: #2f54eb; background: #f0f4ff; border-left-color: #2f54eb; font-weight: 600;
}

.content { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 16px 40px; }

/* ---------------- 卡片 / 标题 ---------------- */
.card {
  background: #ffffff;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 13px; font-weight: 600; margin: 0 0 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.page-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.hint { color: #8c8c8c; font-size: 12px; }
.hint-block {
  margin-top: 10px; padding: 8px 10px; background: #fafafa;
  border: 1px solid #f0f0f0; border-radius: 3px; color: #8c8c8c; font-size: 12px; line-height: 1.7;
}
.warn-block {
  margin-top: 6px; padding: 8px 10px; background: #fffbe6;
  border: 1px solid #ffe58f; border-radius: 3px; color: #ad6800; font-size: 12px; line-height: 1.7;
}

/* ---------------- 表单控件 ---------------- */
.field { margin-bottom: 10px; }
.field-label { display: block; margin-bottom: 4px; color: #595959; }
.field-label .req { color: #ff4d4f; margin-right: 3px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid #d9d9d9; border-radius: 3px;
  background: #ffffff; color: #1f1f1f; font-family: inherit; font-size: 13px;
  padding: 0 8px; height: 30px; outline: none;
}
.textarea { height: auto; padding: 6px 8px; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #2f54eb; }
.input[disabled] { background: #f5f5f5; color: #8c8c8c; }
.select { padding-right: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 12px; border: 1px solid #d9d9d9; border-radius: 3px;
  background: #ffffff; color: #1f1f1f; font-family: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #2f54eb; color: #2f54eb; }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn:disabled:hover { border-color: #d9d9d9; color: #1f1f1f; }
.btn-primary { background: #2f54eb; border-color: #2f54eb; color: #ffffff; }
.btn-primary:hover { background: #1d39c4; border-color: #1d39c4; color: #ffffff; }
.btn-danger { color: #ff4d4f; border-color: #ff9c9e; }
.btn-danger:hover { color: #ffffff; background: #ff4d4f; border-color: #ff4d4f; }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn-link {
  border: 0; background: transparent; color: #2f54eb; padding: 0 4px; height: auto; cursor: pointer;
  font-family: inherit; font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: #ff4d4f; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .spacer { flex: 1; }
.toolbar .input.inline { width: 220px; }
.toolbar .select.inline { width: auto; }
.switch { display: inline-flex; align-items: center; gap: 6px; color: #595959; cursor: pointer; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  height: 34px; padding: 0 10px; text-align: left; font-weight: 500; color: #8c8c8c;
  background: #fafafa; border-bottom: 1px solid #f0f0f0; white-space: nowrap;
}
table.tbl td {
  height: 36px; padding: 0 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle;
}
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl tbody tr.clickable { cursor: pointer; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 40px 0; text-align: center; color: #8c8c8c; }

/* 标签 */
.tag {
  display: inline-block; height: 20px; line-height: 19px; padding: 0 6px;
  border-radius: 2px; font-size: 12px; border: 1px solid transparent; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.tag-blue { color: #2f54eb; background: #f0f4ff; border-color: #d6e0ff; }
.tag-gray { color: #8c8c8c; background: #fafafa; border-color: #e8e8e8; }
.tag-plain { color: #595959; background: #ffffff; border-color: #e8e8e8; }

.s-warn { color: #faad14; }
.s-ok { color: #52c41a; }
.s-reject { color: #ff4d4f; }
.s-none { color: #8c8c8c; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-ok { background: #52c41a; }
.dot-warn { background: #faad14; }
.dot-reject { background: #ff4d4f; }
.dot-off { background: #d9d9d9; }

/* ---------------- Tab ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #f0f0f0; margin-bottom: 10px; }
.tab {
  border: 0; background: transparent; padding: 0 12px; height: 32px; line-height: 32px;
  font-family: inherit; font-size: 13px; color: #595959; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: #2f54eb; }
.tab.active { color: #2f54eb; font-weight: 600; border-bottom-color: #2f54eb; }
.tab .cnt { color: #8c8c8c; font-weight: 400; margin-left: 4px; }
.tab.active .cnt { color: #2f54eb; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: #8c8c8c; }
.pager .spacer { flex: 1; }

/* ---------------- 指标卡 ---------------- */
.metrics { display: flex; gap: 12px; flex-wrap: wrap; }
.metric {
  flex: 1 1 160px; min-width: 150px; background: #ffffff;
  border: 1px solid #f0f0f0; border-radius: 4px; padding: 12px 14px;
}
.metric .m-label { color: #8c8c8c; font-size: 12px; }
.metric .m-value { font-size: 28px; line-height: 1.25; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric .m-value.ok { color: #52c41a; }
.metric .m-value.warn { color: #faad14; }
.metric .m-value.danger { color: #ff4d4f; }
.metric .m-value.primary { color: #2f54eb; }

/* ---------------- 图表 ---------------- */
.chart { width: 100%; overflow-x: auto; }
.legend { display: flex; gap: 14px; color: #8c8c8c; font-size: 12px; margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }

/* ---------------- 抽屉 ---------------- */
.mask {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .35); z-index: 900; display: none;
}
.mask.show { display: block; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 640px; max-width: 100vw;
  background: #ffffff; z-index: 1000; box-shadow: -2px 0 8px rgba(0, 0, 0, .12);
  transform: translateX(100%); transition: transform .18s ease-out;
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
}
.drawer-head h3 { margin: 0; font-size: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.drawer-foot {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: center;
  padding: 10px 16px; border-top: 1px solid #f0f0f0; background: #fafafa;
}
.drawer-foot .spacer { flex: 1; }
.close-x {
  border: 0; background: transparent; cursor: pointer; font-size: 18px; color: #8c8c8c;
  line-height: 1; padding: 0 4px; font-family: inherit;
}
.kv { display: flex; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.kv .k { flex: 0 0 76px; color: #8c8c8c; }
.kv .v { flex: 1; word-break: break-all; }
.section-title { font-size: 12px; color: #8c8c8c; margin: 14px 0 6px; border-top: 1px solid #f0f0f0; padding-top: 10px; }
.qtext { font-size: 14px; line-height: 1.7; word-break: break-word; }

/* ---------------- 弹层 ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 1100; display: none; }
.modal-root.show { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.modal {
  position: relative; width: 480px; max-width: calc(100vw - 32px);
  margin: 8vh auto 0; background: #ffffff; border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18); max-height: 84vh; display: flex; flex-direction: column;
}
.modal.wide { width: 640px; }
.modal-head { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; font-weight: 600; }
.modal-body { padding: 14px 16px; overflow-y: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }
.secret-box {
  background: #f6ffed; border: 1px solid #b7eb8f; border-radius: 3px; padding: 10px;
  font-family: Consolas, "Courier New", monospace; font-size: 13px; word-break: break-all;
  user-select: all;
}

/* ---------------- Toast ---------------- */
.toast-root {
  position: fixed; top: 14px; left: 0; right: 0; z-index: 1200;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.toast {
  min-width: 200px; max-width: 60vw; padding: 8px 14px; border-radius: 3px;
  background: #ffffff; border: 1px solid #f0f0f0; box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  color: #1f1f1f; font-size: 13px;
}
.toast.ok { background: #f6ffed; border-color: #b7eb8f; color: #237804; }
.toast.err { background: #fff2f0; border-color: #ffccc7; color: #a8071a; }
.toast.warn { background: #fffbe6; border-color: #ffe58f; color: #ad6800; }

/* ---------------- 登录页 ---------------- */
.login-page {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: #f5f6f8;
}
.login-box { width: 360px; }
.login-head { text-align: center; margin-bottom: 18px; }
.login-head .logo {
  width: 40px; height: 40px; border-radius: 8px; background: #2f54eb; margin: 0 auto 10px;
}
.login-head h1 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
.login-head p { margin: 0; color: #8c8c8c; font-size: 12px; }
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-img {
  flex: 0 0 auto; height: 30px; border: 1px solid #d9d9d9; border-radius: 3px;
  cursor: pointer; background: #fafafa; display: block;
}
.login-foot { margin-top: 10px; text-align: center; color: #8c8c8c; font-size: 12px; }
.login-err { color: #ff4d4f; font-size: 12px; min-height: 18px; margin-top: 6px; }
