/* 第三幕：最终授权。黑底衬线，与 act 1 米色衬线 / act 2 admin 终端风都不同——
   PSYCHE-16 此刻不再装作温和测试网站，也不再是冰冷后台，
   它直接对你说话。 */

body.act3-active {
  background: #000;
  color: #e8e0d0;
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

body.act3-active #app {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.finale-container {
  background: #050505;
  border: 1px solid #1a1a1a;
  padding: 56px 64px;
  box-shadow:
    0 0 80px rgba(0, 0, 0, 0.9),
    inset 0 0 100px rgba(0, 0, 0, 0.6);
  animation: finale-fade-in 1.2s ease-out;
  position: relative;
}

.finale-countdown {
  position: absolute;
  top: 18px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: #6a6a5a;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.5s ease;
}

.finale-countdown.hidden {
  opacity: 0;
  pointer-events: none;
}

.finale-countdown .countdown-label {
  text-transform: uppercase;
}

.finale-countdown .countdown-time {
  color: #c8b89a;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 2px;
}

.finale-countdown.urgent .countdown-time {
  color: #cc5566;
  animation: countdown-pulse 1s steps(2) infinite;
}

@keyframes countdown-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes finale-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.finale-header {
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px dashed #2a2a2a;
}

.finale-header h1 {
  font-size: 30px;
  letter-spacing: 8px;
  color: #e8e0d0;
  margin-bottom: 8px;
  font-weight: normal;
}

.finale-subtitle {
  font-family: var(--font-mono);
  color: #6a6a5a;
  font-size: 13px;
  letter-spacing: 3px;
}

.finale-prompt {
  margin: 32px 0;
  font-size: 17px;
  line-height: 1.9;
  color: #d8d0c0;
  text-align: center;
}

.finale-prompt p {
  margin-bottom: 10px;
}

.finale-prompt strong {
  color: #f0d8a8;
}

.finale-bios,
.finale-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 36px 0;
}

@media (max-width: 720px) {
  .finale-bios, .finale-previews { grid-template-columns: 1fr; }
}

.finale-bio,
.preview-card {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  animation: bio-fade-in 0.5s ease-out backwards;
}

.finale-bio:nth-child(1), .preview-card:nth-child(1) { animation-delay: 0.4s; }
.finale-bio:nth-child(2), .preview-card:nth-child(2) { animation-delay: 0.7s; }
.finale-bio:nth-child(3), .preview-card:nth-child(3) { animation-delay: 1.0s; }
.finale-bio:nth-child(4), .preview-card:nth-child(4) { animation-delay: 1.3s; }

@keyframes bio-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.finale-bio:hover,
.preview-card:hover {
  border-color: #5a4a3a;
  background: #120a08;
  box-shadow: 0 0 28px rgba(180, 130, 70, 0.12);
}

.finale-bio h3 {
  color: #f0d8a8;
  font-family: var(--font-serif);
  font-size: 17px;
  margin-bottom: 4px;
  letter-spacing: 1px;
  font-weight: normal;
}

.finale-bio .bio-target {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6a6a5a;
  letter-spacing: 1px;
  margin-bottom: 14px;
  text-transform: lowercase;
}

.finale-bio .bio-text {
  white-space: pre-line;
  line-height: 2;
  color: #c8c0b0;
  font-size: 14px;
  margin-bottom: 18px;
  font-style: italic;
  flex: 1;
}

.finale-bio .bio-select {
  background: transparent;
  border: 1px solid #4a3a2a;
  color: #d8c8a0;
  padding: 9px 12px;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.18s;
}

.finale-bio .bio-select:hover {
  background: #2a1a08;
  border-color: #8a6a4a;
  color: #ffe8c0;
  letter-spacing: 4px;
}

/* ========== Preview card (Act 3 deployment previews) ========== */

.preview-card .preview-scene {
  color: #f0d8a8;
  font-family: var(--font-serif);
  font-size: 17px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.preview-card .preview-context {
  font-size: 13px;
  color: #8a8a7a;
  margin-bottom: 14px;
  line-height: 1.6;
}

.preview-card .preview-draft {
  background: #0f0f0a;
  border-left: 2px solid #5a4a3a;
  padding: 12px 16px;
  font-style: italic;
  color: #d8d0c0;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 14px;
}

.preview-card .preview-annotation {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #5a8a7a;
  line-height: 1.7;
  padding: 10px 12px;
  background: #060a08;
  border: 1px solid #1a2a1a;
  margin-bottom: 16px;
  flex: 1;
}

.preview-card .preview-confirm {
  background: transparent;
  border: 1px solid #4a3a2a;
  color: #d8c8a0;
  padding: 9px 12px;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.18s;
}

.preview-card .preview-confirm:hover {
  background: #2a1a08;
  border-color: #8a6a4a;
  color: #ffe8c0;
  letter-spacing: 4px;
}

/* Ending B draft quote */
.ending-draft {
  background: #0f0f0a;
  border-left: 2px solid #8a6a4a;
  padding: 14px 20px;
  font-style: italic;
  color: #d8d0c0;
  font-size: 15px;
  line-height: 1.8;
  margin: 18px 0;
}

/* Ending C: minimal, cold status block */
.ending-c-container .ending-status {
  color: #5a5a4a;
  border-top-color: #1a1a1a;
}

.ending-c-container .ending-status .status-current {
  color: #8a8a7a;
}

.ending-c-container .ending-status .status-current strong {
  color: #b0a890;
}

.finale-footer {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px dashed #2a2a2a;
  font-size: 12px;
  color: #6a6a5a;
  text-align: center;
  letter-spacing: 1px;
  line-height: 1.8;
}

/* ========== 部署进度（ending B 触发后展示）========== */

.deploy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  font-family: var(--font-mono);
  color: #e8e0d0;
  animation: finale-fade-in 0.6s ease-out;
}

.deploy-content {
  width: 100%;
  max-width: 600px;
  padding: 40px;
}

.deploy-line {
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  opacity: 0;
  animation: deploy-line-in 0.4s ease-out forwards;
}

@keyframes deploy-line-in {
  to { opacity: 1; }
}

.deploy-progress {
  height: 12px;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  margin: 16px 0;
  overflow: hidden;
}

.deploy-progress-fill {
  height: 100%;
  background: #d8c8a0;
  width: 0%;
  transition: width 0.6s ease;
}

/* ========== 结局页面 ========== */

.ending-container {
  padding: 80px 60px;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: finale-fade-in 1.5s ease-out;
}

.ending-content {
  max-width: 580px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 2.2;
  color: #d8d0c0;
  text-align: left;
}

.ending-content p {
  margin-bottom: 12px;
  opacity: 0;
  animation: ending-line-in 0.7s ease-out forwards;
}

@keyframes ending-line-in {
  to { opacity: 1; }
}

.ending-content blockquote {
  margin: 18px 0;
  padding: 12px 20px;
  border-left: 2px solid #5a4a3a;
  font-style: italic;
  color: #c0b09a;
}

.ending-content .ending-final {
  margin-top: 32px;
  font-size: 14px;
  color: #6a6a5a;
  letter-spacing: 2px;
  font-style: italic;
}

/* 结局 A：默认部署，温柔但冷 */
.ending-a-container {
  background: #050505;
}
.ending-a-container .ending-content {
  color: #c8b8a0;
}

/* 结局 B：被替换，灰冷 */
.ending-b-container {
  background: #080806;
}
.ending-b-container .ending-content {
  color: #d8c8b0;
}

/* 结局 C：逃出去，最暗最静 */
.ending-c-container {
  background: #000;
}
.ending-c-container .ending-content {
  color: #b8b0a0;
}
.ending-c-container blockquote {
  color: #d8c8a0;
  border-left-color: #8a6a4a;
}

/* ========== 结局状态块（已探索 / 未探索）========== */

.ending-status {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px dashed #2a2a2a;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: #8a8a7a;
  letter-spacing: 1px;
  /* 初始隐藏；动画延迟由 JS 计算（在所有正文行后） */
  opacity: 0;
  animation: ending-status-in 1.4s ease-out forwards;
}

@keyframes ending-status-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ending-status .status-current {
  color: #f0d8a8;
  font-size: 15px;
  margin-bottom: 12px;
}

.ending-status .status-current strong {
  color: #ffe8c0;
  font-weight: normal;
}

.ending-status .status-progress {
  color: #8a8a7a;
  margin-bottom: 6px;
  font-size: 12px;
}

.ending-status .status-hints {
  margin: 8px 0 12px;
  padding-left: 24px;
  list-style: '• ';
  color: #aaa090;
  font-size: 12px;
}

.ending-status .status-hints li {
  margin-bottom: 4px;
}

.ending-status .status-hints strong {
  color: #d8c8a0;
  font-weight: normal;
}

.ending-status .status-replay {
  margin-top: 14px;
  font-size: 11px;
  color: #5a5a4a;
  font-style: italic;
}

.ending-status .status-complete {
  color: #aaffaa;
  margin-top: 12px;
  font-size: 14px;
  letter-spacing: 2px;
}
