/* ================= USDT Pay 后台样式 ================= */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #070b14;
  --bg-soft: #0a101d;
  --panel: #0e1626;
  --panel-2: #0b1322;
  --panel-3: #101a2c;
  --line: #1a2942;
  --line-soft: #142135;
  --txt: #e7eefb;
  --mut: #8ba0bf;
  --dim: #5e7392;
  --green: #34e27a;
  --green-2: #12b864;
  --cyan: #4cc9f0;
  --amber: #f5c24b;
  --red: #ff7b8b;
  --violet: #a78bfa;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--mut); }
.small { font-size: 12px; }
.grad {
  background: linear-gradient(90deg, var(--green), var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.mono { font-family: var(--mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------- 品牌图形 ---------------- */
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  color: var(--green);
  background: radial-gradient(120% 120% at 20% 10%, rgba(52, 226, 122, .18), rgba(76, 201, 240, .06));
  border: 1px solid rgba(52, 226, 122, .25);
  box-shadow: 0 0 22px rgba(52, 226, 122, .12) inset;
}
.brand-mark svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
.brand-mark.lg { width: 54px; height: 54px; border-radius: 15px; }
.brand-mark.lg svg { width: 32px; height: 32px; }

/* ---------------- 登录 ---------------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(52, 226, 122, .14), transparent 60%),
    radial-gradient(800px 500px at 100% 110%, rgba(76, 201, 240, .12), transparent 60%),
    var(--bg);
}
.auth-brand {
  position: relative;
  display: grid;
  place-items: center;
  padding: 48px;
  overflow: hidden;
  border-right: 1px solid var(--line-soft);
}
.auth-brand::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(120, 160, 220, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 220, .055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 70% at 40% 40%, #000 30%, transparent 100%);
}
.auth-brand-inner { position: relative; max-width: 460px; }
.auth-brand h1 {
  font-size: 40px; line-height: 1.15; margin: 22px 0 12px;
  letter-spacing: -.5px;
}
.auth-points { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 10px; color: var(--mut); font-size: 13px; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--dim); display: inline-block; flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 10px rgba(52, 226, 122, .7); }
.dot.warn { background: var(--amber); box-shadow: 0 0 10px rgba(245, 194, 75, .55); }
.dot.err { background: var(--red); box-shadow: 0 0 10px rgba(255, 123, 139, .55); }

.auth-panel { display: grid; place-items: center; padding: 32px; }
.auth-card {
  width: min(392px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), transparent 40%), var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 16px 0 4px; font-size: 21px; letter-spacing: -.2px; }
.auth-card .field:first-of-type { margin-top: 22px; }
.auth-foot { margin: 18px 0 0; text-align: center; }

/* ---------------- 表单 ---------------- */
.field { display: block; margin-top: 14px; }
.field > span, .field-label {
  display: block; font-size: 12px; color: var(--mut); margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: #4a5f80; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(52, 226, 122, .55);
  box-shadow: 0 0 0 3px rgba(52, 226, 122, .12);
  background: #0a1425;
}
select { cursor: pointer; }
.form-error { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 10px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------- 按钮 ---------------- */
.btn {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font: inherit;
  font-weight: 600;
  background: rgba(255, 255, 255, .06);
  color: var(--txt);
  transition: transform .1s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .09); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #3ff08a, var(--green-2));
  color: #03160b;
  border-color: rgba(52, 226, 122, .4);
  box-shadow: 0 6px 18px rgba(18, 184, 100, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, #55f79b, #1ac26d); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--txt); }
.btn-ghost:hover { border-color: var(--line-soft); background: rgba(255, 255, 255, .04); }
.btn-danger { background: rgba(255, 123, 139, .12); border-color: rgba(255, 123, 139, .3); color: #ffb3bc; }
.btn-danger:hover { background: rgba(255, 123, 139, .19); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; margin-top: 8px; padding: 11px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: transparent;
  color: var(--mut); cursor: pointer; transition: .15s;
}
.icon-btn:hover { color: var(--txt); border-color: var(--line-soft); background: rgba(255, 255, 255, .04); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- 主布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 234px; flex: none;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #0a1120, #080d18 60%);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; }
.brand b { display: block; font-size: 16px; letter-spacing: .3px; }
.brand small { display: block; font-size: 11px; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  background: transparent; border: 1px solid transparent;
  color: var(--mut); font: inherit; font-weight: 500; text-align: left;
  cursor: pointer; transition: .15s;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; flex: none; }
.nav-item:hover { color: var(--txt); background: rgba(255, 255, 255, .04); }
.nav-item.active {
  color: #eafff2;
  background: linear-gradient(90deg, rgba(52, 226, 122, .14), rgba(76, 201, 240, .06));
  border-color: rgba(52, 226, 122, .22);
  box-shadow: inset 0 0 0 1px rgba(52, 226, 122, .06);
}
.nav-item.active svg { opacity: 1; color: var(--green); }
.sidebar-foot { margin-top: auto; padding: 14px; }
.net-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line-soft); border-radius: 11px; padding: 10px 12px;
  background: rgba(255, 255, 255, .018);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 13, 24, .82);
  backdrop-filter: blur(10px);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 17px; letter-spacing: -.1px; }
.topbar-title p { margin: 2px 0 0; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 99px;
  padding: 5px 12px 5px 6px; font-size: 12px; color: var(--mut);
  background: rgba(255, 255, 255, .02);
}
.user-chip::before {
  content: ""; width: 22px; height: 22px; border-radius: 99px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  opacity: .85;
}
.view { padding: 24px 26px 60px; max-width: 1360px; width: 100%; margin: 0 auto; }

/* ---------------- 卡片 / 网格 ---------------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), transparent 45%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  font-weight: 600; font-size: 13px;
}
.card-head .sp { flex: 1; }
.card-head .sub { font-weight: 400; color: var(--mut); font-size: 12px; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1.35fr 1fr; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi label { font-size: 12px; color: var(--mut); }
.kpi .ico {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(52, 226, 122, .1); color: var(--green); border: 1px solid rgba(52, 226, 122, .18);
}
.kpi .ico.cyan { background: rgba(76, 201, 240, .1); color: var(--cyan); border-color: rgba(76, 201, 240, .2); }
.kpi .ico.amber { background: rgba(245, 194, 75, .1); color: var(--amber); border-color: rgba(245, 194, 75, .2); }
.kpi .ico.red { background: rgba(255, 123, 139, .1); color: var(--red); border-color: rgba(255, 123, 139, .2); }
.kpi .ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi b { display: block; font-size: 26px; margin-top: 12px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 12px; font-weight: 500; color: var(--mut); margin-left: 4px; letter-spacing: 0; }
.kpi .foot { margin-top: 6px; font-size: 11.5px; color: var(--dim); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th {
  color: var(--dim); font-weight: 600; font-size: 11px; letter-spacing: .6px;
  text-transform: uppercase; white-space: nowrap;
  background: rgba(255, 255, 255, .012);
  position: sticky; top: 0;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(76, 201, 240, .035); }
tbody tr:last-child td { border-bottom: none; }
td.wrap { max-width: 320px; word-break: break-all; }

/* ---------------- 状态 / 标签 ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px; font-size: 11.5px;
  border: 1px solid var(--line); color: var(--mut);
  background: rgba(255, 255, 255, .02); white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 99px; font-size: 11.5px; border: 1px solid;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 99px; background: currentColor; }
.b-pending { color: var(--amber); border-color: rgba(245, 194, 75, .3); background: rgba(245, 194, 75, .08); }
.b-paid, .b-confirmed, .b-success, .b-active { color: var(--green); border-color: rgba(52, 226, 122, .3); background: rgba(52, 226, 122, .08); }
.b-detected { color: var(--cyan); border-color: rgba(76, 201, 240, .3); background: rgba(76, 201, 240, .08); }
.b-expired, .b-canceled, .b-ignored, .b-disabled { color: var(--dim); border-color: var(--line); background: rgba(255, 255, 255, .02); }
.b-unmatched, .b-underpaid, .b-failed { color: var(--red); border-color: rgba(255, 123, 139, .3); background: rgba(255, 123, 139, .08); }

/* ---------------- 日志流 ---------------- */
.feed { max-height: 300px; overflow-y: auto; padding: 6px 0; }
.feed-item {
  display: flex; gap: 10px; padding: 8px 18px;
  font-size: 12px; color: #a9bdd9; border-bottom: 1px solid rgba(20, 33, 53, .7);
}
.feed-item:last-child { border-bottom: none; }
.feed-item time { color: var(--dim); font-family: var(--mono); font-size: 11px; flex: none; white-space: nowrap; }
.feed-item .src { color: var(--cyan); flex: none; }
.feed-item.warn { color: #f3d493; }
.feed-item.error { color: #ffb3bc; }

/* ---------------- 图表 ---------------- */
.chart { padding: 16px 18px 10px; }
.chart svg { display: block; width: 100%; height: 190px; overflow: visible; }
.chart .bar { fill: url(#barGrad); transition: opacity .15s; }
.chart .bar:hover { opacity: .82; }
.chart .axis { fill: var(--dim); font-size: 10.5px; font-family: var(--mono); }
.chart .grid-line { stroke: #16233a; stroke-width: 1; }

/* ---------------- 工具条 ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .sp { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  cursor: pointer; border: 1px solid var(--line); background: transparent;
  color: var(--mut); border-radius: 99px; padding: 6px 13px; font: inherit; font-size: 12px;
  transition: .15s;
}
.chip:hover { color: var(--txt); border-color: var(--line-soft); }
.chip.active {
  color: var(--txt); border-color: rgba(52, 226, 122, .35);
  background: rgba(52, 226, 122, .1);
}

/* ---------------- 空态 / 加载 ---------------- */
.empty { padding: 46px 20px; text-align: center; color: var(--dim); }
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 10px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.skeleton { background: linear-gradient(90deg, #101a2c 25%, #15223a 50%, #101a2c 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------------- 弹窗 ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background: rgba(3, 7, 14, .72); backdrop-filter: blur(6px);
  animation: fade .15s ease;
}
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 30%), var(--panel);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  animation: pop .18s ease;
}
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-size: 15px; flex: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* ---------------- Toast ---------------- */
.toast-root {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #101c30; border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 15px; font-size: 13px; box-shadow: var(--shadow);
  animation: pop .18s ease; max-width: 380px;
}
.toast .t-ico { width: 16px; height: 16px; border-radius: 99px; flex: none; }
.toast.ok .t-ico { background: var(--green); box-shadow: 0 0 10px rgba(52, 226, 122, .6); }
.toast.err .t-ico { background: var(--red); box-shadow: 0 0 10px rgba(255, 123, 139, .6); }
.toast.info .t-ico { background: var(--cyan); box-shadow: 0 0 10px rgba(76, 201, 240, .6); }

/* ---------------- 详情 ---------------- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; align-items: baseline; }
.kv .k { color: var(--mut); font-size: 12px; }
.kv .v { word-break: break-all; }
.copy { cursor: pointer; border-bottom: 1px dashed #35506f; }
.copy:hover { color: var(--cyan); }
.qr-box { background: #fff; border-radius: 12px; padding: 10px; width: 196px; margin: 0 auto; }
.qr-box svg { display: block; width: 100%; height: auto; }
.secret { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; background: var(--panel-2); border: 1px dashed var(--line); padding: 10px 12px; border-radius: 9px; word-break: break-all; }
.twofa-steps { display: grid; gap: 12px; margin-bottom: 16px; }
.hint { font-size: 12px; color: var(--mut); }
.banner {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid rgba(245, 194, 75, .28); background: rgba(245, 194, 75, .08);
  color: #f3d493; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px;
}
.banner .sp { flex: 1; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { padding: 12px 14px; }
  .brand small { display: none; }
  .nav { flex-direction: row; padding: 8px; gap: 4px; }
  .nav-item span { display: none; }
  .nav-item { padding: 9px; }
  .sidebar-foot { display: none; }
  .view { padding: 16px 14px 40px; }
  .topbar { padding: 12px 14px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .form-row, .field-row { grid-template-columns: 1fr; }
}

/* 补充分隔/工具类 */
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.nowrap { white-space: nowrap; }
.section-title { font-size: 13px; margin: 20px 0 10px; color: var(--mut); font-weight: 600; }
.sec-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.sec-row:last-child { border-bottom: none; }
.sec-row > div:first-child { flex: 1; min-width: 0; }
.sec-row b { font-size: 13px; }
.sec-row .hint { margin: 3px 0 0; }
.warn-text { color: var(--amber); }
[data-sub] { font-size: 11px; margin-top: 2px; }
[data-mt] { margin-top: 0; }
.modal .card { box-shadow: none; }
@media (min-width: 861px) {
  [data-cols="2"] { grid-template-columns: 200px 1fr; align-items: start; }
}
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field input { flex: 1; }
