/* =========================================================
   components.css —— 全站共用组件
   导航 / 按钮 / 表单 / 弹窗 / 轻提示 / 灯箱 / 页头
   ========================================================= */

/* ========== 品牌标识 ========== */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 39px;
  height: 39px;
  border-radius: 50% 50% 46% 54% / 48% 46% 54% 52%;
  background: linear-gradient(145deg, var(--pink-300) 4%, var(--pink-400) 48%, var(--teal-400) 100%);
  box-shadow: 0 8px 20px rgba(229, 138, 171, 0.24);
  place-items: center;
}

.brand-mark::after {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: inherit;
  content: "";
}

.brand-mark svg {
  width: 17px;
  height: 17px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(120, 76, 94, 0.16));
}

.brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-type strong {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.brand-type small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 0.34em;
}

/* ========== 内页顶部导航 ========== */
.inner-nav {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--nav-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 251, 253, 0.72);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.inner-nav__inner {
  display: flex;
  width: min(var(--content), calc(100% - 80px));
  height: 100%;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-link {
  position: relative;
  padding: 7px 0;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
}

.nav-link::before {
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--pink-500);
  content: "";
  opacity: 0;
  transform: translateX(-50%) scale(0);
  transition: 0.35s var(--ease-soft);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link.is-active::before,
.nav-link:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.user-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid rgba(95, 147, 145, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
}

.user-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-soft);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  place-items: center;
  text-transform: uppercase;
}

.user-name {
  max-width: 82px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(95, 147, 145, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-soft);
  place-items: center;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.3s var(--ease-soft);
}

.icon-btn:hover {
  background: #fff;
  color: var(--pink-600);
  transform: translateY(-2px);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* ========== 按钮 ========== */
.btn {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  transition:
    transform 0.35s var(--ease-soft),
    box-shadow 0.35s ease,
    background 0.35s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn--primary {
  background: var(--gradient-btn);
  background-size: 150% 100%;
  box-shadow:
    0 14px 30px rgba(219, 117, 154, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  color: #fff;
  text-shadow: 0 1px 2px rgba(87, 68, 83, 0.12);
}

.btn--primary::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  content: "";
  transform: skewX(-20deg);
  transition: left 0.65s var(--ease-soft);
}

.btn--primary:hover {
  box-shadow:
    0 20px 38px rgba(219, 117, 154, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn--primary:hover::before {
  left: 130%;
}

.btn--soft {
  border: 1px solid rgba(95, 147, 145, 0.14);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.btn--soft:hover {
  border-color: rgba(231, 137, 171, 0.28);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--ghost {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn--small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 12px;
}

.btn--block {
  width: 100%;
}

.btn[disabled],
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.is-loading .btn__label {
  opacity: 0;
}

.btn.is-loading::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: spin 0.8s linear infinite;
}

/* 文字按钮 */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.link-arrow svg {
  width: 15px;
  transition: transform 0.35s var(--ease-soft);
}

.link-arrow:hover svg {
  transform: translateX(4px);
}

/* ========== 表单 ========== */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.field__hint {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.input-shell {
  position: relative;
  display: flex;
  min-height: 52px;
  border: 1px solid rgba(91, 145, 142, 0.16);
  border-radius: 14px;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.input-shell:focus-within {
  border-color: rgba(55, 165, 158, 0.5);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(105, 212, 204, 0.12);
}

.input-shell__icon {
  display: grid;
  width: 48px;
  flex: 0 0 48px;
  color: var(--teal-500);
  place-items: center;
}

.input-shell__icon svg {
  width: 17px;
  height: 17px;
  opacity: 0.85;
}

.text-input {
  width: 100%;
  min-width: 0;
  padding: 13px 16px 13px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  letter-spacing: 0.03em;
}

.input-shell:has(.input-shell__icon) .text-input {
  padding-left: 0;
}

.text-input::placeholder {
  color: #aebdbd;
  font-size: 12px;
}

.input-action {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  margin-right: 4px;
  border-radius: 50%;
  color: var(--muted);
  place-items: center;
}

.input-action:hover {
  color: var(--teal-600);
}

.input-action svg {
  width: 17px;
  height: 17px;
}

/* 通用输入框（日记编辑器等） */
.plain-input,
.plain-textarea,
.plain-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(91, 145, 142, 0.17);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.plain-input:focus,
.plain-textarea:focus,
.plain-select:focus {
  border-color: rgba(55, 165, 158, 0.5);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(105, 212, 204, 0.1);
}

.plain-textarea {
  min-height: 120px;
  line-height: 1.9;
  resize: vertical;
}

.plain-select {
  cursor: pointer;
}

/* ========== 页面标题区（内页共用） ========== */
.page-intro {
  display: flex;
  padding: 64px 0 38px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.page-intro__title {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: clamp(46px, 6.3vw, 86px);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.12;
}

.page-intro__title em {
  color: var(--pink-500);
  font-style: normal;
}

.page-intro__copy {
  max-width: 360px;
  padding-bottom: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 2;
}

.page-intro__aside {
  flex: 0 0 auto;
  padding-bottom: 10px;
  text-align: right;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: color 0.25s ease;
}

.back-link svg {
  width: 15px;
  transition: transform 0.3s var(--ease-soft);
}

.back-link:hover {
  color: var(--pink-600);
}

.back-link:hover svg {
  transform: translateX(-4px);
}

/* ========== 标签、徽章 ========== */
.tag {
  display: inline-flex;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid rgba(83, 135, 134, 0.12);
  border-radius: 999px;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.tag--pink {
  border-color: rgba(231, 137, 171, 0.2);
  background: rgba(255, 235, 243, 0.7);
  color: var(--pink-600);
}

.tag--teal {
  border-color: rgba(53, 173, 166, 0.18);
  background: rgba(226, 250, 247, 0.72);
  color: var(--teal-600);
}

/* ========== 轻提示 Toast ========== */
.toast-stack {
  position: fixed;
  z-index: 500;
  bottom: 30px;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100% - 36px));
  align-items: center;
  gap: 9px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  max-width: 100%;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  align-items: center;
  gap: 9px;
  background: rgba(48, 82, 81, 0.94);
  box-shadow: 0 14px 40px rgba(35, 68, 67, 0.22);
  color: #f7fffd;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: 0.35s var(--ease-soft);
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast--pink {
  background: rgba(199, 93, 130, 0.95);
}

.toast svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

/* ========== 弹窗（错误提示 / 确认 / 输入） ========== */
.modal {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 69, 70, 0.32);
  opacity: 0;
  backdrop-filter: blur(9px);
  transition: opacity 0.35s ease;
}

.modal__card {
  position: relative;
  width: min(420px, 100%);
  padding: 34px 34px 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 220, 233, 0.62), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(215, 249, 246, 0.52), transparent 40%),
    rgba(255, 252, 253, 0.97);
  box-shadow: 0 36px 100px rgba(54, 88, 88, 0.24);
  opacity: 0;
  text-align: center;
  transform: translateY(18px) scale(0.96);
  transition: 0.45s var(--ease-soft);
}

.modal.is-open .modal__backdrop {
  opacity: 1;
}

.modal.is-open .modal__card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal.is-shaking .modal__card {
  animation: modal-shake 0.48s ease;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  place-items: center;
  transition: 0.25s ease;
}

.modal__close:hover {
  background: #fff;
  color: var(--ink);
  transform: rotate(90deg);
}

.modal__close svg {
  width: 15px;
  height: 15px;
}

.modal__icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--pink-200), var(--teal-200));
  color: var(--pink-600);
  place-items: center;
}

.modal__icon svg {
  width: 26px;
  height: 26px;
}

.modal__icon--teal {
  color: var(--teal-600);
}

.modal__title {
  margin-bottom: 8px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.modal__text {
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.9;
}

.modal__text strong {
  color: var(--pink-600);
  font-weight: 600;
}

.modal__actions {
  display: flex;
  margin-top: 24px;
  justify-content: center;
  gap: 10px;
}

.modal__actions .btn {
  min-width: 118px;
}

.modal__field {
  margin-top: 18px;
  text-align: left;
}

.modal__note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ========== 图片灯箱 ========== */
.lightbox {
  position: fixed;
  z-index: 450;
  inset: 0;
  display: grid;
  padding: 64px 78px;
  place-items: center;
  background: rgba(28, 49, 50, 0.86);
  opacity: 0;
  backdrop-filter: blur(18px);
  transition: opacity 0.35s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox__figure {
  position: relative;
  display: flex;
  width: min(100%, 980px);
  max-height: 100%;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: scale(0.97);
  transition: transform 0.45s var(--ease-soft);
}

.lightbox.is-open .lightbox__figure {
  transform: scale(1);
}

.lightbox__img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 210px);
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

.lightbox__caption {
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
}

.lightbox__caption strong {
  display: block;
  font-family: var(--font-hand);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.lightbox__caption span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.lightbox__close {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 26px;
  display: grid;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  place-items: center;
  transition: 0.25s ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(90deg);
}

.lightbox__close svg {
  width: 18px;
  height: 18px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  place-items: center;
  transform: translateY(-50%);
  transition: 0.25s ease;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.16);
}

.lightbox__nav svg {
  width: 18px;
  height: 18px;
}

.lightbox__nav--prev {
  left: 24px;
}

.lightbox__nav--next {
  right: 24px;
}

.lightbox__nav[hidden] {
  display: none;
}

/* ========== 内页页脚 ========== */
.site-footer {
  display: flex;
  padding: 42px 0 34px;
  border-top: 1px solid rgba(83, 135, 134, 0.1);
  margin-top: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.site-footer__brand {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.22em;
}

.site-footer__heart {
  color: var(--pink-400);
}

/* ========== 通用加载骨架 / 空状态 ========== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(228, 244, 242, 0.65);
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes modal-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-9px) rotate(-0.6deg);
  }
  40% {
    transform: translateX(8px) rotate(0.6deg);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(4px);
  }
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .inner-nav__inner {
    width: calc(100% - 40px);
    gap: 16px;
  }

  .nav-links {
    gap: 20px;
  }

  .nav-link {
    font-size: 12px;
  }

  .page-intro {
    padding-top: 46px;
  }
}

@media (max-width: 720px) {
  .inner-nav__inner {
    width: calc(100% - 28px);
    gap: 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-type strong {
    font-size: 19px;
  }

  .brand-type small {
    display: none;
  }

  .nav-links {
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    font-size: 11.5px;
    letter-spacing: 0.02em;
  }

  .user-chip,
  .user-cluster .user-name {
    display: none;
  }

  .icon-btn--logout {
    width: 34px;
    height: 34px;
  }

  .page-intro {
    display: block;
    padding: 38px 0 26px;
  }

  .page-intro__title {
    font-size: clamp(36px, 10.4vw, 52px);
  }

  .page-intro__copy {
    max-width: none;
    margin-top: 18px;
    font-size: 12.5px;
  }

  .page-intro__aside {
    margin-top: 16px;
    padding: 0;
    text-align: left;
  }

  .modal {
    padding: 16px;
  }

  .modal__card {
    padding: 30px 22px 24px;
  }

  .lightbox {
    padding: 60px 16px 90px;
  }

  .lightbox__img {
    max-height: calc(100vh - 220px);
  }

  .lightbox__nav {
    top: auto;
    bottom: 24px;
    transform: none;
  }

  .lightbox__nav--prev {
    left: calc(50% - 62px);
  }

  .lightbox__nav--next {
    right: calc(50% - 62px);
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }
}
