:root {
  --bg-base: #030305;
  --bg-panel: rgba(10, 10, 12, 0.85);
  --border-color: rgba(255, 77, 77, 0.2);
  --border-highlight: rgba(255, 77, 77, 0.5);

  --accent-primary: rgb(255, 0, 51);
  --accent-hover: #ff3333;
  --text-primary: #ffffff;
  --text-muted: rgb(180, 180, 190);
  --text-dark: #111111;

  --status-good: #00ff66;
  /* Neon green for active/good states */
  /* Changed from cyan to survival red */
  --status-warn: #ffc107;
  --status-bad: rgb(255, 77, 77);

  --font-en: "Rajdhani", sans-serif;
  --font-cn: "Noto Sans SC", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 4px;
}

body {
  font-family: var(--font-cn);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 2rem;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Cyber Grid */
.hud-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: -2;
  pointer-events: none;
}

/* Optional soft vignette */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    transparent 30%,
    rgba(0, 0, 0, 0.8) 100%
  );
  z-index: -1;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* --- HEADER --- */
.cyber-header {
  margin-bottom: 2rem;
  position: relative;
  padding-left: 1rem;
  border-left: 4px solid var(--accent-primary);
}

.sys-label {
  font-family: var(--font-en);
  color: var(--status-bad);
  /* red */
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
}

.sys-label::before,
.sys-label::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background-color: var(--status-bad);
  margin: 0 10px;
  opacity: 0.5;
}

h1 {
  font-family: var(--font-cn);
  font-size: 2.5rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 0 15px rgba(255, 255, 255, 0.5),
    0 0 30px rgba(255, 0, 0, 0.3);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 4px;
}

.subtitle {
  font-family: var(--font-en);
  color: var(--status-good);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 8px;
}

/* --- LAYOUT GRID --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  gap: 2rem;
  align-items: stretch;
  flex-grow: 1;
}

.col-left,
.col-center,
.col-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.col-sync-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
}

@media (min-width: 901px) {
  .col-center,
  .col-right {
    position: relative;
  }

  .col-sync-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
  }
}

.col-left > .cyber-panel:last-child {
  margin-bottom: 0;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 280px 1fr 320px;
    gap: 1rem;
  }
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.mb-1 {
  margin-bottom: 1rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.radar-progress {
  font-family: var(--font-en);
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 700;
  letter-spacing: 1px;
  animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {
  0%,
  100% {
    opacity: 1;
    text-shadow: 0 0 5px var(--accent-primary);
  }

  50% {
    opacity: 0.5;
    text-shadow: none;
  }
}

.retry-btn {
  font-family: var(--font-en);
  font-size: 0.8rem;
  color: var(--status-warn);
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.retry-btn:hover {
  color: var(--status-good);
}

/* --- PANELS --- */
.cyber-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1.5rem;
  position: relative;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 0 15px rgba(255, 0, 51, 0.03);
}

.col-sync-wrapper > .cyber-panel:last-child {
  margin-bottom: 0;
}

.cyber-panel::before {
  display: none;
}

/* --- FORMS --- */
.input-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-family: var(--font-en);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.input-cyber {
  position: relative;
}

input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  font-family: var(--font-en);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 2px;
  outline: none;
  transition: border-color 0.2s;
}

input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

/* Custom Select Styling */
.cyber-select {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  font-family: var(--font-cn);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 2px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  appearance: none;
  cursor: pointer;
}

.cyber-select:focus,
input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(255, 0, 51, 0.2);
}

.cyber-select:focus {
  border-color: var(--accent-primary);
}

.cyber-select option {
  background: var(--bg-panel);
  color: var(--text-primary);
}

.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-wrapper::after {
  content: "▼";
  font-size: 0.8rem;
  color: var(--accent-primary);
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.decor-corner {
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: var(--accent-primary);
  border-style: solid;
  pointer-events: none;
}

.decor-corner.top-left {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.decor-corner.bottom-right {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

/* --- BUTTONS --- */
.cyber-btn {
  width: 100%;
  background: rgba(12, 16, 22, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: 4px;
  padding: 1rem;
  font-family: var(--font-en);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  text-transform: uppercase;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
  box-shadow: 0 0 15px rgba(255, 0, 51, 0.1);
}

.cyber-btn:hover {
  background: rgba(255, 0, 51, 0.15);
  border-color: rgba(255, 0, 51, 0.8);
  box-shadow:
    0 0 20px rgba(255, 0, 51, 0.4),
    inset 0 0 10px rgba(255, 0, 51, 0.2);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.cyber-btn:active {
  transform: translateY(2px);
}

.cyber-btn.loading .btn-text {
  opacity: 0;
}

.cyber-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-right-color: #fff;
  position: absolute;
  animation: spin 0.8s linear infinite;
}

/* --- RESULTS SECTION --- */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title h2 {
  font-family: var(--font-en);
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.cn-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border-color);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.badge {
  font-family: var(--font-en);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  letter-spacing: 1px;
}

.badge-neutral {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.badge-danger {
  background: rgba(255, 52, 52, 0.1);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

/* --- RECORD CARDS --- */
.records-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.record-card {
  background: rgb(17, 17, 20);
  border: 1px solid rgb(42, 42, 48);
  border-radius: 8px;
  border-left: 4px solid rgb(42, 42, 48);
  padding: 1rem;
  transition: border-color 0.2s;
}

.record-card:hover {
  border-left-color: var(--status-good);
}

.record-card.has-debt:hover {
  border-left-color: var(--accent-primary);
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-color);
}

.park-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.status-label {
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  letter-spacing: 1px;
}

.status-in {
  background: var(--status-good);
  color: var(--text-dark);
}

.status-out {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* Scrollable Log Container */
.log-scroll {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 10px;
}

/* Custom Scrollbar for the Logs */
.log-scroll::-webkit-scrollbar {
  width: 6px;
}

.log-scroll::-webkit-scrollbar-track {
  background: var(--bg-base);
}

.log-scroll::-webkit-scrollbar-thumb {
  background: var(--border-highlight);
  border-radius: 4px;
}

.log-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--status-good);
}

.record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.data-group {
  display: flex;
  flex-direction: column;
}

.data-label {
  font-family: var(--font-en);
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.data-value {
  font-family: var(--font-en);
  font-size: 1rem;
  font-weight: 600;
}

.data-value.cn {
  font-family: var(--font-cn);
  font-size: 0.9rem;
  font-weight: 400;
}

.fee-highlight {
  color: var(--accent-primary);
  font-weight: 700;
}

/* --- EMPTY STATE --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  border-style: dashed;
}

.warning-icon {
  font-size: 3rem;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.en-warn {
  font-family: var(--font-en);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.cn-warn {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cyber-footer {
  margin-top: 3rem;
  text-align: center;
  font-family: var(--font-en);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 2px;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

@media (max-width: 480px) {
  .record-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* --- MAP CONTAINER --- */
.map-container {
  width: 100%;
  flex-grow: 1;
  /* Tall map and syncs with right column */
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

/* Override AMap styles for Dark Theme */
.amap-logo,
.amap-copyright {
  display: none !important;
}

.amap-info-contentContainer {
  background: var(--bg-panel) !important;
  border: 1px solid var(--accent-primary) !important;
  border-radius: 4px !important;
  color: var(--text-primary) !important;
  font-family: var(--font-en) !important;
}

.amap-info-contentContainer .amap-info-content {
  background: transparent !important;
  padding: 10px !important;
}

.amap-info-close {
  color: var(--text-muted) !important;
}

.amap-marker-label {
  border: none !important;
  background: transparent !important;
}

/* --- LOGIN PAGE SPECIFIC --- */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-base);
}

.login-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
  /* Slightly fade the map */
}

.login-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(8, 8, 10, 0.4) 0%,
    rgba(8, 8, 10, 0.9) 80%
  );
  z-index: 1;
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 1s ease-out;
}

.login-subtitle {
  font-family: var(--font-cn);
  color: var(--status-bad);
  /* The red highlight color */
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
}

.login-subtitle::before,
.login-subtitle::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background-color: var(--status-bad);
  margin: 0 10px;
  opacity: 0.5;
}

.login-title {
  font-family: var(--font-cn);
  font-size: 3.5rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 0 15px rgba(255, 255, 255, 0.5),
    0 0 30px rgba(255, 0, 0, 0.3);
  margin: 0;
  line-height: 1.2;
  letter-spacing: 4px;
}

.login-title-en {
  font-family: var(--font-en);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--status-bad);
  letter-spacing: 12px;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.login-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 1px;
  opacity: 0.8;
}

.login-box {
  width: 100%;
  background: rgba(12, 16, 22, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 77, 77, 0.2);
  /* Reddish border */
  padding: 2.5rem 2rem;
  box-shadow:
    0 0 30px rgba(0, 0, 0, 0.8),
    inset 0 0 20px rgba(255, 77, 77, 0.05);
  animation: fadeInUp 1s ease-out 0.2s both;
}

/* Custom corners for login box */
.login-box > .decor-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--status-bad);
  border-style: solid;
  pointer-events: none;
}

.login-box > .top-left {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.login-box > .top-right {
  top: -1px;
  right: -1px;
  border-width: 2px 2px 0 0;
}

.login-box > .bottom-left {
  bottom: -1px;
  left: -1px;
  border-width: 0 0 2px 2px;
}

.login-box > .bottom-right {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.login-box .input-group label {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 2px;
}

.login-box input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 1.25rem;
  font-size: 1rem;
}

.login-box input:focus {
  border-color: var(--status-bad);
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.2);
}

.login-btn {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid var(--status-bad);
  color: var(--status-bad);
  margin-top: 1rem;
  padding: 1.2rem;
}

.login-btn:hover {
  background: rgba(255, 77, 77, 0.25);
  box-shadow: 0 0 20px rgba(255, 77, 77, 0.4);
  color: #fff;
  border-color: #fff;
}

.login-error {
  color: var(--status-bad);
  font-family: var(--font-en);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  animation: pulse-text 1.5s infinite;
}

.login-disclaimer {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: center;
  margin-top: 2rem;
  opacity: 0.5;
  letter-spacing: 1px;
}

.login-footer {
  position: absolute;
  bottom: 2rem;
  width: 100%;
  text-align: center;
  font-family: var(--font-en);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 3px;
  opacity: 0.4;
  z-index: 10;
}

/* Basic Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-5px);
  }

  40%,
  80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.4s ease-in-out;
}
