/* Author: VIVI x Claude */
/* 投票页专用：作品池「画廊模式」+ 作品详情抽屉（边逛边投）。
   只被 index.html 加载，不动共享 styles.css，也不影响 /judge /handbook /gallery。 */

/* ---------- 视图切换 ---------- */
/* 放在 .pool-filters 里，紧跟筛选 chip；「隐藏已投」自带 margin-left:auto 会继续贴最右 */
.pool-views { display: flex; gap: 6px; padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--line); }
.pool-views button {
  min-height: 30px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(255,255,255,.8); color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.pool-views button.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ---------- 画廊模式的作品池 ---------- */
.pool-grid.is-rich {
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
  max-height: min(74vh, 920px);
}
.pool-grid.is-rich .proj { padding: 0; gap: 0; overflow: hidden; }

.proj-shot { position: relative; display: block; aspect-ratio: 4 / 3; background: #eceae2; overflow: hidden; }
.proj-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-shot-none {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 2px;
  color: var(--muted); font-size: 22px; opacity: .55;
}
.proj-shot-none small { font-size: 10.5px; font-weight: 700; }
.proj-shot-more {
  position: absolute; right: 7px; bottom: 7px; padding: 2px 7px; border-radius: 999px;
  background: rgba(28,24,20,.66); color: #fff;
  font-family: "IBM Plex Mono", monospace; font-size: 10.5px; font-weight: 700;
}
.proj-rich-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 11px 11px; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.proj-tags span { padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.proj-tags .t-link { background: rgba(60,169,155,.16); color: #2c7a6f; }
.proj-tags .t-mode { background: rgba(242,199,92,.28); color: #7a5c14; }

/* 卡上的「看详情」角标：跟「点卡片=投票」区分开 */
.proj-peek {
  position: absolute; left: 7px; top: 7px; z-index: 2;
  display: inline-flex; align-items: center; gap: 3px;
  min-height: 26px; padding: 0 9px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 999px;
  background: rgba(28,24,20,.62); color: #fff;
  font: inherit; font-size: 11px; font-weight: 800; cursor: pointer;
}
.proj-peek:hover { background: rgba(28,24,20,.82); }
.pool-grid:not(.is-rich) .proj-peek {
  position: static; align-self: flex-start; margin-top: 4px;
  background: rgba(60,169,155,.14); border-color: rgba(60,169,155,.4); color: #2c7a6f;
}

/* ---------- 作品详情抽屉 ---------- */
.pv-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.pv-back { position: absolute; inset: 0; background: rgba(28,24,20,.58); backdrop-filter: blur(3px); }
.pv-inner {
  position: relative; z-index: 1;
  width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  border-radius: 18px; background: var(--paper); box-shadow: 0 26px 70px rgba(30,22,16,.34);
  -webkit-overflow-scrolling: touch;
}
.pv-x {
  position: sticky; top: 10px; float: right; margin: 10px 12px 0 0; z-index: 2;
  width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 50%;
  background: rgba(255,255,255,.94); color: var(--ink); font-size: 14px; font-weight: 900; cursor: pointer;
}
.pv-body { padding: 18px 20px 22px; }
.pv-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pv-no { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pv-title { font-family: "Noto Serif SC", serif; font-size: 22px; font-weight: 900; line-height: 1.3; margin: 4px 0 0; }
.pv-by { margin: 5px 0 0; font-size: 13.5px; font-weight: 800; color: var(--muted); }
.pv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0 0; }
.pv-sec { margin: 16px 0 0; }
.pv-sec h4 {
  margin: 0 0 6px; font-size: 11.5px; font-weight: 900; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.pv-text { font-size: 14px; font-weight: 600; line-height: 1.72; white-space: pre-wrap; }
.pv-links { display: grid; gap: 8px; }
.pv-links a {
  display: block; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
  color: #2c7a6f; text-decoration: none;
  font-family: "IBM Plex Mono", monospace; font-size: 12.5px; font-weight: 600; word-break: break-all;
}
.pv-links a:hover { border-color: rgba(60,169,155,.65); background: rgba(60,169,155,.08); }
.pv-note {
  margin: 14px 0 0; padding: 11px 13px; border-radius: 12px;
  font-size: 12.5px; font-weight: 700; line-height: 1.6;
  background: rgba(242,199,92,.2); border: 1px solid rgba(242,199,92,.5);
}
.pv-shots { display: grid; gap: 10px; margin: 8px 0 0; }
.pv-shots img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

/* 抽屉里的投票区：黏在底部，逛到哪投到哪 */
.pv-vote {
  position: sticky; bottom: 0; z-index: 3;
  margin: 18px -20px -22px; padding: 13px 20px 16px;
  background: rgba(252,251,247,.97); backdrop-filter: blur(8px);
  border-top: 1.5px solid var(--line-strong);
}
.pv-vote-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 9px; font-size: 12.5px; font-weight: 900; color: var(--muted);
}
.pv-vote-head .pv-left { font-family: "IBM Plex Mono", monospace; font-weight: 700; }
.pv-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.pv-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 40px; padding: 0 13px;
  border: 1.5px solid var(--line-strong); border-radius: 999px; background: #fff;
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.pv-btn:hover:not(:disabled) { border-color: rgba(60,169,155,.6); background: rgba(60,169,155,.08); }
.pv-btn.is-on { border-color: #2f7d5f; background: #e8f3ee; color: #2f7d5f; }
.pv-btn.is-main { border-width: 2px; }
.pv-btn.is-main.is-on { border-color: #b58a1f; background: rgba(242,199,92,.3); color: #7a5c14; }
.pv-btn:disabled { opacity: .42; cursor: not-allowed; }
.pv-btn small { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; font-weight: 700; opacity: .7; }
.pv-locked {
  margin: 0; padding: 10px 12px; border-radius: 12px;
  background: rgba(239,122,92,.13); border: 1px solid rgba(239,122,92,.4);
  color: #b95d46; font-size: 12.5px; font-weight: 800;
}
.pv-nav { display: flex; gap: 8px; margin: 14px 0 0; }
.pv-nav button {
  flex: 1 1 0; min-height: 44px;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff;
  color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer;
}
.pv-nav button:disabled { opacity: .38; cursor: not-allowed; }
.pv-nav button:hover:not(:disabled) { border-color: rgba(60,169,155,.6); background: rgba(60,169,155,.08); }

@media (max-width: 560px) {
  .pool-grid.is-rich { grid-template-columns: repeat(auto-fill, minmax(45%, 1fr)); }
  /* 手机上走「底部弹层」：内容少的时候贴着屏幕底，投票条正好落在拇指位置 */
  .pv-modal { padding: 0; place-items: end stretch; }
  .pv-inner { max-height: 100vh; border-radius: 16px 16px 0 0; width: 100%; }
  .pv-body { padding: 14px 15px 20px; }
  .pv-vote { margin: 16px -15px -20px; padding: 12px 15px 15px; }
  .pv-title { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .proj:active { transform: none; }
}
