:root {
  --primary: #d4b168;
  --bg-dark: #1a1814;
  --text-light: #f0e6d6;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: "游明朝", YuMincho, "Hiragino Mincho ProN W3",
    "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", "HG明朝E", "ＭＳ Ｐ明朝",
    "ＭＳ 明朝", serif;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  padding: 1rem 0;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
  border-bottom: 1px solid var(--primary);
}

header h1 {
  text-align: center;
  color: var(--primary);
}

.period-nav {
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.nav-scroll {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.5rem;
  gap: 1rem;
  justify-content: flex-start;
  max-width: 100%;
}

.nav-scroll::-webkit-scrollbar {
  display: none;
}

.period-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: inherit;
}

.period-btn:hover,
.period-btn.active {
  background: var(--primary);
  color: var(--bg-dark);
}

.description {
  margin-top: calc(120px + 1rem);
  padding: 1rem;
  white-space: pre-wrap;
  text-align: center;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
}

.description.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery {
  padding: 1rem;
  position: relative;
  width: 100%;
}

.gallery-item {
  position: absolute;
  padding: 0;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.gallery-item .title-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 24, 20, 0.8);
  padding: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .title-container {
  opacity: 1;
}

.gallery-item .title {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-right: 0.5rem;
  flex: 1;
}

.gallery-item:hover {
  transform: scale(1.02);
}

@media (max-width: 2000px) {
  .gallery-item {
    width: calc(20% - 1rem);
  }
}

@media (max-width: 1600px) {
  .gallery-item {
    width: calc(25% - 1rem);
  }
}

@media (max-width: 1200px) {
  .gallery-item {
    width: calc(33.333% - 1rem);
  }
}

@media (max-width: 800px) {
  .gallery-item {
    width: calc(50% - 1rem);
  }

  .gallery-item .title-container {
    opacity: 1;
  }

  .gallery-item:hover .title-container {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .description {
    font-size: 0.9rem;
  }
}

.loading-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.loading-mask.visible {
  opacity: 1;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 30px;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.about-container {
  display: none;
  max-width: 800px;
  margin: 2rem auto;
  margin-top: 120px;
  padding: 0 1rem;
}

.about-container.visible {
  display: block;
}

.about-content {
  padding: 3rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  line-height: 1.8;
}

.about-title {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--primary);
}

.about-content p {
  color: #fff;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.about-content a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
  border-bottom: 1px dotted var(--primary);
}

.about-content a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.gallery-item.placeholder {
  background-color: #0f0f0f;
  border-radius: 8px;
}

.image-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

/* PhotoSwipe 自定义样式 */
.pswp__bg {
  transition: opacity 0.3s ease;
}

.favorite-btn {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.favorite-btn:hover {
  opacity: 1;
}

.favorite-btn svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  transition: fill 0.2s ease;
}

.favorite-btn.active svg {
  fill: var(--primary);
}

.gallery-item.visible {
  opacity: 1;
}

@media (max-width: 800px) {
  .gallery-item .title-container {
    opacity: 1;
  }
}

.progress-container {
  position: relative;
  width: 80%;
  max-width: 600px;
  background: rgba(26, 24, 20, 0.9);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  transition: opacity 0.3s ease;
  margin-top: 20px;
}

.progress-text {
  color: var(--text-light);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0;
  transition: width 0.3s ease;
}

.progress-detail {
  display: flex;
  justify-content: space-between;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 5px;
}

.progress-tip {
  color: var(--text-light);
  opacity: 0.7;
  font-size: 0.8rem;
  margin-top: 10px;
}

.cache-status {
  color: var(--primary);
}

@media (max-width: 600px) {
  .progress-container {
    width: 90%;
    padding: 15px;
  }

  .progress-text {
    font-size: 1rem;
  }
}

