/* ===== EmbedKit 自定义样式（配合 Tailwind CDN）===== */

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0b0f17; }
::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #374151; }

::selection { background: rgba(34, 211, 238, 0.3); }

/* ---------- Tab ---------- */
.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: #d1d5db; }
.tab-btn.active {
  color: #22d3ee;
  border-bottom-color: #22d3ee;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(160deg, #111827 0%, #0f1522 100%);
  border: 1px solid #1f2937;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.85rem;
  position: relative;
  padding-left: 0.75rem;
}
.card-title::before {
  content: '';
  position: absolute;
  left: 0; top: 2px; bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(#22d3ee, #34d399);
}

/* ---------- 表单 ---------- */
.lbl {
  display: block;
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
  letter-spacing: 0.05em;
}
.inp {
  width: 100%;
  background: #0b0f17;
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: #e5e7eb;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.inp:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.inp.err {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.inp::placeholder { color: #374151; }

.field-row { display: flex; align-items: flex-start; gap: 0.75rem; }
.field-row .tag { margin-top: 0.45rem; }

/* 进制标签 */
.tag {
  flex: 0 0 64px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.25rem 0;
  border-radius: 0.375rem;
  border: 1px solid;
}
.tag-cyan   { color: #22d3ee; border-color: rgba(34,211,238,.35);  background: rgba(34,211,238,.08); }
.tag-green  { color: #34d399; border-color: rgba(52,211,153,.35);  background: rgba(52,211,153,.08); }
.tag-amber  { color: #fbbf24; border-color: rgba(251,191,36,.35);  background: rgba(251,191,36,.08); }
.tag-violet { color: #a78bfa; border-color: rgba(167,139,250,.35); background: rgba(167,139,250,.08); }
.tag-rose   { color: #fb7185; border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }

/* ---------- 分段选择器 ---------- */
.seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  background: #0b0f17;
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  padding: 3px;
  gap: 3px;
}
.seg {
  padding: 0.3rem 0.8rem;
  font-size: 0.72rem;
  border-radius: 0.375rem;
  color: #6b7280;
  transition: all 0.15s;
}
.seg:hover { color: #d1d5db; }
.seg.active {
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.4);
}

/* ---------- 按钮 ---------- */
.btn-primary {
  background: linear-gradient(135deg, rgba(34,211,238,.18), rgba(52,211,153,.18));
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #22d3ee;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.15s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(34,211,238,.3), rgba(52,211,153,.3));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
}
.btn-ghost {
  border: 1px solid #1f2937;
  color: #9ca3af;
  font-size: 0.75rem;
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: #22d3ee; color: #22d3ee; }

/* ---------- 输出框 / 状态 ---------- */
.out-box {
  background: #0b0f17;
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: #34d399;
  min-height: 2.4rem;
  word-break: break-all;
  user-select: all;
}
.status-box {
  font-size: 0.72rem;
  color: #6b7280;
  background: rgba(31, 41, 55, 0.4);
  border-left: 3px solid #374151;
  border-radius: 0 0.375rem 0.375rem 0;
  padding: 0.5rem 0.75rem;
}
.status-box.ok    { color: #34d399; border-left-color: #34d399; }
.status-box.error { color: #f87171; border-left-color: #f87171; }

/* ---------- 校验结果行 ---------- */
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  color: #9ca3af;
  background: #0b0f17;
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  padding: 0.5rem 0.8rem;
}
.result-row b {
  color: #e5e7eb;
  font-weight: 600;
  letter-spacing: 0.05em;
  user-select: all;
}
.result-row.hl { border-color: rgba(34, 211, 238, 0.35); }
.result-row.hl b { color: #22d3ee; text-shadow: 0 0 10px rgba(34, 211, 238, 0.35); }

/* ---------- 位字段 ---------- */
.bit-byte-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.bit-byte-label {
  font-size: 0.62rem;
  color: #4b5563;
  width: 3.4rem;
  flex-shrink: 0;
  padding-bottom: 0.55rem;
}
.bit-nibble { display: flex; gap: 3px; }
.bit-nibble + .bit-nibble { margin-left: 8px; }
.bit-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bit-idx { font-size: 0.55rem; color: #4b5563; }
.bit-box {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 0.375rem;
  cursor: pointer;
  border: 1px solid #1f2937;
  background: #0b0f17;
  color: #4b5563;
  transition: all 0.12s;
  user-select: none;
}
.bit-box:hover { transform: translateY(-2px); border-color: #6b7280; }
.bit-box.on {
  background: rgba(34, 211, 238, 0.16);
  border-color: #22d3ee;
  color: #22d3ee;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.18);
}

@media (max-width: 480px) {
  .bit-box { width: 24px; height: 24px; font-size: 0.7rem; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 211, 238, 0.15);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: #22d3ee;
  font-size: 0.75rem;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  z-index: 50;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

code.code {
  background: #1f2937;
  padding: 0 0.3em;
  border-radius: 3px;
  font-size: 0.9em;
  color: #22d3ee;
}
