/* feizhuliu.art — non-mainstream art gallery */

:root {
  --bg: #0a0a0a;
  --bg-2: #141414;
  --bg-3: #1f1f1f;
  --ink: #e8e8e8;
  --ink-2: #b8b8b8;
  --muted: #6a6a6a;
  --line: #2a2a2a;
  --neon: #d4ff00;
  --neon-2: #b8e000;
  --pink: #ff00aa;
  --cyan: #00ddff;
  --orange: #ffaa00;
  --violet: #cc88ff;
  --danger: #ff4455;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, monospace, sans-serif; }

a { color: var(--neon); text-decoration: none; }
a:hover { color: var(--neon-2); text-decoration: underline; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 22px 80px; }

/* ---------- topbar (admin) ---------- */
.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 22px;
  background: var(--bg-2); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 700; color: var(--neon); letter-spacing: 0.04em; }
.topbar nav { display: flex; gap: 18px; margin-left: auto; }
.topbar nav a { color: var(--ink); }
.topbar nav a:hover { color: var(--neon); }

/* ---------- sections (text-free revision 2026-10-03 18:22) ---------- */
.section { margin: 36px 0; }

/* ---------- tag wall ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--ink-2); background: var(--bg-2);
  text-decoration: none;
}
.tag::before { content: "#"; color: var(--muted); margin-right: 1px; }
.tag:hover { border-color: var(--neon); color: var(--neon); text-decoration: none; }
.tag.active { background: var(--neon); color: var(--bg); border-color: var(--neon); }
.tag.active::before { color: var(--bg); }

/* size tags by frequency */
.tag[data-count="1"] { font-size: 12px; }
.tag[data-count="2"], .tag[data-count="3"] { font-size: 13px; }
.tag[data-count="4"], .tag[data-count="6"] { font-size: 14px; }
.tag[data-count="7"], .tag[data-count="10"] { font-size: 15px; }
.tag[data-count="11"] { font-size: 16px; font-weight: 500; }

/* ---------- cover wall (text-free, flat grid) ---------- */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.cover {
  display: block;
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color .15s ease, transform .12s ease;
  text-decoration: none;
}
.cover:hover { border-color: var(--neon); transform: scale(1.01); }
.cover img {
  display: block; width: 100%; height: 220px; object-fit: cover;
  background: var(--bg-3);
}
.cover img.icon-cover { object-fit: contain; padding: 32px; }

.cover-caption {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cover:hover .cover-caption { color: var(--neon); }

/* tiny type indicator dot in corner — visual only, no text */
.cover::after {
  content: ""; position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--neon);
}
.cover[data-type="audio"]::after { background: var(--pink); }
.cover[data-type="video"]::after { background: var(--cyan); }
.cover[data-type="pdf"]::after   { background: var(--orange); }
.cover[data-type="text"]::after  { background: var(--violet); }

/* ---------- empty / foot ---------- */
.empty { color: var(--muted); padding: 32px 0; text-align: center; }
.foot { text-align: center; color: var(--muted); padding: 28px 0 16px; font-size: 12px; }

/* ---------- single work ---------- */
.work { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 800px) { .work { grid-template-columns: 1.2fr 1fr; } }
.work-cover img { display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 4px; background: var(--bg-2); }
.work-cover img.icon-cover { max-width: 240px; padding: 24px; margin: 0 auto; }

.work-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.work-title { font-size: 28px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.work-author { color: var(--muted); margin: 0 0 6px; font-size: 13px; }
.work-meta { color: var(--muted); font-size: 12px; margin: 0; }
.work-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.work-tags .tag { font-size: 12px; padding: 4px 10px; }

.work-text {
  white-space: pre-wrap;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--neon);
  padding: 18px 22px;
  border-radius: 0 4px 4px 0;
  font-size: 15px;
  line-height: 1.7;
  margin: 18px 0;
}

.work-files h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-2); margin: 24px 0 10px; }
.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li { display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; margin: 0 0 4px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 3px; }
.file-list li:hover { border-color: var(--neon); }
.file-icon { width: 28px; height: 28px; object-fit: contain; }
.file-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-name { color: var(--neon); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px; }
.file-name:hover { text-decoration: underline; }
.file-meta .muted { color: var(--muted); font-size: 12px; }

/* ---------- flash / errors ---------- */
.flash { padding: 10px 14px; border-radius: 4px; margin: 0 0 16px;
  background: var(--bg-3); border: 1px solid var(--neon); color: var(--neon); }
.flash.err { border-color: var(--danger); color: var(--danger); background: rgba(255,68,85,0.1); }
.err { color: var(--danger); margin: 0 0 8px; font-size: 13px; }

/* ---------- admin: card-form / login ---------- */
.card-form { background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 28px; }
.card-form label { display: block; margin: 12px 0; font-size: 13px; color: var(--ink-2); }
.card-form input { display: block; width: 100%; padding: 10px 12px; margin-top: 6px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.card-form input:focus { outline: 1px solid var(--neon); border-color: var(--neon); }
.card-form button { width: 100%; padding: 10px; margin-top: 12px;
  background: var(--neon); color: var(--bg); border: 0; border-radius: 4px;
  font: inherit; font-weight: 600; cursor: pointer; }
.card-form button:hover { background: var(--neon-2); }

/* ---------- admin: upload form ---------- */
.upload-form { max-width: 760px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 24px; }
.upload-form label { display: block; margin: 14px 0; font-size: 13px; color: var(--ink-2); }
.upload-form input[type="text"],
.upload-form input[type="file"],
.upload-form textarea {
  display: block; width: 100%; padding: 10px 12px; margin-top: 6px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; font: inherit;
}
.upload-form textarea { font-family: monospace; min-height: 80px; resize: vertical; }
.upload-form input[type="file"] { padding: 8px; }
.upload-form small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.upload-form .honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  tab-index: -1;
  /* some password managers ignore visual hiding — also disable interactions */
}
.upload-form fieldset {
  border: 1px dashed var(--line); border-radius: 4px;
  padding: 14px; margin: 14px 0;
}
.upload-form fieldset legend { padding: 0 8px; color: var(--muted); font-size: 12px; }
.upload-form button[type="submit"] {
  background: var(--neon); color: var(--bg); border: 0; border-radius: 4px;
  padding: 12px 24px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.upload-form button[type="submit"]:hover { background: var(--neon-2); }

/* ---------- admin: library list (redesigned 2026-10-03) ---------- */
.library-title { display: inline-block; margin: 0 16px 0 0; vertical-align: middle; }
.add-link {
  display: inline-block;
  padding: 6px 14px;
  background: var(--neon); color: var(--bg);
  border-radius: 4px; font-weight: 600; font-size: 13px;
  vertical-align: middle;
}
.add-link:hover { background: var(--neon-2); text-decoration: none; }

.library-list { display: flex; flex-direction: column; gap: 20px; margin-top: 18px; }

/* ---------- work card ---------- */
.work-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .15s ease;
}
.work-card:hover { border-color: #444; }

.work-head {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 18px;
  padding: 18px;
  align-items: start;
}

/* cover thumb */
.work-head .cover {
  display: block; position: relative;
  width: 180px; height: 180px;
  background: var(--bg-3);
  border-radius: 4px; overflow: hidden;
}
.work-head .cover img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}
.work-head .cover img.icon-thumb { object-fit: contain; padding: 32px; }
.pin-badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--neon); color: var(--bg);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}

/* info column */
.work-info { min-width: 0; }
.work-title {
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.3;
}
.work-sub {
  margin: 0 0 10px;
  font-size: 12px; color: var(--ink-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.work-sub .sep { color: var(--muted); }
.work-sub .work-author { color: var(--ink); }
.work-sub time { color: var(--ink-2); }

/* tag chips */
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.tag-chip {
  display: inline-block; padding: 2px 8px;
  font-size: 11px; color: var(--neon);
  background: transparent; border: 1px solid var(--neon);
  border-radius: 2px;
}
.tag-chip::before { content: ""; }  /* override global ::before */

/* attachment summary pills */
.att-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.att-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px;
  font-size: 12px; color: var(--ink-2);
  background: var(--bg-3); border-radius: 3px;
}

/* delete × button (top-right corner) */
.delete-x {
  align-self: start;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background-color .12s ease;
}
.delete-x:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(255,68,85,0.08);
}

/* ---------- edit form ---------- */
.edit-form {
  border-top: 1px solid var(--line);
  padding: 14px 18px 16px;
  background: var(--bg);
}
.edit-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.field { display: block; margin-bottom: 10px; }
.field > span {
  display: block;
  font-size: 11px; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.field > span em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; font-size: 10px; }
.field > input,
.field > textarea {
  display: block; width: 100%;
  padding: 8px 10px;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 3px;
  font: inherit; font-size: 13px;
}
.field > textarea { font-family: monospace; resize: vertical; min-height: 60px; }
.field > input:focus,
.field > textarea:focus { outline: none; border-color: var(--neon); }

.edit-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.edit-actions .check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.edit-actions .check input { width: auto; }
.save-btn {
  background: var(--neon); color: var(--bg); border: 0; border-radius: 3px;
  padding: 8px 18px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.save-btn:hover { background: var(--neon-2); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
    .work-head { grid-template-columns: 100px 1fr; }
    .work-head .cover { width: 100px; height: 100px; }
    .work-head .cover img.icon-thumb { padding: 18px; }
    .delete-x { grid-row: 1; grid-column: 2; justify-self: end; }
    .edit-grid { grid-template-columns: 1fr; }
}