:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #172033;
  background: #f4f7fb;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #edf3ff 0%, #f8fafc 52%, #eef8f4 100%);
}

a {
  color: #2457d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 48px 0;
}

.admin-shell {
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
  padding: 28px 0 56px;
}

.card {
  padding: 32px;
  border: 1px solid #dce4f0;
  border-radius: 18px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 18px 50px rgb(43 65 110 / 10%);
}

.card + .card {
  margin-top: 20px;
}

h1,
h2,
h3 {
  margin-top: 0;
}

.subtitle,
.muted {
  color: #667085;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field-spacing {
  margin-top: 18px;
}

label {
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #172033;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4975e8;
  outline: 3px solid rgb(73 117 232 / 14%);
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: #285bd4;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #344054;
}

.button.danger,
button.danger {
  background: #c73535;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.error,
.success,
.notice {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 9px;
}

.error {
  background: #fff0f0;
  color: #a82020;
}

.success {
  background: #ebf9f0;
  color: #16723b;
}

.notice {
  background: #eef4ff;
  color: #234fba;
}

.field-error {
  color: #bd2424;
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 15px 20px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: #fff;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat {
  padding: 22px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: #fff;
}

.stat-link {
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-link:hover {
  border-color: #9bb7f5;
  text-decoration: none;
  transform: translateY(-2px);
}

.stat-link:focus-visible {
  outline: 3px solid rgb(73 117 232 / 30%);
  outline-offset: 3px;
}

.stat-link small {
  display: block;
  margin-top: 10px;
  color: #667085;
}

.stat-value {
  display: block;
  margin-top: 8px;
  color: #1d4ec0;
  font-size: 30px;
  font-weight: 800;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e4eaf2;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #526076;
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf2ff;
  color: #244fb5;
  font-size: 12px;
  font-weight: 700;
}

.badge.off {
  background: #f3f4f6;
  color: #667085;
}

.detail-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px 18px;
  margin: 0;
}

.detail-list dt {
  color: #667085;
}

.detail-list dd {
  margin: 0;
  word-break: break-all;
}

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h1 {
  margin-bottom: 0;
}

.compact-actions {
  margin-top: 0;
}

.wrap-content {
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.table-action {
  font-weight: 700;
}

.password-card {
  max-width: 620px;
  margin-right: auto;
  margin-left: auto;
}

@media (max-width: 760px) {
  .page-shell {
    padding: 20px 0;
  }

  .card {
    padding: 22px;
  }

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

  .detail-list {
    grid-template-columns: 1fr;
  }
}

/* Unified fantasy campaign background */
.site-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  isolation: isolate;
  background: #111c55;
}

.site-page::before,
.site-page::after {
  position: fixed;
  z-index: -2;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--public-background-height, 100vh);
  height: max(var(--public-background-height, 100vh), 100lvh);
  content: "";
  pointer-events: none;
}

.site-page::before {
  background:
    #111c55
    url("../images/bj_img.jpg?v=20260730")
    center top / cover no-repeat;
  filter: blur(14px) brightness(0.72);
  transform: scale(1.04);
}

.site-page::after {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 30%, transparent 0 24%, rgb(6 11 45 / 17%) 58%, rgb(4 8 32 / 58%) 100%),
    linear-gradient(180deg, rgb(6 9 36 / 10%) 0%, rgb(8 12 48 / 25%) 48%, rgb(7 10 37 / 38%) 100%),
    url("../images/bj_img.jpg?v=20260730") center top / cover no-repeat;
}

.campaign-brand {
  display: flex;
  gap: clamp(6px, 1.8vw, 12px);
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #fff;
  text-align: center;
  text-shadow: 0 3px 18px rgb(3 7 33 / 72%);
}

.campaign-brand > span {
  font-size: clamp(25px, 5vw, 31px);
  font-weight: 700;
  letter-spacing: normal;
  white-space: nowrap;
}

.campaign-brand img {
  width: clamp(108px, 28vw, 142px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgb(3 7 33 / 40%));
}

.public-shell {
  width: min(100% - 28px, 680px);
  padding: clamp(22px, 5vh, 58px) 0 90px;
}

.public-shell:not(.home-shell) {
  display: flex;
  width: min(100% - 28px, 640px);
  min-height: 100svh;
  flex-direction: column;
  padding: clamp(18px, 4vh, 42px) 0 42px;
}

.public-shell:not(.home-shell) > .public-card {
  width: 100%;
  margin: 0 auto;
}

.public-shell.home-shell {
  display: flex;
  width: min(100% - 28px, 600px);
  min-height: 100svh;
  flex-direction: column;
  padding: clamp(18px, 3.5vh, 38px) 0 38px;
}

.public-page {
  color: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.public-page .public-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 6vw, 44px);
  border: 1px solid rgb(255 255 255 / 42%);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 25%), rgb(101 126 196 / 15%)),
    rgb(31 42 93 / 38%);
  box-shadow:
    0 34px 90px rgb(3 5 28 / 48%),
    inset 0 1px 0 rgb(255 255 255 / 40%);
  color: #fff;
  backdrop-filter: blur(24px) saturate(138%);
  -webkit-backdrop-filter: blur(24px) saturate(138%);
}

.public-page .public-card::before {
  position: absolute;
  top: -120px;
  right: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(120 199 255 / 24%), transparent 67%);
  content: "";
  pointer-events: none;
}

.public-page .public-card > * {
  position: relative;
}

.public-page .home-card {
  width: 100%;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 38px);
  border-color: rgb(255 255 255 / 48%);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 21%), rgb(80 100 178 / 14%)),
    rgb(20 32 87 / 49%);
  box-shadow:
    0 26px 68px rgb(3 6 30 / 42%),
    inset 0 1px 0 rgb(255 255 255 / 46%);
}

.home-intro {
  display: grid;
  justify-items: center;
  margin-bottom: 34px;
  text-align: center;
}

.public-page .home-card h1 {
  margin: 0;
  font-size: clamp(27px, 6.8vw, 38px);
  line-height: 1.35;
}

.home-field-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
}

.home-field-heading label {
  margin: 0;
}

.home-field-heading span {
  color: rgb(255 255 255 / 58%);
  font-size: 12px;
  letter-spacing: normal;
}

.public-page .home-form input {
  min-height: 62px;
  border-color: rgb(255 255 255 / 45%);
  background: rgb(9 22 72 / 31%);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: uppercase;
}

.public-page .home-form input::placeholder {
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.public-page .home-actions {
  margin-top: 22px;
}

.public-page .home-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 18px;
  padding-left: 22px;
}

.home-button-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgb(255 255 255 / 17%);
  font-size: 18px;
  line-height: 1;
}

.home-shell .site-record {
  margin-top: 18px;
}

.public-page .public-card h1 {
  margin-bottom: 18px;
  color: #fff;
  font-size: clamp(34px, 8vw, 48px);
  line-height: 1.18;
  letter-spacing: normal;
  text-shadow: 0 4px 24px rgb(7 10 48 / 40%);
}

.public-page .subtitle,
.public-page .muted {
  color: rgb(255 255 255 / 78%);
}

.public-page .subtitle {
  margin-bottom: 28px;
  font-size: 17px;
  line-height: 1.8;
}

.public-page label {
  color: rgb(255 255 255 / 94%);
  font-size: 16px;
  line-height: 1.55;
}

.public-page input,
.public-page select,
.public-page textarea {
  min-height: 58px;
  padding: 15px 17px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 16px;
  background: rgb(13 26 76 / 22%);
  box-shadow: inset 0 1px 1px rgb(2 8 38 / 12%);
  color: #fff;
}

.public-page textarea {
  min-height: 112px;
}

.public-page input::placeholder,
.public-page textarea::placeholder {
  color: rgb(255 255 255 / 48%);
}

.public-page input:focus,
.public-page select:focus,
.public-page textarea:focus {
  border-color: rgb(145 220 255 / 82%);
  outline: 3px solid rgb(106 196 255 / 20%);
  background: rgb(19 39 101 / 36%);
}

.public-field-spacing {
  margin-top: 22px;
}

.public-page .actions {
  gap: 12px;
}

.public-page .button,
.public-page button {
  min-height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #536ee7, #816be7);
  box-shadow: 0 13px 30px rgb(20 25 92 / 35%);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.public-page .button:hover,
.public-page button:hover {
  filter: brightness(1.08);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgb(20 25 92 / 45%);
}

.public-page .button:active,
.public-page button:active {
  transform: translateY(0);
}

.public-page .button.secondary,
.public-page button.secondary {
  border: 1px solid rgb(255 255 255 / 42%);
  background: rgb(255 255 255 / 10%);
  box-shadow: none;
  color: #fff;
}

.public-actions > * {
  flex: 1 1 180px;
}

.site-record {
  margin-top: 24px;
  text-align: center;
}

.site-record a {
  color: rgb(255 255 255 / 82%);
  font-size: 14px;
  text-decoration: none;
  text-shadow: 0 1px 8px rgb(5 13 49 / 55%);
  transition: color 160ms ease, text-shadow 160ms ease;
}

.site-record a:hover,
.site-record a:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-shadow: 0 1px 12px rgb(114 218 255 / 75%);
}

.public-page .error,
.public-page .success,
.public-page .notice {
  border: 1px solid rgb(255 255 255 / 16%);
  color: #fff;
  line-height: 1.7;
}

.public-page .error {
  background: rgb(173 39 83 / 35%);
}

.public-page .success {
  background: rgb(24 147 125 / 30%);
}

.public-page .notice {
  background: rgb(66 109 206 / 27%);
}

.public-page .field-error {
  color: #ffd0dc;
}

.public-page .detail-list dt {
  color: rgb(255 255 255 / 62%);
}

.public-page .detail-list dd {
  color: #fff;
}

.public-page .card .card {
  border-color: rgb(255 255 255 / 22%);
  background: rgb(15 27 76 / 28%);
  box-shadow: none;
}

.public-page .badge {
  background: rgb(147 209 255 / 18%);
  color: #ccefff;
}

.admin-page .admin-shell,
.admin-page .page-shell {
  position: relative;
}

.admin-page .card,
.admin-page .nav,
.admin-page .stat {
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 22px 60px rgb(4 9 43 / 24%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

@media (max-width: 760px) {
  .public-shell {
    width: min(100% - 22px, 680px);
    padding: 18px 0 72px;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(72px, env(safe-area-inset-bottom));
  }

  .public-shell:not(.home-shell) {
    width: min(100% - 20px, 640px);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .public-shell.home-shell {
    width: min(100% - 20px, 600px);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .campaign-brand {
    gap: 6px;
    margin-bottom: 10px;
  }

  .campaign-brand > span {
    font-size: clamp(20px, 5.8vw, 24px);
  }

  .campaign-brand img {
    width: clamp(96px, 29vw, 124px);
  }

  .public-page .public-card {
    padding: 21px 18px;
    border-radius: 22px;
  }

  .public-page .home-card {
    padding: 22px 18px 18px;
  }

  .home-intro {
    margin-bottom: 30px;
  }

  .public-page .public-card h1 {
    margin-bottom: 11px;
    font-size: clamp(29px, 8vw, 34px);
  }

  .public-page .home-card h1 {
    margin: 0;
    font-size: clamp(25px, 6.7vw, 30px);
  }

  .public-page .subtitle {
    margin-bottom: 18px;
    font-size: 15px;
  }

  .public-page input,
  .public-page select,
  .public-page textarea {
    min-height: 54px;
  }

  .public-page .home-form input {
    min-height: 58px;
  }

  .public-page .home-actions {
    margin-top: 17px;
  }

  .public-page .form-grid {
    gap: 16px;
  }

  .public-page .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 17px;
  }

  .public-page .actions > .button,
  .public-page .actions > button {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 15px;
    white-space: nowrap;
  }

  .public-page .actions > :only-child {
    grid-column: 1 / -1;
  }

  .public-page .detail-list {
    gap: 0;
  }

  .public-page .detail-list dt {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgb(255 255 255 / 14%);
  }

  .public-page .detail-list dt:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .public-page .detail-list dd {
    padding-top: 6px;
  }

  .admin-shell {
    width: min(100% - 20px, 1240px);
    padding: 14px 0 48px;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(48px, env(safe-area-inset-bottom));
  }

  .admin-page .page-shell {
    width: min(100% - 20px, 760px);
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  .admin-page .nav {
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 14px;
    padding: 16px;
  }

  .admin-page .nav > strong {
    font-size: 18px;
  }

  .admin-page .nav-links {
    width: 100%;
    gap: 8px;
  }

  .admin-page .nav-links a,
  .admin-page .nav-links form {
    flex: 1 1 88px;
  }

  .admin-page .nav-links a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid #dbe3f0;
    border-radius: 9px;
    background: #f7f9fd;
    font-weight: 700;
  }

  .admin-page .nav-links button {
    width: 100%;
    min-height: 44px;
  }

  .admin-page .card {
    padding: 20px 17px;
    border-radius: 15px;
  }

  .admin-page h1 {
    font-size: 26px;
    line-height: 1.3;
  }

  .admin-page h2 {
    font-size: 22px;
  }

  .admin-page input,
  .admin-page select,
  .admin-page textarea {
    min-width: 0;
    min-height: 48px;
    font-size: 16px;
  }

  .admin-page textarea {
    min-height: 100px;
  }

  .admin-page .form-grid {
    gap: 16px;
  }

  .admin-page .actions > .button,
  .admin-page .actions > button {
    flex: 1 1 140px;
    min-width: 0;
    min-height: 46px;
  }

  .admin-page .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .admin-page .stat {
    padding: 17px;
  }

  .admin-page .stat-value {
    font-size: 26px;
  }

  .section-heading {
    align-items: stretch;
  }

  .section-heading,
  .section-heading .compact-actions {
    width: 100%;
  }

  .section-heading h1 {
    width: 100%;
  }

  .admin-page .responsive-table,
  .admin-page .responsive-table tbody,
  .admin-page .responsive-table tr,
  .admin-page .responsive-table td {
    display: block;
    width: 100%;
  }

  .admin-page .responsive-table thead {
    display: none;
  }

  .admin-page .responsive-table tbody tr {
    padding: 8px 12px;
    border: 1px solid #dce4f0;
    border-radius: 12px;
    background: #fff;
  }

  .admin-page .responsive-table tbody tr + tr {
    margin-top: 12px;
  }

  .admin-page .responsive-table td {
    display: grid;
    grid-template-columns: minmax(82px, 0.72fr) minmax(0, 1.28fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f6;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .admin-page .responsive-table td::before {
    color: #667085;
    font-size: 13px;
    font-weight: 700;
    content: attr(data-label);
  }

  .admin-page .responsive-table td:last-child {
    border-bottom: 0;
  }

  .admin-page .responsive-table td[colspan] {
    display: block;
    padding: 18px 0;
    text-align: center;
  }

  .admin-page .responsive-table td[colspan]::before {
    content: none;
  }

  .admin-page .responsive-table .table-action {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 9px;
    background: #285bd4;
    color: #fff;
  }

  .admin-page .table-wrap {
    overflow: visible;
  }

  .admin-page .detail-list {
    gap: 0;
  }

  .admin-page .detail-list dt {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9eef5;
  }

  .admin-page .detail-list dt:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .admin-page .detail-list dd {
    padding-top: 5px;
  }

  .admin-page .pagination {
    display: grid;
    grid-template-columns: minmax(60px, 1fr) auto minmax(60px, 1fr);
    align-items: center;
    font-size: 14px;
    text-align: center;
  }

  .admin-page .pagination > :first-child {
    justify-self: start;
  }

  .admin-page .pagination > :last-child {
    justify-self: end;
  }
}

@media (max-width: 380px) {
  .public-page .public-card {
    padding: 19px 16px;
  }

  .public-page .public-card h1 {
    font-size: 28px;
  }

  .public-page .home-card h1 {
    font-size: 24px;
  }

  .public-page .actions > .button,
  .public-page .actions > button {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 14px;
  }

  .admin-page .stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-page .button,
  .public-page button {
    transition: none;
  }
}
