* {
  box-sizing: border-box;
}

/* declare global fonts */
body {
  font-family: 'Open Sans', Calibri, 'Trebuchet MS', Tahoma, Helvetica, 'Microsoft YaHei', '微软雅黑', STXihei, '华文细黑', 'WenQuanYi Micro Hei', 'Droid Sans', YouYuan, sans-serif;
}

.btext-en {
  font-family: 'Open Sans', Calibri, 'Trebuchet MS', sans-serif;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

body {
  max-width: 1280px;
  margin: auto;
  color: #000;
  background-color: #f2c469;
  /*
  color: #300;
  background-color: #eeddbb;
  */
}

.btext-container {
  font-size: 24px;
  border: solid 1px #e3d3b3;
  border-radius: 10px;
  padding-top: 0px;
  padding-left: 3%;
  padding-right: 3%;
  padding-bottom: 1em;
  margin-left: 2%;
  margin-right: 2%;
  /*
  background-color: #fefcf3;
  */
  background-color: rgb(252, 239, 220);
}

.btext-desc {
  position: relative;
  letter-spacing: 1px;
  border: 1px solid rgb(232, 219, 200);
  border-radius: 5px;
  padding: 20px 15px 20px 15px;
  margin: 5px 2% 10px 2%;
  background-color: rgb(242, 229, 200);
}

.btext-panel-content {
  font-size: 80%;
  background-color: rgb(252, 239, 220);
  border: solid 1px rgb(242, 229, 210);
  border-radius: 7px;
  padding: 0.9em 0.3em;
  margin: 1em 1em;
}

.btext-panel-inner-container {
  max-height: 500px;
  overflow: auto;
  padding: 0 0.9em; /* for the vertical scrollbar */
}

.btext-panel-content p {
  margin: 0.5em 0;
}

.btext-panel-content.btext-cn p {
  text-indent: 2em;
}

.btext-panel-content.btext-cn.no-p-indent p {
  text-indent: 0;
}

.btext-panel-content,
.btext-panel-content.btext-en {
  color: #000;
  /*
  color: #421;
  */
}

.btext-panel-content.btext-en cite {
  font-style: italic;
  font-weight: 700;
}

.btext-panel-content h2 {
  color: #620;
  font-size: 125%;
  margin: 1.5em 0 0.2em 0;
}

.btext-panel-content h3 {
  font-size: 120%;
  color: #510;
  margin: 0.8em 0 0.5em 0;
  padding: 0 1em;
}

.btext-panel-content h4 {
  font-size: 110%;
  color: #310;
  font-weight: 600;
  margin: 0.3em 0 0.1em 0;
}

.btext-panel-content.btext-cn .btext-ul-plain {
  list-style: none;
  padding: 0;
}

.btext-panel-content.btext-en .btext-ul-plain {
  list-style: disc;
  padding: 0 0 0 1em;
}

.btext-panel-content .btext-qna {
  margin: 1.5em 0;
}

.btext-panel-content .btext-qna .btext-qna-heading,
.btext-panel-content .btext-qna .btext-qna-q,
.btext-panel-content .btext-qna .btext-qna-a {
  padding: 0.7em 1.2em;
  border: 1px solid #ddccbb;
  border-top-width: 0;
}

.btext-panel-content .btext-qna > div:first-child {
  border-radius: 4px 4px 0 0;
  border-top-width: 1px;
}

.btext-panel-content .btext-qna > div:last-child {
  border-radius: 0 0 4px 4px;
}

.btext-panel-content .btext-qna .btext-qna-heading {
  background-color: #f7e0c7;
  font-weight: bold;
}

.btext-panel-content .btext-qna .btext-qna-q {
  background-color: #f7e7d7;
}

.btext-panel-content .btext-qna .btext-qna-a {
  background-color: #faf1e7;
}

.btext-panel-content .btext-qna .btext-qna-tag {
  font-weight: bold;
}

.btext-corner-btn {
  color: rgba(177, 153, 119, 0.4);
  font-size: 28px;
  text-align: center;
  padding: 0px !important;
  font-weight: bold;
  display: inline-block;
  position: absolute;
  top: 0.1em;
  right: 0.5em;
  clear: both;
}

.btext-corner-btn:hover {
  color: rgba(177, 153, 119, 0.7);
  text-shadow: 0 0 2px #aaa;
}

.btext-corner-btn:focus,
.btext-corner-btn:active {
  color: #a85;
}

hr {
  width: 30%;
  color: #ec8;
  border-top: 1px solid #ec8;
  margin: 15px auto;
}

p {
  margin: 0 0 0 0;
  padding: 2px 0px 2px 0px;
}


ruby {
  font-size: 100%;
  font-weight: 500;
  padding: 0px 1px;
}

.btext-phonetic-none .btext-paragraph ruby,
.btext-phonetic-none .btext-sentence ruby {
  line-height: 1.5;
}

.btext-phonetic-zhuyin .btext-paragraph ruby,
.btext-phonetic-zhuyin .btext-sentence ruby {
  line-height: 2.3;
}

.btext-phonetic-pinyin .btext-paragraph ruby,
.btext-phonetic-pinyin .btext-sentence ruby {
  line-height: 2.5;
}

.btext-phonetic-wg .btext-paragraph ruby,
.btext-phonetic-wg .btext-sentence ruby {
  line-height: 2.5;
}

rt {
  line-height: 1 !important;
  color: rgb(60, 30, 20);
  font-size: 72%;
  font-weight: normal;
  text-align: center;
  vertical-align: bottom !important;
  transform: translateY(-0.25em);
}

rt.btext-pinyin,
rt.btext-wg {
  font-size: 70%;
  font-family: Helvetica, sans-serif !important;
  letter-spacing: 0px !important;
  padding: 0 2px;
  transform: translateY(-0.25em);
}

rt.btext-zhuyin {
  font-size: 50%;
  font-family: "Palatino Linotype", Georgia, "KaiTi", "楷体", STKaiti, "华文楷体", "AR PL UKai CN", serif;
  font-weight: 700;
  letter-spacing: -0.07em !important;
  padding: 0.3em 0.2em;
  transform: translateY(-0.35em);
}

.btext-phonetic-none rt {
  display: none !important;
}

h1 {
  font-weight: bold;
  color: rgb(20, 20, 20);
  /*
  color: #882200;
  */
  font-size: 125%;
  text-align: center;
  padding: 1em 1em 0 1em;
  margin: 0;
  line-height: 2.5;
}

h1 ruby {
  font-weight: 700;
  text-shadow: 0.3px 0.3px 0.7px #aaa;
}

h1 ruby rt {
  font-weight: normal;
  /*
  color: #aa4400 !important;
  */
}

h1 ruby rt.btext-wg {
  text-transform: capitalize;
  transform: translateY(-0.5em);
}

h1 ruby rt.btext-pinyin {
  transform: translateY(-0.5em);
}

h1 ruby rt.btext-zhuyin {
  transform: translateY(-0.6em);
}

h1 .btext-en-title {
  display: block;
  line-height: 1.0;
  font-size: 85% !important;
  margin-bottom: 0.7em;
}

h1 .btext-en-title .btext-en {
  color: #000;
  /*
  color: #a60;
  */
  line-height: 1.35;
}

h1 .btext-pinyin,
h1 .btext-wg {
  font-size: 60%;
}

h1 .btext-zhuyin {
  font-size: 40%;
}

.btext-nowrap {
  white-space: nowrap;
}

.btext-interpunct {
  font-size: 90%;
  padding-left: 0.2em;
  padding-right: 0.3em;
}

.btext-punctuation {
  font-family: YouYuan SimSun serif;
  font-size: 90%;
  padding-left: 0.1em;
}

.btext-toolbar {
  text-align: center;
  letter-spacing: 0px !important;
  line-height: 4;
  margin: 5px 0px;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}

.btext-toolbar > button.btext-btn {
  margin: 0;
}

.btext-btn {
  position: relative;
  font-family: Tahoma, Helvetica, 'Microsoft YaHei', '微软雅黑', STXihei, '华文细黑', 'WenQuanYi Micro Hei', 'Droid Sans', YouYuan, sans-serif;
  font-size: 100%; /* necessary, otherwise buttons will be shifted slight downward */
  color: #840;
  background-color: rgb(249, 247, 231);
  line-height: 1.5;
  text-align: center;
  height: 42px;
  min-width: 42px;
  border-radius: 4px;
  border-image-width: 0px;
  border: 1px solid rgb(229, 227, 201);
  margin: 0;
  padding: 0px 8px;
}

.btext-btn:hover {
  background-color: rgba(255, 255, 235, 0.95);
}

.btext-btn span {
  font-size: 16px;
}

.btext-btn svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.btext-btn-phonetic-type {
  position: relative;
}

.btext-btn-phonetic-type .btext-btn-phonetic-type-label {
  display: block;
  min-width: 28px;
}

.btext-btn-phonetic-type .btext-btn-phonetic-type-label span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  min-width: 2em;
}

.btext-btn-phonetic-type .btext-btn-phonetic-type-label-pinyin span {
  font-size: 100%;
  font-family: Helvetica, sans-serif;
}

.btext-btn-phonetic-type .btext-btn-phonetic-type-label-zhuyin span {
  font-size: 75%;
  font-family: "Palatino Linotype", Georgia, KaiTi, 楷体, STKaiti, 华文楷体, "AR PL UKai CN", serif;
  font-weight: 700;
  letter-spacing: -0.07em !important;
}

.btext-btn-phonetic-type .btext-btn-phonetic-type-label-wg span {
  font-size: 100%;
  font-family: Helvetica, sans-serif;
}

.btext-btn-en {
  padding: 0;
  margin: 0;
  line-height: 1;
}

.btext-btn-en span {
  font-family: 'Times New Roman', Times, serif;
  font-size: 18px;
  font-weight: 500;
  position: absolute;
  display: inline-block;
  left: 10px;
  top: 0;
  transform: translateY(11px);
  line-height: 1;
}

.btext-btn:hover {
  color: #800;
}

.btext-btn:focus,
.btext-btn:active {
  color: #950;
}

.btext-btn-left {
  margin-right: 0px !important;
  border-radius: 5px 0px 0px 5px;
}

.btext-btn-middle {
  margin-left: 0px !important;
  margin-right: 0px !important;
  border-radius: 0px 0px 0px 0px;
}

.btext-btn-right {
  margin-left: 0px !important;
  border-radius: 0px 5px 5px 0px;
  border-left-width: 0px;
}

.btext-btn-group {
  display: inline-block;
  background-color: rgba(0,0,0,0);
  border-radius: 4px;
}

.btext-btn-group-switch {
  /*
  background-color: #aa9977;
  */
  background-color: rgb(236, 163, 74);
  border: 1px solid rgb(226, 153, 74);
  padding: 0px 5px;
  margin: 0px 1px;
  line-height: 2;
  /* height: 42px; */
  /*
  transform: translateY(-1px);
  */
}

.btext-btn-group-switch .btext-btn {
  min-width: 0;
  height: 32px;
  min-width: 32px;
  padding: 2px 8px;
  margin: 5px 0;
  border: none;
}

.btext-btn-group-switch .btext-btn-inactive {
  font-size: 80%;
  min-width: 0;
  padding: 2px 4px;
  border: none !important;
  /*
  color: #aa9977 !important;
  background-color: #aa9977 !important;
  */
  color: rgb(236, 163, 74) !important;
  background-color: rgb(236, 163, 74) !important;
}

.btext-btn-group-switch .btext-btn-inactive:hover {
/*
  color: #bbaa88 !important;
  background-color: #aa9977 !important;
*/
  color: rgb(255, 190, 120) !important;
  background-color: rgb(236, 163, 74) !important;
}

.btext-btn-group-switch .btext-btn span {
  display: block;
  transform: translateY(1px);
}

.btext-btn-toggle.btext-btn-active {
  background-color: rgb(255, 248, 215);
  box-shadow: inset 0px 0px 2px 4px rgb(239, 213, 133);
  border: 1px solid rgb(239, 223, 139);
}

.btext-btn-toggle.btext-btn-active:hover {
  background-color: rgb(255, 248, 225);
  box-shadow: inset 0px 0px 2px 4px rgb(236, 163, 74);
  border: 1px solid rgb(236, 213, 159);
}

.btext-video-container {
  line-height: 1;
  padding: 0px 0px 20px 0px;
}

.btext-video-container video {
  display: block;
  width: 100%;
}

.btext-audio-container {
  line-height: 1;
  padding: 0px 0px 20px 0px;
}

.btext-audio-container audio {
  display: block;
  width: 100%;
}

.btext-audio-container audio::-webkit-media-controls-panel {
  background-color: rgb(255, 245, 230);
}

.btext-subtitle {
  margin: 6px 0px 10px 0px;
  font-size: 100%;
  color: #000;
  /*
  color: #840;
  */
  background-color: rgb(255, 245, 230);
  text-align: center;
  vertical-align: bottom !important;
  letter-spacing: 1px;
  line-height: 200%;
  border: 1px solid rgb(235, 225, 210);
  border-radius: 6px;
  margin-bottom: 20px;
  padding: 15px 10px 5px 10px;
}

.btext-subtitle .btext-subtitle-inner {
  padding: 10px 0;
}

.btext-subtitle.btext-subtitle-empty {
  display: none;
}

.btext-subtitle ruby {
  font-size: 100%;
  padding: 1px;
}

.btext-subtitle .btext-read {
  color: #810;
}

.btext-subtitle .btext-unread {
  color: #765;
}

.btext-hidden {
  /* the `btext-hidden` class needs to be able to override
     other display settings, hence the '!important' modifier */
  display: none !important;
}

.btext-center {
  text-align: center;
}

.btext-cite-note-box {
  font-size: 85%;
  text-align: right;
  margin-top: 1em;
}

.btext-en-book-title {
  font-style: italic;
}

a {
  color: #662211;
  text-decoration: none;
}

.btext-section {
  display: block;
}

/* container for a sentence followed by a btext-endnote-box
   It fits the width of the sentence
   so the note at the end
   can flush to the right without
   losing alignment to the end of the sentence */
.btext-endnote-container {
  display: inline-block;
}

.btext-sentence .btext-note {
  display: inline-block;
  transform: translateX(-0.5em);
}

.btext-endnote-box {
  transform: translateY(-0.6em);
  float: right;
  padding-right: 1em;
  padding-bottom: 0.3em;
}

.btext-phonetic-none .btext-endnote-box {
  transform: translateY(-0.3em);
  padding-bottom: 0.0em;
}

.btext-endnote-box:after {
  clear: both;
  display: table;
}

.btext-note {
  font-size: 60%;
  color: #555;
}

.btext-note ruby {
  line-height: 1;
}

.btext-section.btext-stick-to-below {
  margin: 0 0 0.4em 0;
}

.btext-section.btext-stick-to-above {
  margin: -0.2em 0 1.2em 0;
}

.btext-phonetic-none .btext-section.btext-stick-to-above {
  margin: 0em 0 0.6em 0;
}

.btext-disclaimer {
  font-size: 70%;
  padding: 15px 35px 30px 35px;
  line-height: 1.7;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}

.btext-disclaimer,
.btext-disclaimer .btext-en {
  color: #333;
}

.btext-disclaimer .btext-en-disclaimer {
  line-height: 1.25;
}

ruby.btext-composite svg {
  transform: translateY(0.23em);
}

ruby.btext-composite svg text {
  font-size: 24px;
}

ruby.btext-composite svg text.bold {
  font-weight: 900;
}

ruby.btext-composite{
  transform: translateY(0);
}



.btext-up-btn-ctn {
  position: fixed;
  z-index: 100;
  right: 0px;
  bottom: 0px;
}

.btext-up-btn {
  position: absolute;
  right: -52px;
  bottom: 19px;
  font-size: 20px;
  line-height: 1.43;
  width: 40px;
  height: 40px;
  margin: 4px 0px 0px 4px;
  opacity: 0.8;
  transition: all 0.3s ease-in;
  border-radius: 24px;
  background-color: #531;
  background-image: radial-gradient(circle at 50% 50%, rgba(255,255,200,0.3) 0%, rgba(255,255,255,0.1) 80%);
}

.btext-up-btn:hover {
  transition: all 0.3s ease-in;
}

.btext-up-btn.btext-active {
  right: 12px;
}

.btext-up-triangle {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%,-50%);
  /* up triangle https://stackoverflow.com/a/6325076/13612859 */
  width: 0px;
  height: 0px;
  border-top: none;
  border-bottom: 12px solid #ddbb55;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
}

.btext-up-btn:hover {
  opacity: 0.9;
  background-color: #502000;
}

.btext-up-btn:hover .btext-up-triangle {
  border-bottom-color: #eed377;
}



@media screen and (max-width: 720px) {
  /* narrow-screen mobile device */

  .btext-container, .btext-desc {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    border-radius: 0;
  }

  .btext-container {
    border: none;
  }

  .btext-desc {
    border-width: 1px 0;
  }

}

@media screen and (min-width: 721px) {

  .btext-small-screen-only {
    display: none;
  }

}
