.am-mask {
  --ug-bg: #080a09;
  --ug-surface: #121613;
  --ug-text: #f2f5f2;
  --ug-secondary: #b7c2b8;
  --ug-line: #303a32;
  --ug-green: #53f76b;
  color: var(--ug-text);
  color-scheme: dark;
  font: 15px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ===== 首页报名弹窗（登录/报名/状态三态） ===== */
.am-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 32px);
  background: rgba(3, 6, 4, .84);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.am-mask[hidden] { display: none; }
html.am-lock, html.am-lock body { overflow: hidden; }

.am-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 880px);
  overflow: auto;
  padding: clamp(20px, 3.2vw, 36px);
  background: linear-gradient(180deg, #0d120e 0%, #090c09 100%);
  border: 1px solid #2d3a30;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .72), inset 0 0 0 1px rgba(83, 247, 107, .05);
  color: var(--ug-text);
  animation: am-enter .22s ease-out;
  -webkit-overflow-scrolling: touch;
}
@keyframes am-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .am-dialog { animation: none; } }

.am-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  background: none;
  color: #93a397;
  font: 400 24px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  cursor: pointer;
}
.am-close:hover { color: var(--ug-green); border-color: #385540; }

.am-kicker {
  margin: 0 0 10px;
  font: 11px/1.4 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .18em;
  color: #6fbf85;
}
.am-head h2 {
  margin: 0 0 10px;
  font-size: clamp(21px, 2.4vw, 30px);
  line-height: 1.28;
  font-weight: 650;
  letter-spacing: -.02em;
}
.am-sub {
  margin: 0;
  color: var(--ug-secondary);
  font-size: var(--font-sm);
  line-height: 1.7;
}
.am-out {
  margin-left: 10px;
  color: #6fbf85;
  text-decoration: none;
  border-bottom: 1px solid rgba(111, 191, 133, .4);
}
.am-out:hover { color: var(--ug-green); }

.am-alert {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid #7a2f2f;
  background: #1b1010;
  color: #f0a9a9;
  font-size: var(--font-sm);
  line-height: 1.6;
}
.am-alert--warn { border-color: #7a5f22; background: #1a160c; color: #e8cf94; }

.am-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 16px;
  margin-top: 22px;
}
.am-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: var(--font-xs);
  color: var(--ug-secondary);
}
.am-field > span { letter-spacing: .02em; }
.am-field i { color: var(--ug-green); font-style: normal; }
.am-field--wide { grid-column: 1 / -1; }
.am-field input,
.am-field select,
.am-field textarea {
  width: 100%;
  background: #0a0f0b;
  border: 1px solid #2b3830;
  border-radius: 0;
  color: var(--ug-text);
  font: inherit;
  font-size: var(--font-sm);
  line-height: 1.5;
  padding: 11px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.am-field textarea { resize: vertical; min-height: 84px; }
.am-field select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2353f76b' stroke-width='1.8'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.am-field select option { background: #0d120e; color: var(--ug-text); }
.am-field input::placeholder,
.am-field textarea::placeholder { color: #64756a; }
.am-field input:focus,
.am-field select:focus,
.am-field textarea:focus {
  border-color: var(--ug-green);
  box-shadow: 0 0 0 3px rgba(83, 247, 107, .12);
}

.am-actions,
.am-done,
.am-login {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.am-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 28px;
  border: 1px solid var(--ug-green);
  text-decoration: none;
  cursor: pointer;
  font-size: var(--font-sm);
}
.am-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid #38453b;
  background: transparent;
  color: var(--ug-secondary);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: var(--font-sm);
}
.am-ghost:hover { border-color: #6eaa7e; color: #e0ece3; }

.am-kv {
  margin: 20px 0 0;
  border-top: 1px solid #232d26;
}
.am-kv > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #232d26;
  font-size: var(--font-sm);
}
.am-kv dt { color: #8fa094; margin: 0; }
.am-kv dd { margin: 0; text-align: right; color: var(--ug-text); }
.am-kv .am-code { font-family: "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; color: var(--ug-green); }

.am-tip {
  margin: 14px 0 0;
  color: #7f8f83;
  font-size: var(--font-xxs);
  line-height: 1.65;
}

@media (max-width: 700px) {
  .am-mask { padding: 0; align-items: flex-end; }
  .am-dialog {
    width: 100%;
    max-height: 94vh;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .am-grid { grid-template-columns: 1fr; gap: 12px; }
  .am-actions .am-submit { flex: 1 1 100%; }
  .am-actions .am-ghost { flex: 1 1 100%; }
  .am-login .am-submit,
  .am-login .am-ghost { flex: 1 1 100%; }
  .am-kv > div { font-size: var(--font-xs); }
}
