/* ============================================================================
   console.css —— SaaS 控制台样式（授权中心 + 客户后台共用）
   ----------------------------------------------------------------------------
   ⛔ 不用框架：这套界面要能在 2G 的服务器上跑、要在手机上打开，
      引一个 CDN 框架 = 多一次外网请求 + 多一个挂掉的理由。
   ⛔ 颜色只用品牌绿 + 中性灰；状态色（到期/停用）单独定义，不要就地写死。
   ========================================================================== */

:root {
  --brand: #2F6B4F;
  --brand-d: #24523D;
  --brand-l: #E8F0EB;
  --ink: #1F2421;
  --ink2: #4A544E;
  --ink3: #8A938D;
  --line: #E3E6E3;
  --bg: #F6F7F5;
  --card: #FFFFFF;
  --red: #C0392B;
  --red-l: #FBEAE7;
  --amber: #B7791F;
  --amber-l: #FDF4E3;
  --gray-l: #EEF0EE;
  --r: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar__in {
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
  height: 56px; display: flex; align-items: center; gap: 12px;
}
.logo {
  width: 26px; height: 26px; border-radius: 6px; background: var(--brand);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.topbar__t { font-weight: 600; font-size: 15px; }
.topbar__s { color: var(--ink3); font-size: 12px; margin-left: 4px; }
.spacer { flex: 1; }

.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink2);
  border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 13px;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #C9CFCA; }
.btn--main { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn--main:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn--danger { color: var(--red); border-color: #EBC9C4; }
.btn--danger:hover { background: var(--red-l); }
.btn--sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px;
}
.card + .card { margin-top: 14px; }
.card__t { font-weight: 600; font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card__s { color: var(--ink3); font-size: 12px; font-weight: 400; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat__n { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat__l { color: var(--ink3); font-size: 12px; margin-top: 2px; }
.stat--warn .stat__n { color: var(--amber); }
.stat--bad .stat__n { color: var(--red); }

/* ---------- 表格 ---------- */
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--ink3); font-size: 12px; background: #FBFCFB; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FBFCFB; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--ink2); }
.ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.badge--ok { background: var(--brand-l); color: var(--brand-d); }
.badge--warn { background: var(--amber-l); color: var(--amber); }
.badge--bad { background: var(--red-l); color: var(--red); }
.badge--off { background: var(--gray-l); color: var(--ink3); }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--r); padding: 12px 14px; font-size: 13px; margin-bottom: 14px;
}
.notice--warn { background: var(--amber-l); color: #7A5312; border: 1px solid #F0DDB8; }
.notice--bad { background: var(--red-l); color: #8C2A20; border: 1px solid #EFCBC5; }
.notice--ok { background: var(--brand-l); color: var(--brand-d); border: 1px solid #CFE0D5; }

/* ---------- 表单 ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--ink2); }
.field .hint { font-size: 11.5px; color: var(--ink3); }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  background: #fff; outline: none; width: 100%; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,107,79,.10); }
textarea { min-height: 76px; resize: vertical; }
.form__foot { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; margin-top: 4px; }

/* ---------- 登录 ---------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(180deg, #F6F7F5, #EDF1EE);
}
.login__box { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px 24px; box-shadow: 0 10px 30px rgba(31,36,33,.06); }
.login__t { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.login__s { color: var(--ink3); font-size: 12.5px; margin-bottom: 20px; }
.tabs { display: flex; gap: 6px; background: var(--gray-l); padding: 3px; border-radius: 8px; margin-bottom: 18px; }
.tab { flex: 1; text-align: center; padding: 7px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--ink2); }
.tab--on { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,24,21,.42); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.modal--on { display: flex; }
.modal__box { background: var(--card); border-radius: 12px; width: 100%; max-width: 460px; max-height: 88vh; overflow: auto; }
.modal__h { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal__b { padding: 18px; }
.modal__f { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: #23282A; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 90; max-width: 90vw;
}
.toast--on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--bad { background: #8C2A20; }

/* ---------- 客户后台的授权卡 ---------- */
.lic { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lic__d { font-size: 28px; font-weight: 700; line-height: 1.1; }
.lic__l { color: var(--ink3); font-size: 12px; }
.lic__sep { width: 1px; height: 34px; background: var(--line); }

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form { grid-template-columns: 1fr; }
  .topbar__s { display: none; }
  .wrap { padding: 0 12px 40px; }
  .stat__n { font-size: 20px; }
  .card { padding: 14px; }
  table { min-width: 720px; }
  .lic__d { font-size: 22px; }
}
