@media (orientation:portrait), (max-width: 720px) {
  #container{
    grid-template-columns: 1fr;
  }
  #new,#open,#save,#pub,#doc{
    display: none;
  }
  #commandbar{
    right: 0;
    width: 220px; /* firefox */
  }
  .date{
    display: none;
  }
  #logo span{
    display: none;
  }
  /* .ace_gutter-cell.ace_breakpoint::before{
    display: none;
  } */
} 

@media (orientation:landscape) and (min-width: 721px) {
  #container{
    grid-template-columns: 1fr 1fr;
  }
  #commandbar{
    left: 50%;
    transform: translate(-50%);
    width: 440px; /* firefox */
  }
}

@media (hover: hover) and (pointer: fine) {
  .button:hover{
    filter: invert(0%);
    background-color: white;
  }
}

#container {  
  display: grid;
/*   grid-template-columns: 1fr 1fr; */
  grid-template-rows: 50px 1fr 36px;
  gap: 0px 0px;
  grid-auto-flow: row;
  grid-template-areas:
    "header header"
    "left right"
    "footer footer";
}

#header {
  grid-area: header;
  background-color: #999;
/*   display: flex; */
  position: relative;
}

#editor {
  grid-area: left;
  position: relative;
  font-size:16px;
}

#scene { 
  grid-area: right;
  position: relative;
}

#footer { 
  grid-area: footer; 
  background-color: #999; 
  overflow-y: hidden;
  font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;
  font-size: 14px;
  padding-left:5px;
  cursor: pointer;
  word-break: break-all;
}

a {
	color: unset;
	text-decoration: none;
}

html, body, #container {
  height: 100%;
  margin: 0;
}
    
#logo {
  color: lightgray;
  font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;
	font-size: 20px;
	line-height: 50px;
	padding-left: 5px;
  position: absolute;
/* 	width: 180px; */
}

#logo a{
  color: white;
}

#commandbar{
  height : 100%;
/*   width : fit-content; */
/*   margin: 0 auto; */
  display:flex;
  position: absolute;
/*   left: 50%;
  transform: translate(-50%) */
}
    
.button{
  height: 100%;
  cursor: pointer;
  aspect-ratio: 1.1;
  align-content: center;
  justify-content: center;
  display: grid;
  filter: invert(100%);
}
    

    
#doc{
/*   float: right; */
/*   margin-right: 0px;
  margin-left: 145px; */
  position: absolute;
  right: 0;
}

#docframe {
  width: 100%;
  height: 100%;
  position: absolute;
  box-sizing: border-box;
  padding: 0 0 0 12px;
  overflow: auto;
  font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;
  font-size: 14px;
  line-height: 1.3;
}
#docframe h1, h2, h3, h4, h5, h6{
  padding-bottom: 0.3em;
  border-bottom: 1px solid #ccc;
}
#docframe hr {
  margin: 1em 0;
  border: 0;
  border-bottom: 1px solid #ccc;
}
#docframe blockquote {
  margin-left: 0;
  padding: 0.5em 0 0.5em 2em;
  border-left: 3px solid rgb(211, 218, 234);
}
#docframe li, code {
  margin: 0.4em 0;
}
#docframe p {
  margin: 0.9em 0;
}
#docframe code {
  background: rgba(211, 218, 234, 0.25);
}
#docframe pre > code {
  display: block;
  padding: 0.5em 0.5em;
}
#docframe table {
  border-spacing: 0;
  border-collapse: collapse;
}
#docframe td {
  padding: 4px 8px;
}
#docframe tr:nth-child(2n) {
  background: #f3f3f3;
}
#docframe th {
  border-bottom: 1px solid #aaa;
}
/* #docframe img {
  max-width: 96px;
} */
#docframe a {
  color: #0969da;
}

#docframe a[id] {
    /*color: #d30038;*/
    font-size: 1.2em;
}

#offcanvas {
  width: 100%;
  height: 100%;
  position: absolute;
}

.ace_gutter-cell.ace_breakpoint::before{ 
  content: '🔴';
  font-size: 11px;
  position: absolute;
  left: 1px;
  line-height:19px;
/*   background-image: url("/img/breakpoint.png"); */
}

.ace_gutter_debug_current{ 
  background-color: yellow;
}
    
.ace_gutter-active-line.ace_gutter_debug_current{ 
  background-color: yellow;
}

.ace_mobile-button{
  display: none;
}

.prompt, #version {
  color:lightgray;
}

#command {
  border: none;
  background: transparent;
  outline: none;
  color: blue;
  padding: 0;
  font-size: 14px;
  width: 30%;
}

#statusbar {
  position: fixed;
  right: 5px;
/*   bottom: 0; */
  text-align: right;
}

#state {
  color: white;
}

#newdialog{
  width: 720px;
  height: 435px;
  padding: 0;
  border: 0;
  overflow: hidden;
}
.dialogtitle{
  width:100%;
  height: 30px;
  line-height:30px;
  background-color:grey;
  padding: 0 10px;
}
.dialogclose{
  position: absolute;
  right:10px;
  cursor: pointer;
}
.dialogclose:hover{
  color:white;
}
.newcodecontainer{
  display: flex;
  flex-wrap: wrap;
  width: 710px;
  height: 400px;
  padding-top: 5px;
  padding-left:10px;
  overflow-y: scroll;
}
.newcode{
  width:320px;
  height:180px;
  margin:10px;
  border-color:lightgray;
  border-width:thin;
  border-style:solid;
  cursor: pointer;
}

.newcode:hover{
  filter: brightness(70%);
}

#downdialog{
  width: 720px;
  height: 435px;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.downcontainer{
  width: 710px;
  height: 400px;
  padding-top: 5px;
  padding-left:10px;
  overflow-y: scroll;
}

.downfiletable{
  width: 690px;
}

/* 设置表头背景色为浅灰 */
.downfiletable thead th {
  background-color: lightgray;
}
/* 设置表格行在鼠标悬停时背景色为浅蓝 */
.downfiletable tbody tr:hover {
  background-color: lightblue;
}

#debugwatch{
  position: fixed;
  left: 50%;
  color: yellow;
}