:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #f3f6fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f3f6fb;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid #8db5ff;
  outline-offset: 2px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 56px minmax(560px, 1fr) auto;
  background: #eef3f8;
}

.login-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 56px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(218, 226, 238, 0.8);
  box-shadow: 0 4px 18px rgba(23, 35, 61, 0.06);
  z-index: 2;
}

.login-brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #17233d;
}

.login-brand-main strong {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.login-brand-main span {
  padding-left: 10px;
  border-left: 1px solid #d8e1ec;
  color: #5c6a83;
  font-size: 14px;
  font-weight: 700;
}

.login-brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 7px;
  background: #ff9100 url("/assets/icon.png?v=beta_V1.0.3-gm3") center / cover no-repeat;
}

.login-hero {
  position: relative;
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: center;
  justify-content: end;
  padding: 56px max(80px, calc((100vw - 1320px) / 2));
  overflow: hidden;
  background: #101a52;
}

.login-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 10, 40, 0.03) 0%, rgba(2, 10, 40, 0.02) 48%, rgba(2, 10, 40, 0.16) 100%);
  pointer-events: none;
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(0deg, rgba(9, 18, 48, 0.34), transparent);
  pointer-events: none;
}

.message,
.subtle,
small {
  color: #64748b;
}

.message {
  margin: 0;
  line-height: 1.5;
}

.message:empty {
  display: none;
}

.login-panel,
.panel,
.overview-panel {
  background: #fff;
  border: 1px solid #dce5f1;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.login-panel {
  position: relative;
  z-index: 1;
  grid-column: 2;
  display: grid;
  gap: 16px;
  width: 430px;
  padding: 32px 30px 22px;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 64px rgba(4, 14, 40, 0.22);
  backdrop-filter: blur(10px);
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.login-card-head .login-brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 8px;
}

.login-card-head h1 {
  margin: 0;
  color: #17233d;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.login-card-head h1 span {
  margin-left: 6px;
  color: #3f4a63;
  font-size: 15px;
  font-weight: 700;
}

.login-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  min-height: 22px;
  padding-top: 4px;
  color: #6b7894;
  font-size: 13px;
}

.login-actions::before {
  content: none;
}

.login-actions button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #66748e;
  font: inherit;
  font-weight: 700;
}

.forgot-wrap {
  position: relative;
  display: inline-flex;
}

.forgot-popover {
  position: absolute;
  right: 0;
  bottom: 28px;
  width: 218px;
  padding: 10px 12px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #fff;
  color: #53627b;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 14px 36px rgba(23, 35, 61, 0.16);
}

.forgot-popover::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid #dbe7f3;
  border-bottom: 1px solid #dbe7f3;
  background: #fff;
  transform: rotate(45deg);
}

.login-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 18px 24px;
  color: #8a96aa;
  font-size: 13px;
  background: #eef3f8;
}

.login-footer a {
  color: #66748e;
  text-decoration: none;
}

.login-footer a:hover,
.login-actions button:hover {
  color: #0789c8;
}

label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 14px;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd8e8;
  border-radius: 5px;
  padding: 8px 12px;
  color: #172033;
  background: #fff;
  outline: none;
}

input:focus,
select:focus {
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

.primary,
.outline,
.danger,
.link-action,
.select-trigger {
  border-radius: 5px;
  border: 1px solid transparent;
  min-height: 34px;
}

.primary {
  color: #fff;
  background: linear-gradient(180deg, #2f74ff, #1f5eee);
  border-color: #2465f2;
  padding: 0 18px;
}

.primary.wide {
  width: 100%;
  min-height: 38px;
}

.outline {
  color: #1f5eee;
  background: #fff;
  border-color: #bfd0ee;
  padding: 0 14px;
}

.danger {
  color: #e11d48;
  background: #fff;
  border-color: #f7b6c4;
  padding: 0 14px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  background: linear-gradient(160deg, #071a31 0%, #08284d 58%, #03101f 100%);
  color: #dbeafe;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(160deg, #1f75ff, #4da3ff);
}

.side-brand strong {
  display: block;
  color: #fff;
  font-size: 18px;
}

.side-brand span {
  display: block;
  margin-top: 3px;
  color: #b7c7db;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 10px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: #c7d7eb;
  background: transparent;
  text-align: left;
  font-size: 16px;
}

.nav img {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: contain;
  filter: invert(91%) sepia(17%) saturate(427%) hue-rotate(178deg) brightness(96%) contrast(91%);
}

.nav.active {
  color: #fff;
  background: linear-gradient(180deg, #2f75ff, #1e63f4);
  box-shadow: 0 12px 24px rgba(31, 99, 244, 0.25);
}

.nav.active img {
  filter: brightness(0) invert(1);
}

.collapse {
  margin: auto auto 6px;
  border: 0;
  color: #dbeafe;
  background: transparent;
  font-size: 22px;
}

.content {
  min-width: 0;
  padding: 0 22px 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 20px;
  background: rgba(243, 246, 251, 0.92);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search {
  position: relative;
  width: 260px;
}

.search span {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: #475569;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: #2f75ff;
  font-weight: 700;
}

.profile strong,
.profile small {
  display: block;
}

.logout-chip {
  min-width: 56px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid #bfd0ee;
  border-radius: 5px;
  color: #1f5eee;
  background: #eef5ff;
  font-weight: 700;
}

.logout-chip:hover {
  color: #fff;
  background: #2f75ff;
  border-color: #2f75ff;
}

.view {
  display: grid;
  gap: 14px;
}

.overview-panel {
  display: grid;
  grid-template-columns: 1.15fr 2fr;
  gap: 16px;
  padding: 18px 20px;
}

.overview-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.overview-panel p {
  margin: 6px 0;
  color: #5e6d82;
  line-height: 1.6;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.tool-grid.compact {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tool-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 98px;
  padding: 14px 70px 14px 14px;
  border: 1px solid #dce5f1;
  border-radius: 8px;
  color: inherit;
  background: #fff;
  text-decoration: none;
}

.tool-card img {
  width: 44px;
  height: 44px;
}

.tool-card strong,
.tool-card span,
.tool-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-card strong,
.tool-card span {
  line-height: 1.35;
  white-space: normal;
}

.tool-card span {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.tool-card em {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #16a34a;
  background: #dcfce7;
  font-size: 12px;
  font-style: normal;
}

.more-tool {
  border-style: dashed;
  color: #475569;
}

.plus {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px dashed #94a3b8;
  border-radius: 50%;
  font-size: 26px;
}

.stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #e8eef7;
  padding-top: 16px;
}

.stats div {
  display: grid;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid #e8eef7;
}

.stats div:last-child {
  border-right: 0;
}

.stats span {
  color: #64748b;
  font-size: 13px;
}

.stats strong {
  font-size: 22px;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
}

.panel {
  padding: 18px 20px;
}

.panel-title {
  margin-bottom: 14px;
  color: #172033;
  font-weight: 700;
}

.create-panel {
  display: grid;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.permission-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.permission-row.vertical {
  grid-template-columns: 1fr;
}

.permission-row strong,
.permission-row small {
  display: block;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.check-list label,
.inline-check {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.check-list input,
.inline-check input,
.switch-line input,
.status-radios input,
.row-select {
  width: auto;
  min-height: auto;
}

.advanced-line {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-line input {
  accent-color: #2f75ff;
}

.multi-select {
  position: relative;
}

.select-trigger {
  width: 100%;
  color: #475569;
  background: #fff;
  border-color: #cbd8e8;
  text-align: left;
  padding: 0 12px;
}

.select-menu {
  display: none;
  position: absolute;
  z-index: 8;
  top: 40px;
  left: 0;
  right: 0;
  padding: 10px;
  border: 1px solid #cbd8e8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
}

.multi-select.open .select-menu,
.select-menu.static {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: static;
  box-shadow: none;
}

.select-menu label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #cbd8e8;
  border-radius: 5px;
  background: #f8fbff;
}

.select-menu input {
  width: auto;
  min-height: auto;
}

.action-button {
  justify-self: start;
  min-width: 132px;
}

.action-button.short {
  min-width: 132px;
}

.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.team-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #1551c6;
  background: #eaf1ff;
}

.team-list em {
  color: #94a3b8;
  font-style: normal;
}

.table-panel {
  padding: 0;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid #e8eef7;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-actions select {
  width: 160px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  height: 46px;
  padding: 8px 16px;
  border-bottom: 1px solid #e8eef7;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #475569;
  background: #f8fafc;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 2px 4px 2px 0;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
}

.badge.bili {
  color: #cf376f;
  background: #ffe3ee;
}

.badge.risk {
  color: #047857;
  background: #dffbef;
}

.badge.ltv {
  color: #6d28d9;
  background: #ede4ff;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 54px;
}

.status::before {
  content: "";
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: #94a3b8;
}

.status.on {
  color: #16a34a;
}

.status.on::before {
  background: #2dbd76;
}

.status.off {
  color: #64748b;
}

.link-action {
  color: #1f5eee;
  background: transparent;
  border: 0;
  padding: 0;
}

.muted {
  color: #94a3b8;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 10;
  width: min(430px, 100vw);
  background: #fff;
  border-left: 1px solid #dce5f1;
  box-shadow: -16px 0 42px rgba(15, 23, 42, 0.14);
}

.drawer-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8eef7;
}

.drawer-head h2 {
  margin: 0;
  font-size: 18px;
}

.icon-close {
  width: 32px;
  height: 32px;
  border: 0;
  color: #64748b;
  background: transparent;
  font-size: 24px;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-section span {
  color: #475569;
  font-size: 14px;
}

.status-radios {
  display: flex;
  align-items: center;
  gap: 18px;
}

.status-radios label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 54px;
}

.log-panel {
  display: grid;
  gap: 12px;
}

.log-list {
  display: grid;
  gap: 10px;
}

.log-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e8eef7;
  border-radius: 6px;
  background: #fbfdff;
}

.log-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.log-item span,
.log-item p {
  margin: 0;
  color: #64748b;
}

.log-item code {
  overflow: hidden;
  color: #475569;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.empty {
  padding: 22px;
  color: #94a3b8;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 6px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .overview-panel,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    justify-items: center;
    padding: 32px 18px;
  }

  .login-panel {
    grid-column: 1;
    width: min(430px, 100%);
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .permission-row,
  .advanced-line {
    grid-template-columns: 1fr;
  }
}
