/* ============================================================
   方舟-7 · 唤醒者计划  —  复古绿屏终端主题
   纯 CSS，无外部依赖
   ============================================================ */

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

:root {
  --bg-deep:    #04140a;   /* 深绿黑底 */
  --bg:         #0a1f0e;   /* 终端底色 */
  --bg-panel:   #0d2814;   /* 面板色 */
  --green:      #33ff66;   /* 磷光绿主色 */
  --green-dim:  #1faa44;   /* 暗绿 */
  --green-soft: #5fae6a;   /* 柔绿 */
  --amber:      #ffcc44;   /* 警告琥珀 */
  --red:        #ff4444;   /* 警报红 */
  --red-dim:    #aa2222;
  --gray:       #4a6a54;   /* 灰绿 */
  --text:       #8aff9e;   /* 正文绿 */
  --text-dim:   #4d8a5c;   /* 弱化正文 */
  --scroll-depth: 0;       /* 黑暗进度（真相页用） */
  --scanline-opacity: 0.08;
}

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: "Cascadia Mono", "JetBrains Mono", "Consolas", "Courier New", ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: 0.02em;
  text-shadow: 0 0 2px rgba(51, 255, 102, 0.5);   /* 文字辉光 */
}

/* ---------- CRT 效果：扫描线 ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 3px,
    rgba(0, 0, 0, var(--scanline-opacity)) 3px
  );
}

/* ---------- CRT 效果：暗角 + 弧度 ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.35) 100%
  );
}

/* 屏幕微闪烁动画 */
@keyframes crt-flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.92; }
  98% { opacity: 0.97; }
  99% { opacity: 0.9; }
}
body { animation: crt-flicker 6s infinite; }

/* ---------- 全局布局 ---------- */
.stage {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  position: relative;
  z-index: 1;
}

/* ---------- 终端窗口 ---------- */
.window {
  background: var(--bg);
  border: 1px solid var(--green-dim);
  box-shadow:
    0 0 0 1px rgba(51, 255, 102, 0.1),
    0 0 24px rgba(51, 255, 102, 0.12),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.title-bar {
  background: var(--green-dim);
  color: #04140a;
  font-weight: bold;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-shadow: none;
  border-bottom: 1px solid var(--green);
}
.title-bar .title-text { flex: 1; }
.title-bar .window-buttons { display: flex; gap: 4px; }
.title-bar .win-btn {
  display: inline-block;
  width: 16px; height: 14px;
  line-height: 12px;
  text-align: center;
  background: var(--bg);
  color: var(--green);
  border: 1px solid #04140a;
  font-size: 10px;
  cursor: default;
  text-shadow: none;
  user-select: none;
}

.window-content {
  padding: 22px 26px;
  max-height: 70vh;
  overflow-y: auto;
}

/* 滚动条 */
.window-content::-webkit-scrollbar,
.scroll::-webkit-scrollbar { width: 10px; }
.window-content::-webkit-scrollbar-track,
.scroll::-webkit-scrollbar-track { background: var(--bg-deep); }
.window-content::-webkit-scrollbar-thumb,
.scroll::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  border: 2px solid var(--bg-deep);
}
.window-content::-webkit-scrollbar-thumb:hover,
.scroll::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ---------- 右上角年份/标记（仿原版 .year-2007） ---------- */
.corner-mark {
  position: fixed;
  top: 10px; right: 14px;
  background: var(--green-dim);
  color: #04140a;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-shadow: none;
  z-index: 100;
  display: none;
}
.corner-mark.danger { background: var(--red-dim); color: #fff; }

/* ---------- 页头 ---------- */
.masthead {
  text-align: center;
  margin-bottom: 28px;
  border-bottom: 1px dashed var(--green-dim);
  padding-bottom: 20px;
}
.masthead .system-tag {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.3em;
  margin-bottom: 8px;
}
.masthead h1 {
  color: var(--green);
  font-size: 28px;
  letter-spacing: 0.15em;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(51, 255, 102, 0.6);
}
.masthead .subtitle {
  color: var(--green-soft);
  font-size: 13px;
  letter-spacing: 0.1em;
}

/* ---------- 文本元素 ---------- */
h2, h3 {
  color: var(--green);
  letter-spacing: 0.08em;
  margin: 20px 0 12px;
  text-shadow: 0 0 6px rgba(51, 255, 102, 0.4);
}
h2 { font-size: 18px; border-bottom: 1px solid var(--green-dim); padding-bottom: 4px; }
h3 { font-size: 15px; }

p { margin-bottom: 12px; }

a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #bfffd0; text-shadow: 0 0 8px var(--green); }

strong, b { color: var(--green); }
em { color: var(--amber); font-style: normal; }

.dim { color: var(--text-dim); }
.center { text-align: center; }
.small { font-size: 12px; }

/* 终端式提示行 */
.prompt::before { content: "> "; color: var(--green-dim); }
.prompt { margin-bottom: 8px; }

/* 闪烁光标 */
.cursor::after {
  content: "▋";
  animation: blink 1s steps(2) infinite;
  color: var(--green);
}
@keyframes blink { 50% { opacity: 0; } }

/* 通告/警报文本 */
.alert-red { color: var(--red); text-shadow: 0 0 8px var(--red); }
.alert-amber { color: var(--amber); text-shadow: 0 0 6px var(--amber); }
.glitch { animation: glitch-anim 2.5s infinite; }

@keyframes glitch-anim {
  0%, 92%, 100% { transform: translate(0); text-shadow: 0 0 2px rgba(51,255,102,.5); }
  93% { transform: translate(-1px, 1px); text-shadow: -2px 0 var(--red), 2px 0 var(--green); }
  94% { transform: translate(1px, -1px); text-shadow: 2px 0 var(--amber); }
  95% { transform: translate(0); }
}

/* 数据/表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}
.data-table th, .data-table td {
  border: 1px solid var(--green-dim);
  padding: 5px 10px;
  text-align: left;
}
.data-table th { background: var(--bg-panel); color: var(--green); }

/* 代码块/系统日志 */
.syslog {
  background: var(--bg-deep);
  border-left: 3px solid var(--green-dim);
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--green-soft);
  white-space: pre-wrap;
}

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 18px; }
.form-row > label {
  display: block;
  color: var(--green);
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.form-inline {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.form-inline label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
  background: var(--bg-deep);
  border: 1px solid var(--green-dim);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 10px;
  width: 100%;
  outline: none;
  letter-spacing: 0.03em;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(51, 255, 102, 0.3);
}
textarea { resize: vertical; min-height: 70px; }

/* 复选框伪装单选（仿原版） */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border: 1px solid var(--green-dim);
  background: var(--bg-deep);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
input[type="checkbox"]:checked {
  background: var(--green-dim);
  border-color: var(--green);
}
input[type="checkbox"]:checked::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #04140a;
  font-weight: bold;
}

.error-message {
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
  text-shadow: 0 0 4px var(--red);
}

/* ---------- 按钮 ---------- */
.btn {
  background: var(--bg-deep);
  color: var(--green);
  border: 1px solid var(--green-dim);
  padding: 8px 22px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-shadow: 0 0 4px rgba(51,255,102,.5);
  transition: all 0.12s;
}
.btn:hover {
  background: var(--green-dim);
  color: #04140a;
  text-shadow: none;
  box-shadow: 0 0 12px rgba(51,255,102,.4);
}
.btn:active { transform: translate(1px, 1px); }
.btn.danger { color: var(--red); border-color: var(--red-dim); text-shadow: 0 0 4px var(--red); }
.btn.danger:hover { background: var(--red-dim); color: #fff; }
.btn-row { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- 模态框 ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--bg);
  border: 1px solid var(--green);
  box-shadow: 0 0 30px rgba(51,255,102,.3);
  max-width: 480px;
  width: 100%;
}
.modal-box .modal-title {
  background: var(--green-dim);
  color: #04140a;
  padding: 6px 12px;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
}
.modal-box .modal-body { padding: 20px; }
.modal-box .modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--green-dim);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- 标签页（仿原版 nav-tab） ---------- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--green-dim);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  padding: 6px 16px;
  color: var(--text-dim);
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  font-size: 13px;
  letter-spacing: 0.05em;
  margin-bottom: -1px;
}
.tab:hover { color: var(--green); }
.tab.active {
  color: var(--green);
  background: var(--bg-panel);
  border-color: var(--green-dim);
  border-bottom: 1px solid var(--bg);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- 日志条目 ---------- */
.log-entry {
  border-left: 2px solid var(--green-dim);
  padding: 8px 14px;
  margin: 12px 0;
  background: rgba(13, 40, 20, 0.5);
}
.log-entry .log-date {
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.log-entry .log-body { color: var(--green-soft); font-size: 14px; }
.log-entry.warning { border-color: var(--amber); }
.log-entry.warning .log-date { color: var(--amber); }
.log-entry.danger { border-color: var(--red); }
.log-entry.danger .log-date { color: var(--red); }

/* ---------- 真相页：黑暗递进 + 模糊 ---------- */
.darkness-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  background: rgba(0, 0, 0, var(--scroll-depth));
  transition: background 0.2s;
}
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 501;
  opacity: calc(var(--scroll-depth) * 0.5);
  background-image:
    radial-gradient(rgba(51,255,102,0.1) 1px, transparent 1px),
    radial-gradient(rgba(255,68,68,0.08) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 2px;
  transition: opacity 0.2s;
}
.vignette-truth {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 502;
  background: radial-gradient(ellipse at center,
    rgba(0,0,0,0) calc(40% - var(--scroll-depth) * 40%),
    rgba(0,0,0,0.9) 100%);
}

/* 日志条目逐级模糊（真相页用） */
.blur-1 { filter: blur(0.5px); opacity: 0.95; }
.blur-2 { filter: blur(1px); opacity: 0.85; }
.blur-3 { filter: blur(1.5px); opacity: 0.75; }
.blur-4 { filter: blur(2px); opacity: 0.65; }
.blur-5 { filter: blur(3px); opacity: 0.5; }
.blur-6 { filter: blur(4px); opacity: 0.4; }
.blur-7 { filter: blur(5px); opacity: 0.3; }
.blur-8 { filter: blur(6px); opacity: 0.2; }
[class*="blur-"]:hover { filter: blur(0.5px); opacity: 0.95; }

/* sanity-lost 黑屏态 */
body.sanity-lost { background: #000; }
body.sanity-lost .window,
body.sanity-lost .stage { filter: brightness(0.3); }
body.sanity-lost::before { opacity: 2; }

/* 乱码块 */
.gibberish {
  font-family: "Cascadia Mono", monospace;
  filter: blur(1.5px);
  opacity: 0.5;
  word-break: break-all;
  color: var(--red-dim);
}

/* ---------- 进度条/波形（装饰） ---------- */
.bar {
  border: 1px solid var(--green-dim);
  height: 14px;
  background: var(--bg-deep);
  position: relative;
  margin: 6px 0;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--green-dim);
  box-shadow: 0 0 8px rgba(51,255,102,.4);
}
.bar.danger > span { background: var(--red-dim); box-shadow: 0 0 8px var(--red); }

/* ---------- 闪光分隔线 ---------- */
hr.divider {
  border: none;
  border-top: 1px dashed var(--green-dim);
  margin: 22px 0;
}

/* ---------- 红字系统报错（隐藏入口） ---------- */
.error-report {
  color: var(--red);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  text-shadow: 0 0 4px var(--red);
}
.error-report:hover { color: #ff8888; }

/* ---------- 警报灯（装饰） ---------- */
.beacon {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: beacon-pulse 1s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes beacon-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.beacon.green { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---------- 工具类 ---------- */
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
