@font-face {
  font-family: 'lixunkejingdianxingshu';
  src: url('font/lixunkejingdianxingshu.eot');
  src: url('font/lixunkejingdianxingshu.eot?#font-spider') format('embedded-opentype'), url('font/lixunkejingdianxingshu.woff2') format('woff2'), url('font/lixunkejingdianxingshu.woff') format('woff'), url('font/lixunkejingdianxingshu.ttf') format('truetype'), url('font/lixunkejingdianxingshu.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}
main {
  position: fixed;
  writing-mode: horizontal-tb;
  display: flex;
  flex-direction: column;
  color: #fff;
  text-align: center;
  font-size: 2.5vh;
  font-weight: bold;
  top: 1em;
  bottom: 40px;
  left: 0;
  right: 380px;
}
@media (max-aspect-ratio: 1/1) {
  main {
    font-size: 2.5vw;
    top: 48px;
    bottom: 420px;
    left: 0;
    right: 0;
  }
}
#name {
  font-family: 'lixunkejingdianxingshu';
  font-weight: normal;
  font-size: 4em;
  color: #fff;
  margin: auto;
  display: block;
  inline-size: 1em;
  text-align: center;
  background-position: center top;
  background-repeat: no-repeat;
}
@media (max-aspect-ratio: 1/1) {
  #name {
    inline-size: auto;
  }
}
#pinyin {
  font-family: Georgia;
}
@media (max-aspect-ratio: 1/1) {
  #pinyin {
    font-size: 1.5em;
  }
}
#RGBcolor,
#CMYKcolor {
  padding-block-start: 1em;
  line-height: 1em;
}
#RGBcolor span,
#CMYKcolor span {
  display: inline-block;
  position: relative;
  padding-inline: 0.3em;
}
#RGBcolor span::before,
#CMYKcolor span::before {
  position: absolute;
  font-size: 0.6em;
  line-height: 1em;
  inset-block-end: 100%;
  inset-inline-start: 0;
}
@media (max-aspect-ratio: 1/1) {
  #RGBcolor,
  #CMYKcolor {
    font-size: 1.5em;
  }
}
#CMYKcolor span:nth-child(1) {
  color: #0093d3;
}
#CMYKcolor span:nth-child(1)::before {
  content: 'C';
}
#CMYKcolor span:nth-child(2) {
  color: #cc006b;
}
#CMYKcolor span:nth-child(2)::before {
  content: 'M';
}
#CMYKcolor span:nth-child(3) {
  color: #fff10c;
}
#CMYKcolor span:nth-child(3)::before {
  content: 'Y';
}
#CMYKcolor span:nth-child(4) {
  color: #000000;
}
#CMYKcolor span:nth-child(4)::before {
  content: 'K';
}
#RGBcolor {
  padding-block-end: 1em;
}
#RGBcolor span {
  padding-inline: 0.1em;
}
#RGBcolor span::after {
  position: absolute;
  font-size: 0.6em;
  line-height: 1em;
  inset-block-start: 100%;
  inset-inline-start: 0;
}
#RGBcolor span:nth-child(1) {
  color: #ff0000;
}
#RGBcolor span:nth-child(1)::before {
  content: 'R';
}
#RGBcolor span:nth-child(1)::after {
  content: attr(data-dec);
}
#RGBcolor span:nth-child(2) {
  color: #00ff00;
}
#RGBcolor span:nth-child(2)::before {
  content: 'G';
}
#RGBcolor span:nth-child(2)::after {
  content: attr(data-dec);
}
#RGBcolor span:nth-child(3) {
  color: #0000ff;
}
#RGBcolor span:nth-child(3)::before {
  content: 'B';
}
#RGBcolor span:nth-child(3)::after {
  content: attr(data-dec);
}
#colors {
  position: relative;
  margin: 0;
  padding: 0;
  padding-block: 8px;
  inline-size: 380px;
  margin-inline-start: auto;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  overflow: auto;
  overflow-wrap: anywhere;
  font-size: 12px;
  box-sizing: border-box;
  gap: 12px;
}
@media (max-aspect-ratio: 1/1) {
  #colors {
    /* footer 留出空间*/
    margin-bottom: 40px ;
  }
}
#colors a {
  position: absolute;
  border-inline-start: 6px solid var(--color);
  box-sizing: border-box;
  color: #FFF;
  inline-size: 380px;
  block-size: 50px;
  background-repeat: no-repeat;
  list-style: none;
  display: grid;
  grid-template-areas: 'name pinyin' 'cmyk rgb-lines' 'cmyk rgb';
  grid-template-columns: 160px 1fr;
  grid-template-rows: 25px 7px 18px;
  transition: background-color 0.15s linear;
  text-decoration: none;
}
#colors a[hidden] {
  display: none;
}
#colors a:hover {
  opacity: 0.3;
  transition-duration: 0.3s;
  transition-property: color, background-color, opacity;
}
#colors .name {
  grid-area: name;
  block-size: 25px;
  opacity: 0.6;
  font-family: 'Microsoft YaHei', '微软雅黑', Helvetica;
  padding-inline-start: 8px;
}
#colors .cmyk {
  grid-area: cmyk;
  block-size: 25px;
  display: flex;
  justify-content: space-evenly;
}
#colors .cmyk > :nth-child(1) {
  color: #0093d3;
}
#colors .cmyk > :nth-child(2) {
  color: #cc006b;
}
#colors .cmyk > :nth-child(3) {
  color: #fff10c;
}
#colors .cmyk > :nth-child(4) {
  color: #000000;
}
#colors .pinyin {
  grid-area: pinyin;
  block-size: 25px;
  font-size: 0.8em;
  line-height: 25px;
  font-family: arial;
  text-transform: uppercase;
}
#colors .rgb-lines {
  grid-area: rgb-lines;
  block-size: 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
#colors .rgb-lines * {
  background: #fff3;
  block-size: 1px;
}
#colors .rgb-lines *::before {
  content: '';
  display: block;
  background: currentColor;
  block-size: 1px;
  inline-size: var(--percents);
}
#colors .rgb-lines > :nth-child(1) {
  color: #FF0000;
}
#colors .rgb-lines > :nth-child(2) {
  color: #00FF00;
}
#colors .rgb-lines > :nth-child(3) {
  color: #0000FF;
}
#colors .rgb {
  block-size: 18px;
  line-height: 18px;
  grid-area: rgb;
  font-size: 0.8em;
  font-family: Helvetica;
  text-transform: uppercase;
}
html,
body,
dl,
dt,
dd {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
}
ul {
  list-style: none;
}
body {
  background-image: url(img/texture.png);
  transition: background-color 0.5s ease-in;
  background-color: #ddd;
}
@media (max-aspect-ratio: 1/1) {
  body {
    writing-mode: vertical-rl;
  }
}
footer {
  position: fixed;
  height: 40px;
  bottom: 0;
  left: 0;
  right: 380px;
  grid-area: footer;
}
@media (max-aspect-ratio: 1/1) {
  footer {
    right: 0;
  }
}
#filter {
  background: #fffC;
  color: #333;
  text-align: center;
  writing-mode: horizontal-tb;
  font-size: 20px;
  border: none;
  outline: none;
  height: 48px;
  width: 380px;
  margin-left: auto;
  display: block;
  top: 0;
  position: sticky;
  z-index: 2;
}
@media (max-aspect-ratio: 1/1) {
  #filter {
    position: fixed;
    width: 100%;
  }
}
