/* ============================================================
   旅行手帳 · Traveler's Notebook  —  Design System CSS
   Based on: 手账_.zip / DESIGN.md
   ============================================================ */

/* ---------- Base: Corkboard ---------- */
body {
  background-color: #F5EFE6;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  overflow-x: hidden;
}

/* ---------- Hard Shadow (core) ---------- */
.hard-shadow {
  box-shadow: 3px 3px 0px rgba(74, 55, 40, 0.15);
}
.hard-shadow-lg {
  box-shadow: 5px 5px 0px rgba(74, 55, 40, 0.18);
}
.hard-shadow-sm {
  box-shadow: 2px 2px 0px rgba(74, 55, 40, 0.12);
}

/* ---------- Tape Strip ---------- */
.tape {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  z-index: 10;
}
.tape-hero {
  z-index: 15;
}

/* ---------- Ticket Stub (Hero) ---------- */
.ticket-stub {
  display: inline-block;
  background: #f4e0c0;
  border: 2px dashed #e1bfb9;
  position: relative;
  margin: 0 auto;
}

/* ---------- Filter Tape Bar ---------- */
.filter-tape-bar {
  background: rgba(194, 158, 114, 0.25);
  padding: 12px 24px;
  border-radius: 4px;
  transform: rotate(-0.5deg);
  border: 1px dashed rgba(160, 120, 80, 0.2);
}
.filter-chip {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 18px;
  border-radius: 9999px;
  background: #fff;
  color: #59413d;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.34,1.56,.64,1);
  border: 1px solid transparent;
  transform: rotate(var(--chip-rot, 0deg));
  --chip-rot: 0deg;
}
.filter-chip:hover {
  transform: rotate(0deg) scale(1.05) !important;
  background: #ffe5e1;
  color: #9e2016;
  border-color: #ffb4a9;
}
.filter-chip-active {
  background: #c0392b;
  color: #fff;
  border-color: #9e2016;
  transform: rotate(0deg) scale(1.05) !important;
}
.filter-chip-active:hover {
  background: #a93226;
}

/* ---------- Scrap Canvas (Scattered Overlap Layout) ---------- */
.scrap-canvas {
  position: relative;
  min-height: 900px;
  padding-bottom: 60px;
  margin: 0 auto;
  max-width: 1140px;
}
/* Desktop: wide canvas for scattered cards */
@media (min-width: 641px) {
  .scrap-canvas {
    min-height: 860px;
  }
}

/* ==================== Card Base ==================== */
.scrap-card {
  position: absolute;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease, z-index 0s;
  will-change: transform;
  opacity: 0;
  animation: cardIn 0.45s ease forwards;
}
.scrap-card.dragging {
  cursor: grabbing;
  transform: rotate(-1.5deg) scale(1.06) !important;
  box-shadow: 8px 8px 0 rgba(74,55,40,0.28) !important;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
  z-index: 9999 !important;
}
.scrap-card:hover {
  transform: rotate(0deg) scale(1.04) !important;
  z-index: 50;
  box-shadow: 6px 6px 0px rgba(74, 55, 40, 0.22) !important;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.94) rotate(var(--card-rot, 0deg)); }
  to   { opacity: 1; transform: translateY(0) scale(1) rotate(var(--card-rot, 0deg)); }
}

/* Card pin */
.card-pin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  z-index: 20;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
  pointer-events: none;
}
.card-pin.left { left: 16px; transform: none; top: -10px; }

/* Card tape corner */
.card-tape {
  position: absolute;
  width: 44px; height: 14px;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.25);
  z-index: 15;
  pointer-events: none;
}
.card-tape.tr { top: -5px; right: -8px; transform: rotate(42deg); }
.card-tape.tl { top: -5px; left: -8px; transform: rotate(-42deg); }
.card-tape.br { bottom: -5px; right: -8px; transform: rotate(-42deg); }
.card-tape.bl { bottom: -5px; left: -8px; transform: rotate(42deg); }

/* Type kicker badge */
.type-kicker {
  position: absolute;
  top: -10px; right: -6px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 9999px;
  z-index: 12;
  white-space: nowrap;
}

/* ==================== Polaroid (Movie) ==================== */
.polaroid-card {
  background: #fff;
  padding: 10px 10px 48px 10px;
  width: 220px;
  border-radius: 2px;
}
.polaroid-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border: 1px solid #e1bfb9;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  background: #ffeadc;
  display: block;
}
.polaroid-ph {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #ffeadc 0%, #ffe3cf 50%, #fbddc7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 1px solid #e1bfb9;
}
.polaroid-caption {
  text-align: center;
  padding-top: 10px;
}
.polaroid-title {
  font-family: 'Noto Serif', serif;
  font-weight: 700;
  font-size: 17px;
  color: #28180b;
  line-height: 1.3;
}
.polaroid-meta {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: #8B7355;
  margin-top: 2px;
}
.polaroid-stars {
  color: #b02d21;
  letter-spacing: 1px;
  font-size: 13px;
  margin-top: 4px;
}
.polaroid-note {
  font-family: 'Noto Serif', serif;
  font-style: italic;
  font-size: 13px;
  color: #59413d;
  margin-top: 4px;
  line-height: 1.4;
}

/* ==================== CD Case (Music) ==================== */
.cd-card {
  background: #fff8f5;
  padding: 8px;
  width: 200px;
  height: 200px;
  border: 1px solid #e1bfb9;
  border-radius: 3px;
}
.cd-inner {
  width: 100%;
  height: 100%;
  border: 1px dashed #d7c4a5;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #f4e0c0;
}
.cd-cover-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.82;
  mix-blend-mode: multiply;
}
.cd-cover-ph {
  font-size: 48px;
  opacity: 0.5;
}
/* 播放键 · 仅音乐且填了试听链接时出现 */
.cd-play {
  position: absolute;
  right: 10px; bottom: 34px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(40,24,11,.6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 6;
  box-shadow: 2px 2px 0 rgba(74,55,40,.25);
  transition: transform .15s, background .15s;
  user-select: none;
}
.cd-play:hover { background: rgba(176,45,33,.9); transform: scale(1.08); }
.cd-play .ico-pause { display: none; font-size: 13px; letter-spacing: 1px; }
.cd-play .ico-play { display: block; font-size: 16px; margin-left: 3px; }
.cd-play.playing .ico-play { display: none; }
.cd-play.playing .ico-pause { display: block; }
/* 详情弹窗里的播放器 */
.modal-audio {
  display: flex; align-items: center; gap: 12px;
  background: #f4e0c0; border: 1px dashed #d7c4a5;
  padding: 10px 14px; margin-bottom: 14px; border-radius: 3px;
}
.modal-play {
  width: 40px; height: 40px; border-radius: 50%;
  background: #b02d21; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  user-select: none;
}
.modal-play .ico-pause { display: none; font-size: 13px; letter-spacing: 1px; }
.modal-play .ico-play { display: block; font-size: 16px; margin-left: 3px; }
.modal-play.playing .ico-play { display: none; }
.modal-play.playing .ico-pause { display: block; }
.modal-audio-label { font-size: 13px; color: #6b4f3a; }
/* 网易云官方外链播放器（iframe 版） */
.modal-audio.ncm {
  display: block;
  background: #f4e0c0; border: 1px dashed #d7c4a5;
  padding: 10px; margin-bottom: 14px; border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(74,55,40,0.15);
}
.ncm-iframe {
  display: block; width: 100%; height: 86px;
  border: 0; border-radius: 2px;
  background: #fff8f5;
}
.modal-audio.ncm .modal-audio-label { margin: 6px 0 0; text-align: center; }
.cd-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #b02d21;
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  transform: rotate(-8deg);
  border: 1px solid #9e2016;
}
.cd-info {
  position: absolute;
  bottom: -32px;
  left: 0;
  right: 0;
  text-align: center;
  padding-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #28180b;
}
.cd-meta {
  font-size: 11px;
  color: #8B7355;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ==================== Library Card (Book) ==================== */
.bookmark-card {
  background: #fff1e9;
  width: 180px;
  min-height: 260px;
  border: 1px solid #e1bfb9;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}
.bookmark-ribbon {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 38px;
  background: #b02d21;
  border-radius: 3px 3px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  z-index: 5;
}
.bookmark-body {
  padding: 20px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.bookmark-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #28180b;
  text-align: center;
  border-bottom: 2px dashed #c0392b;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.bookmark-quote {
  font-family: 'Noto Serif', serif;
  font-size: 13px;
  color: #59413d;
  line-height: 1.65;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.bookmark-date {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: #8B7355;
  border-top: 1px dashed #e1bfb9;
  padding-top: 6px;
  margin-top: 8px;
}
.bookmark-dots {
  color: #b02d21;
  letter-spacing: 2px;
  font-size: 11px;
  text-align: center;
  margin-top: 4px;
}

/* ==================== Sticky Note (Idea) ==================== */
.sticky-card {
  padding: 20px 18px;
  width: 190px;
  min-height: 170px;
  border-radius: 3px;
  position: relative;
}
.sticky-card.sticky-pink {
  background: #ffd6dc;
  color: #4a1518;
}
.sticky-card.sticky-yellow {
  background: #fff4b8;
  color: #4a4010;
}
.sticky-card.sticky-blue {
  background: #b8dcff;
  color: #102a4a;
}
.sticky-card.sticky-green {
  background: #c8ebc8;
  color: #104a18;
}
/* Folded corner effect */
.sticky-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 18px 18px;
  border-color: transparent transparent rgba(0,0,0,0.08) transparent;
}
.sticky-head {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 16px;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
  margin-bottom: 10px;
}
.sticky-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
.sticky-stamp {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.6;
  border-top: 1px solid currentColor;
  padding-top: 3px;
}
.sticky-checklist {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}
.sticky-checklist li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 4px;
}
.sticky-checklist .check-icon {
  font-size: 14px;
  color: #6a9462;
}

/* ==================== Modal (Paper Sheet) ==================== */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-root.is-open {
  opacity: 1;
  visibility: visible;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 24, 11, 0.35);
  backdrop-filter: blur(2px);
}
.modal-paper {
  position: relative;
  background: #fff;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  border-radius: 4px;
  box-shadow: 8px 8px 0 rgba(74, 55, 40, 0.2);
  overflow-y: auto;
  transform: translateY(30px) scale(0.95) rotate(-1deg);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
  overscroll-behavior: contain;
}
.modal-root.is-open .modal-paper {
  transform: translateY(0) scale(1) rotate(0.5deg);
}
.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  border: 2px solid #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 rgba(74,55,40,0.2);
  transition: transform 0.15s ease;
}
.modal-close:hover { transform: scale(1.1); }
.modal-close:active { transform: scale(0.95); }

/* Modal inner layout */
.modal-hero-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  border-bottom: 2px dashed #e1bfb9;
}
.modal-hero-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #ffeadc, #fbddc7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  border-bottom: 2px dashed #e1bfb9;
}
.modal-body-pad {
  padding: 24px 28px 32px;
}
.modal-type-badge {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 9999px;
  margin-bottom: 10px;
}
.badge-movie { background: #ffe5e1; color: #9e2016; }
.badge-music { background: #d3eeff; color: #005875; }
.badge-book { background: #f1ddbd; color: #6a5d43; }
.badge-idea { background: #c8ebc8; color: #2a6a32; }

.modal-title-main {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: #28180b;
  line-height: 1.25;
  margin-bottom: 4px;
}
.modal-creator-line {
  font-size: 14px;
  color: #8B7355;
  margin-bottom: 12px;
}
.modal-stars-row {
  color: #b02d21;
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.modal-section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #28180b;
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #e1bfb9;
}
.modal-review-text {
  font-family: 'Noto Serif', serif;
  font-size: 15px;
  color: #3e2a1e;
  line-height: 1.7;
}
.modal-excerpt-box {
  font-family: 'Noto Serif', serif;
  font-style: italic;
  font-size: 15px;
  color: #59413d;
  line-height: 1.7;
  border-left: 3px solid #c0392b;
  padding: 10px 16px;
  background: #fff1e9;
  border-radius: 0 4px 4px 0;
}
.modal-full-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #3e2a1e;
  line-height: 1.75;
}
.modal-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.modal-tag-item {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  padding: 3px 10px;
  background: #ffeadc;
  color: #59413d;
  border-radius: 9999px;
  border: 1px dashed #d7c4a5;
}
.modal-nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px dashed #e1bfb9;
}
.modal-nav-btn {
  flex: 1;
  padding: 10px 14px;
  background: #fff8f5;
  border: 1px dashed #d7c4a5;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #59413d;
  text-align: left;
  transition: background 0.2s;
}
.modal-nav-btn:hover:not(:disabled) {
  background: #ffe5e1;
  color: #9e2016;
}
.modal-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-btn-label {
  font-size: 11px;
  color: #8B7355;
  display: block;
  margin-bottom: 2px;
}
.nav-btn-title {
  font-weight: 600;
  font-size: 13px;
  color: #28180b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* About modal */
.about-paper {
  padding: 36px 32px;
  text-align: center;
}
.about-paper h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: #9e2016;
  margin-bottom: 16px;
}
.about-paper p {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  color: #59413d;
  line-height: 1.7;
  margin-bottom: 12px;
}
.about-types-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.about-type-pill {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 9999px;
  border: 1px dashed;
}
.about-code-hint {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #8B7355;
  background: #fff1e9;
  padding: 3px 8px;
  border-radius: 3px;
}

/* ---------- Nav Active States ---------- */
.nav-link-active { /* desktop */ }
.nav-link-active:not(.nav-link-active) {
  border-bottom-color: transparent;
}
.mobile-tab-active { /* mobile */ }
.mobile-tab:not(.mobile-tab-active) {
  background: transparent;
  color: inherit;
  border-radius: 0;
  transform: rotate(-1deg);
}

/* ---------- Empty State ---------- */
.empty-state { }

/* ---------- Scrollbar ---------- */
.modal-paper::-webkit-scrollbar { width: 6px; }
.modal-paper::-webkit-scrollbar-track { background: transparent; }
.modal-paper::-webkit-scrollbar-thumb { background: #d7c4a5; border-radius: 3px; }

/* ---------- No scroll when modal open ---------- */
body.no-scroll { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .scrap-canvas { min-height: 700px; max-width: 100%; padding: 0 8px; }
  .polaroid-card { width: 150px; }
  .cd-card { width: 150px; height: 150px; }
  .bookmark-card { width: 140px; min-height: 210px; }
  .sticky-card { width: 145px; min-height: 140px; padding: 12px 10px; }
  .modal-paper { max-height: 90vh; border-radius: 3px; }
  .modal-body-pad { padding: 18px 20px 24px; }
  .modal-title-main { font-size: 22px; }
  .filter-tape-bar { gap: 8px; padding: 10px 14px; }
  .filter-chip { font-size: 12px; padding: 5px 12px; }
}

@media (max-width: 380px) {
  .polaroid-card { width: 140px; }
  .cd-card { width: 140px; height: 140px; }
  .bookmark-card { width: 130px; }
  .sticky-card { width: 135px; }
}
