/* 访客端 —— 移动优先，微信内置浏览器是第一战场 */

:root {
  --accent: #b08d57;
  --bg: #ffffff;
  --bg-soft: #f6f5f3;
  --text: #1a1a1a;
  --text-soft: #6f6f6f;
  --line: rgba(0, 0, 0, 0.08);
  --radius: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-mode='dark'] {
  --bg: #101010;
  --bg-soft: #1a1a1a;
  --text: #f2f0ec;
  --text-soft: #9a9691;
  --line: rgba(255, 255, 255, 0.12);
}

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

/* flex / grid 容器里的 hidden 子元素在部分内核上仍会占位 */
[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

a {
  color: var(--accent);
}

/* ------------------------------------------------------------- 加载态 */

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 100;
  transition: opacity 0.4s ease;
}

.loading.is-done {
  opacity: 0;
  pointer-events: none;
}

.loading__dot {
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.app {
  animation: fade 0.6s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

/* --------------------------------------------------------------- 封面 */

.cover {
  position: relative;
  height: 100svh;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.cover__image {
  position: absolute;
  inset: 0;
  background: var(--bg-soft) center / cover no-repeat;
  transform: scale(1.04);
  animation: coverIn 12s ease-out forwards;
}

@keyframes coverIn {
  to {
    transform: scale(1);
  }
}

.cover__mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0.25) 100%);
}

.cover--plain .cover__mask {
  background: none;
}

.cover__text {
  position: relative;
  padding: 0 24px calc(96px + var(--safe-bottom));
  color: #fff;
  animation: riseIn 1s 0.2s ease both;
}

.cover--plain .cover__text {
  color: var(--text);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

.cover__name {
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

.cover__slogan {
  margin-top: 10px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.cover__city {
  margin-top: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  opacity: 0.72;
}

.cover__scroll {
  position: absolute;
  left: 50%;
  bottom: calc(38px + var(--safe-bottom));
  transform: translateX(-50%);
  padding: 12px;
}

.cover__scroll span {
  display: block;
  width: 20px;
  height: 20px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.8);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.8);
  transform: rotate(45deg);
  animation: bob 1.8s ease-in-out infinite;
}

.cover--plain .cover__scroll span {
  border-color: var(--text-soft);
}

@keyframes bob {
  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.4;
  }
  50% {
    transform: rotate(45deg) translate(4px, 4px);
    opacity: 1;
  }
}

/* --------------------------------------------------------------- 分类 */

.filters {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.filters::-webkit-scrollbar {
  display: none;
}

.filters button {
  flex: none;
  padding: 6px 16px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.25s ease;
}

.filters button.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ------------------------------------------------------------- 瀑布流 */

.grid {
  padding: 20px 14px 40px;
  columns: 2;
  column-gap: 10px;
}

@media (min-width: 720px) {
  .grid {
    columns: 3;
    column-gap: 14px;
    padding: 28px 24px 60px;
  }
}

@media (min-width: 1200px) {
  .grid {
    columns: 4;
    max-width: 1600px;
    margin: 0 auto;
  }
}

.card {
  position: relative;
  display: block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.card.is-in {
  opacity: 1;
  transform: none;
}

@media (min-width: 720px) {
  .card {
    margin-bottom: 14px;
  }
}

.card img {
  width: 100%;
  height: auto;
  transition: transform 0.6s ease;
}

@media (hover: hover) {
  .card:hover img {
    transform: scale(1.04);
  }
}

.card__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 12px 10px;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover .card__label,
.card:focus-visible .card__label {
  opacity: 1;
}

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------- 关于 */

.about {
  padding: 56px 24px 40px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}

@media (min-width: 720px) {
  .about {
    padding: 80px 24px 60px;
  }
}

.about__head {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.about__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.about__name {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.about__city {
  font-size: 0.85rem;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

.about__bio {
  max-width: 720px;
  margin: 22px auto 0;
  font-size: 0.95rem;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.packages {
  max-width: 720px;
  margin: 32px auto 0;
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .packages {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.package {
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.package__title {
  font-size: 0.98rem;
  font-weight: 600;
}

.package__price {
  margin-top: 4px;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.package__desc {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.social {
  max-width: 720px;
  margin: 26px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social a,
.social span {
  padding: 7px 14px;
  font-size: 0.82rem;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
}

/* --------------------------------------------------------------- 页脚 */

.footer {
  padding: 30px 24px calc(110px + var(--safe-bottom));
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
  background: var(--bg-soft);
}

.footer__credit {
  margin-top: 6px;
  opacity: 0.5;
  font-size: 0.72rem;
}

/* ----------------------------------------------------------- 约拍按钮 */

.cta {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 30;
  padding: 13px 34px;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.cta:active {
  transform: translateX(-50%) scale(0.96);
}

/* 首屏先让顾客看封面，滑到作品区再冒出来 —— 顺带避开向下箭头 */
.cta--away {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(24px);
}

/* ----------------------------------------------------------- 单图详情 */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #0b0b0b;
  color: #f0eeea;
  animation: fade 0.3s ease;
}

.viewer[hidden] {
  display: none;
}

.viewer__stage {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 52px 12px 8px;
  touch-action: pan-y;
}

.viewer__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  animation: fade 0.35s ease;
}

.viewer__panel {
  flex: none;
  max-height: 42vh;
  overflow-y: auto;
  padding: 16px 22px calc(26px + var(--safe-bottom));
  background: linear-gradient(to top, #0b0b0b 70%, transparent);
}

.viewer__title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.viewer__meta {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #9a958e;
  letter-spacing: 0.06em;
}

.viewer__story {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #c9c4bc;
  white-space: pre-wrap;
}

.viewer__gear {
  margin-top: 12px;
  font-size: 0.75rem;
  color: #6f6b65;
  letter-spacing: 0.05em;
}

.viewer__close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  font-size: 1.7rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-top: -60px;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  opacity: 0.7;
}

.viewer__nav--prev {
  left: 10px;
}

.viewer__nav--next {
  right: 10px;
}

.viewer__nav[disabled] {
  opacity: 0.15;
  cursor: default;
}

@media (max-width: 560px) {
  .viewer__nav {
    display: none; /* 手机上滑动切换就够了，按钮挡画面 */
  }
}

/* --------------------------------------------------------------- 弹层 */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] {
  display: none;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: fade 0.25s ease;
}

.sheet__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 26px 24px calc(26px + var(--safe-bottom));
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  animation: sheetUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@media (min-width: 560px) {
  .sheet {
    align-items: center;
  }
  .sheet__panel {
    border-radius: 18px;
  }
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
}

.sheet__title {
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}

.sheet__body {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
}

.contact-row small {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.contact-qr {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.contact-qr img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}

.contact-qr small {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.sheet__close {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  font-size: 0.9rem;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* --------------------------------------------------------------- 提示 */

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 10px 20px;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
  border-radius: 999px;
  animation: fade 0.2s ease;
}

.toast[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
