/* ===== 作品画廊专用样式（不动 styles.css，投票页/手册页共用那份）===== */

.gal-body { padding-bottom: 20px; }

.gal-intro h2 { font-family: "Noto Serif SC", serif; font-size: 21px; font-weight: 900; }
.gal-lede { margin: 8px 0 14px; font-size: 14px; font-weight: 600; line-height: 1.65; color: var(--muted); }
.gal-stamp {
  margin: 12px 0 0; font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
}

/* ---------- 顶部链接（沿用投票页 .v-links，这里只补 hover 色） ---------- */
.gal-intro .v-links a:hover { border-color: rgba(216,234,79,.9); background: rgba(216,234,79,.18); }

/* ---------- 控制条 ---------- */
.gal-controls { display: grid; gap: 12px; }

.gal-search { position: relative; display: flex; }
.gal-search input {
  width: 100%; min-height: 46px; padding: 0 40px 0 15px;
  border: 1.5px solid var(--line-strong); border-radius: 13px;
  background: #fff; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600;
}
.gal-search input:focus-visible { outline: 3px solid rgba(60,169,155,.4); outline-offset: 1px; }
.gal-q-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(27,34,48,.08); color: var(--muted);
  font-size: 13px; font-weight: 900; cursor: pointer;
}

.gal-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.gal-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  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;
}
.gal-chip b { font-family: "IBM Plex Mono", monospace; font-weight: 700; opacity: .55; }
.gal-chip.is-active { border-color: #2f7d5f; background: #e8f3ee; color: #2f7d5f; }
.gal-chip.is-active b { opacity: .8; }
.gal-chip:disabled { opacity: .4; cursor: not-allowed; }

.gal-viewbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.gal-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.gal-sort select {
  min-height: 38px; padding: 0 10px;
  border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700;
}
.gal-modes { display: flex; gap: 6px; }
.gal-modes button {
  min-height: 38px; padding: 0 13px;
  border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}
.gal-modes button.is-active { border-color: #2f7d5f; background: #e8f3ee; color: #2f7d5f; }

.gal-hint { margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.55; color: var(--muted); }
.gal-hint b { color: var(--ink); }

/* ---------- 卡片网格 ---------- */
.gal-grid { display: grid; gap: 14px; margin: 14px 0 0; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

.gal-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--paper); box-shadow: var(--shadow-soft);
  text-align: left; font: inherit; color: var(--ink);
  cursor: pointer; padding: 0;
}
.gal-card:hover { border-color: rgba(60,169,155,.6); box-shadow: var(--shadow); }
.gal-card:active { transform: translateY(1px); }
.gal-card:focus-visible { outline: 3px solid rgba(60,169,155,.45); outline-offset: 2px; }

.gal-shot { position: relative; aspect-ratio: 4 / 3; background: #eceae2; overflow: hidden; }
.gal-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-shot-more {
  position: absolute; right: 8px; bottom: 8px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(20,18,16,.72); color: #fff;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 700;
}
.gal-shot-none {
  display: grid; place-items: center; height: 100%; gap: 4px;
  color: #a9a49a; font-size: 12.5px; font-weight: 800; text-align: center; padding: 10px;
}
.gal-shot-none span { font-size: 26px; opacity: .5; }

.gal-card-body { display: flex; flex-direction: column; gap: 7px; padding: 13px 14px 14px; }
.gal-card-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.gal-row-no { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.gal-title { font-family: "Noto Serif SC", serif; font-size: 16.5px; font-weight: 900; line-height: 1.35; }
.gal-title.is-todo { color: #a9a49a; font-family: "Noto Sans SC", sans-serif; font-size: 15px; }
.gal-by { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.gal-intro-line {
  font-size: 13px; font-weight: 600; line-height: 1.6; color: #4a4550;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1px; }

.gal-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800; white-space: nowrap;
  background: #e8f3ee; color: #2f7d5f;
}
.gal-tag.iterate { background: #e3edf8; color: #3a6ea5; }
.gal-tag.unknown { background: #eee; color: #888; }
.gal-tag.eazo { background: #efe6fb; color: #6d4aa8; }
.gal-tag.mode { background: rgba(242,199,92,.28); color: #7a5c14; }
.gal-tag.link { background: rgba(60,169,155,.16); color: #2c7a6f; }
.gal-tag.nolink { background: #f1efe9; color: #9b958a; }

/* ---------- 列表视图 ---------- */
.gal-grid.is-list { grid-template-columns: 1fr; gap: 9px; }
.gal-grid.is-list .gal-card { flex-direction: row; align-items: stretch; }
.gal-grid.is-list .gal-shot { flex: 0 0 116px; aspect-ratio: auto; }
.gal-grid.is-list .gal-shot-none span { font-size: 20px; }
.gal-grid.is-list .gal-shot-none small { display: none; }
.gal-grid.is-list .gal-card-body { flex: 1 1 auto; gap: 5px; padding: 12px 14px; }
.gal-grid.is-list .gal-intro-line { -webkit-line-clamp: 2; }

.gal-empty { margin: 26px 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); }
.gal-foot { margin: 22px 0 34px; text-align: center; font-size: 12px; font-weight: 700; line-height: 1.7; color: var(--muted); }

/* ---------- 详情弹窗 ---------- */
.gal-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.gal-modal-back { position: absolute; inset: 0; background: rgba(28,24,20,.58); backdrop-filter: blur(3px); }
.gal-modal-inner {
  position: relative; z-index: 1;
  width: min(760px, 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;
}
.gal-modal-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;
}
.gal-modal-body { padding: 18px 20px 24px; }

.gal-d-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.gal-d-title { font-family: "Noto Serif SC", serif; font-size: 22px; font-weight: 900; line-height: 1.3; }
.gal-d-by { margin: 5px 0 0; font-size: 13.5px; font-weight: 800; color: var(--muted); }
.gal-d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0 0; }

.gal-d-sec { margin: 16px 0 0; }
.gal-d-sec h4 {
  margin: 0 0 6px; font-size: 11.5px; font-weight: 900; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.gal-d-text { font-size: 14px; font-weight: 600; line-height: 1.72; white-space: pre-wrap; }

.gal-d-links { display: grid; gap: 8px; }
.gal-d-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;
}
.gal-d-links a:hover { border-color: rgba(60,169,155,.65); background: rgba(60,169,155,.08); }

.gal-d-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);
}

.gal-d-shots { display: grid; gap: 10px; margin: 8px 0 0; }
.gal-d-shots img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}

.gal-d-nav { display: flex; gap: 8px; margin: 20px 0 0; }
.gal-d-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;
}
.gal-d-nav button:disabled { opacity: .38; cursor: not-allowed; }
.gal-d-nav button:hover:not(:disabled) { border-color: rgba(60,169,155,.6); background: rgba(60,169,155,.08); }

@media (max-width: 460px) {
  .gal-grid { grid-template-columns: 1fr; }
  .gal-grid.is-list .gal-shot { flex-basis: 92px; }
  .gal-modal { padding: 0; }
  .gal-modal-inner { max-height: 100vh; border-radius: 0; width: 100%; }
  .gal-modal-body { padding: 14px 15px 22px; }
  .gal-d-title { font-size: 19px; }
}

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