:root {
  color-scheme: light dark;
  
  --basic-font-size: max(20px, 1vw);
  --default-font: Arial, 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Noto Sans CJK TC', sans-serif;
  --title-font: 'GenYoMin TW TTF', '源樣明體 TTF', 'GenYoMin TW', '源樣明體', 'Songti TC', serif;
  --aside-font: Arial, Microsoft JhengHei, '微軟正黑體', PingFang TC, sans;
  /*--main-title-font: 'GenYoMin TW TTF', '源樣明體 TTF', 'Songti TC', serif;*/
  --main-title-font: Arial, 'PingFang TC', 'Noto Sans CJK TC', 'Microsoft JhengHei', sans-serif;
  
  --quote-font:  Times, 'Times New Roman', 'AR PL New Kai', TW-Kai, DFKai-SB, BiauKaiTC, '標楷體', serif;
  --mono-font: MingLiU, monospace;

  --bg-color: white;
  --main-color: #222;
  --main-title-color: white;
  --main-title-bg-color: #206080;
  --footer-bg-color: #212121;
  --note-color: #666;
  --note-border-color: #ccc;
  --em-color: #ffa;
  --hover-color: red;
  --visited-color: #63a;
  --main-title-hover-color: white;
  --link-color: blue;
  --highlight-color: #dff;
  --light-text-color: #ccc;

  --summary-border-color: gray;
  --summary-bgcolor: #eeeef8;
  --summary-text-color: #666;
  
  --notice-border-color: #f66;
  --notice-bgcolor: #ffc;
  --notice-text-color: #222;
  
  --text-left-margin: max( 5rem, calc( ( 100vw - 61rem ) / 1.8 ) );
  --text-right-margin: 1rem;
  --table-fig-top-margin: 2rem;
  --table-fig-bottom-margin: 3.5rem;
  --table-note-gap: -3rem;
  
  --note-line-height: 150%;
  
  font-size: var(--basic-font-size);
}


html {
  padding: 0;
  margin: 0;
}
body {
  font-family: var(--default-font);
  background-color: var(--bg-color);
  color: var(--main-color);
  padding: 0;
  margin: 0;
  text-align: justify; 
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--title-font);
  font-weight: bold;
}

a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid;
}
a:visited {
  color: var(--visited-color);
}

a:hover {
  color: var(--hover-color);
}

#wikihead a, #wikisidebar a {
  border-bottom: none;
  color: var(--basic-color);
}
#wikihead a:hover {
  color: var(--main-title-hover-color);
  border-bottom: none;
  text-shadow: 0 0 1px black;
}

#wikihead {
  margin-bottom: 2em;
  color: var(--main-title-color);
  background-color: var(--main-title-bg-color);
  background-image: url(lalong-small.jpg);
  background-size: cover;
  background-position: top right;
  height: 28vw;
  text-shadow: black 3px 3px 3px, black 0 2px 1px;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}  


#wikihead #wikititle {
  font-family: var(--main-title-font);
  font-size: 280%;
  font-weight: 500;
  margin: 1rem 0;
  padding: 0;
}
#wikihead #wikisubtitle {
  font-size: 210%;
  font-weight: 300;
  padding-top: 0.7em;
  display: block;
}
#wikihead #wikiheadauthor {
  display: block;
  font-family: var(--title-font);
  font-style: normal;
  font-size: 1.3em;
  font-weight: 500;
  padding-top: 1em;
}
#wikihead #wikiheadauthor::after {
  content: '　著';
}

#wikimenu-toggle, #wikimenu-toggle-label {
  display: none;
}
/*
#wikimenu-toggle-label { 
  margin: 1.5rem 2rem;
  position: absolute;
  right: 1em;
  top: 1em;
}
*/

#wikisidebar {
  display: block !important;
  margin-left: var(--text-left-margin);
  width: calc( 25vw + 40rem );
  text-align: right;
}

#wikisidebar-searchform {
  display: none !important;
}

form.wikisearch .searchbox {
  border: none;
  padding-bottom: 0.3em;
  background-color: transparent;
  color: var(--main-color);
  outline: none !important;
}

form.wikisearch {
  border-bottom: 1px solid var(--note-color);
  display: inline-block;
}

form.wikisearch .searchbutton {
  font-size: 0;
  box-sizing: border-box;
  border: 0;
  cursor: pointer;
  background: transparent url(search.svg) 0 0 no-repeat;
  height: 1.3rem;
  width: 1.3rem;
  position: relative;
  bottom: 0.3rem;
}

/*
#wikisidebar {
  width: 25rem;
  font-family: var(--aside-font);
  font-weight: 300;
  font-size: 90%;
}

#wikisidebar .toc li {
  margin: 0px;
  padding-left: 4em;
  text-indent: -4em;
  list-style: none;
}
*/

#wikicmds {
  float: right;
  margin-right: 2em;
  white-space:nowrap; 
  font-size: smaller; 
}
#wikicmds li { 
  display:inline; 
  margin:0px 5px; 
  padding: 0; 
  border: none; 
}


#wikimid {
}

#wikibody {
  margin-left: var(--text-left-margin);
  margin-right: var(--text-right-margin);
}

#pagetitle .pagegroup {
  display: none;
}

#wikicmds li { 
  display:inline; 
  margin:0px 5px; 
  padding: 0; 
  border: none; 
}


#wikitext {
  width: 40rem;
  line-height: 2;
}

#main-toc ul {
  padding-left: 0px;
}
#main-toc li {
  list-style: none;
}
#main-toc > ul > li {
  font-family: var(--title-font);
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 1rem;
}
#main-toc > ul > li > ul > li {
  font-family: var(--default-font);
  font-size: 1rem;
  font-weight: normal;
}

#main-toc > ul ul ul {
  padding-left: 2rem;
}

#main-toc small {
  display: none;
}

/*
#wikifoot {
  margin-top: 8rem;
  padding-top: 15rem;
  padding-bottom: 0.8rem;
  padding-left: var(--text-left-margin);
  padding-right: var(--text-right-margin);
  line-height: 1.6;
  
  background-image: url("kayap.jpg");
  background-size: cover;
  background-position: bottom center;
}
*/
#wikifoot {
  margin-top: 12rem;
  padding-top: 3rem;
  padding-bottom: calc( 13.5vw + 3rem);
  padding-left: var(--text-left-margin);
  padding-right: var(--text-left-margin); /* !! */
  text-align: center;
  background-color: var(--footer-bg-color);
  color: var(--light-text-color);
  
  background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.3), rgba(0,0,0,0.2)), url("kayap-small.jpg");
  background-size: cover;
  background-position: bottom center;
}

p.notice {
  border: 0.3rem var(--notice-border-color) solid;
  padding: 1rem;
  background-color: var(--notice-bgcolor);
  color:  var(--notice-text-color);
}

.summary {
  color: var(--summary-text-color);
  border: 1px var(--summary-border-color) dotted;
  background-color: var(--summary-bgcolor);
  padding: 1rem;
  margin-bottom: 3rem;
}

textarea#text {
  font-size: 14px;
}


h1 { 
  font-size: 180%;
  font-weight: 700;
}
h2 { 
  font-size: 160%;
  margin-top: 2em;
  margin-bottom: 0.8em;
  font-weight: 700;
  text-align: left;
  border-bottom: 2px solid #666;
}

blockquote {
  font-family: var(--quote-font);
  margin-left: 4em;
  margin-right: 0;
}


dt {
  font-weight: bold;
}


audio {
  width: 100%;
}

textarea#text {
  font-size: 0.95rem;
}

em {
  font-style: normal;
  background-color: var(--highlight-color);
}

.wikitrail {
  font-size: 95%;
  color: #666;
  font-family: var(--title-font);
}

#groupheader, #groupfooter {
  text-align: right;
}

#groupfooter {
  margin-top: var(--table-fig-top-margin);
}

.pagegroup {
  display: none;
}

.bibli li {
  list-style: none !important;
  text-indent: -2em;
}

small {
  font-weight: 300;
  /*font-size: 95%;*/
}

.small {
  font-size: 90%;
}

.small2 {
  font-size: 85%;
}

.gstooltip {
  cursor: pointer;
  border-bottom: 0.13em gray dotted !important;
}
.gstooltip:after {
  font-size: 95% !important;
  font-family: var(--default-font) !important;
}


small.sidenote {
  float: right;
  font-family: var(--default-font);
  color: var(--note-color);
  width: 20vw;
  margin-right: -25vw;
  margin-bottom: 0.2em;
  text-indent: -0.8em;
  line-height: var(--note-line-height);
  clear: right;
}
small.sidenote .sidenote-number {
  vertical-align: super;
}
.sidenote-ref {
  font-weight: 300;
  color: var(--link-color);
  font-family: var(--default-font);
  cursor: pointer;
}
input.sidenote-ref-input:checked + small.sidenote {
  background-color: var(--highlight-color);
}

table {
  margin-top: var(--table-fig-top-margin);
  margin-bottom: var(--table-fig-bottom-margin); 
}

table caption {
  text-align: left;
}

table + p.note {
  margin-top: var(--table-note-gap);
  line-height: var(--note-line-height);
  margin-bottom: calc( var(--table-fig-bottom-margin) * 1.3 );
  color: var(--note-color);
}

table + p.note small {
  font-size: 93%;
}

td, th {
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  text-align: left; 
}

th {
  text-align: center;
}

td {
  vertical-align: top !important;
}

table.column.col1-nowrap td.col1, 
table.column.col2-nowrap td.col2, 
table.column.col3-nowrap td.col3, 
table.column.col4-nowrap td.col4, 
table.column.col5-nowrap td.col5, 
table.column.col6-nowrap td.col6, 
table.column.col7-nowrap td.col7 {
  white-space: nowrap;
} 

table.wide, figure.wide {
  width: calc( 100% + 25vw );
  overflow: visible;
  clear: right;
}

figure.wide img {
  width: 100%;
}

figure {
  margin: var(--table-fig-top-margin) 0 var(--table-fig-bottom-margin) 0;
}
figure > span.embed {
  display: block;
}

figure {
  line-height: var(--note-line-height);
}
figcaption {
  margin-top: 0.5em;
  color: var(--note-color);
}
figcaption > small {
  display: inline-block;
  font-size: 0.93em;
  margin-top: 0.3em;
  padding-left: 0.5em;
  border-left: solid 0.3em var(--summary-bgcolor);
}

iframe {
  border: none;
}

ruby rt {
  padding-top: 0.2em;
}
ruby.xlarge rt {
  font-size: 0.95em !important;
}

div.oric {
  display: table;
  margin-left: 2rem;
  width: calc( 100% - 2rem );
  font-family: var(--quote-font);
}
div.oric .phrase {
  display: table-row;
}
.oric .phrase .amis, .oric .phrase .zh {
  display: table-cell;
  padding-bottom: 1.2rem;
}
.oric .phrase .zh {
  padding-left: 1.5rem;
}

h2.wikiaction {
  font-size: 80%;
  margin-top: -2em;
}
#wikiedit {
  width: 150%;
}

@media screen and (max-width: 1280px) {
  :root {
    --basic-font-size: max( 16px, 1.5625vw );
  }
}


/* start of large tablet styles */
@media screen and (max-width: 991px) {
  :root {
    --basic-font-size: 16px;
    --highlight-color: transparent;
  }
  
  #wikihead {
    height: 20rem;
    background-image: url(lalong-small.jpg);
  }
  #wikihead #wikititle {
  }
  #wikihead #wikititle small {
  }
  #wikihead #wikiheadauthor {
  }
  
  #wikisidebar {
    width: 40rem;
  }
  
  #wikifoot {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.3), rgba(0,0,0,0.2)), url("kayap-small.jpg");
  }
    
  blockquote {
    margin-left: 1em;
    margin-right: 0em;
  }

  small.sidenote, small.sidenote {
    float: none;
    width: auto;
    display: none;
  }
  input.sidenote-ref-input:checked + small.sidenote {
    float: none;
    width: auto;
    display: block;
    margin: 0.5em 0 1.3em 4em;
  }

  table.wide, figure.wide {
    margin-right: 0;
    width: 100%;
  }
}

/* start of medium tablet styles */
@media screen and (max-width: 767px) {
  :root {
    --basic-font-size: 16px;
    --text-left-margin: 1rem;
    --text-right-margin: 1rem;
  }

  #wikihead {
    height: 11rem;
    padding: 0 1rem;
    text-align: left;
  }
  #wikihead #wikititle {
    font-size: 180%;
    margin: 0rem;
  }
  #wikihead #wikisubtitle {
    font-size: 120%;
    padding-top: 0.3em;
  }
  #wikihead #wikiheadauthor {
    font-size: 120%;
  }
  
  #wikisidebar {
    margin-left: 1rem;
    margin-right: 1rem; 
    width: auto;
  }
  
  #wikitext {
    width: auto;
    line-height: 1.8;
  }
  
  div.oric, div.oric .phrase, div.oric .phrase .amis, div.oric .phrase .zh {
    display: block;
  }
  div.oric .phrase .amis {
    padding-bottom: 0.5rem;
  }
  div.oric .phrase .zh {
    padding-bottom: 0.8rem;
  }
}

/* start of phone styles */
@media screen and (max-width: 479px) {
  #wikihead #wikititle {
    font-size: 140%;
  }
  #wikihead #wikiheadauthor {
    font-size: 100%;
  }
  


}


@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #333;
    --main-color: #fffaf6;
    --note-color: #bbb;
    --em-color: #ffa;
    --hover-color: #eae;
    --visited-color: #ccf;
    --link-color: #add;
    --highlight-color: #444;
    --summary-border-color: gray;
    --summary-bgcolor: #44444f;
    --summary-text-color: #bbb;
  }
  
  #wikihead {
    background-image: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url(lalong-loss.jpg);
  }
  img {
    filter: brightness(.8) contrast(1.2);
    background-color: #ccc;
  }
  form.wikisearch .searchbutton {
    filter: invert(80%) brightness(120%);
  }
}

/* These affect the printed appearance of the web view (not the separate
** print view) of pages.  The sidebar and action links aren't printed. */
@media print {
}


