/* 所有页面的基础设置 */
* {
  box-sizing: border-box;
}

@font-face {
  font-family: "Kiki Song";
  src: url("fonts/kiki-song-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  color: rgb(172, 172, 172);
  min-width: 0;
}

body {
  padding: 10px;
}

.element {
  word-break: normal;
  overflow-wrap: normal;
}

.zh-text {
  font-size: 0.8em;
  line-height: 1.6;
  font-family: "Kiki Song", "Songti SC", STSong, SimSun,
    "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", serif;
}

.home-button,
.home-button2,
.home-button3 {
  position: fixed;
  left: 10px;
  margin: 0;
  z-index: 9999;

  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: none;
  font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
  font-size: 1.25rem;
  color: white;
  text-decoration: underline;
}

.home-button {
  top: 50%;
  transform: translateY(-50%);
}

.home-button2 {
  bottom: 5%;

}

.home-button3 {
  top: 5%;
}

button.home-button2 {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;}

.zh-text[hidden] {
  display: none !important;
}

/* layout */
.page-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  height: calc(100dvh - 20px);
  min-height: 0;
  overflow: hidden;
  background-color: #ffffff00;
  grid-template-rows: minmax(0, 1fr);
  position: relative;

}

.page-layout > * {
  min-width: 0;
}

.column {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background-color: #ffffff00;
  padding: 10px 0px 0px 40px;
  overflow-wrap: normal;
  word-break:normal;
  font-size: 1.25rem;
  font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
}

.column:last-child {
  border-right: none;
}

/* home page */
.home-page {
  overflow-x: hidden;
  overflow-y: auto;
}

.home-main {
  min-width: 0;
  color: white;
}

.home-main a {
  color: #ffffff;
}

.home-main p,
.home-main a {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* information page */
.information-page {
  overflow-x: hidden;
  overflow-y: auto;
}

.information-main {
  width: min(900px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 30px 40px 10px;
  font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
  font-size: 1.25rem;
}


.information-post {
  margin-left: 0px;
  margin-bottom: 100px;
}

.information-meta {
  margin-top: -20px;
  font-size: 0.75em;
  color: rgb(120, 120, 120);
}

.information-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.information-post h2,
.information-body {
  font-family:
    Cambria,
    Cochin,
    Georgia,
    "Times New Roman",
    "Kiki Song",
    "Songti SC",
    STSong,
    SimSun,
    "Noto Serif CJK SC",
    "Noto Serif SC",
    "Source Han Serif SC",
    serif;
}

.information-editor {
  margin-top: 10px;
  /* border-top: 1px solid currentColor; */
}

.information-editor form {
  display: grid;
  gap: 12px;
  margin: 10%;
}


.information-editor input,
.information-editor textarea,
.information-editor button {
  width: 100%;
  border: 1px solid currentColor;
  border-radius: 0;
  padding: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.information-editor textarea {
  min-height: 45vh;
  resize: vertical;
}

.information-login {
  color: #ffffff;
}
/* .information-editor button {
  width: max-content;
  cursor: pointer;
} */

@media (max-width: 1000px) {
  .information-main {
    padding: 15px 20px 60px 60px;
    font-size: 1.25rem;
  }

  .information-header {
    display: block;
  }

  .information-login {
    display: inline-block;
    margin-top: 20px;
  }
}


/* archive page */

.title-2{
  margin-bottom: 200px;
  color: rgb(224, 224, 224);
  background-color: #ffffff00;

}

.project {
  display: flow-root;
  margin-bottom: 100px;
}

.content {
  flex: 1;
  height: auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.content::-webkit-scrollbar {
  display: none;
}

.archive-content1{
    grid-column: 1 / span 1;
    grid-row: 1;
    background: transparent;
}

.archive-content2{
    grid-column: 2 / span 1;
    grid-row: 1;
    background: transparent;
}

.archive-content3{
    grid-column: 3 / span 1;
    grid-row: 1;
    background: transparent;

}

.archive-content4{
    grid-column: 4 / span 1;
    grid-row: 1;
    background: transparent;
}

.archive-content-full{
    grid-column: 2 / span 3;
    grid-row: 1;
    min-height: 0;
    padding: 0;
    }

.archive-content-full .content {
  height: 100%;
  overflow-y: auto;
}

.archive-content img[src] {
  float: right;
  height: auto;
  shape-image-threshold: 0.1;
  shape-margin: 0px;
  margin-right: 0px;
  margin-top: 10px;
  margin-bottom: 0px;
}

.project-link{
  color: rgb(224, 224, 224);
  font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}

/* project page */

.project-images {
  display: grid;
  /* grid-template-columns: repeat(4, minmax(0, 1fr)); */
  grid-column: 2 span 3;
  min-height:100%;
  gap: 5px;
}

.project-images img {
  width: 100%;
  height: auto;
  display: block;
}

  .project-cover {
    display: block;
    float: none;
    width: 50%;
    height: auto;
    margin-bottom: 20px;
  }

.archive-content1 p,
.archive-content2 p,
.archive-content3 p,
.archive-content4 p {
  background: rgb(0 0 0 / 35%);
}

/* 宽屏时让分组容器不影响原来的四栏布局 */
.column-group {
  display: contents;
}

/* 项目页分成信息行和图片行 */
body:not(.page) .page-layout {
  grid-template-rows: auto minmax(0, 1fr);
}

/* 上方四栏信息 */
body:not(.page) .archive-content1,
body:not(.page) .archive-content2,
body:not(.page) .archive-content3,
body:not(.page) .archive-content4 {
  grid-row: 1;
  height: auto;
  z-index: auto;
  pointer-events: auto;
}

/* 下方图片区域 */
body:not(.page) .archive-content-full {
  grid-column: 2 / span 3;
  grid-row: 2;
  height: auto;
  min-height: 0;
  padding: 0;
  z-index: auto;
}

/* 图片独立滚动 */
body:not(.page) .archive-content-full .content {
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}


/* 窄窗口：1+2 为左列，3+4 为右列，两列分别滚动 */
@media (min-width: 800px) and (max-width: 1200px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .page-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: calc(100dvh - 20px);
    min-height: 0;
    overflow: hidden;
    left: 20px;
  }

  .column-group {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .column-group::-webkit-scrollbar {
    display: none;
  }

  .column-group-left {
    grid-column: 1;
  }

  .column-group-right {
    grid-column: 2;
  }

  .column {
    display: block;
    height: auto;
    min-height: auto;
    flex: none;
    padding: 10px;
  }

  .title-2 {
    flex: none;
    margin-bottom: 200px;
    top: 10px;
  }

  .project{
    margin-bottom: 100px;

  }

  .project img {
    width: 50% !important;
    height:auto !important;
  }
  
  .content {
    flex: none;
    height: auto;
    overflow: visible;
  }

  .archive-content-full {
    grid-column: 1 / -1;
  }
}


/* 手机：一列，内容依次向下排列 */
@media (max-width: 1000px) {
  html,
  body {
    width: 100%;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0px;
  }

  .page-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: auto;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .column-group {
    display: contents;
  }

  .archive-content1,
  .archive-content2,
  .archive-content3,
  .archive-content4,
  .archive-content-full,
  .home-content {
    grid-column: 1;
    grid-row: auto;
    position: static;
    z-index: auto;
    width: auto;
  }

  .column {
    height: auto;
    min-height: 0;
    padding-top: 5px;
    padding-left: 40px;
    padding-right: 0px;
    padding-bottom: 20px;
  }

  .title-2 {
    margin-bottom: 200px;
  }

  .project {
    margin-bottom: 100px;
  }

  .project img {
    width: 90% !important;
    height:auto !important;
  }

  .project-images {
    grid-template-columns: 1fr;
  }

  .project-images img {
    grid-column: 1;
  }

  .content {
    flex: none;
    height: auto;
    overflow: visible;
  }
}

/* 桌面项目页：图片在文字后面滚动 */
@media (min-width: 801px) {
  body:not(.page) .page-layout {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    height: calc(100dvh - 20px);
    overflow: hidden;
  }

  /* 信息层 */
  body:not(.page) .archive-content1,
  body:not(.page) .archive-content2,
  body:not(.page) .archive-content3,
  body:not(.page) .archive-content4 {
    grid-row: 1;
    z-index: 2;
    background: transparent;
    pointer-events: none;
  }

  /* 链接仍然可以点击 */
  body:not(.page) .archive-content1 a,
  body:not(.page) .archive-content2 a,
  body:not(.page) .archive-content3 a,
  body:not(.page) .archive-content4 a {
    pointer-events: auto;
  }

  /* 去掉文字背后的半透明黑块 */
  body:not(.page) .archive-content1 p,
  body:not(.page) .archive-content2 p,
  body:not(.page) .archive-content3 p,
  body:not(.page) .archive-content4 p {
    background: transparent;
  }

  /* 图片层，与信息层处于同一行 */
  body:not(.page) .archive-content-full {
    display: flex;
    flex-direction: column;
    grid-column: 2 / span 3;
    grid-row: 1;
    height: 100%;
    min-height: 0;
    padding-top: 40px;
    padding-bottom: 0px;
    padding-right: 40px;
    padding-left: 40px;

    z-index: 1;
  }

  /* 图片层独立滚动 */
  body:not(.page) .archive-content-full .content {
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* project page */
@media (max-width: 1000px) {
  body:not(.page) {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body:not(.page) .page-layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: auto;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  body:not(.page) .archive-content1,
  body:not(.page) .archive-content2,
  body:not(.page) .archive-content3,
  body:not(.page) .archive-content4,
  body:not(.page) .archive-content-full {
    grid-column: 1 / -1;
    grid-row: auto;
    position: static;
    width: auto;
    height: auto;
    min-height: 0;
    z-index: auto;
    pointer-events: auto;
  }

@media (max-width: 1000px) {
  body:not(.page) .archive-content2 p{
    margin-top: -80px;
    margin-bottom: -80px;
  }
    body:not(.page) .archive-content4 p{
    margin-top: -100px;
    margin-bottom: -80px;
    text-align: left ! important; 
  }
}

@media (max-width: 1000px) {
  .project-cover {
    display: block;
    float: none;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
  }
}

  body:not(.page) .archive-content-full {
    display: block;
    padding-top: 40px;
    padding-left: 0px;
    padding-right: 0px;
    padding-bottom: 40px;
  }

  body:not(.page) .archive-content-full .content {
    display: block;
    height: auto;
    overflow: visible;
    margin-top: 0;

  }

  body:not(.page) .project-images {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  body:not(.page) .project-images img {
    grid-column: 1 / -1;
    width: 100%;
    height: auto;
  }
}
