:root {
  --page: #f5f5f7;
  --surface: #ffffff;
  --ink: #0b0b0c;
  --muted: #6e6e73;
  --line: #e7e7ec;
  --dark: #080808;
  --white: #ffffff;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  color: var(--white);
  background: rgba(8, 8, 8, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 28px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 7px;
  object-fit: contain;
  background: var(--white);
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 30px;
  width: 100%;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.78);
  list-style: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-list a:hover,
.nav-list .active {
  color: var(--white);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.button-primary {
  color: var(--dark);
  background: var(--white);
}

.button-dark {
  color: var(--white);
  background: var(--dark);
}

.button-ghost {
  color: var(--ink);
  border-color: #d7d7dd;
  background: var(--surface);
}

.nav-login {
  min-height: 34px;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  position: relative;
  gap: 10px;
}

.nav-actions.has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  min-width: 112px;
  height: 8px;
}

.nav-actions.has-dropdown .submenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 112px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.98);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 30;
}

.nav-actions.has-dropdown:hover .submenu,
.nav-actions.has-dropdown:focus-within .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-actions.has-dropdown .submenu a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.nav-actions.has-dropdown .submenu a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  display: block;
  width: 17px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: currentColor;
  content: "";
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(18px);
}

.login-modal.is-open {
  display: flex;
}

.login-modal-content {
  position: relative;
  width: min(100%, 390px);
  padding: 24px;
  border-radius: 8px;
  background: var(--surface);
}

.btn-close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: #f1f1f3;
  cursor: pointer;
  font-size: 22px;
}

.login-header {
  margin-bottom: 20px;
  text-align: center;
}

.qrcode-img {
  display: grid;
  width: 260px;
  height: 260px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8fa;
  color: var(--muted);
  text-align: center;
}

.qrcode-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qrcode-tip,
.qrcode-status {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.qrcode-status {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f1f1f3;
  font-weight: 700;
}

.qrcode-status.success {
  color: #115c2e;
  background: #e7f7ee;
}

.qrcode-status.expired {
  color: #8a1f1f;
  background: #fdecec;
}

.qrcode-refresh {
  display: none;
  min-height: 36px;
  margin-top: 12px;
  padding: 0 16px;
  border: 1px solid #d7d7dd;
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}

.qrcode-refresh.is-visible {
  display: inline-block;
}

footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.qrcode-actions {
  text-align: center;
}

.qrcode-error-icon,
.qrcode-error-message {
  color: #dc3545;
}

@media (max-width: 900px) {

  .container {
    width: min(100% - 32px, var(--container));
  }

  .nav {
    height: 60px;
    min-height: 60px;
    gap: 16px;
  }

  .brand {
    flex: 0 1 auto;
  }

  .menu-toggle {
    display: inline-block;
    flex: 0 0 auto;
  }

  .nav-menu {
    position: fixed;
    top: 60px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(12, 12, 12, 0.96);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.3);
  }

  body.nav-open .nav-menu {
    display: flex;
  }

  .nav-list {
    display: grid;
    gap: 8px;
    width: 100%;
    overflow: visible;
  }

  .nav-list a {
    display: flex;
    align-items: center;
    min-height: 40px;
    white-space: normal;
  }

  .nav-actions {
    width: 100%;
    margin-left: 0;
  }

  .nav-actions .button {
    width: 100%;
  }
}
