/* 维多利亚 3 表情包：沿用科研院目录页的纸色与衬线体，只做这一页需要的东西。 */

:root {
  --ink: #1a1410;
  --muted: #6e6358;
  --line: #cfc4b2;
  --accent: #8b2e2e;
  --card: #fffdf8;
  --glow: rgba(26, 20, 16, 0.09);
}

* { box-sizing: border-box; }

/* 显隐一律用 hidden 属性来控制。下面几处（尤其灯箱的 display: flex）
   的优先级不比 [hidden] 低，会让「藏起来」失效 —— 这里一次性钉死。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #f9f4ea 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e7dcc8 0%, transparent 50%),
    linear-gradient(180deg, #f3ece0 0%, #e4d9c6 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2.25rem) 4rem;
}

.topbar {
  margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.back {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.back:hover { border-color: var(--accent); color: var(--accent); }

.head { border-bottom: 1px solid var(--line); padding-bottom: 1.5rem; }

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5.4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.lead { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.96rem; }
.tally { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- 工具条 ---- */
.bar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1.5rem 0 0;
}

#search {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.62rem 0.9rem;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid var(--line);
  border-radius: 10px;
}

#search:focus { outline: 2px solid rgba(139, 46, 46, 0.35); outline-offset: 1px; }

button {
  font: inherit;
  font-size: 0.94rem;
  padding: 0.62rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

button.solid { color: #fffaf3; background: var(--accent); }
button.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
button.ghost:hover { border-color: var(--accent); color: var(--accent); }
button:hover:not(:disabled) { opacity: 0.9; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: default; }
button.small { padding: 0.3rem 0.7rem; font-size: 0.82rem; border-radius: 999px; }

/* ---- 面板 ---- */
.panel {
  margin-top: 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 32px var(--glow);
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.hint { margin: 0 0 1rem; color: var(--muted); font-size: 0.86rem; }

.state { margin: 0.8rem 0 0; font-size: 0.85rem; color: var(--muted); }
.state.good { color: #2f6b45; }
.state.bad { color: var(--accent); }

.drop {
  display: block;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.drop:hover { border-color: var(--accent); color: var(--accent); }
.drop input { display: none; }
.drop-hint { display: block; margin-top: 0.35rem; font-size: 0.78rem; opacity: 0.85; }

/* ---- 待上传清单 ---- */
.queue { list-style: none; margin: 1rem 0 0; padding: 0; }

.queue li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.queue img {
  width: 46px;
  height: 46px;
  flex: none;
  object-fit: contain;
  background: rgba(26, 20, 16, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue .meta { flex: 1 1 auto; min-width: 0; }

.queue input[type="text"] {
  width: 100%;
  padding: 0.42rem 0.6rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue .sub { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.76rem; }
.queue .drop-one { flex: none; color: var(--muted); background: transparent; border-color: transparent; }
.queue .drop-one:hover { color: var(--accent); }

.submitline { display: flex; gap: 0.6rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.submitline .state { margin: 0; }

/* ---- 提示 ---- */
.notice {
  margin: 1.25rem 0 0;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  color: var(--ink);
  background: rgba(139, 46, 46, 0.08);
  border: 1px solid rgba(139, 46, 46, 0.3);
  border-radius: 10px;
  white-space: pre-wrap;
}

/* ---- 画廊 ---- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.15rem);
  margin-top: 1.75rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px var(--glow);
  transition: transform 0.12s, border-color 0.12s;
}

.card:hover { transform: translateY(-2px); border-color: rgba(139, 46, 46, 0.45); }

.thumb {
  display: block;
  width: 100%;
  height: 168px;
  padding: 0;
  background: repeating-conic-gradient(rgba(26, 20, 16, 0.045) 0% 25%, transparent 0% 50%) 50% / 18px 18px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  cursor: zoom-in;
}

.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.card .body { padding: 0.6rem 0.7rem 0.7rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }

.card .name {
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .sub { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.card .actions { display: flex; gap: 0.35rem; margin-top: auto; flex-wrap: wrap; }

.actions a, .actions button {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.actions a:hover, .actions button:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.actions .danger:hover { border-color: var(--accent); color: #fffaf3; background: var(--accent); }

.empty { margin: 2.5rem 0 0; text-align: center; color: var(--muted); font-size: 0.92rem; }

/* ---- 大图 ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: rgba(26, 20, 16, 0.82);
  backdrop-filter: blur(3px);
}

.lightbox figure {
  margin: 0;
  max-width: min(92vw, 900px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lightbox img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  background: var(--card);
}

.lightbox figcaption {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  color: #f3ece0;
  font-size: 0.9rem;
}

.lightbox figcaption a { color: #f3ece0; border-color: rgba(243, 236, 224, 0.5); text-decoration: none; }

.lightbox-close {
  position: absolute;
  top: clamp(0.5rem, 2vw, 1.25rem);
  right: clamp(0.5rem, 2vw, 1.25rem);
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: #f3ece0;
  background: rgba(243, 236, 224, 0.12);
  border-color: rgba(243, 236, 224, 0.35);
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .thumb { height: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
