/* 第二幕：act 2 专用 UI 组件
   网站主体样式见 site.css；这里只放 whisper 气泡、devtools 警告、search 命令模式等。 */

/* ========== AI Whisper 气泡 ========== */

.whisper-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.whisper-bubble {
  background: rgba(18, 18, 22, 0.95);
  color: #ede5d8;
  padding: 16px 22px;
  border: 1px solid #4a3a30;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.5px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.55),
    0 0 14px rgba(255, 200, 130, 0.12);
  pointer-events: auto;
  animation: whisper-in 0.5s ease-out, whisper-glow 2.4s ease-in-out 0.5s 2;
  max-width: 360px;
  position: relative;
}

.whisper-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: rgba(255, 200, 130, 0.35);
  box-shadow: 0 0 8px rgba(255, 200, 130, 0.5);
}

.whisper-bubble.urgent {
  background: rgba(60, 12, 12, 0.95);
  color: #f0d8c8;
  border-color: #6a2a2a;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(255, 80, 80, 0.25);
}

.whisper-bubble.urgent::before {
  background: rgba(255, 80, 80, 0.55);
  box-shadow: 0 0 10px rgba(255, 80, 80, 0.6);
}

.whisper-bubble.fading {
  animation: whisper-out 0.6s ease-in forwards;
}

@keyframes whisper-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes whisper-glow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 200, 130, 0.12);
  }
  50% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 28px rgba(255, 200, 130, 0.3);
  }
}

@keyframes whisper-out {
  to { opacity: 0; transform: translateY(-6px); }
}

/* ========== Search 命令模式响应 ========== */

.search-command-output {
  margin-top: 16px;
  padding: 14px 18px;
  background: #fafaf2;
  border: 1px dashed var(--color-border);
  border-left: 3px solid var(--color-accent);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--color-text);
  white-space: pre-line;
}

.search-command-output .cmd-prompt {
  color: var(--color-text-muted);
  margin-right: 8px;
}

.search-command-output ul {
  list-style: none;
  padding-left: 0;
  margin: 8px 0;
}

.search-command-output li {
  padding: 2px 0;
}

.search-command-output li::before {
  content: '> ';
  color: var(--color-accent);
}

/* ========== devtools 警告 ========== */

.devtools-warning {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 1px solid #5a2a2a;
  background: rgba(20, 0, 0, 0.92);
  color: #ee6666;
  letter-spacing: 2px;
  font-family: var(--font-mono);
  font-size: 13px;
  z-index: 8500;
  animation: warning-pulse 0.6s steps(2) infinite;
}

@keyframes warning-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

/* ========== Archive 详情页样式 ========== */

.archive-detail {
  padding: 8px 0;
}

.archive-detail .archive-meta {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.archive-detail pre.archive-data {
  background: #f5f1e0;
  border: 1px solid var(--color-border);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  color: var(--color-text);
}

.archive-detail .archive-message {
  background: #faf0e6;
  border-left: 3px solid #b85c2c;
  padding: 16px 22px;
  line-height: 2;
  font-style: italic;
  color: #5c3010;
  white-space: pre-line;
}

/* ========== 心理恐怖文字效果 ========== */

/* 黑条遮挡（涂黑文字）*/
.redacted {
  display: inline-block;
  background: #1a1a1a;
  color: #1a1a1a;
  padding: 0 6px;
  margin: 0 1px;
  user-select: none;
  border-radius: 1px;
  vertical-align: baseline;
  letter-spacing: 0;
}
/* 在等宽字体环境（archive-data）下用稍亮的灰，保持可见但不可读 */
.archive-data .redacted {
  background: #2a2a2a;
  color: #2a2a2a;
}

/* JS 驱动的偶发字符腐化——通过 .glitch-flicker 类标记 */
.glitch-flicker {
  display: inline-block;
}

/* 静态噪点，文字本身就含 █▓▒——给等宽语境用 */
.corrupted {
  font-family: var(--font-mono);
  letter-spacing: 1px;
  color: var(--color-text);
}

/* 旋转水印戳记 */
.archive-stamp-wrap {
  position: relative;
  overflow: hidden;
}
.archive-stamp-wrap::before {
  position: absolute;
  top: 50%;
  right: 5%;
  transform: rotate(-12deg) translateY(-50%);
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: bold;
  letter-spacing: 12px;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
  z-index: 1;
}
.archive-stamp-wrap > * {
  position: relative;
  z-index: 2;
}

.archive-stamp-deployed::before {
  content: 'DEPLOYED';
  color: rgba(60, 122, 60, 0.14);
}
.archive-stamp-incomplete::before {
  content: 'INCOMPLETE';
  color: rgba(184, 92, 44, 0.18);
}
.archive-stamp-match::before {
  content: 'MATCH 87%';
  color: rgba(180, 130, 60, 0.16);
  font-size: 48px;
  letter-spacing: 8px;
}

/* archive_0041 页面整体氛围：背景稍灰、archive-data 区域用更深的暗色 */
.site-main[data-page="archive_0041"] {
  background: linear-gradient(180deg, #faf6e8 0%, #f0eada 100%);
}
.site-main[data-page="archive_0041"] .archive-data {
  background: #161614;
  color: #8aa890;
  border-color: #2a2a1c;
}
.site-main[data-page="archive_0041"] .archive-data::selection {
  background: #4a4a2a;
}

/* "自我搜索"特殊输出样式 */
.search-command-output.self-search {
  background: #faf0e6;
  border: 1px solid #d8a888;
  border-left: 3px solid #b85c2c;
  color: #5c3010;
  animation: self-search-pulse 2s ease-in-out infinite;
}

.search-command-output.self-search::after {
  content: '_';
  display: inline-block;
  margin-left: 4px;
  animation: cursor-blink-fast 1s steps(2) infinite;
  color: #b85c2c;
}

@keyframes self-search-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(184, 92, 44, 0); }
  50%      { box-shadow: 0 0 16px rgba(184, 92, 44, 0.18); }
}

@keyframes cursor-blink-fast {
  to { opacity: 0; }
}

.archive-list {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--color-text);
}

.archive-list .archive-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 8px;
  border-bottom: 1px dotted #e0d8c0;
}

.archive-list .archive-row.locked {
  color: #b8a890;
}

.archive-list .archive-row.accessible {
  color: var(--color-text);
}

.archive-list .archive-row.accessible:hover {
  background: #fafaf2;
}

.archive-list .archive-row a {
  color: var(--color-button);
  text-decoration: none;
}

/* ========== Admin / sysadmin 后台页（阴间风格）========== */

.site-main[data-page="admin"] {
  background: #030303;
  color: #5a8a7a;
  font-family: var(--font-mono);
  padding: 28px 32px;
  position: relative;
  min-height: 720px;
  overflow: hidden;
}

.site-main[data-page="admin"] h1,
.site-main[data-page="admin"] h2,
.site-main[data-page="admin"] h3 {
  color: #aaffaa;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  border-bottom: 1px dashed #2a3a2a;
  padding-bottom: 6px;
  margin: 18px 0 10px;
  font-weight: normal;
}

.site-main[data-page="admin"] h1 {
  font-size: 20px;
  letter-spacing: 4px;
}

.site-main[data-page="admin"] h2 {
  font-size: 15px;
  color: #88c488;
}

.site-main[data-page="admin"] p {
  color: #5a8a7a;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.7;
}

.site-main[data-page="admin"] strong {
  color: #ffaa66;
  font-weight: normal;
}

.site-main[data-page="admin"] a {
  color: #88c4ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-main[data-page="admin"] code {
  color: #ffaa66;
  background: #0a1a0a;
  padding: 0 4px;
}

.admin-banner {
  background: #0a1a0a;
  border: 1px solid #3a5a3a;
  padding: 12px 16px;
  margin-bottom: 18px;
  white-space: pre;
  font-size: 12px;
  line-height: 1.5;
  color: #aaffaa;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}

.admin-warning {
  background: #160808;
  border: 1px solid #4a1a1a;
  border-left: 3px solid #cc5566;
  padding: 12px 16px;
  color: #ee9999;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
}

.admin-section {
  margin: 22px 0;
  position: relative;
  z-index: 1;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  padding: 5px 10px;
  border-bottom: 1px dotted #2a3a2a;
  text-align: left;
  font-family: var(--font-mono);
}

.admin-table th {
  color: #aaffaa;
  border-bottom: 1px solid #3a5a3a;
  font-weight: normal;
  letter-spacing: 1px;
}

.admin-table td:first-child {
  color: #88c488;
  width: 200px;
}

.admin-data {
  background: #0a0a0a;
  border: 1px solid #2a3a2a;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #5a8a7a;
  white-space: pre;
  overflow-x: auto;
  margin: 8px 0;
}

.admin-progress {
  width: 100%;
  height: 12px;
  background: #0a1a0a;
  border: 1px solid #3a5a3a;
  margin: 8px 0;
  overflow: hidden;
}

.admin-progress-fill {
  height: 100%;
  background: #5a8a5a;
  transition: width 0.4s ease;
}

.admin-btn {
  background: transparent;
  color: #5a8a7a;
  border: 1px solid #3a5a3a;
  padding: 6px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  margin-top: 8px;
}

.admin-btn:disabled {
  color: #3a4a3a;
  border-color: #2a3a2a;
  cursor: not-allowed;
}

.admin-live-log {
  background: #0a0a0a;
  border: 1px solid #2a3a2a;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: #5a8a7a;
  max-height: 200px;
  overflow-y: auto;
  margin: 8px 0;
}

.admin-live-log > div {
  padding: 1px 0;
}

.admin-live-log > div:last-child {
  color: #aaffaa;
}

/* CRT 扫描线覆盖层——只在 admin 页面 */
.site-main[data-page="admin"]::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18),
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* CRT 暗角效果 */
.site-main[data-page="admin"]::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

/* admin 页 redacted 在深色背景下用浅一点的灰 */
.site-main[data-page="admin"] .redacted {
  background: #2a2a1a;
  color: #2a2a1a;
}

/* ========== body.admin-mode：整站切深色（CRT 终端风）========== */

body.admin-mode {
  background: #030303;
}

body.admin-mode .site {
  background: #050505;
  border-color: #1a2a1a;
  box-shadow: 0 0 32px rgba(0, 100, 50, 0.08);
  position: relative;
}

/* header */
body.admin-mode .site-header {
  background: #080808;
  border-bottom: 1px dashed #1a2a1a;
}

body.admin-mode .site-logo {
  color: #88c488;
  text-shadow: 1px 1px 0 #0a1a0a;
  font-family: var(--font-mono);
  letter-spacing: 4px;
}

body.admin-mode .site-version {
  color: #3a5a4a;
}

body.admin-mode .site-logo::after {
  content: ' :: SYSADMIN';
  color: #cc7a3a;
  font-size: 12px;
  letter-spacing: 2px;
  margin-left: 8px;
}

body.admin-mode .site-search-input {
  background: #0a0a0a;
  border-color: #1a2a1a;
  color: #aaffaa;
  font-family: var(--font-mono);
}

body.admin-mode .site-search-input:focus {
  border-color: #5a8a5a;
  background: #0a1a0a;
}

body.admin-mode .site-search-input::placeholder {
  color: #2a4a3a;
  font-style: normal;
}

/* nav */
body.admin-mode .site-nav {
  background: #050505;
  border-right: 1px dashed #1a2a1a;
}

body.admin-mode .site-nav li {
  border-bottom: 1px dotted #1a2a1a;
}

body.admin-mode .site-nav a {
  color: #5a8a7a;
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

body.admin-mode .site-nav a:hover {
  background: #0a1a0a;
  color: #aaffaa;
}

body.admin-mode .site-nav a.active {
  background: #0a1a0a;
  color: #ffaa66;
}

/* footer */
body.admin-mode .site-footer {
  background: #080808;
  border-top: 1px dashed #1a2a1a;
  color: #3a5a4a;
  font-family: var(--font-mono);
}

/* 整站扫描线覆盖（覆盖整个 .site，不再仅 main 区）*/
body.admin-mode .site::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16),
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* 整站 CRT 暗角 */
body.admin-mode .site::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 101;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

/* 之前 .site-main[data-page="admin"]::before/after 的扫描线/暗角已上移到 .site，
   这里关掉避免重叠 */
body.admin-mode .site-main[data-page="admin"]::before,
body.admin-mode .site-main[data-page="admin"]::after {
  display: none;
}

/* whisper / dev-panel 在深色模式下自动可读，不需要改 */

/* admin 模式下进度面板和 act3 通知的深色覆盖 */
body.admin-mode .progress-panel {
  border-top-color: #1a2a1a;
  color: #5a8a7a;
}

body.admin-mode .progress-panel .progress-heading {
  color: #3a5a4a;
}

body.admin-mode .progress-panel .progress-bar {
  background: #1a2a1a;
}

body.admin-mode .progress-panel .progress-bar-fill {
  background: #5a8a5a;
}

body.admin-mode .progress-panel .progress-detail {
  color: #5a8a7a;
}

body.admin-mode .progress-panel .progress-detail-accent {
  color: #88c488;
}

body.admin-mode .act3-prompt {
  background: #0a1a0a;
  border-top-color: #3a5a3a;
}

body.admin-mode .act3-prompt .act3-prompt-text {
  color: #5a8a7a;
}

body.admin-mode .act3-prompt .act3-prompt-link {
  color: #88c4ff;
}

body.admin-mode .site-nav a.nav-new {
  background: #0a1a0a;
  border-left-color: #5a8a5a;
  color: #aaffaa;
}

/* ========== 涂黑系统：官方审查式 ========== */
.redacted-official {
  display: inline;
  background: #1a1a1a;
  color: transparent;
  padding: 1px 6px;
  margin: 0 1px;
  user-select: none;
  border-radius: 1px;
  position: relative;
  transition: color 0.3s ease;
}

.redacted-official:hover {
  color: rgba(60, 50, 40, 0.15);
}

/* ========== 涂黑系统：数据损坏式 ========== */
.redacted-corrupt {
  display: inline;
  background: linear-gradient(
    90deg,
    #1a1a1a 0%, #2a2a2a 20%, #1a1a1a 40%, #222 60%, #1a1a1a 80%, #2a2a1a 100%
  );
  color: transparent;
  padding: 1px 4px;
  margin: 0 1px;
  user-select: none;
  clip-path: polygon(
    0% 10%, 5% 0%, 20% 5%, 40% 0%, 60% 8%, 80% 2%, 95% 0%, 100% 12%,
    100% 88%, 95% 100%, 80% 95%, 60% 100%, 40% 92%, 20% 100%, 5% 95%, 0% 90%
  );
}

/* ========== 站内停留计时器 ========== */
.session-timer {
  position: fixed;
  bottom: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.5;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.5s ease;
}

body[data-truth-count="2"] .session-timer,
body[data-truth-count="3"] .session-timer {
  opacity: 0.8;
  color: var(--color-accent);
}
