:root {
  --lime: #c6ff1a;
  --lime-dim: #8fd60f;
  --bg: #000000;
  --surface: #0a0c08;
  --line: rgba(198, 255, 26, 0.35);
  --line-dim: rgba(198, 255, 26, 0.14);
  --text: #eafcd8;
  --text-dim: #7c9a6a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", "Noto Sans TC", ui-monospace, monospace;
  position: relative;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dim) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at top, black 40%, transparent 85%);
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  pointer-events: none;
  animation: splashOut 0.25s ease 0.95s forwards;
}
.splash-shock {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--lime);
  opacity: 0;
  transform: scale(0.3);
  box-shadow: 0 0 30px 4px rgba(198, 255, 26, 0.6);
  animation: shockOut 0.55s cubic-bezier(0.15, 0.8, 0.3, 1) 0s forwards;
}
@keyframes shockOut {
  0% { opacity: 0.9; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(9); }
}
.splash-shock2 {
  border-color: #eafcd8;
  box-shadow: 0 0 30px 4px rgba(234, 252, 216, 0.4);
  animation: shockOut 0.6s cubic-bezier(0.15, 0.8, 0.3, 1) 0.12s forwards;
}

.splash-burst {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.3) rotate(0deg);
  background: repeating-conic-gradient(
    rgba(198, 255, 26, 0.45) 0deg 3deg,
    rgba(198, 255, 26, 0) 3deg 18deg
  );
  mask-image: radial-gradient(circle, transparent 38%, black 40%, black 55%, transparent 62%);
  animation: burstSpin 1.1s linear 0s forwards, burstFade 1.1s ease 0s forwards;
}
@keyframes burstSpin {
  from { transform: scale(1) rotate(0deg); }
  to { transform: scale(1) rotate(220deg); }
}
@keyframes burstFade {
  0% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  20% { opacity: 0.9; }
  100% { opacity: 0; }
}

.splash-particles span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--lime);
  box-shadow: 0 0 8px 2px rgba(198, 255, 26, 0.8);
  opacity: 0;
  animation: particleFly 0.7s ease-out 0.05s forwards;
}
.splash-particles span:nth-child(1) { --a: 0deg; }
.splash-particles span:nth-child(2) { --a: 30deg; background: #eafcd8; box-shadow: 0 0 8px 2px rgba(234, 252, 216, 0.8); }
.splash-particles span:nth-child(3) { --a: 60deg; }
.splash-particles span:nth-child(4) { --a: 90deg; background: #eafcd8; box-shadow: 0 0 8px 2px rgba(234, 252, 216, 0.8); }
.splash-particles span:nth-child(5) { --a: 120deg; }
.splash-particles span:nth-child(6) { --a: 150deg; background: #eafcd8; box-shadow: 0 0 8px 2px rgba(234, 252, 216, 0.8); }
.splash-particles span:nth-child(7) { --a: 180deg; }
.splash-particles span:nth-child(8) { --a: 210deg; background: #eafcd8; box-shadow: 0 0 8px 2px rgba(234, 252, 216, 0.8); }
.splash-particles span:nth-child(9) { --a: 240deg; }
.splash-particles span:nth-child(10) { --a: 270deg; background: #eafcd8; box-shadow: 0 0 8px 2px rgba(234, 252, 216, 0.8); }
.splash-particles span:nth-child(11) { --a: 300deg; }
.splash-particles span:nth-child(12) { --a: 330deg; background: #eafcd8; box-shadow: 0 0 8px 2px rgba(234, 252, 216, 0.8); }
@keyframes particleFly {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--a)) translateX(0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateX(170px) scale(0.3); }
}

.splash-ring {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 2px dashed rgba(198, 255, 26, 0.7);
  opacity: 0;
  transform: scale(0.4) rotate(0deg);
  animation:
    ringIn 0.3s ease 0.05s forwards,
    ringSpin 1.1s linear 0.05s;
}
.splash-ring2 {
  width: 190px;
  height: 190px;
  border: 1px solid rgba(198, 255, 26, 0.35);
  border-style: dotted;
  animation:
    ringIn 0.3s ease 0.12s forwards,
    ringSpinRev 1.4s linear 0.12s;
}
.splash-ring3 {
  width: 230px;
  height: 230px;
  border: 1px solid rgba(234, 252, 216, 0.4);
  border-style: solid;
  border-top-color: transparent;
  border-bottom-color: transparent;
  animation:
    ringIn 0.3s ease 0.2s forwards,
    ringSpin 0.85s linear 0.2s;
}
@keyframes ringIn {
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes ringSpin {
  from { transform: scale(1) rotate(0deg); }
  to { transform: scale(1) rotate(360deg); }
}
@keyframes ringSpinRev {
  from { transform: scale(1) rotate(0deg); }
  to { transform: scale(1) rotate(-360deg); }
}

.splash-hud {
  position: relative;
  padding: 22px 40px;
}
.hud-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  opacity: 0;
  border-color: var(--lime);
  transition: none;
}
.hud-corner.tl { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; animation: hudInTL 0.3s ease 0.18s forwards; }
.hud-corner.br { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; animation: hudInBR 0.3s ease 0.18s forwards; }
.hud-corner.tr { top: 0; right: 0; border-top: 2px solid; border-right: 2px solid; animation: hudInTR 0.3s ease 0.26s forwards; }
.hud-corner.bl { bottom: 0; left: 0; border-bottom: 2px solid; border-left: 2px solid; animation: hudInBL 0.3s ease 0.26s forwards; }
@keyframes hudInTL { from { opacity: 0; transform: translate(-14px, -14px); } to { opacity: 1; transform: translate(0, 0); } }
@keyframes hudInBR { from { opacity: 0; transform: translate(14px, 14px); } to { opacity: 1; transform: translate(0, 0); } }
@keyframes hudInTR { from { opacity: 0; transform: translate(14px, -14px); } to { opacity: 1; transform: translate(0, 0); } }
@keyframes hudInBL { from { opacity: 0; transform: translate(-14px, 14px); } to { opacity: 1; transform: translate(0, 0); } }

.splash-greeting {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  color: #eafcd8;
  text-align: center;
  opacity: 0;
  margin-bottom: 6px;
  text-shadow: 0 0 8px rgba(234, 252, 216, 0.5);
  animation: greetingIn 0.3s ease 0.02s forwards;
}
@keyframes greetingIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.splash-text {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.35em;
  color: var(--lime);
  opacity: 0;
  text-shadow: 0 0 14px rgba(198, 255, 26, 0.7);
  animation: textFadeIn 0.15s ease 0.02s forwards, textFlicker 0.5s steps(1) 0.02s;
}
@keyframes textFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes textFlicker {
  0%, 100% { text-shadow: 0 0 14px rgba(198, 255, 26, 0.7); }
  10% { text-shadow: 2px 0 0 #eafcd8, -2px 0 0 var(--lime-dim); }
  22% { text-shadow: 0 0 14px rgba(198, 255, 26, 0.7); }
  45% { text-shadow: -2px 0 0 #eafcd8, 2px 0 0 var(--lime-dim); }
  55% { text-shadow: 0 0 14px rgba(198, 255, 26, 0.7); }
}

.splash-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  box-shadow: 0 0 24px 4px rgba(198, 255, 26, 0.8);
  animation: scanSweep 0.75s linear 0s 1;
}
.splash-scan2 {
  height: 1px;
  opacity: 0.5;
  background: linear-gradient(90deg, transparent, #eafcd8, transparent);
  box-shadow: 0 0 16px 2px rgba(234, 252, 216, 0.5);
  animation: scanSweepRev 0.95s linear 0.1s 1;
}
@keyframes scanSweep {
  from { top: -5%; opacity: 1; }
  to { top: 105%; opacity: 0.2; }
}
@keyframes scanSweepRev {
  from { top: 105%; opacity: 0.9; }
  to { top: -5%; opacity: 0.1; }
}
@keyframes splashOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.splash-glitchbar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 14px;
  background: rgba(198, 255, 26, 0.12);
  mix-blend-mode: screen;
  opacity: 0;
  animation: glitchJitter 0.5s steps(2, jump-none) 0.5s;
}
.gb1 { top: 32%; animation-duration: 0.45s; animation-delay: 0.48s; }
.gb2 { top: 55%; height: 8px; background: rgba(234, 252, 216, 0.12); animation-duration: 0.4s; animation-delay: 0.55s; }
.gb3 { top: 68%; height: 10px; background: rgba(198, 255, 26, 0.1); animation-duration: 0.35s; animation-delay: 0.6s; }
@keyframes glitchJitter {
  0% { opacity: 0; transform: translateX(0); }
  15% { opacity: 1; transform: translateX(-18px); }
  30% { transform: translateX(14px); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(6px); }
  100% { opacity: 0; transform: translateX(0); }
}

.hud-readout {
  position: absolute;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--lime);
  opacity: 0;
  text-shadow: 0 0 8px rgba(198, 255, 26, 0.6);
  animation: readoutBlink 0.9s ease 0.15s forwards;
}
.rd-tl { top: 24px; left: 24px; animation-delay: 0.1s; }
.rd-tr { top: 24px; right: 24px; text-align: right; color: #eafcd8; text-shadow: 0 0 8px rgba(234, 252, 216, 0.6); animation-delay: 0.18s; }
.rd-bl { bottom: 24px; left: 24px; color: #eafcd8; text-shadow: 0 0 8px rgba(234, 252, 216, 0.6); animation-delay: 0.26s; }
.rd-br { bottom: 24px; right: 24px; text-align: right; animation-delay: 0.34s; }
@keyframes readoutBlink {
  0% { opacity: 0; }
  15% { opacity: 1; }
  20% { opacity: 0.3; }
  25% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.topbar {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-dim);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--lime); font-size: 1rem; }
.brand-text {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  color: var(--lime);
  text-shadow: 0 0 12px rgba(198, 255, 26, 0.5);
}
.blink { animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }

.status-pill {
  border: 1px solid var(--line);
  color: var(--lime);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  text-transform: uppercase;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px;
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 10px; height: 10px;
  border-top: 2px solid var(--lime);
  border-left: 2px solid var(--lime);
}
.card::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-bottom: 2px solid var(--lime);
  border-right: 2px solid var(--lime);
}
.card h2 {
  margin: 0 0 16px;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--lime);
  font-weight: 700;
}
.card h2 .tag {
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-left: 6px;
}

.upload-row { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 0;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--lime);
  color: #050600;
  border-color: var(--lime);
}
.btn-primary:hover { background: var(--lime-dim); }
.btn-ghost {
  background: transparent;
  color: var(--lime);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(198, 255, 26, 0.08); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-danger {
  color: #ff5c5c;
  border-color: rgba(255, 92, 92, 0.45);
}
.btn-danger:hover { background: rgba(255, 92, 92, 0.1); }

.hint {
  color: var(--text-dim);
  font-size: 0.75rem;
  min-height: 1em;
  margin: 10px 0 0;
  letter-spacing: 0.03em;
}

.gallery {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line-dim);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  filter: saturate(1.05);
}
.photo-thumb .del-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 0;
  border: 1px solid var(--lime);
  background: #000;
  color: var(--lime);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}
.photo-thumb.selected {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}
.photo-thumb .select-check {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border: 1px solid var(--lime);
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
  accent-color: var(--lime);
}

.selection-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(198, 255, 26, 0.06);
  font-size: 0.75rem;
  color: var(--lime);
  flex-wrap: wrap;
}
.selection-bar.hidden { display: none; }
.selection-actions { display: flex; gap: 8px; }

textarea#textArea {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--lime);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 12px;
  resize: vertical;
  caret-color: var(--lime);
}
textarea#textArea::placeholder { color: var(--text-dim); }
textarea#textArea:focus { outline: none; box-shadow: 0 0 0 1px var(--lime); }

.text-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 92vw; max-height: 92vh; border: 1px solid var(--line); }
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 0;
  border: 1px solid var(--lime);
  background: #000;
  color: var(--lime);
  font-size: 1.1rem;
  cursor: pointer;
}
