:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: rgba(20, 20, 20, 0.84);
  --panel-2: rgba(32, 32, 32, 0.82);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 126, 24, 0.38);
  --text: #f7f5f1;
  --muted: #aaa39a;
  --soft: #d6d0c8;
  --orange: #ff7a18;
  --orange-2: #ffad45;
  --danger: #ff4f42;
  --success: #46d18c;
  --bronze: #c7864c;
  --silver: #d9dde4;
  --gold: #f9cf5b;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  font-family:
    "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI",
    system-ui, sans-serif;
}

body[data-theme="light"] {
  --bg: #f7f5f1;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-2: rgba(246, 242, 236, 0.9);
  --line: rgba(20, 20, 20, 0.12);
  --line-strong: rgba(230, 103, 18, 0.38);
  --text: #17130f;
  --muted: #6f665c;
  --soft: #312b25;
  --shadow: 0 18px 48px rgba(34, 28, 20, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 122, 24, 0.22), transparent 32rem),
    linear-gradient(135deg, #050505 0%, #12100e 52%, #090909 100%);
  color: var(--text);
  letter-spacing: 0;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(255, 122, 24, 0.18), transparent 32rem),
    linear-gradient(135deg, #fffaf2 0%, #f5f0e9 54%, #ffffff 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 450px);
  align-items: stretch;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 72px);
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 7, 7, 0.08), rgba(7, 7, 7, 0.74)),
    url("./assets/login-bg.png") center / cover no-repeat;
  opacity: 0.92;
  transform: scale(1.02);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(0deg, rgba(7, 7, 7, 0.95), transparent);
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--orange-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-copy h1 {
  margin: 0;
  font-size: clamp(24px, 3.7vw, 56px);
  line-height: 1.08;
  white-space: nowrap;
}

.login-copy p {
  width: min(620px, 100%);
  margin: 22px 0 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.8;
}

.login-panel {
  display: flex;
  align-items: center;
  padding: 28px;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(18px);
}

body[data-theme="light"] .login-panel,
body[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.84);
}

body[data-theme="light"] .login-visual::before {
  background:
    linear-gradient(90deg, rgba(255, 250, 242, 0.42), rgba(255, 255, 255, 0.88)),
    url("./assets/og-logo.jpg") center / min(80vw, 1100px) auto no-repeat;
}

body[data-theme="light"] .login-visual::after {
  background: linear-gradient(0deg, rgba(255, 250, 242, 0.96), transparent);
}

.login-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 26px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.logo-mark {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: #fff url("./assets/og-logo.jpg") center / contain no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.brand-line strong {
  display: block;
  font-size: 18px;
}

.brand-line span {
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

select option {
  background: #151515;
}

.primary,
.ghost,
.danger,
.icon-button {
  min-height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.primary {
  color: #101010;
  font-weight: 900;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  padding: 0 14px;
}

.danger {
  color: #fff;
  background: rgba(255, 79, 66, 0.16);
  border: 1px solid rgba(255, 79, 66, 0.42);
  padding: 0 12px;
}

.icon-button {
  width: 40px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.primary:hover,
.ghost:hover,
.danger:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.error-text {
  color: var(--danger);
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 13px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: rgba(6, 6, 6, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.user-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-profile {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.sidebar-profile .avatar {
  width: 74px;
  height: 74px;
  font-size: 20px;
}

.profile-lines {
  display: grid;
  gap: 3px;
  justify-items: center;
  margin-top: 5px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #111;
  background: linear-gradient(135deg, #fff, #f5b05a);
  font-weight: 900;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity {
  display: block;
  color: var(--orange-2);
  font-size: 21px;
  font-weight: 950;
  line-height: 1.1;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}

.nav button.active,
.nav button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 122, 24, 0.12);
}

.nav-svg {
  width: 22px;
  height: 22px;
  color: var(--orange-2);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

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

.sync-error {
  max-width: 260px;
  color: #fecaca;
  font-size: 12px;
  line-height: 1.35;
}

.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sync-row .primary {
  padding: 0 16px;
}

.fivee-panel {
  margin-top: 18px;
}

.swing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.swing-badge.hot {
  color: #18120a;
  background: linear-gradient(135deg, #ffd37a, #ff8f3d);
  border-color: rgba(255, 211, 122, 0.75);
}

.swing-badge.good {
  color: #101510;
  background: linear-gradient(135deg, #8ef6b2, #3ddc84);
  border-color: rgba(142, 246, 178, 0.75);
}

.swing-badge.solid {
  color: #101426;
  background: linear-gradient(135deg, #aeb8ff, #7c8cff);
  border-color: rgba(174, 184, 255, 0.75);
}

.swing-badge.npc {
  color: #fff7ed;
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.42);
}

.swing-badge.bad,
.swing-badge.awful {
  color: #fff1f2;
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(244, 63, 94, 0.46);
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-top: 5px;
  padding: 0 7px;
  border-radius: 999px;
  color: #111827;
  background: #facc15;
  font-size: 11px;
  font-weight: 900;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.toggle-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.toggle-icon {
  width: 17px;
  height: 17px;
  color: var(--orange-2);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toggle-track {
  position: relative;
  width: 62px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #111;
  background: var(--orange-2);
  font-size: 9px;
  font-weight: 950;
  transition: transform 0.18s ease;
}

.toggle-control.active .toggle-track {
  background: rgba(255, 122, 24, 0.18);
  border-color: var(--line-strong);
}

.toggle-control.active .toggle-knob {
  transform: translateX(29px);
}

.export-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.sidebar-medals {
  margin-top: 8px;
}

.sidebar-medals .medal,
.member-card .medal {
  padding: 5px 8px;
  font-size: 11px;
}

.sidebar-medals .medal-empty,
.member-card .medal-empty {
  font-size: 11px;
  min-height: 24px;
  padding: 4px 8px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 38px);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 12px;
}

.chip b {
  color: var(--orange-2);
}

.section {
  display: grid;
  gap: 16px;
}

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

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.22);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

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

.panel-body {
  padding: 16px;
}

.stat-value {
  display: block;
  margin-top: 8px;
  color: var(--orange-2);
  font-size: 34px;
  font-weight: 950;
}

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

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

.tabs button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  cursor: pointer;
}

.tabs button.active {
  color: #111;
  background: var(--orange-2);
  border-color: var(--orange-2);
  font-weight: 900;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rank-row:hover {
  border-color: var(--line-strong);
  background: rgba(255, 122, 24, 0.09);
}

.rank-top {
  position: relative;
  overflow: hidden;
  border-color: var(--line-strong);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.rank-top::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
}

.rank-top-1::before {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.rank-top-2::before {
  background: linear-gradient(90deg, var(--silver), transparent);
}

.rank-top-3::before {
  background: linear-gradient(90deg, var(--bronze), transparent);
}

.rank-top .rank-no {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #111;
}

.rank-top-1 .rank-no {
  background: var(--gold);
}

.rank-top-2 .rank-no {
  background: var(--silver);
}

.rank-top-3 .rank-no {
  background: var(--bronze);
}

.rank-no {
  color: var(--orange-2);
  font-weight: 950;
}

.rank-main {
  min-width: 0;
}

.rank-name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-weight: 850;
}

.rank-name b {
  color: var(--orange-2);
  font-size: 16px;
}

.bar {
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
}

.rank-value {
  color: var(--text);
  font-weight: 950;
}

.table-wrap {
  overflow: auto;
}

.table-input {
  min-width: 86px;
  padding: 8px 9px;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: var(--orange-2);
  background: rgba(255, 122, 24, 0.06);
  font-weight: 900;
}

td {
  color: var(--soft);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.member-card {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-height: 178px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.member-card:hover,
.member-card.active {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 122, 24, 0.11);
}

.mini-stat {
  color: var(--orange-2);
  font-size: 12px;
  font-weight: 800;
}

.member-home .panel-head {
  align-items: flex-start;
}

.home-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-title h3 {
  margin: 0 0 4px;
}

.subsection-title {
  margin: 18px 0 10px;
  color: var(--orange-2);
  font-weight: 900;
}

.member-stat-row {
  margin-top: 14px;
}

.radar-panel {
  margin-top: 16px;
  display: grid;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.radar-chart {
  width: min(360px, 100%);
  height: auto;
}

.radar-grid {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.radar-axis {
  stroke: rgba(255, 122, 24, 0.24);
  stroke-width: 1;
}

.radar-area {
  fill: rgba(255, 122, 24, 0.28);
  stroke: var(--orange-2);
  stroke-width: 2.5;
}

.radar-dot {
  fill: var(--orange-2);
  stroke: var(--bg);
  stroke-width: 2;
}

.radar-label {
  fill: var(--soft);
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.user-card.wide {
  width: 100%;
  border-bottom: 0;
  padding-bottom: 0;
}

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

.medal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 11px;
  border-radius: 999px;
  color: #111;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.medal-delete {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: inherit;
  background: rgba(0, 0, 0, 0.14);
  cursor: pointer;
}

.medal-empty {
  opacity: 0.78;
}

.medal.gold {
  background: linear-gradient(135deg, #fff1a6, var(--gold));
}

.medal.silver {
  background: linear-gradient(135deg, #ffffff, var(--silver));
}

.medal.bronze {
  background: linear-gradient(135deg, #f0ba80, var(--bronze));
}

.announcement {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.announcement:last-child {
  border-bottom: 0;
}

.announcement h4 {
  margin: 0 0 7px;
}

.announcement p {
  margin: 0;
  color: var(--soft);
  line-height: 1.7;
}

.date-line {
  color: var(--muted);
  font-size: 12px;
}

.mobile-nav-toggle {
  display: none;
}

.hidden {
  display: none !important;
}

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

  .login-visual {
    min-height: 38vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .sidebar {
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    width: min(285px, 84vw);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .content {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .login-panel,
  .login-visual {
    padding: 18px;
  }

  .login-copy h1 {
    font-size: clamp(21px, 6.8vw, 32px);
  }

  .login-copy p {
    font-size: 14px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .rank-row {
    grid-template-columns: 32px 1fr;
  }

  .rank-value {
    grid-column: 2;
    justify-self: start;
  }
}
