/* ===== Shared Styles for coderw.cn ===== */

/* ---- Smooth theme transition ---- */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}
html.dark {
  color-scheme: dark;
}

/* ---- Title character jump animation ---- */
.title-animate .title-char {
  animation: title-jump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-delay: var(--delay);
  animation-fill-mode: both;
}

@keyframes title-jump {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

/* ---- Textarea base ---- */
textarea {
  resize: none;
  outline: none;
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
}
textarea:focus {
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
  border-color: #4a6cf7;
}

/* ---- Custom scrollbar (light) ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* ---- Custom scrollbar (dark) ---- */
html.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ---- Page fade-in ---- */
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter {
  animation: page-in 0.35s ease-out;
}

/* ---- QR code container ---- */
.qrcode-wrapper canvas,
.qrcode-wrapper img {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

/* ---- Tool output area ---- */
.output-area {
  word-break: break-all;
  white-space: pre-wrap;
}

/* ---- Card hover lift (light) ---- */
.card-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}
html.dark .card-lift:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

/* ---- Menu item active indicator ---- */
.menu-item {
  position: relative;
  transition: all 0.2s ease;
}
.menu-item:hover {
  padding-left: 16px;
}
.menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 60%;
  background: #4a6cf7;
  border-radius: 0 2px 2px 0;
  transition: width 0.2s ease;
}
.menu-item:hover::before {
  width: 3px;
}

/* ---- Toggle buttons (theme + lang) ---- */
.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}
.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.toggle-btn svg {
  width: 16px;
  height: 16px;
}
