:root {
  --text: #555;
  --text-strong: #333;
  --line: #686868;
  --soft: #ececec;
  --soft-2: #f7f7f7;
  --paper: #fbfbfa;
  --card: #fff;
  --link: #4f4f4f;
  --link-hover: #111;
  --accent: #6f7a62;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  background: var(--paper);
  color: var(--text);
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.45;
  margin: 0;
  overflow-x: hidden;
  padding: 34px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

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

.page {
  background: var(--card);
  border: 1px solid #dedede;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 980px;
  padding: 28px 30px 18px;
}

.masthead {
  display: block;
}

.masthead h1 {
  color: var(--text-strong);
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.masthead h1 a {
  color: inherit;
}

.masthead h1 a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.rule {
  background: linear-gradient(90deg, #4f4f4f 0 42px, #8b9481 42px 92px, var(--line) 92px 100%);
  height: 12px;
  margin-bottom: 0;
  width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
  margin-top: 18px;
}

.sidebar {
  background: #e9ebe6;
  border-left: 7px solid #cfd4c7;
  min-height: 520px;
  padding: 28px 18px 20px;
}

.sidebar a {
  color: var(--text-strong);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 13px;
  overflow-wrap: anywhere;
  padding: 3px 0;
}

.content {
  padding: 0;
}

.welcome {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
  text-align: right;
}

h2,
h3 {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.25;
  margin: 0;
}

h2 {
  background: var(--soft);
  border-left: 5px solid var(--accent);
  color: var(--text-strong);
  font-weight: 700;
  margin-bottom: 18px;
  padding: 7px 12px;
  text-align: center;
}

.books {
  display: grid;
  gap: 26px 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.book {
  display: flex;
  flex-direction: column;
  min-height: 332px;
}

.book h3 {
  align-items: center;
  background: #eef0eb;
  border-top: 0;
  display: flex;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 9px 10px;
  text-align: center;
}

.book-body {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 140px;
  padding: 16px 14px 10px;
  flex: 1;
}

.book p {
  font-size: 15px;
  margin: 0;
  overflow-wrap: anywhere;
}

.book strong {
  color: var(--accent);
  font-weight: 400;
}

.cover {
  align-items: start;
  display: flex;
  justify-content: center;
}

.cover img {
  height: auto;
  max-height: 205px;
  object-fit: contain;
  width: auto;
}

.more {
  align-self: flex-start;
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px 14px;
  padding: 0;
}

.home-column .more {
  margin-left: 0;
}

.home-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}

.home-column h3 {
  background: #eef0eb;
  display: inline-block;
  margin-bottom: 12px;
  min-height: 0;
  padding: 7px 10px;
}

.home-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.home-list li {
  border-bottom: 1px solid #ecefe7;
  list-style: none;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.home-list li:last-child {
  margin-bottom: 0;
}

.loading-item {
  border-bottom: 0;
  color: #666;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  padding-bottom: 0;
}

.home-list a,
.home-list span {
  font-family: Arial, Helvetica, sans-serif;
}

.home-list a {
  display: block;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.home-list span {
  color: #666;
  display: block;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.home-list em {
  color: #6a6a6a;
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.home-book-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.home-book-list li {
  align-items: start;
  border-bottom: 1px solid #ecefe7;
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr);
  list-style: none;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.home-book-list a,
.home-book-list span {
  font-family: Arial, Helvetica, sans-serif;
}

.home-book-list a {
  display: block;
  margin-bottom: 4px;
}

.home-book-list span {
  color: #666;
  display: block;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.home-thumb {
  margin-bottom: 0 !important;
}

.home-thumb img {
  height: 62px;
  object-fit: cover;
  width: 44px;
}

.footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 10px;
}

.footer p {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

.about-layout {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.about-main {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  max-width: none;
}

.about-main p {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.about-main .signature {
  color: var(--text-strong);
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  margin-top: 30px;
}

.about-aside {
  display: grid;
  align-content: start;
  gap: 14px;
}

.portrait {
  margin: 0;
  text-align: center;
  width: 100%;
}

.portrait img {
  margin: 0 auto;
  width: 112px;
}

.info-note {
  background: #f3f4f1;
  border-left: 4px solid #cfd4c7;
  padding: 12px 14px;
  width: 100%;
}

.info-note-intro {
  margin-top: 0;
}

.info-note p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
}

.info-note-link {
  text-align: center;
}

.info-note-link p {
  margin-bottom: 12px;
  text-align: left;
}

.info-note-link a {
  display: inline-flex;
  justify-content: center;
}

.info-note-link img {
  height: auto;
  width: 44px;
}

.papers-layout {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.papers-main {
  min-width: 0;
}

.papers-aside {
  display: grid;
  align-content: start;
  gap: 14px;
}

.legacy-papers-content {
  color: #666;
}

.legacy-papers-content p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.58;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.legacy-papers-content hr {
  border: 0;
  border-top: 1px solid #d6d9d1;
  margin: 28px 0;
}

.legacy-papers-content h3 {
  background: #eef0eb;
  color: var(--text-strong);
  display: inline-block;
  font-size: 15px;
  line-height: 1.25;
  margin: 26px 0 14px;
  min-height: 0;
  padding: 7px 10px;
}

.legacy-papers-content a {
  color: var(--link);
}

.papers-block {
  margin-bottom: 28px;
}

.papers-block h3 {
  background: #eef0eb;
  display: inline-block;
  margin-bottom: 14px;
  min-height: 0;
  padding: 7px 10px;
}

.paper-entry {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.62;
  margin: 0 0 10px;
}

.paper-no {
  color: var(--text-strong);
  display: inline-block;
  font-weight: 700;
  min-width: 40px;
}

.section-head-inline {
  align-items: flex-start;
  display: flex;
  gap: 12px;
}

.section-head-inline h2 {
  flex: 1;
}

.language-switch img {
  display: block;
  height: 19px;
  margin-top: 6px;
  width: 21px;
}

.research-layout {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.research-main {
  min-width: 0;
}

.research-block {
  margin-bottom: 28px;
}

.research-block h3 {
  background: #eef0eb;
  display: inline-block;
  margin-bottom: 14px;
  min-height: 0;
  padding: 7px 10px;
}

.research-list,
.research-note {
  font-family: Arial, Helvetica, sans-serif;
}

.research-list {
  color: #666;
  margin: 0;
  padding-left: 22px;
}

.research-list li {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.research-note {
  color: #666;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.links-only li {
  margin-bottom: 8px;
}

.research-aside {
  display: grid;
  align-content: start;
  gap: 14px;
}

.references-layout {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.references-main {
  min-width: 0;
}

.references-intro,
.reference-card p {
  font-family: Arial, Helvetica, sans-serif;
}

.references-intro {
  color: #666;
  margin-bottom: 22px;
}

.references-intro p {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.reference-card {
  margin-bottom: 24px;
}

.reference-card h3 {
  background: #eef0eb;
  display: inline-block;
  margin-bottom: 12px;
  min-height: 0;
  padding: 7px 10px;
}

.reference-card p {
  color: #666;
  line-height: 1.6;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.references-aside {
  display: grid;
  align-content: start;
  gap: 14px;
}

.reading-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reading-card {
  border-top: 1px solid #d6d9d1;
  padding-top: 16px;
}

.reading-card:nth-child(-n + 2) {
  border-top: 0;
  padding-top: 0;
}

.reading-card h3 {
  background: #eef0eb;
  display: inline-block;
  margin: 0 0 12px;
  min-height: 0;
  padding: 7px 10px;
}

.reading-card a {
  display: block;
}

.reading-card img {
  display: block;
  height: auto;
  margin-bottom: 12px;
  max-width: 210px;
  width: 100%;
}

.reading-card p,
.link-catalog a {
  font-family: Arial, Helvetica, sans-serif;
}

.reading-card p {
  color: #666;
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
}

.link-catalog {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-catalog li {
  border-top: 1px solid #d6d9d1;
  padding: 12px 0;
}

.link-catalog li:first-child {
  border-top: 0;
  padding-top: 0;
}

.link-catalog a {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.book-detail-layout {
  display: grid;
  gap: 26px;
  grid-template-columns: 220px minmax(0, 1fr);
}

.book-detail-cover img {
  height: auto;
  max-height: 340px;
  object-fit: contain;
  width: 100%;
}

.book-detail-main {
  min-width: 0;
}

.book-detail-main p,
.book-detail-meta,
.book-detail-links {
  font-family: Arial, Helvetica, sans-serif;
}

.book-detail-main p {
  color: #666;
  line-height: 1.62;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.book-detail-meta {
  color: #666;
  margin: 0 0 16px;
}

.book-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 18px;
}

.book-detail-links a {
  font-size: 13px;
  font-weight: 700;
}

.page-nav-button,
.back-to-top {
  background: rgba(233, 235, 230, 0.96);
  border: 1px solid #cfd4c7;
  border-radius: 6px;
  bottom: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  color: var(--text-strong);
  cursor: pointer;
  display: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  position: fixed;
  z-index: 30;
}

.page-nav-button {
  display: inline-flex;
  left: 18px;
  text-decoration: none;
}

.back-to-top.is-visible {
  display: inline-flex;
  right: 18px;
}

@media (max-width: 820px) {
  body {
    padding: 12px;
  }

  .page {
    padding: 18px 20px 14px;
  }

  .layout {
    gap: 16px;
    grid-template-columns: 145px minmax(0, 1fr);
  }

  .sidebar {
    display: block;
    min-height: 0;
    padding: 18px 14px 12px;
  }

  .sidebar a {
    display: block;
    font-size: 13px;
    margin: 0 0 11px;
  }

  .welcome {
    margin-bottom: 12px;
  }

  .book-detail-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
    padding: 6px;
  }

  .page {
    box-shadow: none;
    padding: 12px 12px 10px;
  }

  .masthead h1 {
    font-size: 18px;
  }

  .rule {
    height: 8px;
  }

  .layout {
    gap: 12px;
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .sidebar {
    border-left-width: 5px;
    min-height: 0;
    padding: 14px 10px 10px;
  }

  .sidebar a {
    font-size: 11px;
    margin-bottom: 9px;
  }

  h2,
  h3 {
    font-size: 13px;
  }

  h2 {
    margin-bottom: 14px;
    padding: 6px 10px;
  }

  .welcome {
    font-size: 12px;
  }

  .home-grid {
    gap: 14px;
  }

  .home-column h3,
  .research-block h3,
  .papers-block h3,
  .reference-card h3,
  .legacy-papers-content h3,
  .reading-card h3 {
    font-size: 13px;
    padding: 6px 8px;
  }

  .home-list a,
  .home-list span,
  .home-list em,
  .home-book-list a,
  .home-book-list span,
  .about-main,
  .legacy-papers-content p,
  .research-list,
  .research-note,
  .references-intro,
  .reference-card p,
  .info-note p,
  .reading-card p,
  .link-catalog a {
    font-size: 12px;
  }

  .home-thumb img {
    height: 48px;
    width: 34px;
  }

  .book-body {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 86px;
    padding: 12px 10px 8px;
  }

  .cover img {
    max-height: 140px;
    width: auto;
  }

  .about-layout {
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 160px;
  }

  .papers-layout,
  .research-layout,
  .references-layout {
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 160px;
  }

  .reading-grid {
    gap: 14px;
  }

  .book-detail-layout {
    gap: 16px;
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .info-note {
    margin-bottom: 10px;
    padding: 10px 10px;
  }

  .language-switch img {
    height: 16px;
    margin-top: 4px;
    width: 18px;
  }
}

@media (max-width: 430px) {
  body {
    padding: 2px;
  }

  .page {
    padding: 10px 8px 8px;
  }

  .masthead h1 {
    font-size: 15px;
  }

  .layout {
    gap: 10px;
    grid-template-columns: 94px minmax(0, 1fr);
  }

  .sidebar a {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .sidebar {
    min-height: 0;
  }

  .home-grid {
    gap: 10px;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-list a,
  .home-list span,
  .home-list em,
  .home-book-list a,
  .home-book-list span,
  .about-main,
  .legacy-papers-content p,
  .research-list,
  .research-note,
  .references-intro,
  .reference-card p,
  .info-note p,
  .reading-card p,
  .link-catalog a {
    font-size: 11px;
    line-height: 1.45;
  }

  .reading-grid {
    grid-template-columns: 1fr;
  }

  .reading-card {
    padding-top: 14px;
  }

  .reading-card:nth-child(2) {
    border-top: 1px solid #d6d9d1;
    padding-top: 14px;
  }

  .reading-card img {
    max-width: 180px;
  }

  .book-body {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .papers-layout,
  .research-layout,
  .references-layout,
  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-aside,
  .papers-aside,
  .research-aside,
  .references-aside,
  .book-detail-cover {
    margin-top: 8px;
  }

  .cover img {
    max-height: 118px;
  }

  .book-detail-layout {
    grid-template-columns: 1fr;
  }

  .book-detail-cover img {
    max-height: 260px;
    width: 180px;
  }

  .page-nav-button,
  .back-to-top {
    bottom: 76px;
    font-size: 11px;
    padding: 7px 9px;
  }

  .page-nav-button {
    left: 12px;
  }

  .back-to-top {
    right: 12px;
  }
}
