/* Artvee Gallery — 轻量静态样式，零外部依赖 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #fafafa;
  color: #222;
  line-height: 1.5;
}

a { color: #2c5cc5; text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  background: #eef0f4;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 14px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.5px;
}
.brand .subtitle {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  padding: 6px 10px;
  background: #f3f4f6;
  border-radius: 6px;
}
.stat .num {
  font-size: 20px;
  font-weight: 600;
  color: #111;
}
.stat .num.small {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}
.stat .lbl {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}
.stat-wide {
  min-width: 160px;
  text-align: center;
}

/* ---------- controls ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 28px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
}
.controls input[type="search"],
.controls select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
}
.controls input[type="search"] {
  flex: 1 1 240px;
  min-width: 200px;
}
.counter {
  margin-left: auto;
  font-size: 12px;
  color: #6b7280;
}

/* ---------- main grid ---------- */
main {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
}
.grid {
  padding: 18px 28px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.card .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  display: block;
  object-fit: cover;
}
.card .meta {
  padding: 8px 10px 10px;
  font-size: 12px;
}
.card .title {
  font-weight: 600;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  min-height: 2.6em;
}
.card .artist {
  color: #374151;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .tags {
  margin-top: 4px;
  color: #6b7280;
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.card .tags .tag {
  background: #eef0f4;
  padding: 1px 6px;
  border-radius: 3px;
}
.card .foot {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  color: #9ca3af;
  font-size: 11px;
}

/* ---------- detail panel ---------- */
.detail {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, 100vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -8px 0 24px rgba(0,0,0,0.08);
  z-index: 20;
  overflow-y: auto;
  padding: 20px;
}
.detail[hidden] { display: none; }
.detail .close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}
.detail-image img {
  width: 100%;
  height: auto;
  background: #f3f4f6;
  border-radius: 4px;
}
.detail-meta {
  margin-top: 16px;
  font-size: 13px;
}
.detail-meta h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.detail-meta .row {
  display: flex;
  gap: 6px;
  margin: 6px 0;
  word-break: break-all;
}
.detail-meta .row .k {
  flex: 0 0 90px;
  color: #6b7280;
}
.detail-meta .row .v { color: #111; }
.detail-meta .path {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
}

/* ---------- footer ---------- */
footer {
  text-align: center;
  padding: 18px;
  color: #6b7280;
  font-size: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .topbar { padding: 14px 16px; }
  .controls { padding: 10px 16px; }
  .grid { padding: 12px 16px 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
