:root {
  --surface: #ffffff;
  --surface-soft: #f3fbfd;
  --water-50: #eefbfd;
  --water-100: #d8f3f5;
  --water-300: #8dd8dd;
  --water-500: #28aeb9;
  --water-650: #0b7988;
  --ink: #12333b;
  --muted: #617d84;
  --line: #d7e9ec;
  --success: #11836e;
  --warning: #bc7a25;
  --danger: #bb4250;
  --shadow: 0 12px 32px rgba(15, 80, 91, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font: 14px/1.5 "Segoe UI", "Microsoft YaHei UI", Arial, sans-serif;
  background: var(--water-50);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--water-500);
  border-radius: 8px;
  font-size: 24px;
}

h1,
h2,
p {
  margin: 0;
}

.brand h1 {
  font-size: 19px;
  font-weight: 650;
}

.brand p {
  color: var(--muted);
  font-size: 12px;
}

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 500;
}

.status span {
  width: 9px;
  height: 9px;
  background: #b8ced2;
  border-radius: 50%;
}

.status.connected span {
  background: var(--success);
}

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

.sidebar {
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.tabs {
  display: grid;
  gap: 4px;
}

.tab {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 0 17px;
  border: 0;
  border-radius: 7px;
  color: #42646c;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.tab svg {
  width: 19px;
  height: 19px;
  color: var(--water-650);
}

.tab.active {
  color: var(--water-650);
  font-weight: 600;
  background: var(--water-100);
}

.account-mini {
  margin: 32px 8px 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: auto auto 10px;
  border-radius: 50%;
  color: var(--water-650);
  font-weight: 700;
  background: var(--water-100);
}

.account-mini .name {
  font-weight: 600;
}

.account-mini .id {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  padding: 35px min(5vw, 54px);
  max-width: 1180px;
  width: 100%;
}

.pane {
  display: none;
}

.pane.active {
  display: block;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 24px;
}

.section-title h2 {
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 650;
}

.section-title p,
.hint {
  color: var(--muted);
}

.columns {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(300px, 1fr);
  gap: 22px;
}

.panel {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-form label,
.score-form label {
  display: grid;
  gap: 8px;
  color: #39565d;
  font-weight: 500;
}

textarea,
input,
select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfeff;
  border: 1px solid #cadfe3;
  border-radius: 6px;
  outline: none;
}

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

textarea:focus,
input:focus,
select:focus {
  border-color: var(--water-500);
  box-shadow: 0 0 0 3px rgba(40, 174, 185, 0.14);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 15px;
}

button.primary,
button.secondary {
  height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  color: #ffffff;
  border: 1px solid var(--water-500);
  background: var(--water-500);
}

button.primary svg,
button.secondary svg {
  width: 17px;
  height: 17px;
}

button.secondary {
  color: var(--water-650);
  border: 1px solid #bcdfe3;
  background: var(--surface);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.profile {
  min-height: 310px;
}

.empty-state {
  height: 100%;
  min-height: 250px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  gap: 8px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.profile-card {
  display: grid;
  gap: 22px;
}

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

.profile-head .avatar {
  width: 62px;
  height: 62px;
  margin: 0;
  font-size: 19px;
}

.profile-head strong {
  display: block;
  font-size: 19px;
}

.profile-head span {
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metrics div {
  padding: 13px;
  background: var(--surface-soft);
  border-radius: 6px;
}

.metrics small {
  color: var(--muted);
  display: block;
}

.metrics strong {
  font-size: 18px;
}

.quota {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
}

.quota strong {
  font-size: 26px;
  color: var(--water-650);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 18px;
}

.submit-score {
  margin-top: 24px;
}

.data-panel {
  display: grid;
  gap: 22px;
}

.data-controls {
  display: flex;
  align-items: end;
  gap: 14px;
}

.data-controls label {
  display: grid;
  gap: 8px;
  width: min(270px, 100%);
  color: #39565d;
  font-weight: 500;
}

.data-panel pre {
  min-height: 390px;
  max-height: 58vh;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #17414b;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 13px/1.6 Consolas, "Courier New", monospace;
}

.icon-action {
  width: 43px;
  padding: 0;
  font-size: 21px;
}

.table-panel {
  padding: 0;
  overflow-x: auto;
}

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

th,
td {
  height: 50px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  height: 47px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.placeholder td {
  color: var(--muted);
  text-align: center;
  height: 120px;
}

.tag {
  padding: 4px 8px;
  color: var(--success);
  background: #e6f6f2;
  border-radius: 4px;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 22px;
  max-width: min(370px, calc(100vw - 48px));
  padding: 12px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 16px;
  }

  .workspace {
    display: block;
  }

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

  .tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tab {
    justify-content: center;
    gap: 8px;
    padding: 0 6px;
    font-size: 13px;
  }

  .account-mini {
    display: none;
  }

  .content {
    padding: 24px 16px;
  }

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

  .data-controls {
    display: grid;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: auto;
    min-height: 72px;
    padding: 12px 16px;
    flex-wrap: wrap;
    row-gap: 9px;
  }

  .status {
    width: 100%;
  }

  .workspace {
    min-height: calc(100vh - 101px);
  }

  .panel {
    padding: 19px;
  }

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