:root {
  --brand-deep: #2a2f32;
  --brand-dark: #082850;
  --brand-accent: #1677ff;
  --brand-accent-soft: rgba(22, 119, 255, 0.12);
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --card-border: rgba(15, 16, 17, 0.08);
  --text-main: #0f1011;
  --text-muted: rgba(0, 0, 0, 0.5);
  --danger: #d14343;
  --ok: #0f8f5f;
  --sidebar-width: 220px;
  --header-height: 52px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: 14px;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.page-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 32px;
  padding: 48px;
  background:
    radial-gradient(circle at top right, rgba(22, 119, 255, 0.12), transparent 45%),
    var(--bg);
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(15, 16, 17, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-accent);
  box-shadow: 0 0 10px rgba(22, 119, 255, 0.6);
}

.brand-text {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login-title {
  margin: 0 0 10px;
  font-size: 28px;
}

.login-subtitle {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-field {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field input {
  border: 1px solid #d3d7de;
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  background: #fff;
}

.btn-primary {
  border: 0;
  background: var(--brand-accent);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(0.95);
}

.btn-secondary {
  border: 1px solid #cfd6df;
  background: #fff;
  color: #263140;
  border-radius: 10px;
  padding: 9px 14px;
}

.btn-danger {
  border: 0;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
}

.login-actions {
  margin-top: 16px;
}

.code-wrap {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(8, 40, 80, 0.06);
  border: 1px solid rgba(8, 40, 80, 0.12);
  text-align: center;
}

.code-value {
  font-size: 34px;
  letter-spacing: 0.32em;
  margin: 4px 0;
  font-weight: 700;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

.status-text {
  margin-top: 8px;
  font-size: 14px;
}

.status-ok {
  color: var(--ok);
}

.status-error {
  color: var(--danger);
}

.login-tips {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
}

.side-panel {
  position: relative;
  border-radius: 24px;
  padding: 48px;
  background: linear-gradient(140deg, #0c2f63 0%, #10294f 40%, #2a2f32 100%);
  color: #f5f7fa;
  overflow: hidden;
}

.side-panel h2 {
  margin: 0 0 12px;
  font-size: 30px;
}

.side-panel p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 420px;
  line-height: 1.7;
}

.side-glow {
  position: absolute;
  top: -120px;
  right: -120px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(22, 119, 255, 0.4), transparent 70%);
}

.side-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.side-tags span {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: var(--brand-dark);
  color: #f5f7fa;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left {
  width: var(--sidebar-width);
  background: var(--brand-deep);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.topbar-nav {
  flex: 1;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.topbar-nav span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.topbar-right select,
.topbar-right button {
  height: 34px;
  border-radius: 8px;
}

.topbar-right select {
  min-width: 210px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 10px;
}

.topbar-right select option {
  color: #111;
}

.topbar-user {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.topbar-logout {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 0 12px;
}

.body {
  display: flex;
  flex: 1;
}

.sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid var(--card-border);
  background: var(--card-bg);
  padding: 12px 8px;
}

.group-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(8, 40, 80, 0.12);
  background: rgba(8, 40, 80, 0.06);
  margin-bottom: 10px;
}

.group-card .label {
  color: var(--text-muted);
  font-size: 12px;
}

.group-card .value {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  color: #273244;
  font-size: 14px;
}

.menu-item.active {
  background: #f2f2f2;
  color: #000;
  font-weight: 600;
}

.main {
  flex: 1;
  padding: 22px 26px 40px;
}

.page-title {
  margin: 0;
  font-size: 24px;
}

.page-desc {
  margin: 8px 0 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(15, 16, 17, 0.04);
  margin-bottom: 14px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field textarea,
.field select {
  border: 1px solid #d3d7de;
  border-radius: 9px;
  padding: 9px 10px;
  outline: none;
}

.field textarea {
  min-height: 88px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #253142;
  padding: 7px 0;
}

.checkbox-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid #eceff3;
  padding: 10px 8px;
  vertical-align: top;
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--text-muted);
  font-weight: 600;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dash-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #e6ebf1;
  background: #fff;
}

.dash-card .title {
  color: var(--text-muted);
  font-size: 12px;
}

.dash-card .value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
}

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

.tag {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(22, 119, 255, 0.08);
}

.empty {
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
  border: 1px dashed #d8dee6;
  border-radius: 10px;
  background: #fafbfc;
}

@media (max-width: 1200px) {
  .dash-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .page-login {
    grid-template-columns: 1fr;
    padding: 30px 18px;
  }

  .side-panel {
    padding: 30px;
  }

  .topbar-left {
    width: auto;
    min-width: 160px;
  }

  .topbar-nav {
    display: none;
  }

  .topbar-right select {
    min-width: 120px;
    max-width: 160px;
  }

  .body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--card-border);
  }

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

  table {
    min-width: 520px;
  }
}
