:root {
  --bg: #f3efe8;
  --paper: #f7f4ef;
  --text: #221f1b;
  --muted: #6d675f;
  --line: #e3dcd2;
  --accent: #9a4e32;
  --max: 1080px;
  --pad: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

.wrap {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 8px;
}

.brand {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.hero { padding: 48px 0 28px; }

.hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  max-width: 36em;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 8px;
  padding: 8px 0 22px;
}

.filters a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  line-height: 1.4;
}

.filters a.is-on {
  background: var(--text);
  color: var(--paper);
  border-color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding-bottom: 28px;
}

.card { text-decoration: none; }

.card img,
.frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper);
  border: 1px solid var(--line);
}

.card h2 {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 600;
}

.kicker {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.summary {
  margin: 4px 0 0;
  color: var(--muted);
}

.contact {
  border-top: 1px solid var(--line);
  padding: 36px 0 72px;
}

.qr {
  width: 168px;
  height: 168px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  margin: 8px 0 4px;
}

.qr-caption {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.contact h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.contact .lead {
  margin: 0 0 20px;
  color: var(--muted);
}

.row-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin: 0 0 10px;
}

.row-line span { min-width: 4em; color: var(--muted); }

button,
.button {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf6;
}

.dock {
  display: none;
}

.detail { padding: 28px 0 20px; }

.detail h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.detail-summary {
  margin: 8px 0 0;
  font-size: 18px;
}

.story {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 28px;
}

.zoom-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.story figure { margin: 0; }

.story a { display: block; cursor: zoom-in; }

.pswp__custom-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px 20px;
  color: #f7f4ef;
  background: rgba(34, 31, 27, 0.72);
  font-size: 14px;
  line-height: 1.5;
}

.story img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
}

.story figcaption {
  margin-top: 10px;
  line-height: 1.5;
}

.detail .frame {
  margin: 12px 0 16px;
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.empty {
  color: var(--muted);
  padding: 24px 0 48px;
}

.admin {
  padding: 12px 0 64px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 20px;
  margin: 0 0 16px;
}

.panel h1,
.panel h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
}

textarea { min-height: 72px; resize: vertical; }

.form-actions { margin-top: 16px; }

.note {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 8px;
}

.work-admin {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.work-admin img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg);
}

.work-admin .meta { flex: 1; min-width: 0; }

.work-admin strong { display: block; }

.work-admin em {
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}

.error { color: var(--accent); min-height: 1.4em; }

.error[data-kind="ok"] { color: var(--muted); }

.hidden { display: none; }

@media (min-width: 768px) {
  .hero { padding-top: 72px; }
  .hero h1 { font-size: 64px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 48px 28px; }
}

@media (max-width: 767px) {
  .dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--text);
    z-index: 2;
  }

  .dock a {
    flex: 1;
    color: var(--paper);
    text-align: center;
    text-decoration: none;
    padding: 14px 16px;
    min-height: 48px;
  }

  body.has-dock { padding-bottom: 56px; }
}

.case-frame { border-top: 1px solid var(--line); padding: 16px 0; }
.case-frame img { width: 100%; max-width: 360px; height: auto; display: block; }
.case-frame label { overflow-wrap: anywhere; }
.case-actions { display: flex; gap: 8px; }
button:disabled { opacity: .5; cursor: wait; }
