:root {
  --bg-void: #05010f;
  --bg-panel: rgba(15, 8, 35, 0.75);
  --cyan: #00fff2;
  --magenta: #ff2ee6;
  --violet: #7b2ff7;
  --text-main: #e6f9ff;
  --text-dim: #8fa3b8;
  --danger: #ff3860;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: "Consolas", "Courier New", "Microsoft YaHei", monospace;
  overflow-x: hidden;
}

#matrix-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
}

.container {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.title {
  position: relative;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  letter-spacing: 0.25em;
  margin: 0;
  color: var(--text-main);
  text-shadow:
    0 0 6px var(--cyan),
    0 0 18px var(--cyan);
  animation: flicker 6s infinite;
}

.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 0);
}

.title::before {
  color: var(--magenta);
  transform: translate(2px, 0);
  animation: glitch-1 3.2s infinite linear alternate-reverse;
  opacity: 0.7;
}

.title::after {
  color: var(--cyan);
  transform: translate(-2px, 0);
  animation: glitch-2 2.6s infinite linear alternate-reverse;
  opacity: 0.7;
}

.subtitle {
  margin-top: 6px;
  letter-spacing: 0.35em;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.panel {
  background: var(--bg-panel);
  border: 1px solid rgba(0, 255, 242, 0.35);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(123, 47, 247, 0.15), inset 0 0 24px rgba(0, 255, 242, 0.04);
}

.field {
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.date-select-row {
  display: flex;
  gap: 8px;
}

.date-select-row select {
  flex: 1;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
}

label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.req {
  color: var(--magenta);
}

input,
select,
textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 242, 0.3);
  color: var(--text-main);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 2px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 255, 242, 0.4);
}

select option {
  background: #0a0420;
}

.btn-oracle {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: linear-gradient(90deg, rgba(123, 47, 247, 0.25), rgba(0, 255, 242, 0.25));
  border: 1px solid var(--cyan);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.btn-oracle:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(0, 255, 242, 0.6);
  transform: translateY(-1px);
}

.btn-oracle:disabled {
  opacity: 0.5;
  cursor: wait;
}

.result-panel {
  border-color: rgba(255, 46, 230, 0.4);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.btn-stage {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(0, 255, 242, 0.4);
  color: var(--cyan);
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
}

.btn-stage:hover {
  box-shadow: 0 0 10px rgba(0, 255, 242, 0.5);
}

/* 投屏模式：隐藏表单/页头页脚，只把神谕结果放大居中，方便 OBS 浏览器源全屏采集 */
body.stage-mode .header,
body.stage-mode .form-panel,
body.stage-mode .footer,
body.stage-mode .error-panel {
  display: none !important;
}

body.stage-mode .container {
  max-width: 100%;
  padding: 0;
  min-height: 100vh;
}

body.stage-mode .result-panel {
  min-height: 100vh;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 48px;
}

body.stage-mode .result-header {
  justify-content: center;
}

body.stage-mode .result-title {
  font-size: 1.1rem;
}

body.stage-mode .btn-stage {
  position: fixed;
  top: 16px;
  right: 16px;
  margin-left: 0;
}

body.stage-mode .result-text {
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  text-align: center;
  line-height: 2.1;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 8px var(--magenta);
  animation: pulse 1.4s infinite ease-in-out;
}

.result-title {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--magenta);
  text-transform: uppercase;
}

.result-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-main);
  margin: 0;
}

.result-notice {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--danger);
}

.followup-panel {
  border-color: rgba(123, 47, 247, 0.4);
}

.followup-panel label {
  color: var(--violet);
}

.followup-row {
  display: flex;
  gap: 8px;
}

.followup-row input {
  flex: 1;
}

.btn-followup {
  width: auto;
  margin-top: 0;
  padding: 10px 20px;
  white-space: nowrap;
}

body.stage-mode .followup-panel {
  display: none !important;
}

.error-panel {
  border-color: var(--danger);
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-top: 16px;
}

@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.6; }
}

@keyframes glitch-1 {
  0% { clip-path: inset(0 0 90% 0); }
  20% { clip-path: inset(20% 0 40% 0); }
  40% { clip-path: inset(60% 0 10% 0); }
  60% { clip-path: inset(10% 0 70% 0); }
  80% { clip-path: inset(40% 0 30% 0); }
  100% { clip-path: inset(0 0 90% 0); }
}

@keyframes glitch-2 {
  0% { clip-path: inset(70% 0 5% 0); }
  20% { clip-path: inset(10% 0 60% 0); }
  40% { clip-path: inset(50% 0 20% 0); }
  60% { clip-path: inset(5% 0 80% 0); }
  80% { clip-path: inset(30% 0 40% 0); }
  100% { clip-path: inset(70% 0 5% 0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}
