@import url('/share.css');

:root {
  --paper: #f6f1e7;
  --card: #fffcf6;
  --ink: #3b3530;
  --muted: #8a8178;
  --line: rgba(60, 45, 30, 0.12);
  --heart: #e0456b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(246, 241, 231, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { color: inherit; text-decoration: none; font-size: 20px; letter-spacing: 0.12em; font-weight: 300; }
.brand span { font-weight: 600; letter-spacing: 0.05em; }

/* ---------- 갤러리 목록 ---------- */
.gallery { max-width: 1280px; margin: 0 auto; padding: 18px 16px 48px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 2px 10px rgba(70, 50, 30, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(70, 50, 30, 0.14); }
.card a.thumb { display: block; aspect-ratio: 1; background: #ece6da; }
.card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .body { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; }
.card .text { flex: 1; min-width: 0; }
.card .title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .nick { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
}
.like .heart { font-size: 18px; line-height: 1; transition: transform 0.2s cubic-bezier(.3, 1.8, .5, 1); }
.like[aria-pressed="true"] { color: var(--heart); }
.like[aria-pressed="true"] .heart { transform: scale(1.2); }
.like:active .heart { transform: scale(0.8); }

.status { text-align: center; color: var(--muted); padding: 32px 0; }
.empty { text-align: center; padding: 80px 16px; color: var(--muted); line-height: 1.7; }
.empty .btn { margin-top: 16px; }

/* ---------- 상세 ---------- */
.detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 820px) {
  .detail { grid-template-columns: 1fr; gap: 18px; }
}
.art-frame {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #ece6da;
  box-shadow: 0 6px 30px rgba(70, 50, 30, 0.15);
}
.art-frame img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; }
.info h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; overflow-wrap: anywhere; }
.info .meta { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.info .nick { color: var(--ink); font-weight: 600; }
.info .actions { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.info .actions .like { border: 1px solid var(--line); min-height: 42px; padding: 0 16px; font-size: 16px; }
.minor { display: flex; gap: 16px; }
.link { border: none; background: none; padding: 4px 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.link.danger { color: #b3261e; }
.report-dialog .reasons label { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.report-dialog p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ---------- 관리자 ---------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.admin form.login { display: flex; gap: 8px; max-width: 420px; }
.admin form.login input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
}
.admin .rows { display: grid; gap: 10px; margin-top: 16px; }
.admin .item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: var(--card);
}
.admin .item img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; background: #ece6da; }
.admin .item .t { font-weight: 600; overflow-wrap: anywhere; }
.admin .item .s { font-size: 13px; color: var(--muted); margin-top: 4px; }
.admin .item .flag { color: #b3261e; }
.admin .item .ops { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 560px) {
  .admin .item { grid-template-columns: 72px minmax(0, 1fr); }
  .admin .item img { width: 72px; height: 72px; }
  .admin .item .ops { grid-column: 1 / -1; flex-direction: row; }
}
