/* tokens.css — 统一 Design Token 系统
 * 补充 styles.css 中已有的基础变量，建立完整的间距、圆角、阴影、动效、层级 token。
 * 所有页面在 styles.css 之后加载本文件。
 */
:root {
  /* —— 色彩扩展 —— */
  --ink-deep: #1a1e1b;
  --ink-soft: #3a3f38;
  --paper-warm: #f6f3ec;
  --paper-deep: #e8e5d8;
  --red-deep: #8a3823;
  --red-soft: #b8553a;
  --gold: #d2b786;
  --gold-soft: #d9b574;
  --green-deep: #3d5142;
  --line-soft: rgba(102, 85, 57, 0.10);
  --line-strong: rgba(102, 85, 57, 0.22);

  /* —— 间距阶梯 —— */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* —— 圆角 —— */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-pill: 14px;

  /* —— 阴影 —— */
  --shadow-card: 0 4px 16px rgba(36, 39, 34, 0.08);
  --shadow-card-hover: 0 12px 32px rgba(36, 39, 34, 0.14);
  --shadow-float: 0 16px 38px rgba(36, 39, 34, 0.16), 0 2px 6px rgba(36, 39, 34, 0.08);

  /* —— 动效 —— */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.65, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.2s;
  --dur-mid: 0.35s;
  --dur-slow: 0.6s;

  /* —— 字号阶梯 —— */
  --fs-xs: 10px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 28px;
  --fs-2xl: 41px;
  --fs-hero: clamp(48px, 6vw, 89px);

  /* —— 层级 z-index —— */
  --z-header: 20;
  --z-nav: 80;
  --z-overlay: 100;
  --z-lightbox: 200;

  /* —— 布局 —— */
  --max-width: 1440px;
  --gutter: 5.5vw;
}

/* —— 通用动效增强 —— */

/* 卡片悬停统一动效 */
.work-card,
.featured-card-item,
.masonry-card,
.hall-card {
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
}

.work-card:hover,
.featured-card-item:hover {
  transform: translateY(-4px);
}

.masonry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

/* 图片悬停微缩放统一 */
.real-painting img,
.featured-card-image img,
.masonry-card img,
.hall-card-thumb img {
  transition: transform var(--dur-slow) var(--ease-out),
              filter var(--dur-mid) var(--ease-out);
}

.real-painting:hover img,
.featured-card-item:hover .featured-card-image img {
  transform: scale(1.03);
}

/* 链接下划线动效 */
.text-link,
.arrow-link {
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.text-link:hover,
.arrow-link:hover {
  border-color: var(--red-deep);
}

/* 导航子菜单动效已由 navigation.css 处理 */

/* —— 可访问性增强 —— */

/* 焦点可见样式 */
.hall-nav-item:focus-visible,
.tag-filter-chip:focus-visible,
.menu-button:focus-visible,
.brand:focus-visible,
.main-nav a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* —— 响应式间距优化 —— */
@media (max-width: 760px) {
  :root {
    --space-xl: 28px;
    --space-2xl: 48px;
    --space-3xl: 72px;
  }
}

/* —— 卡片视觉细节优化 —— */

/* Featured 卡片：悬停时边框变红 + 轻微上浮 */
.featured-card-item .featured-card-image {
  border-color: var(--line-soft);
  transition: border-color var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out);
}

.featured-card-item:hover .featured-card-image {
  border-color: rgba(160, 68, 43, 0.3);
  box-shadow: var(--shadow-card-hover);
}

.featured-card-item:hover .featured-card-cat {
  color: var(--red-deep);
}

/* Masonry 卡片：悬停时增加阴影 + 边框 */
.masonry-card {
  border: 1px solid transparent;
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
}

.masonry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(160, 68, 43, 0.2);
}

/* Masonry overlay 渐变更柔和 */
.masonry-card-overlay {
  background: linear-gradient(transparent, rgba(20, 20, 18, 0.75));
  transition: opacity var(--dur-mid) var(--ease-out);
}

.masonry-card:hover .masonry-card-overlay {
  opacity: 1;
}

.masonry-card:hover .masonry-card-cat {
  color: var(--gold-soft);
}

/* Hall nav 激活态下划线动效 */
.hall-nav-item {
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.hall-nav-item::after {
  transition: transform var(--dur-mid) var(--ease-out);
  transform: scaleX(0);
  transform-origin: left;
}

.hall-nav-item.hall-active::after {
  transform: scaleX(1);
}

/* 首页作品卡片：悬停时图片微缩放 + 印章显现 */
.work-card .tiny-seal {
  opacity: 0.85;
  transition: opacity var(--dur-mid) var(--ease-out),
              transform var(--dur-mid) var(--ease-out);
}

.work-card:hover .tiny-seal {
  opacity: 1;
  transform: scale(1.08);
}

.work-card .painting-label {
  transition: opacity var(--dur-mid) var(--ease-out);
}

/* 首页 hero scroll-hint 动画 */
.scroll-hint i {
  animation: scroll-hint-bounce 2.4s var(--ease-in-out) infinite;
}

@keyframes scroll-hint-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* 加载更多按钮：悬停动效优化 */
.load-more-btn {
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.load-more-btn:hover {
  background: rgba(160, 68, 43, 0.04);
}

/* 时间线项目悬停效果 */
.timeline-item {
  transition: background var(--dur-mid) var(--ease-out);
}

.timeline-item:hover {
  background: rgba(229, 224, 210, 0.3);
}

.timeline-item:hover b {
  color: var(--red-deep);
}

/* Journal 列表项悬停优化 */
.journal-item {
  transition: background var(--dur-fast) var(--ease-out);
}

.journal-item:hover {
  background: rgba(229, 224, 210, 0.25);
}

/* 链接卡片悬停效果 */
.link-card {
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* 文化链接卡片悬停 */
.culture-link-box {
  transition: border-color var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out);
}

.culture-link-box:hover {
  border-color: rgba(160, 68, 43, 0.3);
  box-shadow: var(--shadow-card);
}

/* 收藏服务卡片悬停 */
.collection-card {
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out);
}

.collection-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
