/* ==========================================================================
   青衿纪念册 · 专属评语（第二屏）
   手机优先：单列卡片 + 横向照片条；桌面：更大的卡片与照片网格
   ========================================================================== */

/* ---------------------------------------------------------- 覆盖层 */
.personal {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 40px);
  background: rgba(4, 13, 18, .82);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  color: #fff;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  animation: personalIn .7s var(--ease) both;
}
.personal[hidden] { display: none; }
.personal.is-closing { animation: personalOut .55s var(--ease) both; }

@keyframes personalIn {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: none; }
}
@keyframes personalOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: scale(1.02); }
}

.personal__glow {
  position: fixed;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--c-accent) 32%, transparent), transparent 60%),
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--c-primary) 34%, transparent), transparent 55%);
  filter: blur(40px);
  opacity: .55;
  animation: personalGlow 14s var(--ease-io) infinite alternate;
  pointer-events: none;
}
@keyframes personalGlow {
  from { transform: translate(-12%, -6%) scale(.9); }
  to { transform: translate(10%, 8%) scale(1.08); }
}

.personal__inner {
  position: relative;
  width: 100%;
  max-width: 760px;
  min-width: 0;
  flex: 0 0 auto;
  text-align: center;
  padding: 4px 0 10px;
}

/* ---------------------------------------------------------- 头部 */
.personal__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: .12em;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .24);
  animation: pFadeDown .7s var(--ease) both;
}
.personal__spark { color: #ffd88a; animation: sparkSpin 3.6s linear infinite; display: inline-block; }
@keyframes sparkSpin { to { transform: rotate(360deg); } }
@keyframes pFadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}

.personal__title {
  margin: 16px 0 8px;
  font-size: clamp(23px, 4.2vw, 38px);
  line-height: 1.32;
  letter-spacing: -.01em;
  color: #fff;
  text-shadow: 0 10px 34px rgba(0, 0, 0, .5);
  animation: pFadeDown .8s var(--ease) both;
}
.personal__sub {
  font-size: clamp(12px, 1.5vw, 14px);
  color: rgba(255, 255, 255, .66);
  animation: pFadeDown .8s var(--ease) both;
}

/* ---------------------------------------------------------- 评语卡片 */
.personal__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 22px 0 16px;
  min-width: 0;
}
.pnote {
  position: relative;
  text-align: left;
  padding: clamp(18px, 2.6vw, 28px);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .06));
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, .9);
  backdrop-filter: blur(16px);
  animation: pNoteIn .8s var(--ease) both;
  min-width: 0;
}
.pnote:nth-child(2) { animation-delay: .08s; }
.pnote:nth-child(3) { animation-delay: .16s; }
.pnote[data-active] { border-color: rgba(255, 216, 138, .55); }
@keyframes pNoteIn {
  from { opacity: 0; transform: translateY(22px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.pnote__head { display: grid; gap: 6px; }
.pnote__teacher {
  font-size: 12.5px;
  letter-spacing: .08em;
  color: #a8f7ea;
}
.pnote__tag {
  justify-self: start;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #4a3200;
  background: linear-gradient(120deg, #ffe6a8, #ffc247);
  font-weight: 700;
}
.pnote__title {
  font-size: clamp(19px, 2.8vw, 26px);
  line-height: 1.4;
  margin-top: 2px;
  color: #fff;
}
.pnote__body {
  margin-top: 12px;
  font-size: clamp(14.5px, 1.9vw, 17px);
  line-height: 2;
  color: rgba(255, 255, 255, .92);
  min-width: 0;
}
.pnote__line { overflow-wrap: anywhere; }
.pnote__line + .pnote__line { margin-top: 2px; }

/* 照片条：手机横向滑动，桌面自动铺成网格 */
.pnote__photos {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 46%);
  gap: 10px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.pnote__photos[data-count="1"] { grid-auto-columns: minmax(0, 100%); }
.pnote__photo {
  position: relative;
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(255, 255, 255, .06);
  scroll-snap-align: start;
}
.pnote__photo img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  transition: transform .8s var(--ease);
}
.pnote__photo:hover img { transform: scale(1.06); }
.pnote__zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .3s ease;
}
.pnote__photo:hover .pnote__zoom,
.pnote__photo:focus-visible .pnote__zoom { opacity: 1; }
.pnote__hint {
  margin-top: 8px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .55);
}

/* ---------------------------------------------------------- 分页圆点 / 操作 */
.personal__dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 4px;
}
.personal__dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .32);
  cursor: pointer;
  transition: width .4s var(--ease), background .3s ease;
}
.personal__dots button[aria-selected="true"] {
  width: 28px;
  background: linear-gradient(90deg, #7dffd8, #fff);
}

.personal__ctrl {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
  animation: pFadeDown .7s var(--ease) both;
}
.personal__tip {
  margin-top: 14px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .5);
  animation: pFadeDown .8s var(--ease) both;
}

/* ---------------------------------------------------------- 大图查看器 */
.pviewer { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; }
.pviewer[hidden] { display: none; }
.pviewer__mask { position: absolute; inset: 0; background: rgba(3, 10, 14, .9); backdrop-filter: blur(14px); }
.pviewer__box {
  position: relative;
  margin: 0;
  max-width: min(1080px, 94vw);
  max-height: 92vh;
  animation: pvIn .4s var(--ease) both;
}
@keyframes pvIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: none; }
}
.pviewer__box img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 16px;
  display: block;
  margin: 0 auto;
}
.pviewer__box figcaption {
  text-align: center;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .72);
  margin-top: 10px;
}
.pviewer__close,
.pviewer__nav {
  position: absolute;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .3s ease, transform .3s var(--ease);
}
.pviewer__close:hover,
.pviewer__nav:hover { background: rgba(255, 255, 255, .28); transform: scale(1.06); }
.pviewer__close { top: -48px; right: 0; }
.pviewer__nav { top: 50%; margin-top: -21px; font-size: 26px; padding-bottom: 5px; }
.pviewer__nav--prev { left: -54px; }
.pviewer__nav--next { right: -54px; }

/* ---------------------------------------------------------- 导航入口 */
.nav__link--note {
  position: relative;
  color: #ffe9b8 !important;
}
.nav__link--note .nav__dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffc247;
  box-shadow: 0 0 0 0 rgba(255, 194, 71, .7);
  animation: navDot 2.2s infinite;
}
@keyframes navDot {
  0% { box-shadow: 0 0 0 0 rgba(255, 194, 71, .6); }
  70% { box-shadow: 0 0 0 8px rgba(255, 194, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 194, 71, 0); }
}

/* ---------------------------------------------------------- 桌面端 */
@media (min-width: 720px) {
  .pnote__photos {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    grid-auto-columns: auto;
    overflow: visible;
    scroll-snap-type: none;
  }
  .pnote__photo img { height: 170px; }
  .personal__list { margin-top: 26px; }
}
@media (min-width: 1024px) {
  .personal__inner { width: min(860px, 100%); }
  .personal__list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------- 手机端 */
@media (max-width: 560px) {
  .personal { padding: 12px 12px 20px; justify-content: flex-start; }
  .personal__inner { padding-top: 12px; max-width: 100%; }
  .personal__title { margin-top: 12px; font-size: 22px; }
  .pnote { padding: 16px 15px; border-radius: 20px; }
  .pnote__body { line-height: 1.9; }
  .pnote__photos { grid-auto-columns: minmax(140px, 72%); width: 100%; }
  .pnote__photo img { height: 130px; }
  .personal__ctrl { flex-direction: column; width: 100%; }
  .personal__ctrl .btn { width: 100%; }
  .pviewer__close { top: -42px; }
  .pviewer__nav--prev { left: -6px; }
  .pviewer__nav--next { right: -6px; }
  .pviewer__nav { width: 36px; height: 36px; font-size: 22px; }
}

/* 尊重系统的「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  .personal,
  .personal.is-closing,
  .personal__kicker,
  .personal__title,
  .personal__sub,
  .pnote,
  .personal__ctrl,
  .personal__tip,
  .personal__glow,
  .personal__spark,
  .nav__link--note .nav__dot {
    animation: none !important;
  }
}
