:root {
  color-scheme: dark;
  --bg: #0e141b;
  --panel: #17212c;
  --line: #2b3b49;
  --text: #ecf1f4;
  --muted: #97a9b8;
  --gold: #e8c87f;
  --red: #bd523e;
  --green: #8fd2ad;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 18px;
  background: #22303d;
  color: var(--text);
  font-weight: 600;
}
button:hover:not(:disabled) {
  border-color: var(--gold);
  background: #2c3a47;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary,
.primary {
  background: var(--gold);
  color: #18202a;
  border-color: var(--gold);
}
button.danger {
  background: var(--red);
  border-color: var(--red);
}
button.small {
  padding: 6px 12px;
  font-size: 0.875rem;
}
button.ghost {
  background: transparent;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #3b4c5a;
  border-radius: 6px;
  background: #101923;
  color: var(--text);
  padding: 11px 13px;
  min-height: 46px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #97a9b8 50%),
    linear-gradient(135deg, #97a9b8 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 21px,
    calc(100% - 14px) 21px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
input[type='checkbox'] {
  display: inline;
  width: 18px;
  min-height: 18px;
  accent-color: var(--gold);
}
label {
  display: block;
  color: #b7c4ce;
  font-size: 0.875rem;
  margin-bottom: 7px;
}
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
}
h2 {
  font-size: 1.4rem;
  margin-bottom: 18px;
}
h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
p {
  color: var(--muted);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  padding: 32px 20px;
  border-right: 1px solid var(--line);
  background: #111a23;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 1.22rem;
  font-weight: 800;
  margin-bottom: 48px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  background: var(--gold);
  color: #14202a;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 1.3rem;
  transform: rotate(-5deg);
}
.brand small {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
}
.nav {
  display: grid;
  gap: 7px;
}
.nav a {
  padding: 12px 14px;
  border-radius: 6px;
  color: var(--muted);
}
.nav a.active {
  color: var(--gold);
  background: #28302e;
  border-left: 2px solid var(--gold);
}
.nav a:hover {
  color: white;
}
.sidebar-foot {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 24px 12px;
}
.layout {
  margin-left: 224px;
}
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--line);
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #101820;
}
.topbar span {
  font-size: 0.875rem;
  color: var(--muted);
}
main {
  max-width: 1360px;
  padding: 38px 42px 80px;
  margin: auto;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  font-weight: 700;
}
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(115deg, #1c2b37 0%, #18202b 60%, #302927 100%);
  padding: 40px;
  margin-bottom: 28px;
}
.hero:after {
  content: '猫';
  position: absolute;
  right: 28px;
  top: -48px;
  color: #e8c87f09;
  font-weight: 900;
  font-size: 280px;
  transform: rotate(-15deg);
  pointer-events: none;
}
.hero p {
  max-width: 650px;
  margin-bottom: 0;
}
.hero .actions {
  margin-top: 24px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  min-width: 0;
}
.card.clickable:hover {
  border-color: #69745f;
}
.stat {
  font-size: 2.3rem;
  line-height: 1.2;
  font-weight: 750;
  color: var(--gold);
}
.muted {
  color: var(--muted);
}
.gold {
  color: var(--gold);
}
.small-text {
  font-size: 0.875rem;
}
.pill {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid #44533f;
  border-radius: 20px;
  background: #27342d;
  color: var(--gold);
  font-size: 0.75rem;
  white-space: nowrap;
}
.pill.neutral {
  background: #24303b;
  border-color: #394957;
  color: #bbcad6;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wrap {
  flex-wrap: wrap;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.section {
  margin-top: 30px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 30px 0 16px;
}
.section-head h2 {
  margin: 0;
}
.empty {
  border: 1px dashed #344653;
  border-radius: 10px;
  padding: 42px 24px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--text);
}
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child {
  border-bottom: 0;
}
.rank-card { display: flex; align-items: center; gap: 24px; }
.rank-medal { width: 100px; height: 110px; flex-shrink: 0; }
.rank-card h3 { margin: 8px 0; }
.rank-card p { margin: 6px 0; }
.profile-header { display: flex; align-items: center; gap: 36px; }
.profile-identity { flex: 0 1 240px; }
.profile-details { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.profile-details .meta { flex-wrap: wrap; }
.profile-details p { margin: 12px 0 0; }
.profile-card-empty { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.profile-comment { padding: 22px 0; border-bottom: 1px solid var(--line); }
.profile-comment:last-child { border-bottom: 0; }
.comment-content { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.comments-section textarea { width: 100%; min-height: 110px; resize: vertical; }
.comments-section .person { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .profile-header { flex-direction: column; align-items: stretch; gap: 18px; }
  .profile-identity { flex-basis: auto; }
  .profile-details { flex: auto; }
  .rank-card { gap: 14px; }
  .rank-medal { width: 72px; height: 80px; }
}
.public-match:hover { background: #1e2d37; border-radius: 8px; }
.public-match .actions { justify-content: flex-end; }
.match-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.match-pagination select { width: auto; min-width: 100px; }
.match-score { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 28px 0; }
.match-score strong { font-size: 2.3rem; color: var(--gold); }
.match-summary .meta { justify-content: center; flex-wrap: wrap; }
.match-team.radiant { border-top: 3px solid #77b69b; }
.match-team.dire { border-top: 3px solid #d67e70; }
.match-table-wrap { overflow-x: auto; max-width: 100%; margin-top: 16px; }
.match-table { border-collapse: collapse; width: 100%; white-space: nowrap; text-align: right; }
.match-table caption { text-align: left; padding-bottom: 12px; }
.match-table th, .match-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); }
.match-table thead th { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.match-table th:first-child { text-align: left; min-width: 160px; max-width: 240px; white-space: normal; overflow-wrap: anywhere; }
.match-table tbody th { font-weight: 500; }
.match-table tbody th .small-text { margin-top: 5px; }
.match-table .focused-player { background: #293735; }
.match-table-wrap:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.avatar.large {
  width: 88px;
  height: 88px;
  font-size: 2rem;
}
.image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}
.image-preview.avatar {
  width: 160px;
  height: 160px;
}
.image-preview img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
}
.image-preview.avatar img { width: 100%; height: 100%; object-fit: cover; }
.image-editor { min-width: 0; }
.image-editor input[type="file"] { max-width: 100%; }
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #2c3c48;
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}
.person {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}
.person strong {
  display: block;
  overflow-wrap: anywhere;
}
.person small {
  color: var(--muted);
}
.field {
  margin-bottom: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.wide {
  grid-column: 1/-1;
}
.form-card {
  max-width: 780px;
}
.notice {
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  background: #262b27;
  border-radius: 4px;
  color: #e0d5b7;
  margin: 20px 0;
}
.notice.error {
  border-color: #ed8c79;
  background: #362622;
  color: #f1b7a9;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
}
.toolbar input {
  max-width: 520px;
}
.auth-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: 65vh;
}
.auth-art {
  padding: 24px 10px;
}
.auth-art h1 {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
}
.auth-art .rules {
  border-top: 1px solid var(--line);
  margin-top: 35px;
  padding-top: 25px;
  display: flex;
  gap: 28px;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 34px;
  border-radius: 12px;
  max-width: 480px;
}
.auth-card button {
  width: 100%;
  margin-top: 10px;
}
.auth-card a {
  color: var(--gold);
}
.auth-card p {
  font-size: 0.875rem;
}
.team {
  padding: 20px;
  border-top: 3px solid var(--gold);
}
.team ul {
  list-style: none;
  padding: 0;
  margin-bottom: 0;
}
.team li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
}
.team li:last-child {
  border: 0;
}
.team li span:last-child {
  color: var(--muted);
  white-space: nowrap;
}
.score {
  font-size: 1.8rem;
  color: var(--gold);
  font-weight: 800;
}
.match {
  margin-top: 16px;
}
.match form {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.searchable[hidden] {
  display: none;
}
.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.back {
  display: inline-block;
  color: var(--muted);
  margin-bottom: 22px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.loading {
  padding: 80px;
  color: var(--muted);
  text-align: center;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #e8c87f;
  color: #14202a;
  padding: 13px 22px;
  border-radius: 8px;
  z-index: 100;
  box-shadow: 0 8px 30px #0007;
  display: none;
  max-width: 90vw;
}
#toast.show {
  display: block;
}
.code {
  font-family: monospace;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.footer {
  margin-top: 50px;
  color: #718392;
  font-size: 0.8rem;
}
.btn-link {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.btn-link.primary {
  border-color: var(--gold);
}
.option-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.round-title {
  color: var(--gold);
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  margin-top: 28px;
}
.search-count {
  font-size: 0.875rem;
  color: var(--muted);
}
@media (max-width: 1050px) {
  .sidebar {
    width: 190px;
  }
  .layout {
    margin-left: 190px;
  }
  main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-layout {
    gap: 24px;
  }
  .auth-card {
    padding: 24px;
  }
}
@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0 0 16px;
  }
  .sidebar-foot {
    display: none;
  }
  .nav {
    display: flex;
    overflow: auto;
    gap: 4px;
  }
  .nav a {
    padding: 8px 12px;
    white-space: nowrap;
  }
  .layout {
    margin: 0;
  }
  .topbar {
    height: 58px;
    padding: 0 18px;
  }
  .topbar > span {
    max-width: 50%;
    font-size: 0.75rem;
  }
  main {
    padding: 24px 16px 60px;
  }
  .hero {
    padding: 28px 24px;
  }
  .grid,
  .grid.two,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .auth-layout {
    display: block;
    min-height: 0;
  }
  .auth-art {
    padding: 10px 0 24px;
  }
  .auth-art h1 {
    font-size: 2.5rem;
  }
  .auth-art .rules {
    display: none;
  }
  .auth-card {
    max-width: none;
  }
  .card {
    padding: 20px;
  }
  .option-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .row {
    gap: 12px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .list-row {
    gap: 10px;
  }
  .meta {
    gap: 6px;
  }
}
