/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "SF Pro SC", "SF Pro Display", "SF Pro Icons", "PingFang SC",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #fff;
  color: #1d1d1f;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- 页头（TPageHeader） ---------- */
.layout-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  height: 60px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-home { display: flex; align-items: center; flex-shrink: 0; }
.header-logo { display: flex; align-items: center; }
.favicon-img { width: 32px; height: 32px; }
.header-title { margin-left: 8px; font-size: 20px; font-weight: 500; letter-spacing: 2px; }

.header-nav { display: flex; align-items: center; height: 60px; user-select: none; }
.header-nav > a { position: relative; display: flex; }

.nav-item {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  margin-right: 8px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  white-space: nowrap;
  transition: background-color 0.1s ease-in-out;
}
.nav-item:hover { background-color: rgba(0, 0, 0, 0.05); }
.nav-item:active { background-color: rgba(0, 0, 0, 0.09); }

.discount-tag {
  position: absolute;
  top: -4px;
  left: 50%;
  padding: 0 5px;
  line-height: 16px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #fff;
  border-radius: 10px 10px 10px 0;
  white-space: nowrap;
  background-image: linear-gradient(to left, #60a5fa, #3b82f6);
}

/* ---------- 主容器 ---------- */
.page-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.gif-view-container { width: 100%; padding-top: 16px; }
.gif-view-flex {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 左：暗色图床 */
.gif-img-container {
  width: 100%;
  height: 360px;
  min-width: 320px;
  background-color: #212121;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}
.gif-img-preview { max-width: 100%; max-height: 100%; object-fit: contain; }

/* 右：信息 + 下载（与左侧图床等高 360px，内容上下贴边，复刻原页面 justify-between 布局） */
.gif-info-panel {
  width: 100%;
  min-width: 320px;
  height: 360px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.gif-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #1d1d1f;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.gif-desc { margin-top: 16px; font-size: 14px; color: #535354; }

.gif-meta { }
.meta-row { display: flex; align-items: flex-start; margin-bottom: 20px; line-height: 20px; }
.meta-label {
  flex: none;
  width: 82px;
  height: 24px;
  display: flex;
  align-items: center;
  font-size: 12px;
  letter-spacing: 1px;
  color: #1d1d1f;
}
.meta-value { font-size: 12px; line-height: 24px; color: #616161; }
.meta-row-btn { margin-bottom: 0; }

/* 立即下载（渐变按钮，复刻 c-button xl gradient） */
.btn-download {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 6px;
  font-size: 20px;
  letter-spacing: 1px;
  color: #fff;
  cursor: pointer;
  background-image: linear-gradient(to bottom right, #f53e56, #ff9a5a);
  transition: filter 0.1s ease-in-out;
}
.btn-download:hover { filter: brightness(0.95); }
.btn-download:active { filter: brightness(0.9); }
.btn-download:disabled { opacity: 0.75; cursor: not-allowed; }

/* 顶部轻提示（未登录 / 登录失效等） */
.seo-toast {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: 100;
  max-width: 80vw;
  padding: 10px 20px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.seo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 编辑GIF ---------- */
.edit-section {
  margin-top: 48px;
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.section-title {
  padding: 32px 0;
  font-size: 24px;
  letter-spacing: 1px;
  text-align: center;
  color: #1d1d1f;
}
.edit-btns {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.edit-pill {
  margin: 0 8px 8px 0;
  padding: 4px 16px;
  border-radius: 4px;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  background-color: #dedee2;
  transition: background-color 0.1s ease-in-out;
}
.edit-pill:hover { background-color: #e5e5e9; text-decoration: underline; text-underline-offset: 2px; }
.edit-pill:active { background-color: #d4d4d7; }

/* ---------- 使用说明 ---------- */
.usage-section { margin-top: 48px; padding-top: 48px; }
.usage-text { margin-top: 12px; font-size: 12px; color: #707070; }
.usage-highlight { color: #2563eb; }
.usage-link { color: #6b7280; text-decoration: underline; }

/* ---------- 页脚（TPageFooter） ---------- */
.layout-footer {
  margin-top: 48px;
  padding-top: 48px;
  padding-bottom: 24px;
  background-color: #f4f4f5;
}
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 8px; }

.footer-main { display: flex; flex-direction: column; }
.footer-intro { margin-bottom: 32px; font-size: 12px; min-width: 200px; max-width: 220px; }
.footer-brand { display: flex; align-items: center; margin-bottom: 16px; }
.footer-brand .favicon-img { width: 24px; height: 24px; }
.footer-brand span { margin-left: 4px; font-size: 16px; letter-spacing: 2px; }
.footer-intro-text { margin-bottom: 16px; line-height: 1.6; }

.footer-columns { display: flex; flex-direction: column; }
.footer-column { margin-bottom: 32px; font-size: 12px; min-width: 120px; max-width: 150px; }
.footer-column-title { margin-bottom: 16px; font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.footer-link {
  display: flex;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 1px;
  transition: color 0.1s ease-in-out;
}
.footer-link:hover { color: #000; text-decoration: underline; text-underline-offset: 2px; }

.footer-divider { margin: 16px auto; height: 1px; border-top: 1px solid rgba(0, 0, 0, 0.16); }

.footer-blog { padding-top: 32px; }
.footer-blog-title { margin-bottom: 8px; font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.footer-blog-links { display: flex; flex-wrap: wrap; }
.footer-blog-links .footer-link { margin-right: 24px; }

.footer-bottom { display: flex; flex-direction: column; padding-top: 16px; }
.footer-copyright, .footer-beian { font-size: 12px; color: #4b5563; }
.footer-copyright { margin-bottom: 4px; }
.footer-terms { display: flex; font-size: 12px; }
.footer-terms-privacy { margin-left: 16px; }

/* ---------- 分组页（预留，后续启用分组页时使用） ---------- */
.group-view-container { padding: 32px 0 48px; }
.group-title { font-size: 24px; font-weight: 700; letter-spacing: 1px; text-align: center; }
.group-desc { margin: 16px 0 32px; font-size: 14px; color: #535354; text-align: center; }
.gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.gif-card { display: block; }
.gif-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;   /* 正方形：无论原图比例，一律 1:1 */
  object-fit: cover;
  border-radius: 8px;
  background-color: #f3f4f6;
}
.gif-card__title { margin-top: 6px; font-size: 12px; color: #535354; }

/* 素材列表页（/gif/ 与 /gif/page/N/）：卡片放大、每屏更少 */
.gif-grid--list {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.gif-grid--list .gif-card img { border-radius: 10px; }
.gif-grid--list .gif-card__title { margin-top: 8px; font-size: 13px; }

@media (max-width: 640px) {
  .gif-grid--list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gif-grid--list .gif-card__title { font-size: 12px; }
}

/* ---------- 面包屑 / 相关推荐 / 分页 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #6b7280;
}
.breadcrumb a { color: #2f6fed; }
.breadcrumb span { color: #9ca3af; }

.related-section { margin-top: 40px; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 8px;
}
.pager a,
.pager .pager-cur,
.pager .pager-gap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #111827;
}
.pager a:hover { border-color: #2f6fed; color: #2f6fed; }
.pager .pager-cur { background: #2f6fed; border-color: #2f6fed; color: #fff; font-weight: 600; }
.pager .pager-gap { border-color: transparent; background: transparent; color: #9ca3af; }

/* ---------- 响应式（对齐原页面 Tailwind 断点） ---------- */
@media (min-width: 640px) {
  .gif-view-container { padding-top: 32px; }
  .section-title { font-size: 30px; }
  .footer-main { flex-direction: row; justify-content: space-between; }
  .footer-intro { margin-bottom: 0; margin-right: 24px; }
  .footer-columns { flex-direction: row; flex-grow: 1; justify-content: flex-start; }
  .footer-column { margin-bottom: 0; margin-right: 24px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 768px) {
  .gif-view-flex { flex-direction: row; }
  .gif-img-container { width: 60%; }
  .gif-info-panel { width: 40%; margin-top: 0; margin-left: 16px; }
}

@media (min-width: 1024px) {
  .footer-columns { justify-content: space-evenly; }
}

@media (max-width: 700px) {
  /* 移动端简化：隐藏带角标的导航项（原站点为汉堡菜单抽屉） */
  .nav-matting { display: none; }
  .nav-item { padding: 0 8px; font-size: 14px; }
}
