:root {
  --brand: #0f6b5c;
  --brand-2: #14917c;
  --brand-soft: #e6f4f1;
  --bg: #f4f6f6;
  --card: #ffffff;
  --text: #1c2a28;
  --muted: #64736f;
  --line: #dfe6e4;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --ok: #1e8e5a;
  --ok-soft: #e5f6ec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 36, 0.06), 0 4px 16px rgba(16, 40, 36, 0.05);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.boot { padding: 48px; text-align: center; color: var(--muted); }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, #0d5c4f, #13806e 55%, #e6f4f1 55.2%); }
.login-card { width: min(380px, 100%); background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 28px 26px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card p.sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

/* ---------- 布局 ---------- */
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: #0d3d36; color: #cfe7e2; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 600; font-size: 15px; }
.side .logo img { width: 26px; height: 26px; }
.side a.nav { display: block; padding: 9px 12px; border-radius: 8px; color: #cfe7e2; }
.side a.nav:hover { background: rgba(255,255,255,0.07); text-decoration: none; }
.side a.nav.active { background: rgba(255,255,255,0.14); color: #fff; font-weight: 600; }
.side .spacer { flex: 1; }
.side .who { padding: 10px 12px; font-size: 12px; color: #9fc4bc; border-top: 1px solid rgba(255,255,255,0.1); }
.side .who b { color: #fff; font-weight: 600; }
.main { padding: 22px 26px 40px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 19px; }

/* ---------- 组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; color: var(--text); min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(20, 145, 124, 0.35); border-color: var(--brand-2); }
.btn { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #b8c7c3; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--danger); border-color: #efc2bc; }
.btn.danger:hover { background: var(--danger-soft); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.block { width: 100%; padding: 10px; }
.err { color: var(--danger); font-size: 13px; margin: 6px 0 0; min-height: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; word-break: break-all; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafcfb; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f6faf9; }
.table-wrap { overflow-x: auto; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #eef2f1; color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }
.tag.brand { background: var(--brand-soft); color: var(--brand); }

.user-head { display: flex; gap: 14px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); object-fit: cover; flex: none; }
.avatar.sm { width: 30px; height: 30px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; }
.kv .k { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 120px; padding-top: 8px; }
.bars .b { flex: 1; background: var(--brand-2); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .b span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.bars-x { display: flex; gap: 6px; font-size: 10px; color: var(--muted); }
.bars-x div { flex: 1; text-align: center; }

.modal-mask { position: fixed; inset: 0; background: rgba(10, 30, 26, 0.45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { width: min(440px, 100%); background: #fff; border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 12px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.secret-box { background: #f6faf9; border: 1px dashed #9ccfc4; border-radius: 8px; padding: 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #16302b; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 30; max-width: calc(100% - 32px); }
.toast.bad { background: var(--danger); }

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; gap: 2px; position: sticky; top: 0; z-index: 10; }
  .side .logo { padding: 4px 8px; flex-basis: 100%; }
  .side a.nav { padding: 7px 10px; font-size: 13px; }
  .side .spacer, .side .who { display: none; }
  .main { padding: 14px 12px 32px; }
  .kv { grid-template-columns: 90px 1fr; }
  .hide-sm { display: none; }
  th, td { padding: 8px 6px; }
}

.uname { font-size: 16px; font-weight: 600; }
.mt { margin-top: 12px; }
.mt0 { margin-top: 0; }
.m0 { margin: 0; }
.between { justify-content: space-between; margin-bottom: 8px; }
.narrow { max-width: 420px; }
th { white-space: nowrap; }
.nw { white-space: nowrap; }
.ucell { display: flex; gap: 10px; align-items: center; min-width: 180px; }
.ucell .t { min-width: 0; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 1100px) { .hide-md { display: none; } }


/* ---------- 国内 / 国际切换 ---------- */
.side .region { display: flex; gap: 2px; margin: 0 4px 12px; padding: 3px; border-radius: 9px; background: rgba(0,0,0,0.25); }
.side .region a { flex: 1; text-align: center; padding: 6px 0; border-radius: 7px; color: #9fc4bc; font-size: 13px; }
.side .region a:hover { text-decoration: none; color: #fff; }
.side .region a.on { background: #fff; color: #0d3d36; font-weight: 600; }
@media (max-width: 760px) {
  .side .top { display: flex; align-items: center; flex-basis: 100%; gap: 10px; margin-bottom: 4px; }
  .side .top .logo { flex: 1; white-space: nowrap; }
  .side .region { margin: 0; flex: 0 0 120px; }
}
