/* ===== 基础重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: #333;
  line-height: 1.9;
  background: #f0f2f5;
}

/* ===== 背景层 ===== */
.bg {
  position: fixed;
  inset: 0;
  background-image: url('/img/nacho.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.7) blur(1px);
  z-index: 0;
}

/* 浅色遮罩：让背景稍微柔和，文字更清晰 */
.bg-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0.15) 0%,
      rgba(0, 0, 0, 0.35) 70%,
      rgba(0, 0, 0, 0.55) 100%);
  z-index: 1;
}

/* ===== 内容容器 ===== */
html,
body {
  height: 100%;
  overflow: hidden;
}

.stage {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  padding: 40px 24px;
}

.card {
  max-width: 640px;
  margin: 0 auto;
  /* 只做水平居中 */
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 44px 48px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  animation: cardIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 魔方色条装饰 ===== */
.cube-strip {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
}

.cube-strip span {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  opacity: 0.9;
}

.c-w {
  background: #f0f0f0;
  border: 1px solid #aaa;
}

.c-y {
  background: #ffd500;
}

.c-r {
  background: #c41e3a;
}

.c-o {
  background: #ff5800;
}

.c-b {
  background: #0051ba;
}

.c-g {
  background: #009e60;
}

.status {
  font-size: 11px;
  color: #666;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 500;
}

.log {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 20px 0px 20px 0px;
  font-family: monospace;
  color: #008800;
}

.log p {
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.log .time {
  color: #888;
  /* 时间戳灰色 */
}

/* ===== 标题 ===== */
h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 24px;
  letter-spacing: 1px;
  line-height: 1.5;
}

/* ===== 正文 ===== */
.story {
  font-size: 14.5px;
  color: #555;
  margin-bottom: 20px;
}

.story p {
  margin-bottom: 12px;
}

.story p:last-child {
  margin-bottom: 0;
}

/* ===== 密文块 ===== */
.cipher {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(42, 110, 187, 0.2);
  border-radius: 10px;
  padding: 22px 24px;
  margin: 24px 0;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-size: 17px;
  color: #1a5fb4;
  text-align: center;
  letter-spacing: 3px;
  line-height: 1.9;
  word-break: break-all;
  user-select: text;
  cursor: pointer;
}

.cipher.small {
  font-size: 14px;
  letter-spacing: 2px;
  line-height: 2;
}

/* ===== 提示 ===== */
.hint {
  font-size: 12.5px;
  color: #999;
  margin-top: 18px;
  font-style: italic;
}

/* ===== 输入区 ===== */
.input-row {
  margin-top: 28px;
}

.input-label {
  font-size: 12.5px;
  color: #777;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

input[type="text"] {
  width: 100%;
  padding: 13px 16px;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  color: #333;
  font-size: 14px;
  font-family: "SF Mono", "Consolas", monospace;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  border-color: #4a9eff;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

input[type="text"]::placeholder {
  color: #aaa;
}

/* ===== 按钮 ===== */
button {
  margin-top: 14px;
  padding: 12px 30px;
  background: #4a9eff;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

button:hover {
  background: #3a8eef;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
  opacity: 0.7;
}

button:disabled:hover {
  background: #ccc;
}

/* ===== 表格（第三关用） ===== */
.cipher-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 13px;
}

.cipher-table th,
.cipher-table td {
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 9px 8px;
  text-align: center;
  color: #555;
}

.cipher-table th {
  background: rgba(0, 0, 0, 0.03);
  color: #777;
  font-weight: 500;
}

.cipher-table td {
  background: rgba(255, 255, 255, 0.6);
}

.cipher-table .highlight {
  color: #1a5fb4;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .card {
    padding: 32px 24px;
    border-radius: 14px;
  }

  h1 {
    font-size: 19px;
  }

  .cipher {
    font-size: 15px;
    letter-spacing: 2px;
    padding: 18px 16px;
  }

  .cipher.small {
    font-size: 12.5px;
    letter-spacing: 1px;
  }
}

/* ===== 移动端警告 ===== */
.mobile-warning {
  display: none;
  background: rgba(255, 200, 0, 0.08);
  border: 1px solid rgba(255, 200, 0, 0.25);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: #a07000;
  line-height: 1.7;
}

.mobile-warning strong {
  color: #c08000;
}

/* 窄屏时显示 */
@media (max-width: 768px) {
  .mobile-warning {
    display: block;
  }
}