/* About / Copyright — compact floating modal (~小比例居中浮层) */

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
}

.legal-modal.is-open {
  display: grid !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 8, 0.55);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border: 0;
  cursor: pointer;
}

.legal-modal__panel {
  position: relative;
  z-index: 1;
  /* 小比例浮动：约半宽、内容自适应高度 */
  width: min(460px, 92vw);
  max-height: min(64vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(ellipse 90% 55% at 10% 0%, rgba(16, 163, 127, 0.16), transparent 55%),
    linear-gradient(165deg, #16181a 0%, #0e1012 55%, #0a0a0a 100%);
  box-shadow:
    0 0 0 1px rgba(16, 163, 127, 0.1),
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 8px 20px rgba(0, 0, 0, 0.35);
  transform: translateY(14px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.legal-modal.is-open .legal-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.legal-modal__chrome {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-modal__eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-hover, #10a37f);
}

.legal-modal__title {
  margin: 3px 0 0;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text, #f2f2f2);
}

.legal-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-body, #c8c8c8);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.legal-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.legal-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 18px 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-body, #c8c8c8);
  -webkit-overflow-scrolling: touch;
}

.legal-modal__body h2 {
  margin: 0 0 0.7em;
  font-size: 1.05em;
  font-weight: 600;
  color: var(--text, #f2f2f2);
}

.legal-modal__body h3 {
  margin: 1.15em 0 0.45em;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text, #ececec);
}

.legal-modal__body p {
  margin: 0 0 0.85em;
}

.legal-modal__body ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.legal-modal__body li {
  margin: 0.25em 0;
}

.legal-modal__body a {
  color: var(--accent-hover, #10a37f);
}

.legal-modal__status {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #888);
}

body.legal-modal-open {
  overflow: hidden;
}

/* Standalone /about /copyright host page */
body.legal-host {
  min-height: 100dvh;
  background: #0a0a0a;
}

body.legal-host .site-shell {
  filter: blur(2px) brightness(0.55);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 720px) {
  .legal-modal__panel {
    width: min(94vw, 460px);
    max-height: min(72vh, 580px);
  }

  .legal-modal__chrome {
    padding: 12px 12px 8px 14px;
  }

  .legal-modal__body {
    padding: 12px 14px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-modal,
  .legal-modal__panel {
    transition: none;
  }

  .legal-modal__panel {
    transform: none;
  }
}
