/**
 * 潮汐福利院：1999关停档案 - 全局样式
 * 复古Windows98档案系统风格
 */

/* ========== 基础重置与变量 ========== */
:root {
  --win-bg: #c0c0c0;
  --win-bg-light: #dfdfdf;
  --win-bg-dark: #808080;
  --win-shadow: #404040;
  --win-highlight: #ffffff;
  --title-bar: #000080;
  --title-bar-inactive: #808080;
  --desktop-bg: #008080;
  --text-dark: #000000;
  --text-light: #ffffff;
  --accent-red: #cc0000;
  --accent-blue: #000080;
  --accent-gold: #b8923a;
  --doc-bg: #f5f0e0;
  --doc-bg-dark: #e8e0d0;
  --stamp-red: #c41e3a;
  --folder-yellow: #ffd700;
  --file-paper: #faf8f0;
  --highlight: #0000ff;
  --success: #008000;
  --warning: #cc8800;
  --danger: #cc0000;
  --font-main: 'MS Sans Serif', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif;
  --font-mono: 'Courier New', 'Consolas', monospace;
  --font-serif: 'SimSun', 'Songti SC', 'Noto Serif SC', serif;
}

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

html, body {
  font-family: var(--font-main);
  background: var(--desktop-bg);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
}

/* ========== CRT显示器效果 ========== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.03) 0px,
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99997;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.15) 100%);
}

/* ========== Win98 窗口通用样式 ========== */
.win98-window {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  box-shadow: 1px 1px 0 var(--win-shadow), -1px -1px 0 var(--win-highlight);
  position: relative;
}

.win98-window-outset {
  border: 2px solid;
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
}

/* 标题栏 */
.title-bar {
  background: linear-gradient(90deg, var(--title-bar), #1084d0);
  color: var(--text-light);
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
  font-size: 13px;
  height: 24px;
  user-select: none;
}

.title-bar.inactive {
  background: linear-gradient(90deg, var(--title-bar-inactive), #b0b0b0);
}

.title-bar-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  display: inline-block;
  vertical-align: middle;
}

.title-bar-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-bar-controls {
  display: flex;
  gap: 2px;
}

.title-bar-btn {
  width: 18px;
  height: 16px;
  background: var(--win-bg);
  border: 1px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  color: var(--text-dark);
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.title-bar-btn:active {
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
}

/* 菜单栏 */
.menu-bar {
  background: var(--win-bg);
  display: flex;
  padding: 2px 4px;
  border-bottom: 1px solid var(--win-bg-dark);
  font-size: 13px;
}

.menu-item {
  padding: 2px 8px;
  cursor: default;
}

.menu-item:hover {
  background: var(--title-bar);
  color: var(--text-light);
}

.menu-item u {
  text-decoration: underline;
}

/* 工具栏 */
.toolbar {
  background: var(--win-bg);
  padding: 4px 8px;
  display: flex;
  gap: 4px;
  align-items: center;
  border-bottom: 1px solid var(--win-bg-dark);
  flex-wrap: wrap;
}

.toolbar-btn {
  background: var(--win-bg);
  border: 1px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  padding: 3px 8px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-btn:hover {
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
}

.toolbar-btn:active {
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
  padding: 4px 7px 2px 9px;
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--win-bg-dark);
  margin: 0 2px;
}

/* 状态栏 */
.status-bar {
  background: var(--win-bg);
  border-top: 1px solid;
  border-color: var(--win-highlight) var(--win-bg-dark) var(--win-bg-dark) var(--win-highlight);
  padding: 2px 8px;
  display: flex;
  gap: 8px;
  font-size: 12px;
}

.status-bar-field {
  border: 1px solid;
  border-color: var(--win-bg-dark) var(--win-highlight) var(--win-highlight) var(--win-bg-dark);
  padding: 1px 6px;
  flex: 1;
}

.status-bar-field.fixed {
  flex: 0 0 auto;
}

/* ========== Win98 按钮 ========== */
.win98-btn {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  padding: 4px 16px;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 13px;
  color: var(--text-dark);
  min-width: 60px;
}

.win98-btn:active,
.win98-btn.pressed {
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
  padding: 5px 15px 3px 17px;
}

.win98-btn:disabled {
  color: var(--win-bg-dark);
  text-shadow: 1px 1px 0 var(--win-highlight);
  cursor: default;
}

.win98-btn.primary {
  font-weight: bold;
}

/* ========== 输入框 ========== */
.win98-input {
  background: var(--text-light);
  border: 2px solid;
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
}

.win98-input:focus {
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
}

/* ========== 桌面 ========== */
.desktop {
  width: 100vw;
  height: 100vh;
  background: var(--desktop-bg);
  position: relative;
  overflow: hidden;
}

/* ========== 文件夹/文件图标 ========== */
.file-icon {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  cursor: pointer;
  text-align: center;
}

.file-icon:hover {
  background: rgba(0, 0, 128, 0.1);
}

.file-icon.selected {
  background: rgba(0, 0, 128, 0.2);
  border: 1px dotted var(--win-shadow);
}

.file-icon-img {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.file-icon-label {
  font-size: 12px;
  color: var(--text-light);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  word-break: break-all;
  max-width: 72px;
  line-height: 1.2;
}

.file-icon.locked .file-icon-img {
  filter: grayscale(0.5) opacity(0.5);
}

.file-icon.locked .file-icon-label {
  color: rgba(255,255,255,0.5);
}

.file-icon.locked::after {
  content: '🔒';
  position: absolute;
  font-size: 12px;
  margin-top: -28px;
  margin-left: 20px;
}

/* ========== 文件资源管理器 ========== */
.explorer {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.explorer-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.explorer-sidebar {
  width: 180px;
  background: var(--win-bg);
  border-right: 1px solid var(--win-bg-dark);
  padding: 4px;
  overflow-y: auto;
}

.sidebar-item {
  padding: 3px 8px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 0;
}

.sidebar-item:hover {
  background: rgba(0,0,128,0.1);
}

.sidebar-item.active {
  background: var(--title-bar);
  color: var(--text-light);
}

.explorer-main {
  flex: 1;
  background: var(--text-light);
  overflow-y: auto;
  padding: 8px;
}

.file-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
}

/* ========== 文档查看器 ========== */
.doc-viewer {
  background: var(--win-bg);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.doc-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--win-bg-dark);
}

/* 做旧纸张效果 */
.document {
  background: var(--file-paper);
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 50px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
  font-family: var(--font-serif);
  color: #2a2a2a;
  line-height: 1.8;
  font-size: 14px;
}

/* 纸张纹理 */
.document::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(180,160,120,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(180,160,120,0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(200,180,140,0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* 折痕效果 */
.document::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 49.5%, rgba(0,0,0,0.03) 50%, transparent 50.5%);
  pointer-events: none;
}

.document-header {
  text-align: center;
  border-bottom: 2px solid #333;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.document-title {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 4px;
  margin-bottom: 6px;
}

.document-subtitle {
  font-size: 12px;
  color: #666;
}

.document-body {
  position: relative;
  z-index: 1;
}

.document-body p {
  margin-bottom: 12px;
  text-indent: 2em;
}

.document-body .no-indent {
  text-indent: 0;
}

/* 红头文件 */
.red-header {
  text-align: center;
  margin-bottom: 16px;
}

.red-header .org-name {
  font-size: 24px;
  font-weight: bold;
  color: var(--stamp-red);
  letter-spacing: 6px;
  font-family: var(--font-serif);
}

.red-header .doc-number {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.red-line {
  border: none;
  border-top: 3px solid var(--stamp-red);
  margin: 8px 0 16px;
}

/* 印章效果 */
.stamp {
  display: inline-block;
  border: 3px solid var(--stamp-red);
  color: var(--stamp-red);
  padding: 6px 12px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 4px;
  transform: rotate(-15deg);
  opacity: 0.8;
  font-family: var(--font-serif);
  border-radius: 4px;
}

.stamp-circle {
  width: 100px;
  height: 100px;
  border: 3px solid var(--stamp-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--stamp-red);
  font-size: 14px;
  font-weight: bold;
  transform: rotate(-12deg);
  opacity: 0.7;
  font-family: var(--font-serif);
  position: absolute;
  top: 20px;
  right: 30px;
  line-height: 1.3;
}

/* 表格 */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.doc-table th {
  background: #e0d8c8;
  border: 1px solid #999;
  padding: 6px 10px;
  text-align: center;
  font-weight: bold;
}

.doc-table td {
  border: 1px solid #bbb;
  padding: 5px 10px;
  text-align: center;
}

.doc-table tr:nth-child(even) {
  background: #f5f0e0;
}

.doc-table .highlight-row {
  background: #fff3cd !important;
}

.doc-table .missing-row {
  background: #f8d7da !important;
  color: var(--danger);
}

/* 批注/注释 */
.annotation {
  color: var(--accent-red);
  font-size: 12px;
  font-style: italic;
  margin-left: 8px;
  cursor: help;
  border-bottom: 1px dotted var(--accent-red);
}

.annotation-popup {
  position: absolute;
  background: #fffbe6;
  border: 1px solid var(--accent-gold);
  padding: 8px 12px;
  font-size: 12px;
  max-width: 250px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  color: #333;
  font-style: italic;
}

/* 涂抹/遮挡 */
.redacted {
  background: #000;
  color: #000;
  cursor: pointer;
  user-select: none;
  padding: 0 2px;
}

.redacted.revealed {
  background: transparent;
  color: var(--accent-red);
}

/* ========== 谜题专用样式 ========== */

/* 谜题容器 */
.puzzle-box {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  padding: 16px;
  margin: 12px 0;
}

.puzzle-title {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.puzzle-title .icon {
  font-size: 16px;
}

.puzzle-hint {
  font-size: 12px;
  color: #555;
  margin-bottom: 12px;
  font-style: italic;
}

.puzzle-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.puzzle-input-row .win98-input {
  flex: 1;
  max-width: 300px;
}

/* 楼层地图 */
.building-map {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: #e8e8e8;
  border: 2px inset var(--win-bg);
}

.floor-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.floor-label {
  width: 40px;
  text-align: center;
  font-weight: bold;
  font-size: 12px;
}

.room-cell {
  width: 70px;
  height: 50px;
  border: 1px solid #999;
  background: var(--file-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.room-cell:hover {
  background: #e0f0ff;
  border-color: var(--title-bar);
}

.room-cell.selected {
  background: #000080;
  color: white;
  border-color: #000;
}

.room-cell.highlighted {
  background: #fff3cd;
  border-color: var(--warning);
}

/* 拖拽拼字 */
.word-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  min-height: 60px;
  background: #e8e8e8;
  border: 2px inset var(--win-bg);
  margin-bottom: 8px;
}

.word-tile {
  background: var(--file-paper);
  border: 1px solid #999;
  padding: 6px 12px;
  cursor: grab;
  font-size: 14px;
  font-family: var(--font-serif);
  box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  user-select: none;
}

.word-tile:active {
  cursor: grabbing;
}

.word-tile.dragging {
  opacity: 0.5;
}

.word-tile.placed {
  background: #d4edda;
  border-color: var(--success);
}

/* 拼字槽 */
.word-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  min-height: 60px;
  background: #f5f5dc;
  border: 2px inset var(--win-bg);
}

.word-slot {
  min-width: 50px;
  min-height: 36px;
  border: 2px dashed #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.word-slot.filled {
  border-style: solid;
  border-color: var(--success);
}

/* 组合锁 */
.combo-lock {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 20px;
}

.combo-dial {
  width: 60px;
  height: 80px;
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.combo-dial-btn {
  cursor: pointer;
  font-size: 12px;
  color: var(--title-bar);
  padding: 2px;
}

.combo-dial-num {
  font-size: 28px;
  font-weight: bold;
  font-family: var(--font-mono);
  width: 40px;
  text-align: center;
  background: var(--text-light);
  border: 1px solid var(--win-bg-dark);
}

/* 简谱键盘 */
.music-keys {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 16px;
}

.music-key {
  width: 50px;
  height: 80px;
  background: var(--text-light);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  transition: all 0.1s;
}

.music-key:hover {
  background: #e0f0ff;
}

.music-key:active,
.music-key.playing {
  background: var(--title-bar);
  color: white;
  transform: translateY(2px);
}

.music-key .note-name {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}

.music-key.playing .note-name {
  color: #aaa;
}

.music-sequence {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 24px;
  letter-spacing: 8px;
}

/* 日历组件 */
.calendar-widget {
  display: inline-block;
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
  padding: 8px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: bold;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-cell {
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}

.calendar-cell.header {
  font-weight: bold;
  color: #666;
  cursor: default;
}

.calendar-cell.other-month {
  color: #ccc;
}

.calendar-cell:hover:not(.header) {
  background: var(--title-bar);
  color: white;
}

.calendar-cell.selected {
  background: var(--accent-red);
  color: white;
  font-weight: bold;
}

.calendar-cell .marker {
  position: absolute;
  font-size: 8px;
  color: var(--accent-red);
  margin-top: 14px;
}

/* 柱状图 */
.bar-chart {
  padding: 16px;
  background: var(--text-light);
  border: 1px solid var(--win-bg-dark);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.bar-label {
  width: 120px;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: #eee;
  border: 1px solid #ccc;
  position: relative;
}

.bar-fill {
  height: 100%;
  transition: width 0.5s ease;
}

.bar-fill.normal { background: #4a7c59; }
.bar-fill.anomaly { background: #cc0000; }
.bar-fill.warning { background: #cc8800; }

.bar-value {
  width: 40px;
  font-family: var(--font-mono);
}

/* 真相填空 */
.truth-puzzle {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 24px;
  margin: 16px 0;
  border: 2px solid var(--accent-gold);
}

.truth-sentence {
  font-size: 18px;
  line-height: 2.5;
  text-align: center;
  font-family: var(--font-serif);
}

.truth-blank {
  display: inline-block;
  min-width: 100px;
  border-bottom: 2px solid var(--accent-gold);
  text-align: center;
  margin: 0 4px;
  cursor: pointer;
  color: var(--accent-gold);
  font-weight: bold;
}

.truth-blank.filled {
  border-color: var(--success);
  color: var(--success);
}

.truth-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.truth-option {
  background: #2a2a4e;
  color: #e0e0e0;
  border: 1px solid var(--accent-gold);
  padding: 6px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.truth-option:hover {
  background: var(--accent-gold);
  color: #1a1a2e;
}

.truth-option.used {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ========== 提示系统 ========== */
.hint-panel {
  background: #fffbe6;
  border: 2px solid var(--accent-gold);
  padding: 12px 16px;
  margin: 8px 0;
  font-size: 13px;
  display: none;
}

.hint-panel.show {
  display: block;
  animation: hintFadeIn 0.3s ease;
}

@keyframes hintFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hint-panel .hint-label {
  font-weight: bold;
  color: var(--warning);
  margin-bottom: 4px;
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  padding: 16px 32px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  text-align: center;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--title-bar); }

.toast-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

/* ========== 弹窗对话框 ========== */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-box {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  min-width: 300px;
  max-width: 500px;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.3);
}

.dialog-content {
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
}

.dialog-buttons {
  padding: 8px 16px 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* ========== 进度条 ========== */
.progress-bar {
  width: 100%;
  height: 18px;
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #000080, #1084d0);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  color: white;
  font-size: 11px;
}

/* ========== 档案标签页 ========== */
.archive-tabs {
  display: flex;
  border-bottom: 2px solid var(--win-bg-dark);
  background: var(--win-bg);
  padding: 4px 4px 0;
  gap: 2px;
  flex-wrap: wrap;
}

.archive-tab {
  padding: 4px 12px;
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-bg) var(--win-highlight);
  border-bottom: none;
  cursor: pointer;
  font-size: 12px;
  position: relative;
  top: 2px;
  border-radius: 4px 4px 0 0;
  opacity: 0.6;
}

.archive-tab:hover {
  opacity: 0.8;
}

.archive-tab.active {
  opacity: 1;
  top: 0;
  z-index: 2;
  font-weight: bold;
}

.archive-tab.locked {
  color: var(--win-bg-dark);
  cursor: not-allowed;
}

.archive-tab.locked::before {
  content: '🔒 ';
  font-size: 10px;
}

/* ========== 档案内容区 ========== */
.archive-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: var(--win-bg-dark);
}

.archive-page {
  display: none;
  padding: 20px;
  position: relative;
}

.archive-page.active {
  display: block;
  animation: pageFadeIn 0.4s ease;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 结局画面 ========== */
.ending-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  color: #e0e0e0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow-y: auto;
}

.ending-title {
  font-size: 28px;
  font-family: var(--font-serif);
  letter-spacing: 8px;
  margin-bottom: 24px;
  text-align: center;
}

.ending-body {
  max-width: 600px;
  text-align: center;
  line-height: 2.2;
  font-size: 15px;
  margin-bottom: 32px;
}

.ending-image-placeholder {
  width: 300px;
  height: 200px;
  border: 2px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #888;
  margin: 20px auto;
  background: #1a1a1a;
}

.ending-quote {
  font-style: italic;
  color: var(--accent-gold);
  font-size: 16px;
  margin-top: 24px;
  text-align: center;
}

/* 槐花飘落 */
.petal {
  position: fixed;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #fff8dc, #f0e68c);
  border-radius: 0 100% 0 100%;
  pointer-events: none;
  z-index: 9999;
  animation: petalFall linear forwards;
}

@keyframes petalFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0.3; }
}

/* ========== 涂鸦彩蛋 ========== */
.doodle {
  position: absolute;
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.3s;
  z-index: 5;
}

.doodle:hover {
  opacity: 1;
  transform: scale(1.3);
}

.doodle.found {
  opacity: 0.15;
  pointer-events: none;
}

/* ========== 音频开关 ========== */
.audio-toggle {
  position: fixed;
  bottom: 8px;
  right: 8px;
  z-index: 100;
  cursor: pointer;
  font-size: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
}

/* ========== 加载动画 ========== */
.loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  color: #0f0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

.loading-text {
  font-size: 16px;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.loading-bar {
  width: 300px;
  height: 20px;
  border: 1px solid #0f0;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: #0f0;
  width: 0%;
  transition: width 0.3s ease;
}

.loading-dots::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* ========== 扫描件效果 ========== */
.scan-effect {
  position: relative;
  overflow: hidden;
}

.scan-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 128, 128, 0.3);
  animation: scanLine 3s linear infinite;
  pointer-events: none;
}

@keyframes scanLine {
  0% { top: 0; }
  100% { top: 100%; }
}

/* ========== 闪烁文字 ========== */
.blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ========== 打字机效果 ========== */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2s steps(40) forwards;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

/* ========== 红色警告 ========== */
.alert-banner {
  background: var(--accent-red);
  color: white;
  padding: 8px 16px;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
  animation: alertPulse 2s ease-in-out infinite;
}

@keyframes alertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ========== 系统消息 ========== */
.sys-message {
  background: #ffffcc;
  border: 1px solid var(--warning);
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sys-message .icon {
  font-size: 16px;
}

/* ========== 线索收集面板 ========== */
.clue-panel {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--win-bg);
  border-left: 2px solid var(--win-shadow);
  z-index: 500;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 12px rgba(0,0,0,0.2);
}

.clue-panel.open {
  right: 0;
}

.clue-panel-header {
  background: linear-gradient(90deg, var(--title-bar), #1084d0);
  color: white;
  padding: 6px 10px;
  font-weight: bold;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clue-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.clue-item {
  background: var(--text-light);
  border: 1px solid var(--win-bg-dark);
  padding: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
}

.clue-item:hover {
  background: #e0f0ff;
}

.clue-item .clue-title {
  font-weight: bold;
  margin-bottom: 2px;
}

.clue-item .clue-desc {
  color: #555;
  font-size: 11px;
}

.clue-item.new {
  border-color: var(--success);
  animation: clueGlow 1s ease;
}

@keyframes clueGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(0,128,0,0); }
  50% { box-shadow: 0 0 8px rgba(0,128,0,0.4); }
}

/* ========== 滚动条 Win98 风格 ========== */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
  background: var(--win-bg);
}

::-webkit-scrollbar-track {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23c0c0c0'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23c0c0c0'/%3E%3C/svg%3E");
}

::-webkit-scrollbar-thumb {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--win-bg-light);
}

::-webkit-scrollbar-button {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-shadow) var(--win-shadow) var(--win-highlight);
  display: block;
  height: 16px;
  width: 16px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  body { font-size: 13px; }
  .explorer-sidebar { width: 140px; }
  .document { padding: 20px 16px; }
  .room-cell { width: 55px; height: 40px; font-size: 10px; }
  .music-key { width: 38px; height: 60px; font-size: 16px; }
  .ending-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .explorer-sidebar { display: none; }
  .combo-dial { width: 48px; height: 64px; }
  .combo-dial-num { font-size: 22px; }
  .word-tile { padding: 4px 8px; font-size: 12px; }
  .bar-label { width: 80px; font-size: 11px; }
}
