:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #181a1f;
  --muted: #666d78;
  --line: #dedfd8;
  --accent: #b3262f;
  --accent-strong: #8f1d25;
  --teal: #1d6f73;
  --gold: #b7791f;
  --shadow: 0 12px 32px rgba(24, 26, 31, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: system-ui, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

a { color: inherit; }
img { max-width: 100%; }

.site-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 20px;
  background: rgba(247, 247, 244, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand-link,
.back-link {
  text-decoration: none;
  font-weight: 700;
}

.brand-link { letter-spacing: 0; }
.back-link { color: var(--muted); font-size: .92rem; }

.page-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 28px 18px 64px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-hero,
.circle-hero {
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--line);
}

.home-hero h1,
.circle-hero h1,
.work-summary h1 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: 0;
}

.home-hero h1 { font-size: clamp(2rem, 7vw, 4.4rem); }
.home-hero p { max-width: 640px; margin: 12px 0 0; color: var(--muted); }

.circle-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.circle-hero h1 { font-size: clamp(1.9rem, 6vw, 3.6rem); }
.circle-logo {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface);
}

.profile {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.25;
}

.count {
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}

.featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  margin-top: 20px;
}

.work-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(24, 26, 31, .04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.work-card:hover {
  transform: translateY(-2px);
  border-color: rgba(179, 38, 47, .35);
  box-shadow: var(--shadow);
}

.work-link {
  display: grid;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.thumb-frame {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #ece8dd;
}

.work-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-missing,
.media-missing {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-size: .72rem;
  font-weight: 800;
}

.work-body {
  display: grid;
  gap: 5px;
  padding: 11px 12px 12px;
}

.circle-name {
  color: var(--teal);
  font-size: .76rem;
  font-weight: 700;
}

.work-title {
  display: -webkit-box;
  min-height: 2.8em;
  overflow: hidden;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: .8rem;
}

.sale-price {
  color: var(--accent);
  font-weight: 800;
}

.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.tag-row a,
.tag-cloud span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: .86rem;
  text-decoration: none;
}

.tag-row a.is-active,
.tag-row a:hover {
  color: var(--accent-strong);
  border-color: rgba(179, 38, 47, .35);
}

.tag-row span,
.tag-cloud b {
  color: var(--teal);
  font-weight: 800;
}

.tag-row.compact {
  margin-top: 16px;
}

.circle-list {
  display: grid;
  gap: 10px;
}

.circle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.circle-row:hover { border-color: rgba(29, 111, 115, .36); }
.circle-row span { display: grid; gap: 3px; min-width: 0; }
.circle-row strong { font-size: 1rem; }
.circle-row small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.circle-row em {
  color: var(--muted);
  font-size: .86rem;
  font-style: normal;
  white-space: nowrap;
}

.work-detail {
  display: grid;
  grid-template-columns: minmax(260px, 430px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 18px;
}

.work-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.work-media img {
  display: block;
  width: 100%;
}

.work-summary {
  display: grid;
  gap: 14px;
}

.work-summary h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
.byline { margin: 0; color: var(--muted); }
.byline a { color: var(--teal); font-weight: 700; text-decoration: none; }

.meta-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
}

.meta-list div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.meta-list dt {
  color: var(--muted);
  font-size: .84rem;
}

.meta-list dd { margin: 0; }

.price-box {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0;
}

.price-box strong {
  color: var(--accent);
  font-size: 1.8rem;
  line-height: 1;
}

.price-box span {
  color: var(--muted);
  text-decoration: line-through;
}

.price-box em {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(183, 121, 31, .13);
  color: var(--gold);
  font-size: .82rem;
  font-style: normal;
  font-weight: 800;
}

.purchase-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: min(100%, 360px);
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.purchase-button:hover { background: var(--accent-strong); }

.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.sample-grid img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.related-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.empty-state {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.age-gate,
.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.gate,
.notice {
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate h1,
.notice h1 {
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.gate p,
.notice p {
  margin: 0;
  color: var(--muted);
}

.gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.btn-yes { background: var(--accent); color: #fff; }
.btn-no { background: #ececea; color: var(--muted); }

.admin-shell {
  max-width: 1180px;
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}

.admin-head h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.admin-head p:last-child {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

.admin-section {
  margin-top: 28px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.admin-table code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .86em;
}

.compact-table {
  min-width: 860px;
}

@media (max-width: 720px) {
  .site-bar { padding: 0 14px; }
  .page-shell { padding: 22px 14px 48px; }
  .circle-hero { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .work-detail { grid-template-columns: 1fr; }
  .work-title { font-size: .86rem; }
  .circle-row { align-items: start; }
  .circle-row small { white-space: normal; }
  .admin-head {
    align-items: start;
    flex-direction: column;
  }
  .admin-head p:last-child {
    text-align: left;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .works-grid { grid-template-columns: 1fr; }
  .gate-actions { flex-direction: column; }
}
