/* ===========================
   My Gallery — Global Styles
   Light Beige × Dusty Pink Theme
=========================== */

:root {
  --bg-primary: #f7f2ec;
  --bg-secondary: #efe9e1;
  --bg-card: #faf6f1;
  --bg-card-hover: #f3ece4;
  --bg-input: #ede7df;
  --border: #d9cfc5;
  --border-light: #e8e0d8;
  --text-primary: #4a3728;
  --text-secondary: #6b5244;
  --text-muted: #9e8070;
  --accent-gold: #c0748a;
  --accent-gold-light: #d494a8;
  --accent-gold-dim: rgba(192,116,138,0.12);
  --accent-red: #b85c6e;
  --accent-blue: #7a9cbb;
  --accent-green: #7aaa8a;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 4px 20px rgba(74,55,40,0.10);
  --shadow-modal: 0 20px 60px rgba(74,55,40,0.22);
  --transition: 0.2s ease;
  --font-serif: 'Zen Maru Gothic', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-sans: 'M PLUS Rounded 1c', 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Kaku Gothic ProN', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
}

/* ===========================
   Loading Screen
=========================== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
}
.loading-logo {
  font-size: 48px;
  animation: pulse 1.5s ease-in-out infinite;
}
.loading-screen p {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent-gold);
  letter-spacing: 4px;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ===========================
   Navigation
=========================== */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(247,242,236,0.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--accent-gold);
  text-decoration: none;
  letter-spacing: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-logo span {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 4px;
}

.nav-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}
.nav-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px 7px 36px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition);
}
.nav-search input:focus {
  border-color: var(--accent-gold);
}
.nav-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.nav-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.nav-btn:hover, .nav-btn.active {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
}
.nav-btn i {
  font-size: 14px;
}

/* ===========================
   Main Content
=========================== */
#main {
  padding-top: 56px;
  min-height: 100vh;
}

.page {
  display: none;
  padding: 24px 20px 80px;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}
.page.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   Mood Tags / Filter Bar
=========================== */
.mood-section {
  margin-bottom: 28px;
}
.mood-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.tag-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.tag-scroll::-webkit-scrollbar { display: none; }

.mood-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.mood-tag:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}
.mood-tag.active {
  background: var(--accent-gold-dim);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}
.mood-tag .tag-emoji {
  margin-right: 4px;
}

/* ===========================
   Section Header
=========================== */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.section-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===========================
   Artwork Grid
=========================== */
.artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}

.artwork-card {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s ease;
  position: relative;
  background: var(--bg-secondary);
}
.artwork-card:hover {
  opacity: 0.85;
}

.artwork-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.artwork-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 36px;
}

/* Seen badge */
.artwork-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(39,174,96,0.85);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

/* ===========================
   Stats Bar (Top Page)
=========================== */
.stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  flex-shrink: 0;
  min-width: 100px;
}
.stat-number {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--accent-gold);
  font-weight: 400;
}
.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===========================
   Artwork Detail
=========================== */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 20px;
  transition: color var(--transition);
}
.detail-back:hover {
  color: var(--accent-gold);
}

.detail-layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.detail-image-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* 画像とバッジを包むインナーラッパー：画像サイズに合わせて縮む */
.detail-image-inner {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;  /* img の下余白を消す */
}

.detail-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(74,55,40,0.15);
  background: var(--bg-card);
  object-fit: contain;
}
.detail-image-placeholder {
  width: 480px;
  max-width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  font-size: 60px;
  color: var(--text-muted);
  line-height: normal;
}

.detail-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 6px;
}
.detail-title-original {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
}
.detail-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 4px;
}
.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
}
.detail-meta-item i {
  color: var(--accent-gold);
  width: 14px;
}
.detail-meta-item a {
  color: var(--accent-gold);
  text-decoration: none;
}
.detail-meta-item a:hover {
  text-decoration: underline;
}

.detail-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.detail-fav-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}
.detail-fav-btn.active {
  background: rgba(231,76,60,0.1);
  border-color: #e74c3c;
  color: #e74c3c;
}

/* ===========================
   Personal Record Section
=========================== */
.personal-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.personal-section-title {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.personal-row {
  margin-bottom: 14px;
}
.personal-label {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.star-input {
  display: flex;
  gap: 4px;
}
.star-input-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--border-light);
  transition: all 0.15s ease;
  padding: 2px;
  line-height: 1;
}
.star-input-btn.active {
  color: var(--accent-gold);
}
.star-input-btn:hover {
  transform: scale(1.2);
}

.personal-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  resize: vertical;
  transition: border-color var(--transition);
  line-height: 1.6;
}
.personal-input:focus {
  border-color: var(--accent-gold);
}
.personal-input::placeholder {
  color: var(--text-muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toggle-label-text {
  font-size: 13px;
  color: var(--text-primary);
}
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider {
  background: var(--accent-gold);
}
.toggle input:checked + .toggle-slider::after {
  transform: translateX(18px);
}

.personal-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.personal-tag {
  background: var(--accent-gold-dim);
  border: 1px solid rgba(192,116,138,0.25);
  color: var(--accent-gold-light);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.personal-tag:hover {
  background: rgba(192,116,138,0.25);
}
.personal-tag .remove {
  margin-left: 4px;
  opacity: 0.6;
}

.tag-add-row {
  display: flex;
  gap: 6px;
}
.tag-add-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
}
.tag-add-input:focus {
  border-color: var(--accent-gold);
}
.tag-add-btn {
  background: var(--accent-gold-dim);
  border: 1px solid rgba(192,116,138,0.25);
  color: var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.tag-add-btn:hover {
  background: rgba(192,116,138,0.18);
}

.save-btn {
  width: 100%;
  background: var(--accent-gold);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 14px;
  font-family: var(--font-sans);
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}
.save-btn:hover {
  background: var(--accent-gold-light);
}

/* ===========================
   Description Section
=========================== */
.desc-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.desc-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.desc-tab {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.desc-tab.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}
.desc-content {
  padding: 20px;
}
.desc-pane {
  display: none;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.8;
}
.desc-pane.active {
  display: block;
}
.trivia-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trivia-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.trivia-list li::before {
  content: '✦';
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===========================
   Related Artworks
=========================== */
.related-section {
  margin-top: 32px;
}
.related-group {
  margin-bottom: 28px;
}
.related-group-title {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.related-group-title::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--text-muted);
}
.related-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.related-card {
  flex-shrink: 0;
  width: 110px;
  cursor: pointer;
  transition: all var(--transition);
}
.related-card:hover {
  transform: translateY(-2px);
}
.related-card img,
.related-card .related-img-ph {
  width: 110px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  background: var(--bg-card);
}
.related-img-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-muted);
}
.related-card-title {
  font-size: 11px;
  color: var(--text-primary);
  margin-top: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===========================
   Artist Page
=========================== */
.artist-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.artist-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
  overflow: hidden;
}
.artist-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.artist-info h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.artist-info .sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.artist-info .bio {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.7;
}
.artist-memo {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-gold-dim);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent-gold-light);
  font-style: italic;
}
.artist-memo::before {
  content: '📝 ';
}

/* ===========================
   Museum Page
=========================== */
.museum-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}
.museum-header h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.museum-header .location {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.museum-header a {
  color: var(--accent-gold);
  font-size: 13px;
  text-decoration: none;
}

/* ===========================
   Favorites Page
=========================== */
.favorites-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.favorites-header h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
}
.favorites-header .heart {
  color: #e74c3c;
  font-size: 22px;
}

/* ===========================
   Empty State
=========================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state p {
  font-size: 15px;
  margin-bottom: 6px;
}
.empty-state small {
  font-size: 13px;
  opacity: 0.7;
}

/* ===========================
   Toast
=========================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  animation: slideIn 0.3s ease;
  max-width: 260px;
}
.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===========================
   Utility
=========================== */
.hidden { display: none !important; }
.text-gold { color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* System Tag Chips */
.system-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.system-tag-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.system-tag-chip:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ===========================
   Responsive — Mobile
=========================== */
@media (max-width: 768px) {
  .detail-layout {
    gap: 16px;
  }
  .detail-image {
    max-height: 55vh;
  }
  .detail-title {
    font-size: 20px;
  }
  .artwork-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 4px;
  }
  .nav-search {
    max-width: 160px;
  }
  .stat-card {
    min-width: 80px;
    padding: 10px 12px;
  }
  .stat-number {
    font-size: 18px;
  }
  .page {
    padding: 20px 14px 80px;
  }
}

@media (max-width: 400px) {
  .artwork-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }
}

/* ===========================
   Bottom Nav (Mobile)
=========================== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(247,242,236,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 8px 0 env(safe-area-inset-bottom);
}
.bottom-nav-items {
  display: flex;
  justify-content: space-around;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 16px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 10px;
  transition: color var(--transition);
  background: none;
  border: none;
  font-family: var(--font-sans);
}
.bottom-nav-item i {
  font-size: 18px;
}
.bottom-nav-item.active, .bottom-nav-item:hover {
  color: var(--accent-gold);
}

@media (max-width: 768px) {
  .bottom-nav { display: block; }
  .nav-actions { display: none; }
  #main { padding-bottom: 0; }
}

/* ===========================
   Lightbox
=========================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(40, 24, 16, 0.0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  transition: background 0.25s ease;
}
.lightbox-overlay.open {
  background: rgba(40, 24, 16, 0.93);
}

/* 画像ラッパー：ピンチズームのため overflow hidden しない */
.lightbox-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 60px rgba(74,55,40,0.35);
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22,1,0.36,1),
              opacity 0.22s ease;
  cursor: zoom-in;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none; /* ピンチズーム制御はJSで行う */
}
.lightbox-overlay.open .lightbox-img {
  transform: scale(1);
  opacity: 1;
}

/* ズーム中 */
.lightbox-img.zoomed {
  cursor: grab;
  border-radius: 2px;
}
.lightbox-img.zoomed:active {
  cursor: grabbing;
}

/* 閉じるボタン */
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  z-index: 2001;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.22);
  transform: scale(1.1);
}

/* ズームリセットボタン */
.lightbox-reset {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  border-radius: 99px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.2s;
  z-index: 2001;
  opacity: 0;
  pointer-events: none;
}
.lightbox-reset.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ヒント */
.lightbox-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  pointer-events: none;
  z-index: 2001;
  transition: opacity 0.4s;
  white-space: nowrap;
}
.lightbox-hint.hidden { opacity: 0; }

/* タイトル */
.lightbox-title {
  position: fixed;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  pointer-events: none;
  z-index: 2001;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 画像にホバーカーソルを付ける */
.detail-image {
  cursor: zoom-in;
}

/* ===========================
   Memo entries
=========================== */
.memo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.memo-card {
  background: var(--bg-elevated, #1e1e1e);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  position: relative;
}
.memo-card-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 28px;
}
.memo-card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}
.memo-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
}
.memo-card-delete:hover {
  opacity: 1;
  color: #e05555;
}
.memo-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
  font-style: italic;
}
.memo-add-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.memo-add-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 72px;
  transition: border-color 0.2s;
  line-height: 1.6;
}
.memo-add-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}
.memo-add-textarea::placeholder {
  color: var(--text-muted);
}
.memo-add-btn {
  align-self: flex-end;
  background: var(--accent-gold);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 20px;
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.memo-add-btn:hover  { background: var(--accent-gold-light); }
.memo-add-btn:active { transform: scale(0.97); }
.memo-add-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===========================
   Footer
=========================== */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding: 28px 24px 36px;
  text-align: center;
  color: var(--text-muted);
}
.site-footer .footer-logo {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.site-footer .footer-name {
  font-size: 15px;
  color: var(--accent-gold);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.site-footer .footer-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.8;
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 14px;
}
.site-footer .footer-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer .footer-links a:hover {
  color: var(--accent-gold);
}
@media (max-width: 768px) {
  .site-footer { padding-bottom: 80px; } /* bottom-nav分の余白 */
}

/* タップ拡大ヒント（画像右下に小さく表示） */
.zoom-hint-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(74,55,40,0.55);
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 99px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.3s;
}

/* ===========================
   Visit Records Page
=========================== */
.visits-header {
  padding: 24px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.visits-header h2 {
  font-size: 18px;
  color: var(--text-primary);
}
.visits-header .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 一覧カード */
.visit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  margin: 0 16px 16px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.visit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(74,55,40,0.12);
}

/* カバー写真ストリップ */
.visit-card-photos {
  display: flex;
  height: 160px;
  overflow: hidden;
  gap: 2px;
  background: var(--bg-elevated, #e8dfd6);
}
.visit-card-photos img {
  flex: 1;
  min-width: 0;
  object-fit: cover;
  display: block;
}
.visit-card-photos .no-photo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-muted);
  background: var(--bg-elevated, #e8dfd6);
}

/* カード下部テキスト */
.visit-card-body {
  padding: 14px 16px;
}
.visit-card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}
.visit-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.visit-card-meta i { font-size: 11px; }
.visit-card-memo {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 詳細ページ */
.visit-detail-cover {
  width: 100%;
  position: relative;
  background: var(--bg-secondary);
  overflow: hidden;
}
.visit-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 3px;
  padding: 0 16px 20px;
}
.visit-photo-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  background: var(--bg-elevated, #e8dfd6);
}
.visit-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.visit-photo-item:hover img { transform: scale(1.04); }
.visit-photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(74,55,40,0.65));
  color: #fff;
  font-size: 11px;
  padding: 16px 8px 6px;
  pointer-events: none;
}

.visit-detail-info {
  padding: 20px 20px 8px;
}
.visit-detail-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.35;
  font-family: var(--font-serif);
}
.visit-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.visit-detail-meta i { margin-right: 4px; }
.visit-detail-memo {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.visit-photos-label {
  padding: 0 16px 12px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 空状態 */
.visits-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.visits-empty .icon { font-size: 48px; margin-bottom: 12px; }
.visits-empty p { font-size: 15px; margin-bottom: 6px; color: var(--text-secondary); }
.visits-empty small { font-size: 12px; }

/* ─── 訪問記録リスト ─── */
.visits-list {
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── 訪問済み美術館マップセクション ─── */
.visit-map-section {
  margin: 0 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.visit-map-header {
  padding: 14px 18px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.visit-map-header i { color: var(--accent-gold); }
.visit-map-badge {
  margin-left: auto;
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  border-radius: 99px;
  font-size: 11px;
  padding: 2px 10px;
}

/* バブルチャート */
.museum-bubbles-wrap {
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.museum-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.museum-bubble-inner {
  width: var(--bubble-size);
  height: var(--bubble-size);
  border-radius: 50%;
  background: var(--accent-gold-dim);
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
.museum-bubble:hover .museum-bubble-inner {
  background: var(--accent-gold);
  color: #fff;
  transform: scale(1.08);
}
.museum-bubble-label {
  font-size: 10px;
  color: var(--text-muted);
  max-width: 72px;
  text-align: center;
  line-height: 1.3;
  word-break: break-all;
}

/* 年別タイムライン */
.visit-timeline {
  border-top: 1px solid var(--border);
  padding: 14px 18px 16px;
}
.visit-timeline-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.visit-timeline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.visit-timeline-year {
  font-size: 12px;
  color: var(--text-muted);
  width: 36px;
  flex-shrink: 0;
  text-align: right;
}
.visit-timeline-bar-wrap {
  flex: 1;
  background: var(--bg-secondary);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.visit-timeline-bar {
  height: 100%;
  background: var(--accent-gold);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  min-width: 6px;
}
.visit-timeline-count {
  font-size: 11px;
  color: var(--accent-gold);
  width: 24px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .visit-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .museum-bubbles-wrap { gap: 8px; padding: 12px 14px; }
}
