/* ==================================================
   实验室：虚拟终端
   ================================================== */
.term {
  --term-bg: #141816;
  --term-fg: #cfd8d1;
  --term-dim: #6d7d74;
  --term-hi: #8fd3ae;
  --term-warn: #e0b064;
  --term-err: #e08a8a;
  background: var(--term-bg);
  border: 1px solid #26302a;
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--mono);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .55);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: #1b211d;
  border-bottom: 1px solid #26302a;
}

.term-bar .d { width: 9px; height: 9px; border-radius: 50%; background: #3b4a41; }
.term-bar .d:nth-child(1) { background: #cc6b5f; }
.term-bar .d:nth-child(2) { background: #cc9f5f; }
.term-bar .d:nth-child(3) { background: #6faf82; }

.term-bar .t {
  margin-left: 6px;
  font-size: 11.5px;
  color: var(--term-dim);
  letter-spacing: .04em;
}

.term-bar button {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--term-dim);
  background: none;
  border: 1px solid #2c3831;
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
}

.term-bar button:hover { color: var(--term-fg); border-color: #3f5047; }

.term-body {
  height: 380px;
  overflow-y: auto;
  padding: 14px 16px 18px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--term-fg);
  cursor: text;
  overscroll-behavior: contain;
}

.term-body::-webkit-scrollbar { width: 8px; }
.term-body::-webkit-scrollbar-thumb { background: #2c3831; border-radius: 4px; }

.term-out { white-space: pre-wrap; word-break: break-word; }
.term-out .cmd { color: var(--term-hi); }
.term-out .dim { color: var(--term-dim); }
.term-out .warn { color: var(--term-warn); }
.term-out .err { color: var(--term-err); }
.term-out .ok { color: #86c79c; }
.term-out a { color: var(--term-hi); text-decoration: underline; text-underline-offset: 2px; }

.term-line {
  display: flex;
  align-items: baseline;
  gap: 0;
  margin-top: 2px;
}

.term-prompt {
  color: var(--term-hi);
  white-space: nowrap;
  flex: 0 0 auto;
}

.term-line input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--term-fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  padding: 0 0 0 6px;
  caret-color: var(--term-hi);
}

.lab-hint {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.85;
  margin: 14px 0 0;
}

.lab-hint code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ==================================================
   密码强度
   ================================================== */
.pwd-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin: 4px 0 8px;
}

.pwd-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width .25s ease, background .25s ease;
}

.pwd-verdict {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--sans);
  font-size: 13px;
  margin-bottom: 6px;
}

.pwd-verdict b { font-weight: 500; font-size: 15px; }
.pwd-verdict span { color: var(--muted); font-family: var(--mono); font-size: 12px; }

.pwd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0 28px;
  margin-top: 18px;
}

.pwd-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
}

.pwd-row .mark {
  flex: 0 0 auto;
  width: 15px;
  text-align: center;
  color: var(--muted);
}

.pwd-row.pass .mark { color: var(--accent); }
.pwd-row.fail .mark { color: #b4553f; }
[data-theme="dark"] .pwd-row.fail .mark { color: #d98a72; }

.pwd-row .t { color: var(--muted); }

.pwd-best {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.8;
  word-break: break-all;
}

.clock {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: -.01em;
  margin: 2px 0 4px;
}

.clock small {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 6px;
}

/* ==================================================
   零宽隐写
   ================================================== */
textarea.mono { font-family: var(--mono); font-size: 13px; line-height: 1.8; }
.zw-status { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.7; }
.zw-status b { color: var(--accent); font-weight: 500; }

/* ==================================================
   正则测试
   ================================================== */
.re-hit { background: rgba(51, 96, 79, .22); border-bottom: 1px solid var(--accent); border-radius: 2px; }
[data-theme="dark"] .re-hit { background: rgba(133, 184, 161, .22); }

.re-list { font-family: var(--mono); font-size: 12.5px; line-height: 1.9; }
.re-list div { padding: 4px 0; border-bottom: 1px solid var(--line); word-break: break-all; }
.re-list div:last-child { border-bottom: 0; }
.re-list .i { color: var(--muted); display: inline-block; min-width: 26px; }

@media (max-width: 720px) {
  .term-body { height: 300px; font-size: 12px; padding: 12px 12px 16px; }
  .term-line input { font-size: 16px; } /* 避免 iOS 聚焦缩放 */
  .pwd-grid { grid-template-columns: 1fr; gap: 0; }
  .clock { font-size: 19px; }
}

.term-row { display: flex; gap: 14px; }
.term-row .k { flex: 0 0 152px; color: var(--term-hi); }
.term-row .v { flex: 1 1 auto; color: var(--term-fg); }

@media (max-width: 720px) {
  .term-row { gap: 10px; }
  .term-row .k { flex: 0 0 118px; }
}
