* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  color: #222;
  background: #f6f6f4;
  line-height: 1.6;
}
.container { max-width: 1024px; margin: 0 auto; padding: 0 16px; }
a { color: #0b5cad; }
h1 { font-size: 1.5rem; margin: 20px 0 12px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; border-bottom: 2px solid #e3e3de; padding-bottom: 4px; }
.sub { color: #666; font-size: 0.88rem; }
.empty { color: #666; padding: 24px 0; }

/* ヘッダー */
.site-header { background: #fff; border-bottom: 1px solid #ddd; }
.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.logo { font-size: 1.2rem; font-weight: bold; color: #222; text-decoration: none; }
.nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; }
.inline-form { display: inline; }
.link-button { background: none; border: none; color: #0b5cad; cursor: pointer; font-size: 1rem; padding: 0; }

/* フッター */
.site-footer { margin-top: 48px; padding: 16px 0 32px; color: #777; font-size: 0.85rem; border-top: 1px solid #e0e0e0; }

/* フラッシュメッセージ */
.flash { padding: 10px 14px; border-radius: 6px; margin: 16px 0 0; }
.flash-success { background: #e6f4ea; color: #1c6b34; border: 1px solid #b6dcc0; }
.flash-error { background: #fdecea; color: #a12622; border: 1px solid #f3c1bf; }

/* 検索バー */
.search-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.search-bar input[type="text"] { flex: 1 1 220px; }
input, select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid #bbb; border-radius: 6px; background: #fff;
}
button {
  font: inherit; padding: 8px 18px; border: none; border-radius: 6px;
  background: #e8a13a; color: #fff; font-weight: bold; cursor: pointer;
}
button:hover { opacity: 0.9; }
button.secondary { background: #fff; color: #333; border: 1px solid #bbb; font-weight: normal; }
button.small { padding: 4px 10px; font-size: 0.85rem; }

/* 商品グリッド */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.item-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.item-thumb { display: block; aspect-ratio: 4 / 3; background: #eee; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-image { display: flex; align-items: center; justify-content: center; height: 100%; color: #999; font-size: 0.9rem; background: #eee; }
.no-image.large { aspect-ratio: 4 / 3; border-radius: 8px; }
.item-card-body { padding: 10px 12px 12px; }
.item-title { font-weight: bold; text-decoration: none; color: #222; display: block; margin-bottom: 6px; }
.item-meta { display: flex; justify-content: space-between; font-size: 0.9rem; }
.item-meta .price { color: #b3541e; font-weight: bold; }
.ending-soon { color: #c0392b; font-weight: bold; }

/* 商品詳細 */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 20px; }
.detail-images img#main-image { width: 100%; border-radius: 8px; border: 1px solid #e0e0e0; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid #ddd; }
.price-box { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px 16px; margin: 14px 0; }
.price-big { font-size: 1.5rem; color: #b3541e; }
.ended-label { color: #a12622; font-weight: bold; margin-top: 6px; }
.result-box { background: #eef6ee; border: 1px solid #b6dcc0; border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.bid-form { margin: 14px 0; }
.bid-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.bid-row input { width: 160px; }
.description { white-space: pre-wrap; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px 16px; }

/* テーブル */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border: 1px solid #e0e0e0; padding: 8px 10px; text-align: left; font-size: 0.92rem; }
th { background: #f0f0ec; }
.list-table, .bid-history { margin-bottom: 8px; }

/* フォーム */
.form { max-width: 420px; display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.form.wide { max-width: 560px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: bold; font-size: 0.95rem; }
.form .row { display: flex; gap: 8px; align-items: center; font-weight: normal; }
.form .row input { width: 90px; }

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  th, td { font-size: 0.82rem; padding: 6px; }
}
