/* Tianmatai Studio — 重写版样式
   断点：桌面 ≥1024px（按策划好的行排版）；平板 600–1023px、手机 <600px（自动两端对齐排版） */

@font-face {
  font-family: "Lakki Reddy";
  src: url("../fonts/LakkiReddy-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lisu Bosa";
  src: url("../fonts/LisuBosa-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --panel: #060424;        /* 年份区块底色 */
  --nav-bg: #020024;       /* 底部导航底色 */
  --title: #0b03a8;        /* 首屏标题蓝 */
  --text: #fff;
  --active: #ff0000;       /* 当前年份高亮 */
  --contact: #ff9696;      /* Contact 粉色 */

  --display: "Lakki Reddy", "Trebuchet MS", sans-serif;
  --body: "Lisu Bosa", "Times New Roman", serif;

  --pad: 40px;             /* 左右留白 */
  --gap: 12px;             /* 作品间距 */
  --maxw: 1200px;          /* 作品区最大宽度 */
  --nav-h: 76px;
  --row-h: 260px;          /* 平板/手机自动排版的目标行高 */
  --hero-h: min(56.25vw, 88svh);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

/* ---------- 首屏：图片固定在底层，内容从上面盖过去 ---------- */
.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  height: var(--hero-h);
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}
.hero__title {
  position: relative;
  margin: 0;
  padding: min(110px, 9vw) 16px 0;
  text-align: center;
  font: 400 min(110px, 11vw)/1.2 var(--display);
  color: var(--title);
}

/* ---------- 内容层 ---------- */
.content {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.intro {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px var(--pad) 0;
  text-align: center;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.6;
}

/* ---------- 年份区块 ---------- */
.year {
  margin-top: 40px;
  padding: 20px var(--pad) 48px;
  background: var(--panel);
}
/* 还没放作品的年份：留出占位高度（不小于导航判定线，保证高亮准确） */
.year:not(:has(img)) { min-height: clamp(200px, 30vh, 480px); }

.year__title {
  margin: 0 0 24px;
  font: 400 clamp(30px, 3.6vw, 43px)/1.2 var(--display);
}

.works {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: var(--maxw);
  margin: 0 auto;
}

/* 桌面：一行里的作品等高、刚好铺满一行（宽度按图片比例分配） */
.row {
  display: flex;
  gap: var(--gap);
  justify-content: center;
}
.row img {
  flex: var(--r, 1) 1 0;
  width: 0;
  min-width: 0;
}
/* 只有一张图的行：不铺满，居中显示 */
.row--single img { flex: 0 1 auto; width: min(100%, 560px); }

/* 小图行：每张固定为 1/8 宽，居中 */
.row--thumbs { flex-wrap: wrap; align-items: center; }
.row--thumbs img {
  flex: 0 0 calc((100% - 7 * var(--gap)) / 8);
  width: auto;
}

/* ---------- 年份区块里的入口按钮（2026 → 游戏页） ---------- */
.enter {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 4px 0 28px;
  padding: 14px 26px 8px;          /* Lakki Reddy 字形偏上，下边距少留一点才居中 */
  border: 2px solid currentColor;
  font: 400 clamp(20px, 2.2vw, 26px)/1.2 var(--display);
  transition: color 0.2s, background-color 0.2s;
}
.enter__zh {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 0.72em;
  transform: translateY(-0.2em);
}
.enter__arrow { font-family: Arial, sans-serif; transform: translateY(-0.18em); }
.enter:hover, .enter:focus-visible { color: var(--active); }

/* ---------- 联系 ---------- */
.contact {
  min-height: 50vh;
  margin-top: 40px;
  padding: 20px var(--pad) 64px;
  background: rgba(0, 0, 0, 0.46);
}
.contact__title {
  margin: 0 0 20px;
  font: 400 clamp(30px, 3.6vw, 43px)/1.2 var(--display);
}
.contact__mail {
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--contact);
  border-bottom: 1px solid currentColor;
  overflow-wrap: anywhere;
}

/* ---------- 底部年份导航 ---------- */
.yearnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 0 var(--pad) env(safe-area-inset-bottom);
  background: var(--nav-bg);
  font-family: var(--display);
}
.yearnav__list {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3.2vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}
.yearnav a {
  display: block;
  padding: 8px 0;
  font-size: 21px;
  transition: color 0.2s;
}
.yearnav a:hover { color: #ff6b6b; }
.yearnav a.is-active { color: var(--active); }
.yearnav__early { font-weight: 700; }
.yearnav__contact {
  margin-left: auto;
  padding-left: 24px;
}
.yearnav .yearnav__contact { font-size: 33px; color: var(--contact); }
.yearnav .yearnav__contact.is-active { color: var(--active); }

/* ---------- 平板（含 iPad 竖屏/横屏小尺寸） ---------- */
@media (max-width: 1023.98px) {
  :root {
    --pad: 28px;
    --gap: 10px;
    --nav-h: 64px;
    --row-h: 240px;
    --grow-cap: 1.6;       /* 作品最多放大到目标行高的几倍（防止落单的图被拉得太大） */
    --hero-h: max(56.25vw, 52svh);
  }
  /* 作品改为自动两端对齐：按目标行高排，每行等高、铺满，不裁切；落单的作品居中 */
  .works { flex-flow: row wrap; justify-content: center; }
  .row { display: contents; }
  .row img,
  .row--single img {
    flex: var(--r, 1) 1 calc(var(--r, 1) * var(--row-h));
    width: 0;
    max-width: min(100%, calc(var(--r, 1) * var(--row-h) * var(--grow-cap)));
  }
  .row--thumbs { display: flex; flex-basis: 100%; }
  .row--thumbs img { flex: 0 0 calc((100% - 3 * var(--gap)) / 4); max-width: none; }

  .yearnav a { font-size: 18px; }
  .yearnav .yearnav__contact { font-size: 26px; }
}

/* ---------- 手机 ---------- */
@media (max-width: 599.98px) {
  :root {
    --pad: 16px;
    --gap: 8px;
    --nav-h: 56px;
    --row-h: 170px;
    --grow-cap: 2.4;
    --hero-h: max(56.25vw, 60svh);
  }
  .hero__bg { object-position: 50% 45%; }
  .intro { padding-top: 28px; }
  .year { margin-top: 28px; padding-bottom: 32px; }
  .year__title { margin-bottom: 16px; }
  .row--thumbs img { flex-basis: calc((100% - 2 * var(--gap)) / 3); }

  /* 导航：年份可左右滑动，Contact 固定在右侧 */
  .yearnav { padding-left: 4px; padding-right: 0; }
  .yearnav__list {
    flex: 1;
    min-width: 0;
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 28px), transparent);
    padding: 0 28px 0 12px;
  }
  .yearnav__list::-webkit-scrollbar { display: none; }
  .yearnav a { font-size: 16px; padding: 12px 0; }
  .yearnav .yearnav__contact { font-size: 18px; padding: 12px 16px 12px 12px; }
}

/* ---------- 子页面（tropical-company） ---------- */
.page-simple .lane { padding-bottom: 40px; }
