@font-face {
  font-family: Zhaohua;
  src: url("../fonts/hgx314zt77rT4VM7jffeaVGmA.ttf");
}

@font-face {
  font-family: Qiji;
  src: url("../fonts/cRlCeCBTN82rySwblecgchyzq4I.ttf");
}

@font-face {
  font-family: SourceHan;
  src: url("../fonts/hief7Umr6mqzKUO37He3NcwPo14.otf");
}

@font-face {
  font-family: ZhaohuaBlack;
  src: url("../fonts/bCyQLokiGPVnKHEkWTZmq7hLc.ttf");
}

:root {
  --browser-bg: #eee;
  --page-bg: #fff;

  --banner-bg: #b3c9ad;
  --banner-text: #fff;
  --banner-start: #afc5a8;
  --banner-middle: #b9cfb2;
  --banner-end: #afc5a8;
  --mobile-menu-bg: rgba(179, 201, 173, .98);

  --page-glow: rgba(179, 201, 173, .14);

  --profile-bg: #f0f1e8;
  --facts-bg: #f4f5f1;

  --card-bg: #fff;
  --card-translucent-bg: rgba(255, 255, 255, .78);
  --card-soft-bg: rgba(246, 248, 243, .78);

  --intro-text: #364024;

  --field-top: #b3bfa4;
  --field-bottom: #dde3d5;

  --ink: #565b54;
  --green: #718a45;
  --deep: #33451f;
  --field: #b7c8ad;
  --line: #d7d9d2;

  --owner-color: #859b68;
  --relation-name: #869e61;
  --relation-arrow: #91a77c;
  --relation-line: rgba(113, 138, 69, .16);
  --relation-hover: rgba(179, 201, 173, .20);
  --relation-focus: rgba(113, 138, 69, .28);

  --banner-border: rgba(77, 94, 70, .32);
  --banner-shadow: rgba(56, 77, 44, .12);
  --soft-border: rgba(113, 138, 69, .08);
  --profile-shadow: rgba(52, 69, 40, .10);
  --facts-shadow: rgba(69, 83, 59, .045);
  --panel-shadow: rgba(52, 69, 40, .12);
  --portrait-shadow: rgba(55, 72, 44, .10);
  --card-shadow: rgba(66, 82, 55, .055);
  --menu-border: rgba(77, 94, 70, .20);
  --menu-shadow: rgba(49, 66, 39, .12);

  --portrait-position: -150% 40px;
  --portrait-scale: 2.1;
  --portrait-origin: 50% 12%;
  --portrait-position-tablet: -20% 40px;
  --portrait-scale-tablet: 2.1;
  --portrait-origin-tablet: 50% 12%;

  --serif: SourceHan, "Songti SC", serif;
  --display: Qiji, Zhaohua, "STKaiti", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--browser-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;

  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;

  background:
    radial-gradient(
      circle at 78% 18%,
      var(--page-glow),
      transparent 30%
    ),
    var(--page-bg);
}

/* =========================
   顶部导航
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;

  display: flex;
  align-items: center;

  height: 62px;
  padding: 0 102px;

  color: var(--banner-text);
  background: linear-gradient(
    90deg,
    var(--banner-start) 0%,
    var(--banner-middle) 55%,
    var(--banner-end) 100%
  );

  border-bottom: 1px solid var(--banner-border);
  box-shadow: 0 4px 18px var(--banner-shadow);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 48px;

  height: 100%;
  margin-right: auto;
}

.site-nav a {
  position: relative;

  padding: 0;

  color: var(--banner-text);
  opacity: 1;

  font-family: Zhaohua, var(--serif);
  font-size: 22px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;

  transform-origin: center;
  transition:
    transform .2s ease,
    opacity .2s ease;
}

.site-nav a::after {
  display: none;
}

.site-nav a:hover {
  color: var(--banner-text);
  background: transparent;
  opacity: .76;

  text-shadow: none;
  transform: scale(1.08);
}

.menu-toggle {
  display: none;
}

/* 用户中心图标 */

.account {
  position: relative;

  display: block;
  flex: 0 0 40px;

  width: 40px;
  height: 40px;

  border: 0;
  background: transparent;
  color: transparent;

  font-size: 0;
  text-decoration: none;

  cursor: pointer;

  transition:
    transform .2s ease,
    opacity .2s ease;
}

.account::before,
.account::after {
  content: "";

  position: absolute;
  left: 50%;

  border: 3px solid var(--banner-text);

  transform: translateX(-50%);
}

.account::before {
  top: 4px;

  width: 10px;
  height: 10px;

  border-radius: 50%;
}

.account::after {
  bottom: 4px;

  width: 24px;
  height: 12px;

  border-radius: 18px 18px 4px 4px;
}

.account:hover,
.account:focus-visible {
  opacity: .76;
  transform: scale(1.08);
}

.account:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .7);
  outline-offset: 4px;
  border-radius: 50%;
}

/* =========================
   页面总体布局
   ========================= */

.page-shell {
  display: grid;
  grid-template-columns: 445px minmax(0, 1fr);
  align-items: start;

  width: 1497px;
  max-width: calc(100% - 118px);

  margin: 52px auto 0;
  margin-bottom: -58px;

  transform: scale(.92);
  transform-origin: top center;
}

/* =========================
   左侧人物卡片
   ========================= */

.profile-card {
  position: relative;

  height: 730px;
  padding: 22px 43px;

  background: var(--profile-bg);

  border: 1px solid var(--soft-border);
  border-radius: 22px;

  box-shadow: 0 18px 45px var(--profile-shadow);
}

.profile-card::before {
  display: none;
}

.avatar-wrap {
  width: 230px;
  height: 230px;

  margin: 0 auto 12px;

  overflow: hidden;

  background: transparent;
  border: 0;
  border-radius: 50%;

  box-shadow: none;
}

.avatar-wrap img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.eyebrow {
  display: none;
}

.profile-card h1 {
  margin: 0 0 12px;

  color: var(--deep);

  font: 40px / 1.15 var(--display);
  font-weight: 400;
  text-align: center;
}

/* 人物资料 */

.facts {
  margin: 0;
  padding: 24px 48px;

  background: var(--facts-bg);

  border: 1px solid var(--soft-border);

  box-shadow: 0 8px 24px var(--facts-shadow);
}

.facts > div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;

  height: 47px;

  border-bottom: 1px solid var(--line);
}

.facts > div::before {
  display: none;
}

.facts dt {
  padding: 0;
  color: #646862;
}

.facts dd {
  margin: 0;

  color: var(--green);
  text-align: right;
}

/* owner */

.owner-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  color: var(--owner-color);
  text-decoration: none;

  cursor: pointer;
  transform-origin: center;

  transition:
    transform .2s ease,
    opacity .2s ease;
}

.owner-dot:hover,
.owner-dot:focus-visible {
  opacity: .76;
  transform: scale(1.08);
}

.owner-dot::before {
  display: none;
}

.owner-dot svg {
  width: 20px;
  height: 20px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================
   右侧人物区域
   ========================= */

.character-panel {
  position: relative;

  display: grid;
  grid-template-columns: minmax(0, 590px) 329px;
  grid-template-rows: 550px;
  align-content: center;
  column-gap: 32px;

  height: 650px;
  margin-top: 40px;
  padding: 0 38px 0 42px;

  background: linear-gradient(
    to bottom,
    var(--field-top) 0%,
    var(--field-bottom) 100%
  );

  box-shadow: 0 20px 50px var(--panel-shadow);
}

.content-area {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 57px 151px 57px 225px;
  gap: 20px;

  padding: 0;

  background: transparent;
}

/* 通用纸张卡片 */

.paper-card {
  padding: 0 29px;

  background: var(--card-translucent-bg);
  border-radius: 12px;
}

.paper-card header {
  display: flex;
  align-items: center;

  height: 57px;
  margin: 0;
}

.paper-card header span {
  display: none;
}

.paper-card h2 {
  margin: 0;

  color: var(--green);

  font-family: Zhaohua, var(--serif);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: .08em;
}

/* 标题图标 */

.title-icon {
  width: 22px;
  height: 22px;
  margin-left: auto;

  fill: none;
  stroke: var(--green);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-icon .icon-fill {
  fill: var(--green);
  stroke: none;
}

/* =========================
   人物简介
   ========================= */

.intro {
  display: contents;
}

.intro header {
  grid-row: 1;

  padding: 0 29px;

  background: var(--card-bg);
  border-radius: 12px;
}

.intro p {
  grid-row: 2;

  display: flex;
  align-items: center;

  margin: 0;
  padding: 18px 28px;

  overflow: hidden;

  color: var(--intro-text);
  background: var(--card-soft-bg);

  border-radius: 12px;

  font-family: Qiji, var(--serif);
  font-size: 23px;
  font-weight: 400;
  font-synthesis: none;

  line-height: 1.6;
  letter-spacing: -.04em;

  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.intro p strong {
  font-weight: inherit;
}

.intro p > span {
  max-height: 100%;
  padding-right: 6px;

  overflow-x: hidden;
  overflow-y: auto;

  overscroll-behavior: contain;
}

/* =========================
   人物关系
   ========================= */

.relations {
  display: contents;
}

.relations header {
  grid-row: 3;

  padding: 0 29px;

  background: var(--card-bg);
  border-radius: 12px;
}

.relation-grid {
  grid-row: 4;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 15px 25px;

  background: var(--card-soft-bg);
  border-radius: 12px;
}

.relation-grid a {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 46px;
  padding: 0 26px 0 8px;

  border: 0;
  border-bottom: 1px solid var(--relation-line);
  border-radius: 0;

  cursor: pointer;
  outline: none;
  color: inherit;
  text-decoration: none;

  transition:
    color .18s ease,
    background-color .18s ease,
    padding .18s ease;
}

.relation-grid b {
  color: var(--relation-name);
  font-weight: 400;
}

.relation-grid small {
  color: #60635e;
  font-size: 15px;
}

.relation-grid a::after {
  content: "›";

  position: absolute;
  right: 9px;

  color: var(--relation-arrow);
  opacity: 0;

  transform: translateX(-4px);

  transition:
    opacity .18s ease,
    transform .18s ease;
}

.relation-grid a:hover,
.relation-grid a:focus-visible {
  padding-left: 14px;

  background: var(--relation-hover);
}

.relation-grid a:hover::after,
.relation-grid a:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

.relation-grid a:focus-visible {
  box-shadow: 0 0 0 2px var(--relation-focus);
}

/* =========================
   立绘
   ========================= */

.portrait-area {
  position: relative;

  grid-column: 2;
  grid-row: 1;

  height: 550px;

  overflow: hidden;

  background: var(--card-bg);

  border: 0;
  border-radius: 11px;

  box-shadow: 0 10px 24px var(--portrait-shadow);
}

.portrait {
  position: absolute;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: var(--portrait-position);

  filter: saturate(.94) contrast(1.015);

  transform: scale(var(--portrait-scale));
  transform-origin: var(--portrait-origin);
}

/* 底部英文 */

.panel-footer {
  position: absolute;
  right: 0;
  bottom: -42px;
  left: 0;

  display: flex;
  align-items: center;
  justify-content: flex-end;

  width: auto;
  height: 34px;
  padding: 0;

  color: var(--green);

  font: 14px Georgia, serif;
}

.panel-footer span {
  padding-right: 8px;
}

.panel-footer i {
  display: none;
}

/* 卡片阴影 */

.paper-card,
.intro header,
.intro p,
.relations header,
.relation-grid {
  border: 0;
  box-shadow: 0 7px 18px var(--card-shadow);
}

/* 减少动画偏好 */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* =========================
   iPad / 平板
   ========================= */

@media (max-width: 1250px) {
  body {
    margin: 0;
  }

  .site-header {
    padding: 0 42px;
  }

  .site-nav {
    gap: 28px;
  }

  .page-shell {
    grid-template-columns: 340px 1fr;

    max-width: calc(100% - 48px);

    margin-bottom: 0;
    padding-bottom: 64px;

    transform: none;
  }

  .profile-card {
    padding: 22px 28px;
  }

  .facts {
    padding: 24px 30px;
  }

  .character-panel {
    grid-template-columns: minmax(0, 1fr) 270px;
    column-gap: 24px;

    padding-right: 28px;
    padding-left: 28px;
  }

  .portrait {
    object-position: var(--portrait-position-tablet);
    transform: scale(var(--portrait-scale-tablet));
    transform-origin: var(--portrait-origin-tablet);
  }
}

/* =========================
   手机 / 窄屏
   ========================= */

@media (max-width: 900px) {
  .site-header {
    height: 62px;
    min-height: 62px;
    padding: 0 20px;

    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .site-nav {
    position: absolute;
    top: 62px;
    right: 0;
    left: 0;

    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;

    width: 100%;
    height: auto;
    padding: 10px 20px 16px;

    overflow: hidden;

    background: var(--mobile-menu-bg);

    border-bottom: 1px solid var(--menu-border);

    box-shadow: 0 12px 24px var(--menu-shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 12px 24px;

    font-size: 20px;
    text-align: left;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;

    width: 40px;
    height: 40px;
    padding: 9px 7px;

    border: 0;
    background: transparent;

    cursor: pointer;
  }

  .menu-toggle span {
    display: block;

    width: 100%;
    height: 2px;

    background: var(--banner-text);
    border-radius: 2px;

    transform-origin: center;

    transition:
      transform .2s ease,
      opacity .2s ease;
  }

  .menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .page-shell {
    display: flex;
    flex-direction: column;

    width: min(620px, 100% - 24px);
    max-width: none;

    margin-top: 24px;
  }

  .profile-card {
    order: 1;

    width: 100%;
    height: auto;

    border-radius: 18px;
  }

  .facts {
    max-width: 420px;
    margin: auto;
  }

  .character-panel {
    order: 2;

    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    align-content: start;
    gap: 0;

    width: 100%;
    height: auto;

    margin: 18px 0 0;
    padding: 18px;
  }

  .portrait-area {
    display: none;
  }

  .portrait {
    object-fit: contain;
    transform: none;
  }

  .content-area {
    grid-column: 1;
    grid-row: 1;

    grid-template-rows: 61px auto 61px auto;
  }

  .panel-footer {
    display: none;
  }

  .intro p {
    min-height: 150px;
  }

  .relation-grid {
    min-height: 230px;
  }
}

/* =========================
   小尺寸手机
   ========================= */

@media (max-width: 480px) {
  .site-nav a {
    padding-inline: 12px;
    font-size: 18px;
  }

  .account {
    display: none;
  }

  .page-shell {
    width: 100%;
  }

  .character-panel,
  .profile-card {
    border-radius: 0;
  }

  .profile-card {
    padding-inline: 20px;
  }

  .facts {
    padding: 25px;
  }

  .character-panel {
    padding: 12px;
  }

  .paper-card h2 {
    font-size: 23px;
  }

  .intro p {
    padding: 24px 22px;
  }

  .relation-grid {
    padding: 18px 22px;
  }
}
