:root {
  --navy: #16345a;
  --navy-deep: #0f2744;
  --navy-soft: #2b4d78;
  --accent: #2a6f97;
  --bg: #eef2f6;
  --bg-soft: #f7f9fc;
  --card: #ffffff;
  --text: #1a2332;
  --muted: #5b6b7c;
  --line: #dce3ec;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(15, 39, 68, 0.08);
  --header-h: 64px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, #f4f7fb 0%, var(--bg) 40%, #e8eef5 100%);
  line-height: 1.6;
}

img {
  max-width: 100%;
  border: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  color: var(--navy-deep);
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.nav-toggle-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a,
.nav-drop > summary {
  display: inline-flex;
  align-items: center;
  color: var(--navy-soft);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  list-style: none;
  cursor: pointer;
}

.site-nav a:hover,
.nav-drop > summary:hover {
  background: var(--bg-soft);
  color: var(--navy-deep);
  text-decoration: none;
}

.nav-drop {
  position: relative;
}

.nav-drop > summary {
  list-style: none;
}

.nav-drop > summary::-webkit-details-marker {
  display: none;
}

.nav-drop > summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.nav-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 30;
}

.nav-menu a {
  display: block;
  padding: 8px 10px;
  color: var(--text);
  border-radius: 8px;
  white-space: nowrap;
}

.nav-qr {
  width: 168px;
  padding: 10px;
  text-align: center;
}

.nav-qr img {
  width: 148px;
  height: auto;
  display: block;
}

.page-main {
  padding: 28px 0 8px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  align-items: stretch;
}

.page-main > aside {
  display: flex;
  min-height: 0;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card,
.welcome-card {
  padding: 24px 22px;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.login-card .social-login {
  margin-top: auto;
}

.card-title {
  margin: 0 0 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-deep);
}

.field {
  margin-bottom: 14px;
}

.field input:not([type="checkbox"]) {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: var(--bg-soft);
  outline: none;
  font-family: inherit;
}

.field input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 111, 151, 0.12);
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  height: 44px;
  color: #fff;
  background: var(--navy);
}

.btn-primary:hover {
  background: var(--navy-deep);
}

.social-login {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.social-login p {
  margin: 0 0 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-social {
  height: 40px;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.btn-social:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
}

.btn-social img {
  width: 18px;
  height: 18px;
}

.login-links {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.login-register {
  margin: 10px 0 0;
}

.welcome-card h2 {
  margin: 0 0 18px;
  text-align: center;
  font-size: 18px;
}

.server-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.server-list a {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
}

.server-list a:hover {
  border-color: var(--accent);
  background: var(--navy);
  color: #fff;
  text-decoration: none;
}

.games-grid {
  display: flex;
  gap: 18px;
  align-self: stretch;
  align-items: stretch;
}

.game-card {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  padding: 22px 18px 20px;
  display: flex;
  flex-direction: column;
}

.game-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 24px;
  margin: 0 auto 16px;
  display: block;
  box-shadow: 0 10px 24px rgba(15, 39, 68, 0.14);
}

.game-card h3 {
  margin: 0 0 12px;
  text-align: center;
  font-size: 18px;
}

.game-card h3 a {
  color: var(--navy-deep);
}

.game-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  flex: 1;
}

.game-card p a {
  color: inherit;
}

.news-section {
  grid-column: 1 / -1;
  padding: 24px;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
}

.news-col h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--navy-deep);
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid transparent;
}

.news-list a:hover {
  border-color: var(--line);
  background: #fff;
  text-decoration: none;
}

.news-list .title {
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
}

.news-list .date {
  flex-shrink: 0;
  font-size: 12px;
  color: #8a97a6;
}

.news-list .is-new .title {
  color: var(--danger);
  font-weight: 700;
}

.news-list .is-new .title::after {
  content: attr(data-new);
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
  vertical-align: middle;
}

.site-footer {
  margin-top: 36px;
  padding: 36px 0 28px;
  background: linear-gradient(180deg, #f5f7fa 0%, #eceff3 100%);
  border-top: 1px solid var(--line);
  color: #566573;
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.footer-links a {
  color: #566573;
}

.certs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.certs a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #464646;
}

.certs img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.footer-info,
.footer-contact {
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: #666;
}

.footer-warning {
  max-width: 860px;
  margin: 18px auto;
  padding: 12px 14px;
  text-align: center;
  color: #c0392b;
  background: rgba(231, 76, 60, 0.05);
  border: 1px solid rgba(231, 76, 60, 0.12);
  border-radius: 8px;
  font-size: 12px;
}

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

  .games-grid {
    flex-direction: column;
  }

  .game-card {
    flex: 1 1 auto;
  }

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

@media (max-width: 820px) {
  .nav-toggle-btn {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow);
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }

  .nav-menu {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 8px;
    min-width: 0;
  }

  .nav-drop[open] > summary {
    background: var(--bg-soft);
  }
}

@media (min-width: 821px) {
  .nav-drop .nav-menu {
    display: none;
  }

  .nav-drop:hover .nav-menu,
  .nav-drop:focus-within .nav-menu {
    display: block;
  }
}
