/* =========================
   基础设置
========================= */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  background: #e8e5dc;
}

body {
  min-height: 100vh;
  color: #173f67;

  font-family:
    "Yu Mincho",
    "Hiragino Mincho ProN",
    "Noto Serif JP",
    "MS Mincho",
    "Microsoft YaHei",
    serif;
}


/* =========================
   整个日语目录页面
========================= */

.japanese-page {
  position: relative;

  display: flex;
  flex-direction: column;

  width: 100%;
  min-height: 100vh;

  padding:
    clamp(28px, 5vh, 58px)
    clamp(28px, 7vw, 110px)
    clamp(34px, 5vh, 60px);

  overflow: hidden;

  background-color: #eeeae0;

  /*
    同时兼容 menu.png 和 menu.jpg。
  */
  background-image:
    url("./images/menu.png"),
    url("./images/menu.jpg");

  background-repeat:
    no-repeat,
    no-repeat;

  background-position:
    center center,
    center center;

  background-size:
    cover,
    cover;
}


/*
  淡化背景，让目录更容易阅读，
  但仍然保留蓝白布纹。
*/
.japanese-page::before {
  content: "";
  position: absolute;
  inset: 0;

  z-index: 0;
  pointer-events: none;

  background:
    linear-gradient(
      90deg,
      rgba(242, 241, 235, 0.3) 0%,
      rgba(242, 241, 235, 0.16) 42%,
      rgba(249, 246, 238, 0.64) 100%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 48%,
      rgba(244, 240, 230, 0.17) 100%
    );
}


/* 页面中的内容保持在背景之上 */
.page-header,
.study-menu,
.page-footer {
  position: relative;
  z-index: 2;
}


/* =========================
   页面顶部
========================= */

.page-header {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: start;

  width: 100%;
  margin-bottom: clamp(38px, 7vh, 78px);
}


/* 返回主目录 */
.back-link {
  justify-self: start;

  padding: 8px 0;

  color: rgba(17, 56, 91, 0.76);
  text-decoration: none;

  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;

  transition:
    color 0.35s ease,
    transform 0.35s ease;
}

.back-link:hover {
  color: #062f59;
  transform: translateX(-4px);
}


/* 页面中央标题 */
.page-heading {
  justify-self: center;
  text-align: center;
}

.site-name {
  margin: 0 0 14px;

  color: rgba(18, 56, 90, 0.53);

  font-size: 0.72rem;
  letter-spacing: 0.35em;
}

.page-heading h1 {
  margin: 0;

  color: #123f68;

  font-size: clamp(3.2rem, 5.8vw, 6rem);
  font-weight: 500;
  line-height: 1;

  letter-spacing: 0.22em;
  text-indent: 0.22em;

  text-shadow:
    0 2px 10px rgba(21, 56, 86, 0.08);
}

.page-description {
  margin: 17px 0 0;

  color: rgba(18, 56, 90, 0.6);

  font-size: 0.78rem;
  letter-spacing: 0.25em;
}


/* =========================
   五项学习目录
========================= */

.study-menu {
  align-self: center;

  width: min(900px, 80vw);
  margin: auto 0;
}


/* 每一个目录项目 */
.study-item {
  display: grid;
  grid-template-columns: 105px 1fr 55px;
  align-items: center;

  min-height: clamp(92px, 11vh, 122px);

  border-top: 1px solid rgba(19, 59, 94, 0.27);

  color: #123f68;
  text-decoration: none;

  transition:
    padding-left 0.45s ease,
    padding-right 0.45s ease,
    background-color 0.45s ease,
    color 0.45s ease;
}

.study-item:last-child {
  border-bottom: 1px solid rgba(19, 59, 94, 0.27);
}

.study-item:hover {
  padding-left: 18px;
  padding-right: 10px;

  color: #062e57;
  background-color: rgba(255, 255, 255, 0.18);
}


/* 01—05 */
.item-number {
  font-family:
    Arial,
    Helvetica,
    sans-serif;

  color: rgba(14, 51, 85, 0.73);

  font-size: clamp(1.05rem, 1.4vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.12em;
}


/* 日语标题与中文说明 */
.item-text {
  display: flex;
  align-items: baseline;
  gap: clamp(20px, 3vw, 48px);
}


/* 日语主标题 */
.item-title {
  min-width: 270px;

  font-size: clamp(1.8rem, 3.2vw, 3.15rem);
  font-weight: 400;
  line-height: 1.2;

  letter-spacing: 0.15em;
}


/* 中文小字 */
.item-translation {
  color: rgba(18, 55, 88, 0.58);

  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    sans-serif;

  font-size: clamp(0.75rem, 1vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.18em;
}


/* 右侧箭头 */
.item-arrow {
  justify-self: end;

  color: rgba(17, 55, 89, 0.48);

  font-family:
    Arial,
    sans-serif;

  font-size: 1.3rem;

  transition:
    color 0.35s ease,
    transform 0.35s ease;
}

.study-item:hover .item-arrow {
  color: #062e57;
  transform: translateX(6px);
}


/* =========================
   页面底部
========================= */

.page-footer {
  align-self: center;

  margin-top: clamp(38px, 6vh, 70px);
  text-align: center;
}

.page-footer p {
  margin: 0;

  color: rgba(19, 57, 90, 0.56);

  font-size: 0.77rem;
  letter-spacing: 0.2em;
}

.page-footer .footer-translation {
  margin-top: 8px;

  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    sans-serif;

  font-size: 0.67rem;
  letter-spacing: 0.16em;
  opacity: 0.75;
}


/* =========================
   较窄电脑和平板
========================= */

@media (max-width: 1000px) {
  .page-header {
    grid-template-columns: 120px 1fr 120px;
  }

  .study-menu {
    width: 86vw;
  }

  .study-item {
    grid-template-columns: 82px 1fr 42px;
  }

  .item-title {
    min-width: 220px;
  }
}


/* =========================
   手机适配
========================= */

@media (max-width: 700px) {
  .japanese-page {
    padding:
      24px
      8vw
      32px;

    background-position:
      60% center,
      60% center;
  }

  .japanese-page::before {
    background:
      rgba(247, 244, 236, 0.62);
  }

  .page-header {
    display: block;
    margin-bottom: 42px;
  }

  .back-link {
    display: inline-block;
    margin-bottom: 32px;
  }

  .page-heading h1 {
    font-size: clamp(3rem, 15vw, 4.8rem);
    letter-spacing: 0.15em;
    text-indent: 0.15em;
  }

  .study-menu {
    width: 100%;
  }

  .study-item {
    grid-template-columns: 58px 1fr 26px;
    min-height: 94px;
  }

  .item-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .item-title {
    min-width: 0;

    font-size: clamp(1.45rem, 7vw, 2rem);
    letter-spacing: 0.11em;
  }

  .item-translation {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

  .item-number {
    font-size: 0.92rem;
  }

  .item-arrow {
    font-size: 1rem;
  }

  .page-footer {
    margin-top: 40px;
  }
}