:root {
  --bg: #0f0f0f;
  --card: #1c1c1c;
  --line: #2a2a2a;
  --text: #f1f1f1;
  --sub: #a1a1a1;
  --primary: #ff6a00;
  --warn: #ffd166;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Barlow', 'Noto Sans SC', sans-serif;
  background: radial-gradient(circle at top, #212121 0%, #0a0a0a 45%, #050505 100%);
  color: var(--text);
}

.app-page {
  background:
    linear-gradient(rgba(6, 8, 12, 0.8), rgba(6, 8, 12, 0.88)),
    url('./background.png') center center / cover no-repeat fixed;
}
.login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
}

.app-shell {
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

.city-pill,
.search,
button,
input {
  font: inherit;
}

.city-pill {
  border: 1px solid #3a3a3a;
  background: #181818;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}

.search {
  border: 1px solid #3a3a3a;
  background: #171717;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}

.locate-btn {
  border: 1px solid #3a3a3a;
  background: #181818;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}

main {
  padding: 14px;
}

.view {
  display: none;
  animation: fade 220ms ease;
}

.view.active {
  display: block;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.map-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  height: 48vh;
  min-height: 360px;
  border: 1px solid #333;
  background: #111;
}

.real-map {
  position: absolute;
  inset: 0;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(160deg, #131313 0%, #1b1b1b 55%, #101010 100%);
}

.ball-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(12, 12, 12, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 10px rgba(255, 146, 45, 0.6);
}

.court-card,
.detail-card,
.panel,
.game-row {
  margin-top: 12px;
  border: 1px solid #323232;
  border-radius: 16px;
  background: var(--card);
  padding: 14px;
}

.hidden {
  display: none;
}

.cta,
.btn-primary,
.btn-secondary,
.chip,
.tab {
  border: 0;
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
}

.cta,
.btn-primary {
  background: linear-gradient(100deg, var(--primary), #ff8740);
  color: #111;
  font-weight: 800;
}

.btn-secondary {
  background: #272727;
  border: 1px solid #3a3a3a;
}

.cta {
  width: 100%;
  margin-top: 12px;
}

.section-title {
  margin: 0 0 8px;
}
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.chip {
  background: #2d2d2d;
  border: 1px solid #3b3b3b;
}

.chip.active {
  background: #ff6a0020;
  border-color: var(--primary);
}

.input {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #3a3a3a;
  background: #121212;
  border-radius: 10px;
  color: var(--text);
  padding: 10px;
}
.field-help {
  margin: 2px 0 0;
  color: var(--sub);
  font-size: 13px;
}

select.input {
  appearance: none;
}

.demand-item {
  border: 1px solid #353535;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: #171717;
}

.demand-item .meta {
  margin-top: 4px;
}
.favorite-item {
  border: 1px solid #353535;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: #171717;
}
.busy-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 6px;
  border: 1px solid #3f3f3f;
}

.pos-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #3b3b3b;
  border-radius: 10px;
  padding: 7px 10px;
  background: #252525;
}

.pos-check input {
  accent-color: var(--primary);
}

.panel.muted {
  color: var(--sub);
}

.form label {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.form input {
  border: 1px solid #3a3a3a;
  background: #121212;
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
}

.full {
  width: 100%;
  margin-bottom: 8px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.tab {
  background: #1e1e1e;
  border: 1px solid #313131;
  color: #bbb;
  padding: 10px 2px;
  font-size: 12px;
}

.tab.active {
  color: #111;
  background: var(--warn);
  font-weight: 700;
}

.meta {
  color: var(--sub);
  font-size: 14px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 420px);
  max-height: 84vh;
  overflow: auto;
  border: 1px solid #353535;
  border-radius: 16px;
  padding: 14px;
  background: #171717;
}
.modal-card label {
  display: block;
  margin-bottom: 10px;
}
.login-card {
  width: min(92vw, 420px);
  height: min(86vh, 740px);
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 122, 35, 0.2), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(255, 122, 35, 0.15), transparent 40%),
    linear-gradient(180deg, #151515 0%, #111 100%);
}
.standalone-login-card {
  position: static;
  transform: none;
}
.login-hero {
  height: 46%;
  padding: 24px 18px 10px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(0deg, rgba(17,17,17,0.95), rgba(17,17,17,0.55)),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px) 0 0 / 30px 30px,
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px) 0 0 / 30px 30px,
    #181818;
}
.brand-main {
  font-size: 46px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.brand-sub {
  margin-top: 10px;
  color: #d0d0d0;
  font-size: 22px;
  font-weight: 700;
}
.login-panel {
  padding: 14px;
}
.login-panel .panel.muted {
  margin-top: 8px;
}
.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 12px;
  color: var(--sub);
  font-size: 13px;
}
.link-btn {
  border: 0;
  background: transparent;
  color: #ffd166;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.link-btn:hover {
  text-decoration: underline;
}
.agree-row a {
  color: #ffd166;
  text-decoration: none;
}
.agree-row a:hover {
  text-decoration: underline;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.login-btn-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 2px;
}
.login-btn-row .btn-primary,
.login-btn-row .btn-secondary {
  width: 100%;
  min-height: 46px;
}
.agree-under-buttons {
  margin-top: 12px;
}
.policy-content {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  padding: 12px;
  background: #101010;
  line-height: 1.6;
  color: #ddd;
  white-space: pre-wrap;
}
.register-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.register-row .input {
  margin-top: 0;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}
.photo-cell {
  border: 1px dashed #4a4a4a;
  border-radius: 10px;
  background: #121212;
  color: var(--sub);
  font-size: 12px;
  min-height: 66px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6px;
}
.form input:disabled {
  opacity: 0.75;
}
.profile-plain {
  color: var(--text);
  font-weight: 700;
  line-height: 1.9;
  font-size: 18px;
}
.demand-item .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.demand-item .actions button {
  flex: 1;
}

.amap-logo,
.amap-copyright {
  z-index: 1 !important;
}

@media (max-width: 480px) {
  .app-shell {
    max-width: 100%;
  }
}
