/* ============================================================
   橘猫壁纸 - 全站样式
   - 字体与基础
   - Hero（首屏大图区）
   - 搜索框
   - 一言
   - 历史图片网格 + 卡片
   - 模态框
   - 分页
   - 页脚
   - Toast / Loading
   ============================================================ */

/* ---------- 1. 字体声明 ---------- */
@font-face {
  font-family: 'ChillRoundGothic';
  src: url('/fonts/ChillRoundGothic_Normal.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. 基础重置 ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* 始终为滚动条预留空间，避免模态框打开/关闭时页面宽度跳变 */
html {
  scrollbar-gutter: stable;
}

body {
  font-family: "ChillRoundGothic", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #e0e0e0;
  background-color: #121212;
  line-height: 1.6;
  min-height: 100vh;
  min-width: 325px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

img { -webkit-user-drag: none; }

/* ============================================================
   Hero（首屏）- 编辑/杂志风格
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background: #0d0a08;
  isolation: isolate;
}

@supports not (height: 100svh) {
  .hero { height: 100vh; }
}

/* 大图 + Ken Burns 缓慢推进 */
.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  animation: heroKenBurns 24s ease-out forwards;
}

.hero:hover .hero__image {
  animation-play-state: paused;
}

@keyframes heroKenBurns {
  from { transform: scale(1.02); }
  to   { transform: scale(1.12); }
}

/* 蒙层：上下两道渐变（顶部一点点压暗方便白字，底部留出空间放 meta） */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 120px;
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.18) 18%,
      rgba(0, 0, 0, 0.10) 45%,
      rgba(0, 0, 0, 0.55) 82%,
      rgba(0, 0, 0, 0.78) 100%
    );
}

/* 中央内容容器 */
.hero__content {
  position: relative;
  text-align: center;
  width: 100%;
  max-width: 880px;
  z-index: 3;
}

/* 顶部小标签：DAILY · 2026 / 06 / 28 */
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.75rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(255, 200, 130, 0.95);
  margin-bottom: 28px;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero__eyebrow::before,
.hero__eyebrow::after {
  content: '';
  width: 28px;
  height: 1px;
  background: rgba(255, 200, 130, 0.55);
}

.hero__title {
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  font-weight: 800;
  letter-spacing: 0.35em;
  text-indent: 0.35em; /* 抵消 letter-spacing 让末字视觉居中 */
  color: #fff;
  line-height: 1.05;
  margin: 0 0 18px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 1s ease-out 0.4s both;
}

/* 英文副标题 */
.hero__subtitle {
  font-size: 0.82rem;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 36px;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero__desc {
  max-width: 620px;
  margin: 0 auto 40px;
  padding: 0 8px;
  font-size: 1.02rem;
  line-height: 1.95;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  animation: fadeInUp 1s ease-out 0.8s both;
}

/* 底部版权信息 */
.hero__meta {
  position: absolute;
  bottom: 36px;
  left: 0;
  right: 0;
  padding: 0 24px;
  text-align: center;
  z-index: 3;
  animation: fadeInUp 1s ease-out 1s both;
}

.hero__copy {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================================
   搜索框
   ============================================================ */
.search-container {
  position: relative;
  margin: 0 auto;
  max-width: 560px;
  width: 100%;
  animation: fadeInUp 1s ease-out 1s both;
}

.search-container__input {
  width: 100%;
  height: 44px;
  padding: 0 90px 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.search-container__input::placeholder {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.search-container__input:focus {
  outline: none;
  border-color: rgba(26, 115, 232, 0.6);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 18px rgba(26, 115, 232, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-container__input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.search-container__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-container__input::-webkit-autofill,
.search-container__input::-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px rgba(30, 30, 30, 0.9) inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
}
.search-container__input::selection { background: rgba(26, 115, 232, 0.5); color: #fff; }
.search-container__input::-moz-selection { background: rgba(26, 115, 232, 0.5); color: #fff; }

.search-container__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

.search-container__btn:hover {
  background: rgba(255, 255, 255, 0.32);
  color: #fff;
  transform: translateY(-50%) scale(1.05);
}
.search-container__btn:active { transform: translateY(-50%) scale(0.95); }
.search-container__btn:disabled { opacity: 0.5; cursor: not-allowed; transform: translateY(-50%); }

.search-container__btn--clear { right: 42px; display: none; }
.search-container__btn--clear.visible { display: flex; }
.search-container__btn--search { right: 8px; }

.search-container__btn svg { width: 40%; height: 40%; pointer-events: none; }

/* ============================================================
   一言
   ============================================================ */
.yiyan {
  color: #e0e0e0;
  padding: 15px 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.yiyan__content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 10px 20px;
  font-weight: 300;
  text-align: center;
}

.yiyan__content::before,
.yiyan__content::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border-color: rgba(255, 255, 255, 0.3);
  border-style: solid;
}
.yiyan__content::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.yiyan__content::after  { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.yiyan__loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

/* ============================================================
   历史图片网格
   ============================================================ */
.history-container {
  background: #1e1e1e;
  flex: 1;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.history {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 0 auto;
  padding: 20px 10px 0;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.history__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px 20px;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.history__empty-icon { font-size: 64px; margin-bottom: 20px; color: #999; }
.history__empty-title { font-size: 24px; margin-bottom: 10px; color: #d4c6c6; }
.history__empty-desc  { font-size: 16px; margin-bottom: 30px; color: #888; max-width: 400px; }
.history__empty-btn {
  padding: 12px 30px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.history__empty-btn:hover { background: #1668d3; transform: translateY(-1px); }

.card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #2d2d2d;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.card:not(.card-loaded)::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #1a73e8;
  animation: spin 1s ease-in-out infinite;
  z-index: 2;
}
.card.card-loaded::before { display: none; }

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.card:hover img { transform: scale(1.05); }

.card__date {
  position: absolute;
  bottom: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.card__copy {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.card:hover .card__date { opacity: 0; transform: translateY(10px); }
.card:hover .card__copy  { opacity: 1; transform: translateY(0); }

/* ============================================================
   模态框
   ============================================================ */
/* ============================================================
   全屏原图查看器（Lightbox）
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
  display: flex;
}

.lightbox__stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  overflow: hidden;
}

.lightbox__image {
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 110px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
.lightbox__image[hidden] { display: none; }

/* 关闭按钮 */
.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__close:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.05); }
.lightbox__close:active { transform: scale(0.95); }
.lightbox__close svg { width: 22px; height: 22px; }

/* 下载按钮 */
.lightbox__download {
  position: absolute;
  top: 18px;
  right: 72px;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__download:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.05); }
.lightbox__download:active { transform: scale(0.95); }
.lightbox__download svg { width: 20px; height: 20px; }

.lightbox__download.modal__btn--disabled,
.lightbox__download.modal__btn--disabled:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #666;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* 加载状态 */
.lightbox__loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  color: #ccc;
}
.lightbox__loader[hidden] { display: none; }

.lightbox__loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.lightbox__loader-text {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.lightbox__loader-hint {
  font-size: 0.8rem;
  color: #888;
}

/* 错误状态 */
.lightbox__error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  color: #ccc;
}
.lightbox__error[hidden] { display: none; }

.lightbox__error-icon {
  font-size: 48px;
  margin-bottom: 12px;
  color: #f44336;
}

.lightbox__error-text {
  font-size: 1rem;
  margin-bottom: 6px;
  color: #ddd;
}

.lightbox__error-hint {
  font-size: 0.85rem;
  color: #888;
  max-width: 320px;
}

/* 标题 */
.lightbox__caption {
  position: absolute;
  padding: 10px 24px 14px;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.5;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2));
  border-radius: 10px;
  pointer-events: none;
  /* 位置由 JS 动态设置，紧贴图片底部 */
  left: 12px;
  right: 12px;
  width: auto;
  max-width: none;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
}
.lightbox__caption[hidden] { display: none; }

@media (max-width: 768px) {
  .lightbox__close,
  .lightbox__download { width: 40px; height: 40px; top: 12px; }
  .lightbox__close    { right: 12px; }
  .lightbox__download { right: 62px; }
  .lightbox__stage    { padding: 16px 0; }
  .lightbox__image    { max-width: calc(100vw - 24px); max-height: calc(100vh - 92px); }
  .lightbox__caption  {
    left: 8px;
    right: 8px;
    padding: 8px 14px 10px;
    font-size: 0.7rem;
    line-height: 1.4;
    border-radius: 8px;
  }
}

/* ============================================================
   分页
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 20px;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 16px;
  background: #2d2d2d;
  color: #e0e0e0;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.pagination a:hover { background: #404040; color: #fff; }
.pagination .current { background: #1a73e8; color: #fff; }
.pagination .disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .page-info { color: #aaa; margin: 0 10px; }

/* ============================================================
   页脚
   ============================================================ */
footer {
  background: #1a1a1a;
  color: #aaa;
  padding: 0 15px;
  text-align: center;
  font-size: 0.9rem;
}

footer a {
  color: #e0e0e0;
  text-decoration: none;
  transition: color 0.2s ease;
}
footer a:hover { color: #fff; text-decoration: underline; }
footer div { margin-bottom: 10px; }
.footer-stats { margin-bottom: 0.5em; }

#vercount_value_site_pv,
#vercount_value_site_uv {
  font-weight: bold;
  color: #e0e0e0;
}

/* ============================================================
   全屏 Loading
   ============================================================ */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loading__content { text-align: center; }

.loading__spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid #333;
  border-radius: 50%;
  border-top-color: #1a73e8;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}

.loading__text { color: #e0e0e0; font-size: 16px; }

/* ============================================================
   动画 keyframes
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   响应式
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero { min-height: 600px; }
}

@media (max-width: 1200px) {
  .history { grid-template-columns: repeat(2, 1fr); }
}

/* 平板及以下：保持桌面版风格，整体等比缩小 */
@media (max-width: 768px) {
  .hero { min-height: 100svh; }

  .hero__overlay    { padding: 80px 20px 110px; }

  .hero__eyebrow    { font-size: clamp(0.62rem, 1.6vw, 0.75rem); letter-spacing: 0.36em; margin-bottom: 24px; gap: 12px; }
  .hero__eyebrow::before,
  .hero__eyebrow::after { width: 24px; }

  .hero__title {
    font-size: clamp(2rem, 8vw, 3.6rem);
    letter-spacing: 0.28em;
    text-indent: 0.28em;
    margin-bottom: 16px;
  }

  .hero__subtitle {
    font-size: clamp(0.65rem, 1.6vw, 0.82rem);
    letter-spacing: 0.48em;
    text-indent: 0.48em;
    margin-bottom: 30px;
  }

  .hero__desc  {
    font-size: clamp(0.9rem, 2vw, 1.02rem);
    line-height: 1.85;
    margin-bottom: 34px;
    padding: 0 8px;
    max-width: 560px;
  }

  .hero__meta  { bottom: 28px; padding: 0 20px; }
  .hero__copy  { font-size: 0.72rem; line-height: 1.5; max-width: 600px; }

  .search-container         { margin: 0 auto; width: min(100% - 40px, 520px); }
  .search-container__input  { height: 46px; padding: 0 88px 0 18px; font-size: 0.9rem; }
  .search-container__btn    { width: 34px; height: 34px; }
  .search-container__btn--search { right: 10px; }
  .search-container__btn--clear  { right: 50px; }

  .history {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 100%;
  }

  .pagination             { padding: 20px 10px; }
  .pagination a,
  .pagination span        { padding: 6px 12px; font-size: 0.8rem; }
}

/* 手机小屏：继续等比缩小，风格完全一致 */
@media (max-width: 480px) {
  .hero__overlay { padding: 70px 16px 100px; }

  .hero__eyebrow { font-size: 0.62rem; letter-spacing: 0.3em; margin-bottom: 20px; gap: 10px; }
  .hero__eyebrow::before,
  .hero__eyebrow::after { width: 18px; }

  .hero__title {
    font-size: clamp(1.8rem, 10vw, 2.4rem);
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    margin-bottom: 14px;
  }

  .hero__subtitle { font-size: 0.6rem; letter-spacing: 0.4em; text-indent: 0.4em; margin-bottom: 26px; }
  .hero__desc     { font-size: 0.85rem; line-height: 1.75; margin-bottom: 30px; }
  .hero__copy     { font-size: 0.68rem; }

  .search-container         { width: min(100% - 24px, 440px); }
  .search-container__input  { height: 44px; padding: 0 80px 0 16px; font-size: 0.85rem; }
  .search-container__btn    { width: 32px; height: 32px; }
  .search-container__btn--search { right: 8px; }
  .search-container__btn--clear  { right: 46px; }
}

/* 超小屏 */
@media (max-width: 340px) {
  .hero__title {
    font-size: 1.5rem;
    letter-spacing: 0.16em;
    text-indent: 0.16em;
  }
  .hero__eyebrow { gap: 8px; font-size: 0.55rem; letter-spacing: 0.25em; }
  .hero__eyebrow::before,
  .hero__eyebrow::after { width: 14px; }
  .hero__subtitle { font-size: 0.55rem; letter-spacing: 0.35em; text-indent: 0.35em; }

  .search-container         { width: calc(100% - 16px); }
  .search-container__input  { height: 40px; font-size: 0.8rem; padding: 0 74px 0 12px; }
  .search-container__btn    { width: 28px; height: 28px; }
  .search-container__btn--search { right: 6px; }
  .search-container__btn--clear  { right: 40px; }
}

/* 减少动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
