:root {
  --blue: #1990ff;
  --blue-deep: #0b84f8;
  --ink: #222426;
  --muted: #8b919a;
  --line: #eeeeee;
  --head: #c3c7ce;
  --page: #f6f7f9;
  --card: #ffffff;
  --field: #e6e8ee;
  --placeholder: #c5c8ce;
  --shadow: 0 8px 28px rgba(31, 45, 61, 0.05);
  --radius: 16px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: var(--page);
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }

.is-login {
  min-height: 100vh;
  background:
    radial-gradient(90% 70% at 100% -10%, rgba(214, 232, 255, 0.95), transparent 52%),
    radial-gradient(70% 55% at -10% 110%, rgba(214, 230, 255, 0.85), transparent 50%),
    linear-gradient(180deg, #f8fbff 0%, #f3f8fd 100%);
  overflow: hidden;
}
.login-bg { position: fixed; inset: 0; pointer-events: none; }
.login-bg span {
  position: absolute;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(214, 230, 255, 0.28));
}
.login-bg .a {
  width: 58vw;
  height: 78vh;
  right: -6vw;
  top: -18vh;
  clip-path: polygon(28% 0, 100% 0, 100% 78%, 8% 100%);
}
.login-bg .b {
  width: 46vw;
  height: 42vh;
  left: -12vw;
  bottom: -8vh;
  background: linear-gradient(20deg, rgba(190, 220, 255, 0.35), rgba(255, 255, 255, 0));
  clip-path: polygon(0 30%, 70% 0, 100% 100%, 0 100%);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  position: relative;
  z-index: 1;
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(70, 110, 160, 0.08);
  padding: 52px 46px 42px;
  animation: rise 0.45s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}
.brand svg { width: 54px; height: 50px; flex: none; }
.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.15;
}
.brand p {
  margin: 5px 0 0;
  font-size: 11px;
  color: #9aa0a8;
  letter-spacing: 0;
  white-space: nowrap;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.field {
  width: 100%;
  height: 42px;
  border: 1px solid var(--field);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  outline: none;
  font-size: 14px;
}
.field::placeholder { color: var(--placeholder); }
.field:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(25, 144, 255, 0.12);
}
select.field {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.2 6 6.2 11 1.2' fill='none' stroke='%23c5c8ce' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
select.field.placeholder { color: var(--placeholder); }
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 18px;
  font-size: 13px;
  color: #8d939c;
}
.remember { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.remember input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.linkish {
  border: 0;
  background: none;
  color: var(--blue);
  padding: 0;
  font-size: 13px;
}
.linkish:hover { text-decoration: underline; }
.btn-login, .btn-primary {
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
}
.btn-login {
  display: block;
  width: 100%;
  height: 42px;
  font-size: 16px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}
.btn-login:hover, .btn-primary:hover { background: var(--blue-deep); }
.form-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #e5484d;
  font-size: 12px;
}

.shell {
  min-height: 100vh;
  display: flex;
  gap: 16px;
  padding: 16px;
}
.sider, .panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sider {
  width: 228px;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 20px;
}
.sider-title {
  font-size: 16px;
  font-weight: 600;
  padding: 16px 12px 14px;
  letter-spacing: 0.4px;
}
.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { background: #fafbfc; }
.nav-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f4f5f7;
  color: #1c1c1c;
  box-shadow: 0 5px 12px rgba(28, 39, 64, 0.08);
  flex: none;
}
.nav-item.active .nav-ico {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 16px rgba(25, 144, 255, 0.28);
}
.nav-ico svg { width: 18px; height: 18px; display: block; }

.main { flex: 1; min-width: 0; display: flex; }
.panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 12px;
}
.panel-top {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 4px;
}
.who-wrap { position: relative; }
.who {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
}
.who:hover { background: #f6f8fb; }
.avatar { width: 30px; height: 30px; display: block; }
.who-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 128px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 30, 50, 0.12);
  padding: 6px;
  z-index: 8;
}
.who-menu.show { display: block; }
.who-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
}
.who-menu button:hover { background: #f4f7fb; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 16px 6px;
}
.filters .field { width: 168px; height: 36px; }
.btn-primary {
  height: 36px;
  min-width: 68px;
  padding: 0 18px;
  font-size: 14px;
}

.table-wrap { overflow-x: auto; padding: 8px 8px 0; }
table.grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.grid th {
  color: var(--head);
  font-weight: 400;
  text-align: center;
  padding: 14px 4px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: bottom;
}
.grid td {
  text-align: center;
  padding: 18px 4px;
  border-bottom: 1px solid #f2f3f5;
  vertical-align: middle;
  color: #2c3136;
}
.grid tbody tr.clickable { cursor: pointer; }
.grid tbody tr.clickable:hover td { background: #fafbfc; }
.lab, .when, .stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.4;
}
.when span { white-space: nowrap; }
.movie {
  display: block;
  width: 6em;
  margin: 0 auto;
  line-height: 1.45;
  word-break: break-all;
}
.grid td, .grid th { word-break: keep-all; }
.oid { white-space: nowrap; letter-spacing: 0.2px; }
.muted { color: #b0b4bb; }
.sum {
  color: #b0b4bb;
  font-size: 12px;
  text-align: right;
  padding: 12px 16px 8px;
}
.empty { padding: 48px 12px !important; color: #b0b4bb; }

.slots { min-width: 1110px; width: 1110px; }
.slots td { font-size: 12px; }
.slots .link { white-space: nowrap; font-size: 12px; }
.slots thead tr:first-child th.group { border-bottom: none; padding-bottom: 0; color: #b7bcc4; }
.slots .v {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.25;
  font-size: 12px;
}
.links { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.link {
  display: block;
  border: 0;
  background: none;
  color: var(--blue);
  padding: 0;
  font-size: 13px;
  line-height: 1.75;
}
.link:hover { text-decoration: underline; }
.ops { color: var(--blue); }

.tag-off { color: #a3a8b0; }
.money-pos { color: #179b62; }
.money-neg { color: #e5484d; }
.reason { display: block; color: #a3a8b0; font-size: 12px; margin-top: 4px; }

.mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 38, 0.38);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}
.mask.align-end { place-items: stretch end; padding: 0; }
.dialog {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(20, 40, 80, 0.18);
  padding: 22px 22px 18px;
  animation: rise 0.22s ease;
}
.dialog h3 { margin: 0 48px 12px 0; font-size: 16px; }
.dialog p { margin: 0 0 8px; color: #5c6370; font-size: 14px; line-height: 1.7; }
.dialog-h { position: relative; }
.x {
  position: absolute;
  right: 0;
  top: -2px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #98a0aa;
}
.x:hover { background: #f4f6f8; }
.dialog-f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.btn-ghost {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--field);
  background: #fff;
}
.qr-wrap { display: grid; justify-items: center; gap: 8px; padding: 8px 0 4px; }
.qr-wrap svg { width: 188px; height: 188px; }
.qr-url { color: var(--blue); font-size: 13px; word-break: break-all; text-align: center; }
textarea.field { height: 88px; padding: 10px 12px; resize: vertical; }

.drawer {
  width: min(440px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 40px rgba(20, 30, 50, 0.12);
  padding: 22px 24px 32px;
  overflow: auto;
  animation: slide 0.22s ease;
}
@keyframes slide {
  from { transform: translateX(16px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}
.drawer h3 { margin: 0 0 6px; font-size: 18px; }
.drawer .subid { color: #8b919a; font-size: 12px; margin-bottom: 18px; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 12px 10px; font-size: 14px; }
.kv dt { color: #98a0aa; }
.kv dd { margin: 0; }
.status-plain { font-weight: 600; }

.account-form { padding: 12px 16px 24px; }
.account-card {
  max-width: 420px;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 22px 22px 18px;
}
.account-card h3 { margin: 0 0 8px; font-size: 16px; }
.account-hint { margin: 0 0 18px; color: #8b919a; font-size: 13px; line-height: 1.6; }
.account-label {
  display: block;
  margin: 0 0 8px;
  color: #5c6370;
  font-size: 13px;
}
.account-form .field { margin-bottom: 14px; }
.account-form .btn-primary { margin-top: 4px; min-width: 96px; }
.account-form .form-error { margin-top: 10px; min-height: 18px; }

.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1f2329;
  color: #fff;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 960px) {
  .shell { flex-direction: column; padding: 10px; }
  .sider { width: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav-item { flex: none; padding: 4px 6px; font-size: 13px; }
  .brand p { white-space: normal; }
  .login-card { padding: 40px 28px 32px; }
  .filters .field { width: calc(50% - 8px); }
  table.grid { min-width: 980px; width: 980px; }
  .slots { min-width: 1110px; width: 1110px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
