/* ============================================
   PROJECTS — 手账日历（参考 p10 / p11）
   奶油纸 + 粉色网格 + 衬线斜体月份 + 贴纸拼贴
   ============================================ */

.projects-page {
  position: relative;
  min-height: calc(100vh - var(--menu-bar-h));
  min-height: calc(100svh - var(--menu-bar-h));
  padding: var(--sp-5) var(--sp-5) 100px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.projects-frame {
  width: 100%;
  max-width: 980px;
}

.projects-body {
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  overflow-y: auto;
  max-height: calc(100svh - var(--menu-bar-h) - 170px);
  background:
    radial-gradient(ellipse 80% 30% at 0% 0%, rgba(246, 226, 154, .28), transparent 60%),
    radial-gradient(ellipse 70% 30% at 100% 10%, rgba(242, 181, 190, .22), transparent 60%),
    var(--cream);
}

/* —— 顶部：标题 + 年份 —— */
.proj-year-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.proj-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.proj-heading .ph-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.proj-heading h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: .01em;
}
.proj-heading .ph-script {
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--olive);
  transform: rotate(-1.5deg);
  display: inline-block;
}

.proj-year-left { position: relative; display: flex; align-items: center; gap: 10px; }
.proj-year-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--butter);
  border: 1px solid rgba(120, 100, 72, .2);
  box-shadow: 0 2px 6px rgba(90, 72, 48, .10);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.proj-year-btn:hover { transform: translateY(-2px) rotate(-1deg); background: var(--butter-soft); box-shadow: var(--shadow-md); }
.proj-year-btn svg { width: 13px; height: 13px; transition: transform var(--dur-fast); }
.proj-year-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.proj-count {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: .04em;
  padding-bottom: 4px;
}

/* —— 年份切换提示 —— */
.proj-year-hint {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 2px;
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--ink-soft);
}
.proj-year-hint .hint-click { color: var(--red); }
.proj-year-hint .hint-tag {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  letter-spacing: .02em;
}
.proj-year-hint .hint-tag.campus {
  background: rgba(244, 198, 66, .30);
  border: 1px dashed rgba(120, 90, 20, .45);
}
.proj-year-hint .hint-tag.intern {
  background: rgba(214, 90, 90, .14);
  border: 1px dashed rgba(160, 60, 60, .45);
}

.proj-year-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 300;
  min-width: 150px;
  padding: 6px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid rgba(120, 100, 72, .16);
  box-shadow: var(--shadow-window);
  animation: popIn .18s var(--ease-spring);
}
.proj-year-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  border-radius: 9px;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink-soft);
  transition: background var(--dur-fast);
}
.proj-year-dropdown button:hover { background: var(--cream); }
.proj-year-dropdown button.is-active {
  background: var(--butter);
  color: var(--ink);
  font-weight: 700;
}

/* —— 日历纸 —— */
.cal-sheet {
  position: relative;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid rgba(120, 100, 72, .16);
  box-shadow: 0 14px 34px rgba(90, 72, 48, .14);
  padding: 14px 14px 16px;
  background-image:
    repeating-linear-gradient(0deg, rgba(242, 181, 190, .18) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(242, 181, 190, .10) 0 1px, transparent 1px 34px);
}
.cal-sheet .cal-rings {
  position: absolute;
  top: -7px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0 24px;
  pointer-events: none;
}
.cal-sheet .cal-rings span {
  width: 8px; height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, #D9D2C4, #BEB5A4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6);
}

/* —— 网格 —— */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px dashed rgba(214, 87, 78, .28);
  border-left: 1px dashed rgba(214, 87, 78, .28);
}

.proj-month {
  position: relative;
  min-height: 158px;
  padding: 10px 10px 12px;
  border-right: 1px dashed rgba(214, 87, 78, .28);
  border-bottom: 1px dashed rgba(214, 87, 78, .28);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--dur-fast);
  background: transparent;
  text-align: left;
}
.proj-month.empty { opacity: .62; }
.proj-month.has-project { cursor: pointer; }
.proj-month.has-project:hover { background: rgba(251, 239, 195, .34); }
.proj-month.has-project:hover .m-photo { transform: rotate(-1deg) scale(1.02); }
.proj-month.has-project:hover .m-note { transform: rotate(0deg) translateY(-2px); }
.proj-month:active { background: rgba(249, 214, 219, .35); }

/* 仅文字项目：不可点开，视觉更淡 */
.proj-month.has-brief { cursor: default; }
.proj-month.has-brief:hover,
.proj-month.has-brief:active { background: transparent; }
.m-sparkle-mute { opacity: .3; }
.m-briefs {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.m-brief {
  position: relative;
  padding-left: 11px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-soft);
  letter-spacing: .01em;
}
.m-brief::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  opacity: .55;
}

/* ———— 详情弹窗 · 视频 ———— */
.pd-video {
  width: 100%;
  margin-top: var(--sp-3);
  border-radius: 6px;
  background: #000;
  box-shadow: 0 10px 24px rgba(78, 62, 42, .22);
}

/* ———— 详情弹窗 · 作品链接按钮 ———— */
.pd-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.pd-link:hover { opacity: .85; transform: translateY(-1px); }

.proj-month .m-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: .01em;
  line-height: 1.1;
}
.proj-month.has-project .m-label { color: var(--ink); font-weight: 600; }

/* 拍立得缩略图 */
.m-photo-wrap {
  position: relative;
  margin-top: 2px;
  transform: rotate(-1.6deg);
  transition: transform var(--dur-med) var(--ease-spring);
}
.m-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 4px solid #fff;
  border-bottom-width: 14px;
  border-radius: 2px;
  box-shadow: 0 4px 10px rgba(90, 72, 48, .20);
  display: block;
}

/* 便签标题 */
.m-note {
  position: absolute;
  left: -4px;
  bottom: -10px;
  right: 6px;
  background: var(--butter);
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 11.5px;
  line-height: 1.25;
  padding: 5px 8px 6px;
  border-radius: 2px 2px 8px 2px;
  box-shadow: 0 3px 7px rgba(90, 72, 48, .18);
  transform: rotate(2.4deg);
  transition: transform var(--dur-med) var(--ease-spring);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-sparkle {
  position: absolute;
  right: 8px; top: 6px;
  width: 13px; height: 13px;
  color: var(--red);
  opacity: .65;
}

/* 空月份装饰 */
.m-empty-dots {
  margin-top: auto;
  display: flex;
  gap: 4px;
  opacity: .35;
}
.m-empty-dots i {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-faint);
}

/* 月份里多个项目的小圆点 */
.m-dots { display: flex; gap: 3px; margin-top: 2px; }
.m-dots i { width: 5px; height: 5px; border-radius: 50%; }

/* —— 项目详情弹窗 —— */
.proj-detail {
  width: 100%;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px;
}
.proj-detail-shell {
  max-width: 800px;
  max-height: calc(100vh - 70px);
  max-height: calc(100svh - 70px);
  width: 100%;
}

.pd-hero {
  position: relative;
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  border-bottom: 1px dashed rgba(120, 100, 72, .2);
  background:
    linear-gradient(120deg, rgba(251, 239, 195, .55), rgba(253, 250, 242, 0) 70%),
    var(--paper);
}
.pd-hero .pd-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.pd-hero h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 6px;
}
.pd-hero .pd-meta {
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  margin-bottom: var(--sp-3);
}
.pd-hero .pd-tag { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-stamp {
  position: absolute;
  right: 22px; top: 18px;
  width: 62px; height: 62px;
  border: 2px solid rgba(214, 87, 78, .5);
  border-radius: 50%;
  display: grid; place-items: center;
  text-align: center;
  color: rgba(214, 87, 78, .78);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
  transform: rotate(-12deg);
}

.pd-body { padding: var(--sp-5) var(--sp-6) var(--sp-6); }
.pd-section { margin-bottom: var(--sp-5); }
.pd-section h3 {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pd-section h3::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--red);
  transform: rotate(12deg);
  flex: 0 0 auto;
}
.pd-section p, .pd-section li {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.8;
}
.pd-section ul, .pd-section ol { padding-left: 0; }
.pd-section ul li, .pd-section ol li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
}
.pd-section ul li::before {
  content: "▸";
  position: absolute;
  left: 2px;
  color: var(--sage);
  font-size: 11px;
}
.pd-section ol { counter-reset: step; }
.pd-section ol li { counter-increment: step; }
.pd-section ol li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 4px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--butter);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.pd-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-3);
}
.pd-photos figure {
  margin: 0;
  background: #fff;
  padding: 6px 6px 22px;
  border-radius: 3px;
  box-shadow: var(--shadow-paper);
  transform: rotate(-1deg);
  transition: transform var(--dur-med) var(--ease-spring);
}
.pd-photos figure:nth-child(even) { transform: rotate(1.4deg); }
.pd-photos figure:hover { transform: rotate(0deg) translateY(-4px); }
.pd-photos img { border-radius: 2px; width: 100%; display: block; }
.pd-photos figcaption {
  font-family: var(--font-hand);
  font-size: 11px;
  color: var(--ink-mute);
  text-align: center;
  padding-top: 6px;
}

/* =========== 响应式 =========== */
@media (max-width: 900px) {
  .proj-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .projects-page { padding: var(--sp-4) var(--sp-3) 96px; }
  .projects-body { padding: var(--sp-4) var(--sp-3) var(--sp-5); }
  .cal-sheet { padding: 10px; }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-month { min-height: 146px; padding: 8px; }
  .proj-month .m-label { font-size: 14px; }
  .pd-hero, .pd-body { padding: var(--sp-4); }
  .pd-stamp { width: 52px; height: 52px; right: 12px; top: 12px; font-size: 8px; }
  .proj-heading h2 { font-size: 1.25rem; }
}
@media (max-width: 420px) {
  .proj-month { min-height: 132px; padding: 6px; }
  .proj-month .m-label { font-size: 13px; }
  .pd-photos { grid-template-columns: 1fr; }
}
