:root {
  --paper: #f6f1e6;
  --paper-white: #ffffff;
  --ink: #2b2620;
  --ink-secondary: #6e655b;
  --ink-light: #9f968b;
  --cinnabar: #8f2b21;
  --cinnabar-hover: #a63429;
  --viewer-bg: #1c1a17;
  --font-serif: "Noto Serif SC", "Songti SC", serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.6;
}

[v-cloak] {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 列表页容器 */
.album-list-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.list-header {
  margin-bottom: 28px;
  text-align: center;
}

.site-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--cinnabar);
}

.site-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.state-container,
.empty-state {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--ink-secondary);
  font-size: 15px;
  text-align: center;
}

.album-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 700px) {
  .album-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

.album-card {
  background-color: #fbf9f4;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(43, 38, 32, 0.08);
  box-shadow: 0 4px 14px rgba(43, 38, 32, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.album-card:hover,
.album-card:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(43, 38, 32, 0.14);
}

.card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  border: 4px solid var(--paper-white);
  box-shadow: 0 3px 0 rgba(43, 38, 32, 0.18);
  overflow: hidden;
  background-color: #eae3d5;
}

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

.card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  font-size: 14px;
}

.badge-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--cinnabar);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  line-height: 1.2;
}

.card-meta {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.9em;
}

.card-date {
  font-size: 12px;
  color: var(--ink-secondary);
}

/* 通用转圈加载 */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(143, 43, 33, 0.22);
  border-top-color: var(--cinnabar);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.btn-cinnabar {
  min-height: 44px;
  padding: 0 18px;
  background-color: var(--cinnabar);
  color: #ffffff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.16s ease;
}

.btn-cinnabar:hover {
  background-color: var(--cinnabar-hover);
}

/* 查看器全屏容器 */
.viewer-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: var(--viewer-bg);
  color: #ffffff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* 查看器顶部导航 */
.viewer-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: linear-gradient(180deg, rgba(28, 26, 23, 0.88) 0%, rgba(28, 26, 23, 0) 100%);
}

.viewer-btn-back {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.viewer-btn-back:hover {
  background: rgba(255, 255, 255, 0.15);
}

.viewer-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.viewer-title {
  font-size: 14px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

/* 居中主舞台 */
.viewer-stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 左右1/4触控/点击区 */
.tap-zone {
  position: absolute;
  top: 60px;
  bottom: 80px;
  width: 25%;
  z-index: 10;
  cursor: pointer;
}

.tap-zone-left {
  left: 0;
}

.tap-zone-right {
  right: 0;
}

.viewer-image-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.viewer-image-wrapper.is-animating {
  transition: transform 240ms cubic-bezier(0.2, 0, 0.25, 1);
}

.viewer-image {
  max-width: 94vw;
  max-height: 92vh;
  max-height: 92dvh;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.viewer-video {
  position: relative;
  z-index: 12;
  max-width: 94vw;
  max-height: 92vh;
  max-height: 92dvh;
  object-fit: contain;
  background-color: var(--viewer-bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  outline: none;
}

.viewer-status-layer {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.viewer-tip {
  letter-spacing: 1px;
}

/* 角标 */
.page-indicator {
  position: absolute;
  right: 18px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  pointer-events: none;
}

/* 底部操作栏 */
.viewer-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background-color: rgba(28, 26, 23, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bar-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bar-actions-right {
  display: flex;
  align-items: center;
}

.action-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.action-btn-primary {
  background-color: var(--cinnabar);
  color: #ffffff;
}

.action-btn-primary:not(:disabled):hover {
  background-color: var(--cinnabar-hover);
}

.action-btn-secondary {
  background-color: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.action-btn-secondary:not(:disabled):hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

/* 针对小屏幕(如390x844)微调操作栏保证单行不折断，或优雅排列 */
@media (max-width: 420px) {
  .viewer-bottom-bar {
    padding-left: 8px;
    padding-right: 8px;
    gap: 6px;
  }
  .bar-actions-left {
    gap: 6px;
  }
  .action-btn {
    padding: 0 10px;
    font-size: 12px;
  }
}