﻿/* ===== 全局变量 ===== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-dim: #808080;
  --text-faint: #555;
  --accent-green: #00ff41;
  --accent-amber: #ffb000;
  --accent-red: #ff3333;
  --accent-blue: #4a9eff;
  --border-color: #333;
  --redacted: #222;
  --terminal-font: 'Courier New', 'Consolas', monospace;
  /* 公司风格变量 */
  --corp-white: #f8f9fa;
  --corp-blue: #1a73e8;
  --corp-light: #e8f0fe;
  --corp-gray: #5f6368;
  --corp-bg: #ffffff;
  --corp-border: #dadce0;
}

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

body {
  font-family: var(--terminal-font);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background 1.5s ease;
}

/* ===== 背景图模式 ===== */
body.mode-corp {
  background: var(--corp-bg) url('bg-corp.jpg') no-repeat center top fixed;
  background-size: 100% auto;
  background-attachment: fixed;
}
body.mode-portal {
  background: #f0f2f5 url('bg-lobby.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #333;
}
body.mode-terminal {
  background: #f0f2f5 url('bg-archive.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #333;
}
body.mode-void {
  background: #050003 url('bg-void.jpg') no-repeat center center fixed;
  background-size: cover;
}

/* ===== 动态桌面背景（按权限等级/模块/药状态切换）===== */
body.bg-stage1-oa {
  background: #e8eef5 url('bg-office-day.jpg') no-repeat center center fixed;
  background-size: cover;
}
body.bg-stage2-terminal {
  background: #0a0e14 url('bg-server-room.jpg') no-repeat center center fixed;
  background-size: cover;
}
body.bg-stage3-scp {
  background: #0c0608 url('bg-scp-archive.jpg') no-repeat center center fixed;
  background-size: cover;
}
body.bg-zone-b {
  background: #0d0f10 url('bg-bzone.jpg') no-repeat center center fixed;
  background-size: cover;
}

/* 停药状态裂纹叠加层 */
body.pill-offmeds::after {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 9994;
  pointer-events: none;
  background: url('bg-mind-fracture.jpg') no-repeat center center fixed;
  background-size: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
}
body.pill-offmeds.pill-offmeds-active::after {
  opacity: 0.35;
}
body.pill-withdrawing::after {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 9994;
  pointer-events: none;
  background: url('bg-mind-fracture.jpg') no-repeat center center fixed;
  background-size: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
}
body.pill-withdrawing.pill-withdrawing-active::after {
  opacity: 0.12;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
  transition: background 1s ease;
}
/* ===================================================== */
/* ====== 基础布局（暗色终端主题，stage1覆盖转明亮）===== */
/* ===================================================== */

/* ===== 屏幕/容器 ===== */
#game-container { position: relative; width: 100%; min-height: 100vh; z-index: 1; }

.screen { display: none; }
.screen.active { display: block; }

/* ===== 覆盖层 ===== */
#vignette-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 9990; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%);
  opacity: 0.8;
}
body.mode-corp #vignette-overlay { display: none; }
body.stage1 #vignette-overlay { display: none; }

#flash-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 10002; pointer-events: none; opacity: 0;
  transition: opacity 0.15s ease;
}
#flash-overlay.flash-white { background: #fff; opacity: 0.9; }
#flash-overlay.flash-red { background: #ff0000; opacity: 0.7; }

/* ===== 公司官网 — 居中白色容器，两侧露出建筑背景 ===== */
#corp-screen.active {
  display: block;
  max-width: 1024px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 60px rgba(0,0,0,0.15);
}

/* 导航栏 — 白底通栏，与内容同宽 */
.corp-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 60px;
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid #e8eaed;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.corp-logo {
  font-size: 17px; font-weight: 700; color: #1a56c4; letter-spacing: 1px;
}
.corp-nav-links { display: flex; gap: 2px; }
.corp-nav-link {
  padding: 8px 18px; cursor: pointer; font-size: 14px;
  color: #5f6368; border-radius: 4px; transition: all .15s;
  text-decoration: none;
}
.corp-nav-link:hover { background: #f1f3f4; color: #1a73e8; }
.corp-nav-link.active { color: #1a73e8; font-weight: 600; background: #e8f0fe; }

/* Tab 切换 */
.corp-tab { display: none; }
.corp-tab.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Banner — 圆角通栏，蓝底白字 */
.corp-hero {
  position: relative; height: 300px; overflow: hidden;
  margin: 16px 20px 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
  display: flex; align-items: center; justify-content: center;
}
.corp-hero-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, rgba(26,35,126,0.15) 0%, rgba(10,10,30,0.45) 100%);
  border-radius: 12px;
}
.corp-hero-text { position: relative; text-align: center; color: #fff; z-index: 1; padding: 0 20px; }
.corp-hero-text h1 { font-size: 30px; letter-spacing: 4px; margin-bottom: 10px; font-weight: 300; }
.corp-hero-text p { font-size: 15px; opacity: 0.9; margin-bottom: 2px; }
.corp-since { font-size: 13px !important; opacity: 0.6 !important; }

/* 内容区块 — 白底，内边距 */
.corp-section {
  padding: 36px 32px;
}
.corp-section h2 {
  font-size: 22px; color: #1a56c4; margin-bottom: 20px;
  padding-bottom: 10px; border-bottom: 2px solid #e8f0fe;
}
.corp-section p { font-size: 15px; color: #333; margin-bottom: 12px; line-height: 1.9; }

/* 业务卡片 */
.corp-cards { display: flex; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.corp-card {
  flex: 1; min-width: 220px; background: #f8f9fa; border: 1px solid #e8eaed;
  border-radius: 8px; padding: 24px; transition: box-shadow .2s, transform .2s;
}
.corp-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.corp-card .card-icon { font-size: 28px; color: #1a73e8; margin-bottom: 12px; }
.corp-card h3 { font-size: 16px; color: #1a56c4; margin-bottom: 8px; }
.corp-card p { font-size: 13px; color: #5f6368; line-height: 1.6; margin: 0; }

/* 图片块 */
.corp-img-block { margin: 24px 0; text-align: center; }
.corp-img { max-width: 75%; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.corp-img-caption { font-size: 12px; color: #999; margin-top: 8px; }

/* 引用 */
.corp-quote {
  margin: 28px 0; padding: 20px 24px; background: #f0f4ff; border-left: 4px solid #1a73e8;
  border-radius: 0 8px 8px 0; font-size: 15px; color: #333; font-style: italic;
}
.quote-author { display: block; margin-top: 8px; font-size: 13px; color: #5f6368; font-style: normal; }

/* 页脚 */
.corp-footer {
  text-align: center; padding: 20px; font-size: 12px; color: #999;
  border-top: 1px solid #e8eaed;
}

/* 组织架构 */
.dept-tree { padding: 8px 0; }
.dept-node { padding: 8px 12px; font-size: 14px; color: #333; cursor: default; }
.dept-root { font-weight: 700; color: #1a56c4; }
.dept-icon { margin-right: 6px; }
.dept-children { margin-left: 24px; border-left: 2px solid #e8eaed; padding-left: 8px; }
.dept-clickable { cursor: pointer; border-radius: 4px; transition: all .15s; }
.dept-clickable:hover { background: #e8f0fe; color: #1a73e8; }
.dept-special { cursor: pointer; color: #999; }
.dept-special:hover { background: #fce8e6; }
.dept-faded { color: #bbb; }
.dept-sub { font-size: 12px; color: #bbb; margin-left: 6px; }
.dept-faint { color: #ddd; }
.dept-question { color: #ddd; letter-spacing: 1px; }
.special-dept-note {
  margin-top: 12px; padding: 12px 16px; background: #fce8e6; border-radius: 6px;
  font-size: 13px; color: #d93025;
}
.dept-detail-panel { margin-top: 16px; }
.dept-detail-header { font-size: 16px; font-weight: 700; color: #1a56c4; margin-bottom: 8px; }
.dept-detail-desc { font-size: 13px; color: #5f6368; margin-bottom: 12px; }
.dept-detail-fields { font-size: 13px; }
.dept-field-row { display: flex; padding: 6px 0; border-bottom: 1px solid #e8eaed; }
.dept-field-label { min-width: 100px; color: #999; }
.dept-field-val { color: #333; }
.dept-detail-note {
  margin-top: 12px; padding: 8px 12px; font-size: 12px;
  background: #fef7e0; border-left: 3px solid #f9ab00; color: #5d4037; border-radius: 0 4px 4px 0;
}

/* 新闻 */
.news-item { padding: 16px 0; border-bottom: 1px solid #e8eaed; }
.news-item:last-child { border-bottom: none; }
.news-date { font-size: 12px; color: #999; margin-bottom: 4px; }
.news-title {
  font-size: 15px; font-weight: 600; color: #1a56c4; cursor: pointer; margin-bottom: 6px;
  transition: color .15s;
}
.news-title:hover { color: #1a73e8; text-decoration: underline; }
.news-body { font-size: 13px; color: #5f6368; line-height: 1.7; }
.news-full { display: none; }

/* 联系我们 */
.contact-info { font-size: 14px; line-height: 2.2; }
.contact-info strong { color: #1a56c4; }
.inline-link { color: #1a73e8; cursor: pointer; text-decoration: underline; }
.inline-link:hover { color: #d93025; }

/* ===== 员工登录页 ===== */
.portal-container {
  max-width: 480px; margin: 0 auto; padding: 50px 24px; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; position: relative; z-index: 2;
}
.portal-login-card {
  display: flex; flex-direction: column;
}
.portal-brand-area {
  text-align: center; margin-bottom: 28px;
}
.portal-brand-mark {
  display: inline-block; width: 56px; height: 56px; line-height: 56px;
  font-size: 28px; color: #1a56c4;
  background: #e8f0fe; border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(26,86,196,0.12);
}

/* ===== 员工桌面后台 ===== */
#portal-desktop {
  min-height: 100vh; position: relative; z-index: 1;
  max-width: 1060px; margin: 0 auto; padding: 12px 16px 40px;
}
.desktop-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; font-size: 13px;
  background: rgba(10,10,15,0.92); border: 1px solid #2a2a2a; border-bottom: none;
  border-radius: 8px 8px 0 0; color: #8ab4f8;
}
.header-right { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.header-right span { white-space: nowrap; }
.desktop-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px 12px; background: rgba(15,15,20,0.92);
  border: 1px solid #2a2a2a; border-top: none;
}
.tool-btn {
  padding: 6px 14px; font-size: 12px; cursor: pointer;
  background: #1a1a1a; border: 1px solid #333; color: #b0b0b0;
  border-radius: 3px; transition: all .15s; font-family: var(--terminal-font);
}
.tool-btn:hover { border-color: #8ab4f8; color: #8ab4f8; background: rgba(138,180,248,0.08); }
.tool-btn.active { border-color: #8ab4f8; color: #8ab4f8; background: rgba(138,180,248,0.12); font-weight: 600; }

.desktop-body {
  padding: 20px; background: rgba(10,10,15,0.88);
  border: 1px solid #2a2a2a; border-top: none; border-radius: 0 0 8px 8px;
  min-height: 500px; margin-bottom: 20px;
}

/* ===== 两栏布局（主内容 + 线索板）===== */
.desktop-columns {
  display: flex; gap: 16px; align-items: flex-start;
}
.main-column { flex: 1; min-width: 0; }
.clue-panel {
  width: 280px; flex-shrink: 0;
  background: rgba(15,15,20,0.9); border: 1px solid #2a2a2a; border-radius: 6px;
  position: sticky; top: 10px; max-height: calc(100vh - 120px); overflow-y: auto;
}
.clue-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #2a2a2a;
}
.clue-panel-title { font-size: 13px; color: #8ab4f8; letter-spacing: 2px; }
.clue-panel-count {
  font-size: 11px; color: #666; border: 1px solid #333;
  padding: 1px 8px; border-radius: 10px; background: rgba(0,0,0,0.3);
}
.clue-list { padding: 8px; }
.clue-empty {
  text-align: center; color: #444; font-size: 12px; padding: 24px 8px; line-height: 1.6;
}
.clue-item {
  padding: 8px 10px; margin-bottom: 6px;
  border-left: 2px solid rgba(138,180,248,0.3);
  background: rgba(138,180,248,0.04); border-radius: 0 4px 4px 0;
  transition: all 0.3s ease;
}
.clue-item.new-entry {
  animation: clueFlash 0.6s ease;
}
@keyframes clueFlash {
  0% { background: rgba(255,176,0,0.15); border-left-color: #ffb000; }
  100% { background: rgba(138,180,248,0.04); border-left-color: rgba(138,180,248,0.3); }
}
.clue-item-source {
  font-size: 10px; color: #555; margin-bottom: 4px; letter-spacing: 1px;
}
.clue-item-text {
  font-size: 12px; color: #b0b0b0; line-height: 1.6;
}
.clue-item-divider {
  height: 1px; background: #2a2a2a; margin: 4px 0;
}

.module-content { color: #d0d0d0; font-size: 14px; line-height: 1.8; }
.module-content h3 { color: #8ab4f8; font-size: 16px; margin-bottom: 12px; }
.module-content p { margin-bottom: 8px; }

/* Welcome panel */
.welcome-panel {
  background: rgba(138,180,248,0.08); border-left: 3px solid #8ab4f8;
  border-radius: 0 6px 6px 0; padding: 16px; margin-bottom: 16px;
}
.welcome-panel h3 { color: #8ab4f8; margin-bottom: 8px; }
.welcome-panel p { color: #b0b0b0; }

/* Sticky note */
.sticky-note {
  background: rgba(255,176,0,0.06); border: 1px solid rgba(255,176,0,0.15);
  border-radius: 6px; padding: 16px; margin-top: 16px;
}
.sticky-title {
  font-size: 13px; color: #ffb000; margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,176,0,0.15);
}
.sticky-note ol { padding-left: 20px; font-size: 13px; color: #b0b0b0; line-height: 2; }
.sticky-note .sticky-sign { text-align: right; font-size: 12px; color: #777; margin-top: 8px; }

/* Divider */
.divider { border: none; border-top: 1px solid #333; margin: 16px 0; }

/* ===== 站内消息 ===== */
.email-list { list-style: none; }
.email-item {
  padding: 12px; border-bottom: 1px solid #2a2a2a; cursor: pointer;
  transition: background .15s; border-left: 3px solid transparent;
}
.email-item:hover { background: rgba(138,180,248,0.06); }
.email-item.unread { border-left-color: #ffb000; }
.email-date { font-size: 11px; color: #777; }
.email-sender { font-size: 13px; font-weight: 600; color: #8ab4f8; }
.email-subject { font-size: 13px; color: #d0d0d0; }
.email-tag { font-size: 10px; color: #ffb000; margin-left: 6px; }
.email-preview { font-size: 12px; color: #888; margin-top: 4px; }

/* ===== 文档中心 ===== */
.file-list { list-style: none; }
.file-list li {
  padding: 10px 12px; border-bottom: 1px solid #2a2a2a; cursor: pointer;
  display: flex; align-items: center; gap: 8px; transition: background .15s;
}
.file-list li:hover { background: rgba(138,180,248,0.06); }
.file-list li.locked { opacity: 0.5; cursor: not-allowed; }
.folder-icon { color: #ffb000; font-size: 16px; }
.file-icon { color: #8ab4f8; font-size: 16px; }
.file-status { font-size: 11px; color: #777; margin-left: auto; }
.file-status.locked-tag { color: #ff3333; }
.file-status.read-tag { color: #5f6368; }

/* 文档已读/未读区分 */
.file-list li.doc-read { opacity: 0.55; }
.file-list li.doc-read .file-icon { color: #555; }
.file-list li.doc-unread { font-weight: 600; }
.doc-unread-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #4a90d9; flex-shrink: 0; box-shadow: 0 0 4px rgba(74,144,217,0.5);
}
/* 侧边栏徽章 */
.nav-badge { font-size: 11px; color: #4a90d9; font-weight: normal; }

/* ===== 通讯录 ===== */
.directory-item {
  padding: 10px 12px; border-bottom: 1px solid #2a2a2a; cursor: pointer;
  transition: background .15s; display: flex; align-items: flex-start; gap: 12px;
}
.directory-item:hover { background: rgba(138,180,248,0.06); }

/* 头像 */
.dir-avatar {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: #222; border: 1px solid #3a3a3a;
}
.dir-avatar img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.15) contrast(1.05);
}
.dir-avatar-initial {
  background: linear-gradient(135deg, #1a3a5c, #2a5a8c);
  border-color: #3a6a9c;
}
.dir-avatar-initial span {
  font-size: 18px; font-weight: 600; color: #b0d0f0;
}
.dir-avatar-placeholder {
  background: #2a2a2a; border-color: #555;
}
.dir-avatar-placeholder span {
  font-size: 16px; color: #777;
}
.dir-avatar-anomaly {
  background: #1a1a1a; border: 1px dashed #555;
}
.dir-avatar-broken {
  font-size: 20px; color: #444; letter-spacing: 2px;
}

/* 通讯录主信息区 */
.dir-main {
  flex: 1; min-width: 0;
}
.dir-main .dir-name { margin-right: 8px; }
.dir-name { font-size: 14px; color: #8ab4f8; font-weight: 600; }
.dir-info { font-size: 12px; color: #777; margin-top: 2px; }
.dir-tag { font-size: 10px; padding: 2px 8px; border-radius: 3px; display: inline-block; vertical-align: middle; }
.dir-tag.normal { background: #2a2a2a; color: #8ab4f8; border: 1px solid #333; }
.dir-tag.special { background: #2a1a1a; color: #ff3333; border: 1px solid #4a2222; }
.dir-detail {
  margin-top: 8px; padding: 12px; background: rgba(20,20,25,0.6);
  border: 1px solid #333; border-radius: 4px; font-size: 13px;
}
.dir-row { display: flex; padding: 4px 0; }
.dir-label { min-width: 80px; color: #777; }
.dir-val { color: #d0d0d0; }
.dir-note {
  margin-top: 8px; padding: 8px; font-size: 12px; background: rgba(255,51,51,0.08);
  border-left: 2px solid rgba(255,51,51,0.3); color: #999;
}

/* ===== 个人信息 ===== */
.profile-card {
  background: rgba(20,20,25,0.6); border: 1px solid #333; border-radius: 6px;
  padding: 16px; font-size: 13px;
}
.profile-row { display: flex; padding: 6px 0; border-bottom: 1px solid #2a2a2a; }
.profile-row:last-child { border-bottom: none; }
.profile-label { min-width: 100px; color: #777; }
.profile-value { color: #d0d0d0; }
.permission-upgrade {
  background: rgba(138,180,248,0.08); border: 1px solid rgba(138,180,248,0.2);
  border-radius: 6px; padding: 12px; margin-top: 12px;
}
.permission-upgrade p { color: #8ab4f8; }

/* Memory bar */
.memory-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #b0b0b0; max-width: 400px; }
.memory-bar span { min-width: 40px; }
.memory-bar-track {
  flex: 1; height: 8px; background: #2a2a2a; border-radius: 4px; overflow: hidden;
}
.memory-bar-fill { height: 100%; max-width: 100%; transition: width .5s ease, background .5s ease; }

/* System logs */
.sys-log-entry {
  padding: 8px 12px; border-bottom: 1px solid #2a2a2a; font-size: 12px;
  display: flex; gap: 8px; align-items: flex-start;
}
.sys-log-time { color: #777; white-space: nowrap; font-size: 11px; }
.sys-log-type { font-size: 10px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.sys-log-type.info { background: #1a2a1a; color: #6ec07a; }
.sys-log-type.warn { background: #2a2a1a; color: #ffb000; }
.sys-log-type.error { background: #2a1a1a; color: #ff3333; }

/* SCP hint (hidden text) */
.scp-hint { color: rgba(138,180,248,0.1); cursor: pointer; transition: color .3s; }
.scp-hint:hover { color: rgba(138,180,248,0.4); }

/* ===== 搜索 ===== */
.search-box { margin-bottom: 16px; }
.search-box input {
  width: 100%; padding: 10px 14px; font-size: 14px;
  background: rgba(10,10,15,0.8); border: 1px solid #333; color: #d0d0d0;
  border-radius: 4px; font-family: var(--terminal-font);
}
.search-box input:focus { border-color: #8ab4f8; outline: none; box-shadow: 0 0 5px rgba(138,180,248,0.2); }
.search-box input::placeholder { color: #555; }
.search-results { font-size: 13px; }
.search-result-item {
  padding: 10px 12px; border-bottom: 1px solid #2a2a2a; cursor: pointer;
  transition: background .15s; color: #d0d0d0;
}
.search-result-item:hover { background: rgba(138,180,248,0.06); }
.search-error { color: #ff3333; font-size: 13px; padding: 8px; }
.cog-gate-notice {
  padding: 12px; background: rgba(255,176,0,0.06); border-left: 3px solid rgba(255,176,0,0.3);
  border-radius: 0 4px 4px 0; font-size: 13px; color: #b0b0b0; margin-bottom: 12px;
}

/* ===== 模态框 ===== */
.modal {
  display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 10000; background: rgba(0,0,0,0.7);
  align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
  background: #1a1a1a; border: 1px solid #333; border-radius: 8px;
  max-width: 680px; width: 90%; max-height: 85vh; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #222; border-bottom: 1px solid #333;
  font-size: 14px; color: #8ab4f8; border-radius: 8px 8px 0 0;
}
.modal-body {
  padding: 20px; color: #d0d0d0; font-size: 14px; line-height: 1.8;
  overflow-y: auto; max-height: 70vh;
}
.modal-body h3 { color: #8ab4f8; margin-bottom: 12px; }
.modal-body p { color: #b0b0b0; margin-bottom: 8px; }
.close-btn {
  background: transparent; border: 1px solid #444; color: #ff3333;
  cursor: pointer; font-size: 16px; padding: 2px 8px; border-radius: 3px;
  font-family: var(--terminal-font);
}
.close-btn:hover { background: rgba(255,51,51,0.1); }
.password-modal-content { max-width: 420px; }
.password-modal-content input {
  width: 100%; padding: 10px; font-size: 14px; margin: 8px 0;
  background: rgba(10,10,15,0.8); border: 1px solid #333; color: #d0d0d0;
  border-radius: 4px; font-family: var(--terminal-font);
}
.password-modal-content input:focus { border-color: #8ab4f8; outline: none; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%);
  padding: 10px 24px; font-size: 13px; z-index: 10001;
  background: rgba(10,10,15,0.95); border: 1px solid #8ab4f8; color: #8ab4f8;
  border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-8px); }
.toast.warning { border-color: #ffb000; color: #ffb000; }
.toast.danger { border-color: #ff3333; color: #ff3333; }

/* ===== 按钮 ===== */
.small-btn {
  padding: 6px 14px; font-size: 12px; cursor: pointer;
  background: #1a1a1a; border: 1px solid #333; color: #b0b0b0;
  border-radius: 3px; transition: all .15s; font-family: var(--terminal-font);
}
.small-btn:hover { border-color: #8ab4f8; color: #8ab4f8; }
.small-btn.danger { border-color: #4a2222; color: #ff3333; }
.small-btn.danger:hover { background: rgba(255,51,51,0.1); }

/* ===== 最终抉择 ===== */
.choice-btn {
  display: block; width: 100%; padding: 14px 16px; margin-bottom: 8px;
  font-size: 14px; cursor: pointer; text-align: left;
  background: #1a1a1a; border: 1px solid #333; color: #d0d0d0;
  border-radius: 6px; transition: all .2s; font-family: var(--terminal-font);
}
.choice-btn:hover { border-color: #8ab4f8; background: rgba(138,180,248,0.08); }
.choice-label { font-weight: 600; color: #8ab4f8; margin-right: 8px; }
.hidden-choice { opacity: 0.3; }

/* ===== 结局画面 ===== */
.ending-container {
  max-width: 680px; margin: 0 auto; padding: 60px 40px; text-align: center;
  position: relative; z-index: 2;
  background: rgba(8, 6, 12, 0.92);
  border: 1px solid #1a1a2a;
  border-radius: 8px;
  margin-top: 40px;
  margin-bottom: 40px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}
.ending-container p {
  margin-bottom: 14px;
  line-height: 1.8;
  color: #c0c0c8;
}
.ending-title { font-size: 24px; color: #ffb000; letter-spacing: 4px; margin-bottom: 24px; text-align: center; }
.ending-title.ending-d { color: #ff00ff; text-shadow: 0 0 10px rgba(255,0,255,0.3); }
.ending-sign { font-size: 14px; color: #666; margin-top: 32px; text-align: center; }
.ending-final {
  margin-top: 40px; padding: 16px; font-size: 13px; color: #555;
  border-top: 1px solid #2a2a2a; text-align: center;
}

/* ===== 文档内容样式 ===== */
.doc-entry {
  border-left: 2px solid #444; padding: 8px 12px; margin-bottom: 16px;
}
.entry-date { font-size: 12px; color: #6ec07a; margin-bottom: 4px; }
.handwritten { color: #e0b040; font-style: italic; }
.redacted { background: #333; color: #333; border-radius: 2px; }
.struck-through { text-decoration: line-through; color: #777; }
.cognitive-anchor {
  color: #8ab4f8; border-bottom: 1px dashed #8ab4f8; cursor: help;
}
.audio-wave {
  color: #8ab4f8; border-bottom: 1px solid #8ab4f8; cursor: pointer; font-style: italic;
}

/* ===== 视觉特效 ===== */
.corrupted #vignette-overlay { opacity: 1; }
.heavy #vignette-overlay {
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.85) 100%);
  opacity: 1;
}
.fading-text { animation: fadeTextOut 8s ease forwards; }
@keyframes fadeTextOut {
  0%, 60% { opacity: 1; }
  100% { opacity: 0.1; }
}

/* stage1 portal 模式：轻度蒙版，保留背景图可见度 */
body.stage1.mode-portal::before { background: rgba(255, 255, 255, 0.45); }
/* 非 stage1 portal 模式：保留原有深色蒙版 */
body:not(.stage1).mode-portal::before { background: rgba(8, 12, 18, 0.85); }
.portal-title { color: #1a56c4; font-size: 17px; font-weight: 600; letter-spacing: 1px; margin-bottom: 2px; }
.portal-subtitle { color: #5f6368; font-size: 11px; letter-spacing: 2px; }
.portal-box {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #dadce0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 24px 28px;
}
.portal-box > p { color: #333; }
.portal-login-form { }
.portal-form-hint {
  color: #5f6368; font-size: 13px; margin-bottom: 18px;
  padding-bottom: 12px; border-bottom: 1px solid #f0f0f0;
}
.portal-field { margin-bottom: 16px; }
.portal-field label {
  color: #5f6368; font-size: 12px; display: block; margin-bottom: 6px;
  letter-spacing: 1px;
}
.portal-field input {
  background: #fff;
  border: 1px solid #dadce0;
  color: #333;
  border-radius: 6px;
  width: 100%; box-sizing: border-box;
  padding: 10px 14px; font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.portal-field input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26,115,232,.12);
  outline: none;
}
.portal-btn {
  background: #1a73e8;
  border: 1px solid #1a73e8;
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  width: 100%; padding: 11px 0; font-size: 15px;
  cursor: pointer; letter-spacing: 4px;
  transition: all .2s;
}
.portal-btn:hover { background: #1557b0; border-color: #1557b0; box-shadow: 0 2px 8px rgba(26,115,232,0.25); }
.portal-btn:active { transform: scale(0.98); }
.error-msg { color: #d93025; font-size: 12px; margin-top: 8px; text-align: center; }
.portal-hint { color: #999; text-align: center; font-size: 12px; margin-bottom: 0; }
.portal-footer-info {
  text-align: center; margin-top: 24px;
  font-size: 11px; color: #aaa;
  display: flex; justify-content: center; gap: 16px;
}
#portal-login .divider { border-color: #e8eaed; margin: 20px 0; }
.onboarding-letter {
  background: #f0f4ff;
  border: 1px solid #c5d9ff;
  border-radius: 8px;
  padding: 18px;
  margin-top: 4px;
}
.letter-header {
  font-weight: 600; color: #1a56c4; font-size: 13px;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid #d0e0ff;
  letter-spacing: 1px;
}
.onboarding-letter p { color: #444; font-size: 13px; margin-bottom: 6px; line-height: 1.7; }
.onboarding-letter strong { color: #1a56c4; font-size: 15px; }
.letter-credentials {
  background: rgba(255,255,255,0.7); border-radius: 6px; padding: 8px 12px; margin: 8px 0;
}

/* ===================================================== */
/* ====== Stage 1 明亮企业OA桌面风格 ==================== */
/* ===================================================== */

/* Body overlay for stage 1 — 去掉泛白蒙版，背景图直接显示 */
body.stage1::before { background: transparent; }

/* 动态桌面背景的蒙版层——保证文字可读性 */
body.bg-stage2-terminal::before { background: rgba(6, 10, 16, 0.82); }
body.bg-stage3-scp::before { background: rgba(12, 4, 6, 0.80); }
body.bg-zone-b::before { background: rgba(8, 10, 12, 0.78); }
body.stage1.bg-stage1-oa::before { background: rgba(232, 238, 245, 0.35); }

/* Desktop header */
body.stage1 .desktop-header {
  background: rgba(255,255,255,0.97);
  border: 1px solid #dadce0;
  color: #1a56c4;
  border-radius: 8px 8px 0 0;
}
body.stage1 .header-right { color: #5f6368; }
body.stage1 .header-logout { color: #5f6368; }
body.stage1 .header-logout:hover { color: #d93025; }

/* Toolbar */
body.stage1 .desktop-toolbar {
  background: rgba(248,249,250,0.97);
  border: 1px solid #dadce0;
  border-top: none;
}

/* Tool buttons */
body.stage1 .tool-btn {
  background: #fff;
  border: 1px solid #dadce0;
  color: #333;
  border-radius: 4px;
}
body.stage1 .tool-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
}
body.stage1 .tool-btn.active {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
  font-weight: 600;
}

/* Desktop body */
body.stage1 .desktop-body {
  background: rgba(255,255,255,0.97);
  border: 1px solid #dadce0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  color: #333;
}
body.stage1 .module-content { color: #333; }

/* Clue panel — Stage 1 */
body.stage1 .clue-panel {
  background: rgba(248,249,250,0.97); border-color: #dadce0;
}
body.stage1 .clue-panel-header { border-bottom-color: #dadce0; }
body.stage1 .clue-panel-title { color: #1a73e8; }
body.stage1 .clue-panel-count {
  border-color: #dadce0; background: #e8f0fe; color: #1a73e8;
}
body.stage1 .clue-empty { color: #999; }
body.stage1 .clue-item {
  background: #f1f3f4; border-left-color: #1a73e8;
}
body.stage1 .clue-item-text { color: #333; }
body.stage1 .clue-item-source { color: #5f6368; }
body.stage1 .clue-item-divider { background: #e8eaed; }

/* Welcome panel */
body.stage1 .welcome-panel {
  background: #e8f0fe !important;
  border-left: 3px solid #1a73e8;
  border-radius: 0 6px 6px 0;
}
body.stage1 .welcome-panel h3 { color: #1a56c4 !important; }
body.stage1 .welcome-panel p { color: #333 !important; }

/* Sticky note */
body.stage1 .sticky-note {
  background: #fff8e1 !important;
  border: 1px solid #ffe082 !important;
  border-radius: 6px;
}
body.stage1 .sticky-title {
  color: #e65100 !important;
  border-bottom-color: #ffe082 !important;
}
body.stage1 .sticky-note ol li { color: #5d4037 !important; }
body.stage1 .sticky-note .sticky-sign { color: #8d6e63 !important; }

/* Divider */
body.stage1 .divider { border-color: #e8eaed !important; }

/* H3 headers in module content */
body.stage1 .module-content h3 { color: #1a56c4 !important; }

/* File/email list */
body.stage1 .file-list li,
body.stage1 .email-item {
  border-bottom-color: #e8eaed !important;
  color: #333 !important;
}
body.stage1 .file-list li:hover,
body.stage1 .email-item:hover { background: #f1f3f4 !important; }
body.stage1 .file-list li.locked { color: #999 !important; }
body.stage1 .email-item.unread { border-left-color: #1a73e8 !important; }
body.stage1 .email-sender { color: #e65100 !important; }
body.stage1 .email-subject { color: #1a56c4 !important; }
body.stage1 .email-preview { color: #5f6368 !important; }
body.stage1 .email-date { color: #999 !important; }
body.stage1 .email-tag { color: #d93025 !important; }
body.stage1 .file-status { color: #5f6368 !important; }
body.stage1 .file-status.locked-tag { color: #d93025 !important; }
body.stage1 .file-icon { color: #1a73e8 !important; }
body.stage1 .folder-icon { color: #e65100 !important; }
body.stage1 .file-status.read-tag { color: #999 !important; }
body.stage1 .file-list li.doc-read { color: #999 !important; opacity: 1; }
body.stage1 .file-list li.doc-read .file-icon { color: #bcc0c4 !important; }
body.stage1 .file-list li.doc-unread { color: #1a56c4 !important; }
body.stage1 .doc-unread-dot { background: #1a73e8; box-shadow: 0 0 4px rgba(26,115,232,0.4); }
body.stage1 .nav-badge { color: #1a73e8; }

/* Communication directory */
body.stage1 .directory-item {
  border-bottom-color: #e8eaed !important;
  color: #333 !important;
}
body.stage1 .directory-item:hover { background: #f1f3f4 !important; }
body.stage1 .dir-name { color: #1a56c4 !important; }
body.stage1 .dir-info { color: #5f6368 !important; }
body.stage1 .dir-tag.normal {
  background: #e8f0fe !important; color: #1a73e8 !important;
  border: 1px solid #c5d9ff !important;
}
body.stage1 .dir-tag.special {
  background: #fce8e6 !important; color: #d93025 !important;
  border: 1px solid #f5c6c2 !important;
}

/* Dir avatars — Stage 1 bright theme */
body.stage1 .dir-avatar {
  background: #f0f2f5 !important; border-color: #dadce0 !important;
}
body.stage1 .dir-avatar img {
  filter: none;
}
body.stage1 .dir-avatar-initial {
  background: linear-gradient(135deg, #4a90d9, #1a56c4) !important;
  border-color: #1a56c4 !important;
}
body.stage1 .dir-avatar-initial span {
  color: #fff !important;
}
body.stage1 .dir-avatar-placeholder {
  background: #e8eaed !important; border-color: #bcc0c4 !important;
}
body.stage1 .dir-avatar-placeholder span {
  color: #5f6368 !important;
}
body.stage1 .dir-avatar-anomaly {
  background: #fce8e6 !important; border: 1px dashed #d93025 !important;
}
body.stage1 .dir-avatar-broken {
  color: #d93025 !important;
}

/* Dir detail popup */
body.stage1 .dir-detail {
  background: #f8f9fa !important;
  border: 1px solid #e8eaed !important;
  color: #333;
}
body.stage1 .dir-detail .dir-label { color: #5f6368 !important; }
body.stage1 .dir-detail .dir-val { color: #333 !important; }
body.stage1 .dir-detail .dir-note {
  background: #fce8e6 !important;
  border-left-color: #d93025 !important;
  color: #d93025 !important;
}

/* Profile card */
body.stage1 .profile-card {
  background: #f8f9fa !important;
  border: 1px solid #dadce0 !important;
  border-radius: 6px;
  color: #333 !important;
}
body.stage1 .profile-row { border-bottom-color: #e8eaed !important; }
body.stage1 .profile-label { color: #5f6368 !important; }
body.stage1 .profile-value { color: #333 !important; }

/* Permission upgrade note */
body.stage1 .permission-upgrade {
  background: #e8f0fe !important;
  border: 1px solid #c5d9ff !important;
}
body.stage1 .permission-upgrade p { color: #1a56c4 !important; }

/* Memory bar */
body.stage1 .memory-bar { color: #333 !important; }
body.stage1 .memory-bar-track { background: #e8eaed !important; }

/* System logs */
body.stage1 .sys-log-entry {
  border-bottom-color: #e8eaed !important;
  color: #333 !important;
}
body.stage1 .sys-log-time { color: #999 !important; }
body.stage1 .sys-log-type.info {
  background: #e8f0fe !important; color: #1a73e8 !important;
}
body.stage1 .sys-log-type.warn {
  background: #fef7e0 !important; color: #b06000 !important;
}
body.stage1 .sys-log-type.error {
  background: #fce8e6 !important; color: #d93025 !important;
}

/* Search */
body.stage1 .search-box input {
  background: #fff !important;
  border: 1px solid #dadce0 !important;
  color: #333 !important;
  border-radius: 4px;
}
body.stage1 .search-box input:focus { border-color: #1a73e8 !important; }
body.stage1 .search-result-item {
  border-bottom-color: #e8eaed !important;
  color: #333 !important;
}
body.stage1 .search-result-item:hover { background: #f1f3f4 !important; }
body.stage1 .search-error { color: #d93025 !important; }

/* Small buttons */
body.stage1 .small-btn {
  background: #fff !important;
  border: 1px solid #dadce0 !important;
  color: #333 !important;
  border-radius: 4px;
}
body.stage1 .small-btn:hover {
  border-color: #1a73e8 !important;
  color: #1a73e8 !important;
}

/* Modal - doc viewer in stage 1 */
body.stage1 .modal { background: rgba(0,0,0,0.35); }
body.stage1 .modal-content {
  background: #fff !important;
  border: 1px solid #dadce0 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
  border-radius: 8px;
}
body.stage1 .modal-header {
  background: #f8f9fa !important;
  border-bottom-color: #e8eaed !important;
  color: #1a56c4 !important;
  border-radius: 8px 8px 0 0;
}
body.stage1 .modal-body { color: #333 !important; }
body.stage1 .modal-body h3 { color: #1a56c4 !important; }
body.stage1 .modal-body p { color: #333; }
body.stage1 .close-btn {
  border-color: #dadce0 !important;
  color: #d93025 !important;
  border-radius: 4px;
}

/* Password input in stage 1 */
body.stage1 #pwd-input {
  background: #fff !important;
  border: 1px solid #dadce0 !important;
  color: #333 !important;
  border-radius: 4px;
}
body.stage1 #pwd-input:focus { border-color: #1a73e8 !important; }

/* Toast in stage 1 */
body.stage1 .toast {
  background: #fff !important;
  border: 1px solid #1a73e8 !important;
  color: #1a73e8 !important;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
body.stage1 .toast.warning {
  border-color: #e65100 !important;
  color: #e65100 !important;
}
body.stage1 .toast.danger {
  border-color: #d93025 !important;
  color: #d93025 !important;
}

/* Doc entries inside modal */
body.stage1 .doc-entry { border-left-color: #c5d9ff !important; }
body.stage1 .entry-date { color: #1a73e8 !important; }
body.stage1 .handwritten { color: #e65100 !important; }
body.stage1 .redacted { background: #ccc !important; color: #ccc !important; }
body.stage1 .struck-through { color: #999 !important; }
body.stage1 .cognitive-anchor {
  color: #1a56c4 !important;
  border-bottom-color: #1a73e8 !important;
}
body.stage1 .audio-wave {
  color: #1a73e8 !important;
  border-bottom-color: #1a73e8 !important;
}
body.stage1 .scp-hint { color: rgba(26,86,196,0.2) !important; }
body.stage1 .scp-hint:hover { color: rgba(26,86,196,0.5) !important; }

/* Scrollbar in stage 1 */
body.stage1::-webkit-scrollbar-track { background: #f1f3f4; }
body.stage1::-webkit-scrollbar-thumb { background: #c4c7c5; }
body.stage1::-webkit-scrollbar-thumb:hover { background: #999; }

/* ===================================================== */
/* ====== Dark theme (stage 2+) contrast overrides ====== */
/* ===================================================== */

/* Override inline styles in document bodies for dark theme */
body:not(.stage1) .modal-body p[style*="color:#555"],
body:not(.stage1) .modal-body p[style*="color: #555"] { color: #999 !important; }
body:not(.stage1) .modal-body p[style*="color:#444"],
body:not(.stage1) .modal-body p[style*="color: #444"] { color: #aaa !important; }
body:not(.stage1) .modal-body div[style*="color:#555"],
body:not(.stage1) .modal-body div[style*="color: #555"] { color: #999 !important; }
body:not(.stage1) .modal-body p[style*="color:#ccc"] { color: #777 !important; }
body:not(.stage1) .modal-body p[style*="color:#ddd"] { color: #666 !important; }
body:not(.stage1) .modal-body p[style*="color:#999"] { color: #888 !important; }

/* Doc entry text in dark theme */
body:not(.stage1) .doc-entry { border-left-color: #444 !important; }
body:not(.stage1) .doc-entry p { color: #d0d0d0; }
body:not(.stage1) .entry-date { color: #6ec07a !important; }
body:not(.stage1) .handwritten { color: #e0b040 !important; }
body:not(.stage1) .redacted { background: #333 !important; color: #333 !important; }
body:not(.stage1) .struck-through { color: #777 !important; }
body:not(.stage1) .cognitive-anchor { color: #8ab4f8 !important; border-bottom-color: #8ab4f8 !important; }
body:not(.stage1) .audio-wave { color: #8ab4f8 !important; border-bottom-color: #8ab4f8 !important; }
body:not(.stage1) .choice-btn { background: #1a1a1a !important; border: 1px solid #444 !important; color: #e0e0e0 !important; }
body:not(.stage1) .choice-btn:hover { border-color: var(--accent-amber) !important; background: rgba(255,176,0,.08) !important; }

/* Email/Document inline style overrides for dark theme */
body:not(.stage1) .email-list .email-item { color: #d0d0d0; }
body:not(.stage1) .file-list li { color: #d0d0d0; }
body:not(.stage1) .file-status { color: #909090 !important; }

/* H3 headers in module content for dark theme */
body:not(.stage1) .module-content h3 { color: #8ab4f8; }

/* Search input placeholder for dark theme */
body:not(.stage1) .search-box input::placeholder { color: #666; }

/* Welcome panel text in dark theme */
body:not(.stage1) .welcome-panel h3 { color: #8ab4f8; }
body:not(.stage1) .welcome-panel p { color: #b0b0b0; }

/* Return-to-website button in header */
.header-logout {
  margin-left: 12px;
  font-size: 11px;
  color: #8ab4f8;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}
.header-logout:hover { color: #ffb000; }

/* Search hint chips */
.search-hint-chip {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  margin: 2px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s;
}
.search-hint-chip:hover { border-color: #8ab4f8; color: #8ab4f8; }

/* ===== 扫描线效果（暗色终端模式）===== */
.scanlines {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9992;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0) 2px,
    rgba(0,255,65,0.03) 3px,
    rgba(0,0,0,0) 4px
  );
  animation: scanline-flicker 8s infinite linear;
}
body:not(.stage1) .scanlines { display: block; }

@keyframes scanline-flicker {
  0% { opacity: 0.6; }
  50% { opacity: 0.9; }
  51% { opacity: 0.3; }
  52% { opacity: 0.85; }
  100% { opacity: 0.6; }
}

/* CRT 边角暗角效果 */
body:not(.stage1) #portal-desktop::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9991;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
}

/* Stage 1（明亮模式）无扫描线 */
body.stage1 .scanlines { display: none !important; }
body.stage1 #portal-desktop::before { display: none; }

/* ===== 进度指示器 ===== */
.progress-indicator {
  font-size: 11px;
  color: #909090;
  font-family: var(--terminal-font);
  padding: 2px 8px;
  border: 1px solid #444;
  border-radius: 3px;
  white-space: nowrap;
  display: none;
}
body.stage1 .progress-indicator {
  color: #5f6368;
  border-color: #dadce0;
  background: #f1f3f4;
  display: inline-block;
}
body:not(.stage1) .progress-indicator {
  color: #8ab4f8;
  border-color: #333;
  background: rgba(10,10,10,0.8);
  display: inline-block;
}

/* ===== 记忆完整性视觉故障效果 ===== */
@keyframes memory-glitch {
  0% { transform: translate(0); filter: hue-rotate(0deg); }
  20% { transform: translate(-2px, 1px); filter: hue-rotate(90deg) contrast(1.2); }
  40% { transform: translate(2px, -1px); filter: hue-rotate(180deg) contrast(0.8); }
  60% { transform: translate(-1px, -1px); filter: hue-rotate(270deg) saturate(2); }
  80% { transform: translate(1px, 2px); filter: hue-rotate(45deg) brightness(0.9); }
  100% { transform: translate(0); filter: hue-rotate(0deg); }
}

body.memory-critical #portal-desktop {
  animation: memory-glitch 3s infinite steps(10);
}

/* 故障文本闪烁 */
@keyframes text-glitch {
  0%, 100% { opacity: 1; }
  33% { opacity: 0.7; text-shadow: 2px 0 #ff3333, -2px 0 #00ffff; }
  66% { opacity: 0.8; text-shadow: -2px 0 #ff3333, 2px 0 #00ffff; }
}

body.memory-critical .desktop-header span {
  animation: text-glitch 2s infinite;
}

/* ===== 认知测试 UI ===== */
.cognitive-test-content {
  max-width: 420px !important;
}

#cogtest-sequence {
  font-family: var(--terminal-font);
  color: #00ff41;
  text-shadow: 0 0 10px rgba(0,255,65,0.5);
  transition: opacity 0.3s;
}

#cogtest-sequence.hide {
  opacity: 0;
}

#cogtest-input {
  border-radius: 4px;
  outline: none;
}
#cogtest-input:focus {
  border-color: #8ab4f8 !important;
  box-shadow: 0 0 5px rgba(74,158,255,0.3);
}

/* Stage 1（明亮模式）认知测试样式 */
body.stage1 #cogtest-sequence {
  color: #1a73e8;
  text-shadow: none;
}
body.stage1 #cogtest-input {
  background: #fff !important;
  border-color: #dadce0 !important;
  color: #202124 !important;
}

/* 认知测试数字闪现动画 */
@keyframes number-flash {
  0% { opacity: 0; transform: scale(1.5); }
  30% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}
.cog-flash { animation: number-flash 0.8s ease-in-out; }

/* ===================================================== */
/* ====== 新增模块样式 ================================== */
/* ===================================================== */

/* ===== 通讯拨号动画 ===== */
.comms-dot {
  display: inline-block;
  animation: comms-dot-pulse 1s infinite ease-in-out;
}
@keyframes comms-dot-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ===== 药瓶模块 ===== */
.pill-bottle-area {
  text-align: center;
  padding: 20px 0;
}
.pill-bottle-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: inline-block;
  animation: pill-float 3s infinite ease-in-out;
}
@keyframes pill-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.pill-state-label {
  font-size: 14px;
  margin-bottom: 6px;
}
.pill-state-desc {
  font-size: 13px;
  max-width: 500px;
  margin: 0 auto 16px;
  line-height: 1.7;
}
.pill-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pill-offmeds-notice {
  padding: 12px;
  border-left: 3px solid rgba(255,51,51,0.3);
  margin-top: 12px;
  animation: pill-warning-pulse 2s infinite;
}
@keyframes pill-warning-pulse {
  0%, 100% { background: rgba(255,51,51,0.05); }
  50% { background: rgba(255,51,51,0.12); }
}

/* ===== 通讯系统 ===== */
.comms-dial-area {
  text-align: center;
  padding: 12px 0;
}
.comms-dial-display input {
  text-align: center;
  font-size: 20px;
  letter-spacing: 8px;
  width: 200px;
  padding: 10px;
}
.comms-log {
  font-size: 12px;
}
.comms-log-item {
  padding: 6px 8px;
  border-bottom: 1px solid #3a3a3a;
  transition: background 0.15s;
}
.comms-log-item:hover {
  background: rgba(138,180,248,0.08);
}
.comms-response {
  padding: 16px;
  border: 1px solid #3a3a3a;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  animation: comms-response-in 0.4s ease;
}
@keyframes comms-response-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.comms-response-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid #3a3a3a;
  padding-bottom: 8px;
}
.comms-response-body {
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  min-height: 40px;
}
.comms-dialing {
  font-size: 14px;
  animation: comms-dialing-blink 1s infinite;
}
@keyframes comms-dialing-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== B区探索 ===== */
.bzone-corridor-desc {
  padding: 16px;
  font-size: 14px;
  line-height: 1.9;
  border-radius: 6px;
}
.bzone-rooms {
  margin-top: 8px;
}
.bzone-room-item {
  padding: 10px 12px;
  border: 1px solid #3a3a3a;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 6px;
}
.bzone-room-item:hover {
  border-color: #8ab4f8;
  background: rgba(138,180,248,0.06);
}
.bzone-room-item.locked {
  cursor: not-allowed;
  opacity: 0.5;
}
.bzone-room-desc {
  padding: 16px;
  font-size: 14px;
  line-height: 1.9;
  border-radius: 6px;
}
.bzone-room-actions {
  margin-top: 16px;
}

/* B区行动结果框 */
.bzone-action-result {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.8;
  border-radius: 6px;
  animation: bzoneResultFadeIn 0.4s ease;
}
@keyframes bzoneResultFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* B区停药/感知提示框 */
.bzone-offmeds-note {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 12px;
  border-radius: 4px;
  line-height: 1.7;
}
.bzone-offmeds-note.danger {
  background: rgba(255,51,51,0.06);
  border-left: 3px solid rgba(255,51,51,0.3);
}
.bzone-offmeds-note.warning {
  background: rgba(255,176,0,0.06);
  border-left: 3px solid rgba(255,176,0,0.3);
}

/* B区房间项 */
.bzone-room-name { transition: color .15s; }
.bzone-room-tag-locked { font-size: 10px; }
.bzone-room-tag-visited { font-size: 10px; }

/* ===== B区——Stage 1 明亮主题 ===== */
body.stage1 .bzone-corridor-desc,
body.stage1 .bzone-room-desc {
  color: #333 !important;
  background: #f8f9fa !important;
  border: 1px solid #e8eaed !important;
}
body.stage1 .bzone-room-item {
  border-color: #dadce0 !important;
  color: #333 !important;
}
body.stage1 .bzone-room-item:hover {
  border-color: #1a73e8 !important;
  background: #e8f0fe !important;
}
body.stage1 .bzone-room-name { color: #333 !important; }
body.stage1 .bzone-room-name.visited { color: #1a73e8 !important; }
body.stage1 .bzone-room-tag-locked { color: #d93025 !important; }
body.stage1 .bzone-room-tag-visited { color: #999 !important; }

/* 行动结果框——Stage 1 */
body.stage1 .bzone-action-result {
  background: #f0f4ff !important;
  border: 1px solid #c5d9ff !important;
  color: #333 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* 停药提示——Stage 1 保持可读性 */
body.stage1 .bzone-offmeds-note.danger {
  background: rgba(220,53,69,0.06) !important;
  border-left-color: rgba(220,53,69,0.4) !important;
  color: #c62828 !important;
}
body.stage1 .bzone-offmeds-note.warning {
  background: rgba(248,177,30,0.08) !important;
  border-left-color: rgba(248,177,30,0.4) !important;
  color: #e65100 !important;
}

/* B区小按钮——Stage 1 */
body.stage1 .bzone-room-actions .small-btn {
  background: #fff !important;
  border: 1px solid #dadce0 !important;
  color: #333 !important;
}
body.stage1 .bzone-room-actions .small-btn:hover {
  border-color: #1a73e8 !important;
  color: #1a73e8 !important;
  background: #e8f0fe !important;
}

/* ===== B区——暗色终端主题（Stage 2+）===== */
body:not(.stage1) .bzone-corridor-desc,
body:not(.stage1) .bzone-room-desc {
  color: #c0c0c0;
  background: rgba(0,0,0,0.25);
  border: 1px solid #3a3a3a;
}
body:not(.stage1) .bzone-action-result {
  background: rgba(0,0,0,0.3);
  border: 1px solid #3a3a3a;
  color: #c0c0c0;
}
body:not(.stage1) .bzone-offmeds-note.danger {
  background: rgba(255,51,51,0.05);
  border-left: 3px solid rgba(255,51,51,0.2);
  color: #ff6666;
}
body:not(.stage1) .bzone-offmeds-note.warning {
  background: rgba(255,176,0,0.05);
  border-left: 3px solid rgba(255,176,0,0.2);
  color: #ffb000;
}
body:not(.stage1) .bzone-room-name { color: #999; }
body:not(.stage1) .bzone-room-name.visited { color: #8ab4f8; }
body:not(.stage1) .bzone-room-tag-locked { color: #ff3333; }
body:not(.stage1) .bzone-room-tag-visited { color: #555; }

/* ===== 考勤打卡 ===== */
.attendance-today {
  padding: 20px;
  text-align: center;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  margin-bottom: 16px;
}
.attendance-records {
  font-size: 12px;
}

/* ===== 模块插图通用 ===== */
.module-illustration {
  width: 100%;
  max-width: 560px;
  border-radius: 8px;
  border: 1px solid #3a3a3a;
  display: block;
  margin: 16px auto;
}
.module-illustration-caption {
  font-size: 11px;
  color: #909090;
  text-align: center;
  margin-top: 4px;
  margin-bottom: 12px;
}

/* ===== 彩蛋照片 ===== */
.easter-egg-photo {
  width: 100%;
  max-width: 480px;
  border-radius: 8px;
  border: 1px solid #3a3a3a;
  display: block;
  margin: 16px auto;
  transition: transform 0.3s;
}
.easter-egg-photo:hover {
  transform: scale(1.02);
}
.easter-egg-caption {
  font-size: 11px;
  color: #909090;
  text-align: center;
  margin-top: 4px;
  margin-bottom: 16px;
  font-style: italic;
}

/* ===== 搜索增强——人名相关文档 ===== */
.person-search-basic {
  padding: 10px;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  margin-bottom: 12px;
}
.person-search-docs {
  padding: 10px;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
}
.person-search-doc-item {
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #2a2a2a;
  cursor: pointer;
  transition: color 0.15s;
}
.person-search-doc-item:hover {
  color: #8ab4f8;
}
.person-search-hint {
  margin-top: 8px;
  padding: 8px;
  border-left: 2px solid rgba(255,176,0,0.2);
  font-size: 11px;
  color: #999;
}

/* ===================================================== */
/* ====== Stage 1 覆盖——新模块明亮模式 ================ */
/* ===================================================== */

/* 药瓶 */
body.stage1 .pill-bottle-icon { filter: none; }
body.stage1 .pill-state-desc { color: #5f6368 !important; }
body.stage1 .pill-offmeds-notice {
  background: #fce8e6 !important;
  border-left-color: #d93025 !important;
}
body.stage1 .pill-actions .small-btn {
  background: #fff !important;
  border-color: #dadce0 !important;
  color: #333 !important;
}

/* 通讯 */
body.stage1 .comms-dial-display input {
  background: #fff !important;
  border: 1px solid #dadce0 !important;
  color: #333 !important;
  border-radius: 4px;
}
body.stage1 .comms-log-item {
  border-bottom-color: #e8eaed !important;
}
body.stage1 .comms-log-item:hover {
  background: #f1f3f4 !important;
}
body.stage1 .comms-response {
  background: #f8f9fa !important;
  border: 1px solid #dadce0 !important;
}
body.stage1 .comms-response-header {
  border-bottom-color: #e8eaed !important;
}
body.stage1 .comms-response-body {
  color: #333 !important;
}

/* B区 — 见上方B区样式块 */

/* 考勤 */
body.stage1 .attendance-today {
  border-color: #dadce0 !important;
  background: #f8f9fa;
}

/* 搜索增强 */
body.stage1 .person-search-basic {
  background: #f8f9fa !important;
  border-color: #e8eaed !important;
}
body.stage1 .person-search-docs {
  background: #f8f9fa !important;
  border-color: #e8eaed !important;
}
body.stage1 .person-search-doc-item {
  border-bottom-color: #e8eaed !important;
  color: #333 !important;
}
body.stage1 .person-search-doc-item:hover {
  color: #1a73e8 !important;
}
body.stage1 .person-search-hint {
  background: #fef7e0 !important;
  border-left-color: #e65100 !important;
  color: #5d4037 !important;
}

/* ===================================================== */
/* ====== Stage 1 暗色覆盖（stage2+新模块）============= */
/* ===================================================== */
body:not(.stage1) .comms-response-body { color: #d0d0d0; }
/* B区暗色覆盖已移至上方B区样式块 */
body:not(.stage1) .pill-state-desc { color: #999; }
body:not(.stage1) .attendance-records { color: #c0c0c0; }

/* ===================================================== */
/* ====== 通讯互动对话样式 ============================== */
/* ===================================================== */
.comms-choice-item {
  border-radius: 6px;
  transition: all 0.2s ease;
}
.comms-choice-item:hover {
  border-color: rgba(138,180,248,0.6) !important;
  transform: translateX(4px);
}
.comms-dialogue-npc {
  animation: commsFadeIn 0.4s ease;
}
@keyframes commsFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stage 1 明亮模式下通讯对话 */
body.stage1 .comms-response {
  background: #f8f9fa !important;
  border-color: #dadce0 !important;
}
body.stage1 .comms-response-header {
  border-bottom-color: #dadce0 !important;
}
body.stage1 .comms-dialogue-npc,
body.stage1 #comms-typewriter,
body.stage1 .comms-response-body {
  color: #333 !important;
  border-left-color: #1a73e8 !important;
}
body.stage1 .comms-choice-item {
  background: #e8f0fe !important;
  border-color: #d2e3fc !important;
  color: #1a73e8 !important;
}
body.stage1 .comms-choice-item:hover {
  background: #d2e3fc !important;
}
body.stage1 .comms-dialing {
  color: #1a73e8 !important;
}
body.stage1 .comms-dot {
  color: #999 !important;
}

/* 考勤打卡未签到警告动画 */
.attendance-today {
  transition: border-color 0.3s ease;
}
@keyframes pulseWarning {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,51,51,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(255,51,51,0); }
}
.attendance-today:not(.checked-in) {
  animation: pulseWarning 2s ease infinite;
}

/* 响应式：窄屏时线索板堆叠到下方 */
@media (max-width: 1024px) {
  .desktop-columns { flex-direction: column; }
  .clue-panel { width: 100%; position: static; max-height: 300px; order: 2; }
  .main-column { order: 1; }
  .floating-pill { left: 12px !important; bottom: 12px !important; }
}

/* ===================================================== */
/* ====== 悬浮药物状态 =================================== */
/* ===================================================== */
.floating-pill {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9995;
  background: rgba(15,15,20,0.92);
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  font-family: var(--terminal-font);
  backdrop-filter: blur(6px);
}
.floating-pill-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer;
}
.floating-pill-icon { font-size: 14px; }
.floating-pill-label { font-size: 12px; color: #b0b0b0; letter-spacing: 1px; }
.floating-pill-body { padding: 8px 14px 12px; }
.floating-pill-memory {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.floating-pill-mem-text { font-size: 10px; color: #666; white-space: nowrap; }
.floating-pill-mem-track {
  width: 120px; height: 6px; background: #1a1a2e;
  border-radius: 3px; overflow: hidden;
}
.floating-pill-mem-fill {
  height: 100%; width: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #00ff41, #8ab4f8);
  transition: width .5s, background .5s;
}
.floating-pill-mem-val { font-size: 10px; color: #999; min-width: 26px; text-align: right; }
.floating-pill-status { font-size: 10px; color: #666; }

/* 药物状态颜色 */
.floating-pill.state-medicated .floating-pill-icon { color: #00ff41; }
.floating-pill.state-medicated .floating-pill-label { color: #6ec07a; }
.floating-pill.state-withdrawing .floating-pill-icon { color: #ffb000; }
.floating-pill.state-withdrawing .floating-pill-label { color: #ffb000; }
.floating-pill.state-offmeds .floating-pill-icon { color: #ff3333; }
.floating-pill.state-offmeds .floating-pill-label { color: #ff3333; }

/* stage1 明亮模式适配 */
body.stage1 .floating-pill {
  background: rgba(255,255,255,0.97);
  border-color: #dadce0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
body.stage1 .floating-pill-label { color: #5f6368; }
body.stage1 .floating-pill-mem-text { color: #999; }
body.stage1 .floating-pill-mem-track { background: #e8eaed; }
body.stage1 .floating-pill-mem-val { color: #5f6368; }
body.stage1 .floating-pill-status { color: #999; }
body.stage1 .floating-pill.state-medicated .floating-pill-label { color: #1e8e3e; }
body.stage1 .floating-pill.state-medicated .floating-pill-icon { color: #1e8e3e; }
body.stage1 .floating-pill.state-withdrawing .floating-pill-label,
body.stage1 .floating-pill.state-withdrawing .floating-pill-icon { color: #e65100; }
body.stage1 .floating-pill.state-offmeds .floating-pill-label,
body.stage1 .floating-pill.state-offmeds .floating-pill-icon { color: #d93025; }

/* 边框颜色随状态 */
.floating-pill.state-medicated { border-color: rgba(0,255,65,0.25); }
.floating-pill.state-withdrawing { border-color: rgba(255,176,0,0.3); }
.floating-pill.state-offmeds { border-color: rgba(255,51,51,0.35); }
body.stage1 .floating-pill.state-medicated { border-color: rgba(30,142,62,0.3); }
body.stage1 .floating-pill.state-withdrawing { border-color: rgba(230,81,0,0.3); }
body.stage1 .floating-pill.state-offmeds { border-color: rgba(217,48,37,0.3); }
