@charset "UTF-8";

:root {
  --bg-main: #9e9e9e;        /* 青みのないニュートラルなグレー */
  --bg-card: #ffffff;        /* カードは明るい白 */
  --bg-viewer: #e2e8f0;
  --text-main: #2b2b2b;
  --text-sub: #666666;
  --text-muted: #888888;
  --border-color: #d1d5db;
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* レイアウト全体 */
.layout-container {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  gap: 28px;
  min-height: 100vh;
}

/* 左サイドバー */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}

.sidebar-divider {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  text-align: left;
}

.profile-box {
  text-align: center;
}

.profile-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
  display: block;
  border: 1px solid var(--border-color);
  background: #eee;
}

.profile-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 10px;
  margin-bottom: 2px;
}

.profile-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-bottom: 10px;
}

.profile-bio {
  font-size: 0.85rem;
  color: var(--text-sub);
  white-space: pre-wrap;
  line-height: 1.5;
}

/* 外部リンクボタン（アイコンをさらに薄く調整） */
.social-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  font-size: 1.05rem;
  color: #767676;
  opacity: 0.55; /* アイコンをQRコードと同じくらい薄くする */
  transition: background 0.2s, opacity 0.2s, color 0.2s, transform 0.15s;
}

.social-btn:hover {
  background: #d4d4d8;
  color: var(--text-main);
  opacity: 1;
  transform: translateY(-2px);
}

/* QRコードエリア */
.qr-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.qr-thumb {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.qr-thumb img {
  display: block;
  opacity: 0.55; /* QRコードを薄くする */
  transition: opacity 0.2s;
}

.qr-thumb:hover img {
  opacity: 1;
}

.qr-thumb:hover {
  transform: scale(1.03);
}

.qr-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* サイドバー内セクション（シリーズ・タグ） */
.sidebar-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* シリーズなどのリストの行間を詰める調整 */
.filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-sub);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

.filter-item.active {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
  font-weight: 600;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
}

.tag-chip:hover,
.tag-chip.active:hover {
  background: #e5e7eb;
  color: var(--text-main);
}

.tag-chip.active {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
  font-weight: 600;
}

/* 管理者ログインボタン */
.admin-toggle-btn {
  width: 100%;
  padding: 9px;
  background: var(--bg-main);
  border: 1px solid #7a7a7a;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: #7a7a7a;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.admin-toggle-btn:hover {
  background: #757575;
  color: #ffffff;
  border-color: #757575;
}

/* メインエリア */
.main-content {
  flex: 1;
  min-width: 0;
}

/* 管理ドロップゾーン */
.drop-zone {
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone.dragover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--accent-color);
}

.drop-zone-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 4px;
}

.drop-zone-sub {
  font-size: 0.8rem;
  color: #3b82f6;
}

/* 作品グリッド（OGP横長カード向け） */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.work-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* サムネイルラッパー */
.work-thumb-wrap {
  position: relative;
  aspect-ratio: 1.91 / 1;
  background: #ffffff;
  overflow: hidden;
  display: block;
  margin: 0;
  padding: 0;
}

/* 通常時は白黒（グレースケール）、ホバー時にカラーに変化 */
.work-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.work-card:hover .work-thumb {
  filter: grayscale(0%);
}

.badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #f87171;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 右下：いいねバッジ */
.badge-like {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.38);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  backdrop-filter: blur(2px);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  z-index: 2;
}

/* ハートアイコン：通常時も白（塗りつぶし）に変更 */
.badge-like .heart-icon {
  stroke: #ffffff;
  fill: #ffffff;
  stroke-width: 2;
  transition: transform 0.2s;
}

.badge-like:hover {
  background: rgba(15, 23, 42, 0.55);
  transform: scale(1.05);
}

/* 押したあとのスタイル */
.badge-like.liked {
  background: rgba(15, 23, 42, 0.55);
  cursor: default;
}

.badge-like.liked .heart-icon {
  stroke: #ffffff;
  fill: #ffffff;
}

.work-info {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.work-series-label {
  font-size: 0.72rem;
  color: #4b6b94;
  font-weight: 600;
  margin-bottom: 2px;
}

.work-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 8px;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.work-tag-mini {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 管理者用カード操作ボタン */
.admin-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  z-index: 5;
}

.admin-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: rgba(30, 41, 59, 0.85);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.15s;
}

.admin-icon-btn:hover { background: var(--accent-color); }
.admin-icon-btn.danger:hover { background: #dc2626; }
.drag-handle { cursor: grab; }

/* モーダル共通 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
    padding: 16px;
  }
  .sidebar {
    width: 100%;
  }
  .works-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}