:root {
  --luban-red: #b91c1c;
  --luban-red-dark: #7f1d1d;
  --luban-gold: #c58b2b;
  --luban-ink: #1c1917;
  --luban-muted: #78716c;
  --luban-line: #e7e5e4;
  --luban-surface: #ffffff;
  --luban-warm: #f7f3ef;
  --luban-paper: #fffdfa;
  --luban-focus-ring: rgba(185, 28, 28, 0.12);
  --admin-red: var(--luban-red);
  --admin-red-dark: var(--luban-red-dark);
  --admin-ink: var(--luban-ink);
  --admin-muted: var(--luban-muted);
  --admin-line: var(--luban-line);
  --admin-surface: var(--luban-surface);
  --admin-warm: var(--luban-warm);
  --ink: var(--luban-ink);
  --muted: #71665d;
  --paper: var(--luban-paper);
  --surface: var(--luban-surface);
  --line: #eadfd2;
}

.serif {
  font-family: "Playfair Display", Georgia, serif;
}

html[lang^="zh"] .serif {
  font-family: "Noto Serif SC", "Playfair Display", Georgia, serif;
}

.panel,
.profile-panel {
  border-radius: 8px;
  border: 1px solid var(--luban-line);
  box-shadow: 0 18px 50px rgba(28, 25, 23, 0.08);
}

.form-input,
.form-select,
.form-textarea,
.field {
  width: 100%;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field {
  padding: 0.8rem 0.9rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.field:focus {
  outline: none;
  border-color: var(--luban-red);
  box-shadow: 0 0 0 3px var(--luban-focus-ring);
}

.validation-invalid {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12) !important;
}

.validation-valid {
  border-color: #15803d !important;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.11) !important;
}

.validation-message {
  margin-top: 0.35rem;
  min-height: 1.1rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.validation-message.error {
  color: #b91c1c;
}

.validation-message.success {
  color: #15803d;
}

[data-luban-header] {
  display: contents;
}

.luban-site-footer nav {
  position: static;
  top: auto;
  width: auto;
  background: transparent;
  box-shadow: none;
  z-index: auto;
}

.toast-container {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #fff;
  background: #292524;
  box-shadow: 0 18px 35px rgba(28, 25, 23, 0.22);
  animation: toastIn 0.22s ease-out;
}

.toast.removing {
  animation: toastOut 0.18s ease-in forwards;
}

.toast-success {
  background: #166534;
}

.toast-error {
  background: #991b1b;
}

.toast-info {
  background: #292524;
}

.toast-icon {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.05rem;
}

.toast-msg {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.toast-close {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  border: 0;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.72;
}

.toast-close:hover,
.toast-close:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(28, 25, 23, 0.62);
  backdrop-filter: blur(4px);
}

.confirm-modal-panel {
  width: min(100%, 25rem);
  border: 1px solid var(--luban-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 60px rgba(28, 25, 23, 0.28);
  animation: modalPop 0.2s ease-out;
}

.confirm-modal-body {
  padding: 1.5rem;
}

.confirm-modal-title {
  margin: 0;
  color: var(--luban-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.confirm-modal-message {
  margin: 0.55rem 0 0;
  color: var(--luban-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0 1.5rem 1.5rem;
}

.confirm-modal-actions button {
  min-height: 2.5rem;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.confirm-cancel {
  border: 1px solid #d6d3d1;
  color: #44403c;
  background: #fff;
}

.confirm-cancel:hover,
.confirm-cancel:focus-visible {
  background: #fafaf9;
}

.confirm-ok {
  border: 1px solid var(--luban-red);
  color: #fff;
  background: var(--luban-red);
}

.confirm-ok:hover,
.confirm-ok:focus-visible {
  background: var(--luban-red-dark);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.scroll-top-btn {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: calc(max(1rem, env(safe-area-inset-bottom, 0px)) + 4rem);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--luban-ink);
  box-shadow: 0 14px 28px rgba(28, 25, 23, 0.24);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.75rem);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-btn:hover,
.scroll-top-btn:focus-visible {
  background: var(--luban-red);
  outline: none;
}

.scroll-top-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

@media (max-width: 520px) {
  body.luban-chatbot-open .scroll-top-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem) scale(0.92);
  }
}

.skeleton-card {
  min-height: 23rem;
  overflow: hidden;
  border: 1px solid #f5f5f4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(28, 25, 23, 0.06);
}

.skeleton-img,
.skeleton-text,
.skeleton-text-sm,
.skeleton-btn {
  border-radius: 6px;
  background: linear-gradient(90deg, #e7e5e4 25%, #f8f6f4 50%, #e7e5e4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.35s infinite;
}

.skeleton-img {
  width: 100%;
  height: 15rem;
  border-radius: 0;
}

.skeleton-text {
  height: 1rem;
}

.skeleton-text-sm {
  height: 0.75rem;
}

.skeleton-btn {
  height: 2.5rem;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.luban-confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 950;
  pointer-events: none;
  overflow: hidden;
}

.luban-confetti-piece {
  position: absolute;
  top: -1rem;
  width: 0.5rem;
  height: 0.65rem;
  border-radius: 2px;
  opacity: 0;
  animation: lubanConfettiFall 2.4s ease-in forwards;
}

@keyframes lubanConfettiFall {
  0% {
    opacity: 1;
    transform: translate3d(0, -1rem, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--confetti-drift, 0), 110vh, 0) rotate(720deg);
  }
}

@media (max-width: 640px) {
  .toast-container {
    right: 1rem;
    left: 1rem;
    width: auto;
  }

  .confirm-modal-actions {
    flex-direction: column-reverse;
  }

  .confirm-modal-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.removing,
  .confirm-modal-panel,
  .skeleton-img,
  .skeleton-text,
  .skeleton-text-sm,
  .skeleton-btn,
  .luban-confetti-piece {
    animation: none;
  }

  .scroll-top-btn {
    transition: none;
  }
}
