body { 
  font-family: "IBM Plex Mono", monospace; 
  color: hsl(0, 0%, 75%);
  margin: 0 1.5em;
  padding: 20px;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 30px;
}

p { 
  font-family: "IBM Plex Mono", monospace; 
  color: #323232; 
  margin: 0px; 
  padding: 0px;
}

.figlet-hover {
  white-space: pre;
  line-height: 0.8em;
  font-size: clamp(3px, 1vw, 13px);
  letter-spacing: 0.2em;
  margin: 0;
  -webkit-text-stroke: 0.8px currentColor;
  animation: marquee 8s linear infinite;
}
@keyframes marquee {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100vw); }
}
.figlet-hover:hover {
  animation-play-state: paused;   /* 悬停暂停 */
}
.figlet_title:hover {
  color: rgb(255, 255, 255);  
  cursor: help;   
  position: relative;
  display: block;      
}
.figlet-hover:hover .tooltip {
  display: block;
}
.figlet_desk {
  width: max-content;
  margin: 0 auto;
  text-align: left;
  white-space: pre;
  font-family: monospace;
  line-height: 0.8em;
  font-size: clamp(4px, 1.1vw, 14px);
  letter-spacing: 0.2em;
  -webkit-text-stroke: 0.8px currentColor;
}
.hover-zone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background-color: fuchsia;
  color: white;
  cursor: pointer;
  -webkit-text-stroke: 0;
}

.tooltip {
  display: none;
  position: fixed;
  white-space: normal;
  font-size: 11px;
  letter-spacing: normal;
  line-height: 1.2em;
  color: #333;
  background-color: white;
  background-image: radial-gradient(circle 60px at center, yellow 0%, transparent 80%);
  border: 1px solid #333;
  padding: 8px 10px;
  width: 320px;
  z-index: 999;
  text-align: left;
  -webkit-text-stroke: 0px currentColor;
}
.hover-zone:hover .tooltip {
  display: block;
}


.tooltip ul {
  padding-left: 1.5em;
  margin: 0.5em 0;
}
.tooltip li {
  margin: 0.4em 0;
}
.tooltip p {
  margin: 0.5em 0;
}
.hover-zone-top .tooltip{
  top:1.9em;
  left:1.8em;
  width: 470px;
  height: auto;
  line-height: 1.5em;

}
.hover-zone-right .tooltip {
  width: 320px; 
  line-height: 1.5em;
}
.line {
  display: block;
  width: 100%;
  overflow: hidden;
  font-size: clamp(4px, 1.1vw, 14px);
  -webkit-text-stroke: 0.8px currentColor;
  letter-spacing: 0.2em;
  white-space: nowrap;
}
.line::after {
  content: "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
  display: block;
}
.detail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  background-color: fuchsia;
  color: white;
  cursor: pointer;
  position: relative;  /* 让detail-content相对它定位 */
}
.detail-content {
  display: none;
  position: absolute;  /* 改成absolute跟着父元素走 */
  font-size: 11px;
  letter-spacing: normal;
  line-height: 2em;
  color: #333;
  background-color: white;
  border: 1px solid #333;
  padding: 8px 10px;
  width: 300px;
  height: auto;
  z-index: 999;
  text-align: left;
  left:2em;  
}

.detail:hover .detail-content {
  display: block;
}
A:link, A:visited, A:active { 
  text-decoration: none; 
  color: blue; 
  background-color: transparent;
  transition: color 0.6s ease, background-color 0.6s ease; 
}
a.blue-hover:hover {
  color: white;
  background-color: blue;
}

A:hover { 
  text-decoration: none; 
  color: white;
  background-color: fuchsia;
  transition: color 0s, background-color 0s; 
}

.VERSION { font-size: thin; }
.NORM  { color: black;   }
.FIFO  { color: purple;  }
.CHAR  { color: yellow;  }
.DIR   { color: blue;    }
.BLOCK { color: yellow;  }
.LINK  { color: aqua;    }
.SOCK  { color: fuchsia; }
.EXEC  { color: green;   }

#hoverPreview {
  position: fixed;
  width: 420px;
  height: 520px;
  border: 1px solid rgba(0,0,0,0.25);
  background-color: white;
  background-image: radial-gradient(circle 200px at center, yellow 0%, transparent 70%);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 9999;
  display: none;
  border-radius: 0.8cap;
}

#hoverPreview .bar {
  display: none;
}

#hoverPreview iframe {
  display: block;
  width: 100%;
  height: 100%;
  background: white;
}

a.html-preview:hover {
  text-decoration: none;
}

#toggle-btn,
#toggle-btn-2 {
  appearance: none;
  -webkit-appearance: none;
  border:none;
  box-shadow: none;
  background: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.5em;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

#gallery-wrap,
#gallery-wrap-2 {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.gallery-slider {
  width: 100%;
  overflow-x: auto;
  cursor: grab;
  scrollbar-width: none;
  padding: 8px 0;
}

.gallery-slider::-webkit-scrollbar {
  display: none;
}

.gallery-track {
  display: flex;
  gap: 80px;
}

.gallery-track img {
  box-shadow: 3px 3px 3px fuchsia;
  pointer-events: none;
  display: block;
  object-fit: cover;
  object-position: top;
  width: 450px;
  height: 300px;
}


#rainbow-line {
  position: fixed;
  height: 80px;
  width: 100%;
  z-index: 999;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, 
  rgba(255, 255, 255, 0) 0%,
  rgb(255, 255, 255) 20%,
  yellow 40%,
  rgb(2, 110, 250) 60%,
  aqua 70%,
  fuchsia 80%,
  rgb(126, 255, 126) 100%
);
  pointer-events: none;
  transition: top 0.5s ease, bottom 0.5s ease; /* 加这行 */
}


/* generate page */
.generate-page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 20px clamp(12px, 4vw, 56px) 88px;
  overflow: hidden;
}

.generate-page > .figlet-hover {
  flex-shrink: 0;
}

.generate-page .page-layout {
  --button-height: clamp(32px, 8dvh, 56px);
  --button-gap: clamp(8px, 2dvh, 16px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 4vw, 48px);
  flex: 1;
  min-height: 0;
  width: 100%;
}

.generate-page .left,
.generate-page .right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--button-gap);
  min-width: 0;
  min-height: 0;
}

.generate-page .page-layout-right {
  display: flex;
  justify-content: center;
  width: 100%;
}

.generate-page :is(.input-html, .input-txt, .input-img, .input-pdf, .input-mp3) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
  height: var(--button-height);
  padding: 0 clamp(6px, 2vw, 20px);
  border: none;
  border-radius: 10px;
  background: #eeeeee;
  color: #454545;
  font-family: inherit;
  font-size: clamp(12px, 1.5vw, 16px);
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(69, 69, 69, 0.12);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.generate-page :is(.input-html, .input-txt, .input-img, .input-pdf, .input-mp3):hover {
  background: #eeeeee;
  color: #111;
  text-shadow: 0 0 3px #fff, 0 0 6px #fff;
  box-shadow: 0 6px 16px rgba(2, 110, 250, 0.22),
              0 3px 10px rgba(255, 0, 255, 0.18);
  transform: translateY(-2px);
}

.generate-page :is(.input-html, .input-txt, .input-img, .input-pdf, .input-mp3):active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgb(37 99 235 / 20%);
}

.generate-page :is(.input-html, .input-txt, .input-img, .input-pdf, .input-mp3):focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

.generate-page .input-html {
  height: calc(var(--button-height) * 4 + var(--button-gap) * 3);
}


/* File generator controls */
.generate-page .generate-actions {
  flex-shrink: 0;
  padding-top: 12px;
}
.generate-page #generate-status {
  font-size: 12px;
  line-height: 1.5;
  max-height: 3em;
  overflow: auto;
  margin-bottom: 8px;
}
.generate-page .generate-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.generate-page .generate-actions button,
.generate-page #generate-dialog button {
  font: inherit;
  line-height: 1.4;
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #eee;
  color: #333;
  cursor: pointer;
}
.generate-page button:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.generate-page .generate-actions button:focus-visible,
.generate-page #generate-dialog :is(button, select):focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}
.generate-page #generate-dialog {
  box-sizing: border-box;
  width: min(1200px, 94vw);
  height: 88vh;
  height: 88dvh;
  max-height: 94dvh;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 14px;
  color: #333;
  background: #fafafa;
  overflow: auto;
}
.generate-page #generate-dialog[open] {
  display: flex;
  flex-direction: column;
}
.generate-page #generate-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.generate-page .generate-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.generate-page #generate-dialog h2 { font-size: 18px; margin: 0; }
.generate-page #generate-dialog h3 { font-size: 15px; margin: 0 0 8px; }
.generate-page .generate-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}
.generate-page .generate-matches { overflow: auto; padding: 4px; }
.generate-page .generate-matches p { font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.generate-page .resource-row { display: block; margin: 14px 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.generate-page .resource-row select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  font: inherit;
  background: white;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.generate-page #generated-preview { box-sizing: border-box; width: 100%; height: 100%; border: 1px solid #ddd; border-radius: 8px; background: white; }
.generate-page #resource-status { padding: 10px; background: #eee; border-radius: 8px; }
.generate-page .generate-hint { color: #666; }
.generate-page .generate-output-actions { display: grid; gap: 16px; }
.generate-page .publish-panel {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid #d4d4d4;
  border-radius: 10px;
  background: #f4f4f4;
}
.generate-page .publish-panel h3 { margin-bottom: 2px; }
.generate-page .publish-panel label { font-size: 12px; }
.generate-page .publish-panel input {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: white;
  color: #222;
  font: inherit;
}
.generate-page .publish-panel input:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 1px;
}
.generate-page #publish-button { margin-top: 5px; }
.generate-page #publish-status {
  margin: 2px 0 0;
  padding: 0;
  min-height: 1.6em;
  overflow-wrap: anywhere;
}
.generate-page #publish-status a { color: #075fc7; }
@media (max-width: 640px) {
  .generate-page .generate-workspace { display: flex; flex-direction: column; overflow: auto; }
  .generate-page .generate-matches { flex: 0 0 auto; overflow: visible; }
  .generate-page #generated-preview { flex: 0 0 45dvh; }
}
@media (max-height: 640px) {
  .generate-page { padding-top: 8px; padding-bottom: 48px; }
  .generate-page #rainbow-line { height: 40px; }
  .generate-page .page-layout { --button-height: clamp(24px, 6dvh, 38px); --button-gap: 6px; }
  .generate-page > p { font-size: 12px; line-height: 1.3; }
}
@media (max-height: 420px) {
  .generate-page > .figlet-hover { font-size: 5px; }
  .generate-page .figlet_title { margin: 4px 0; }
  .generate-page .page-layout { --button-height: 22px; }
}

/* Download controls on the ASCII table. */
.desk-download,
.desk-download:link,
.desk-download:visited,
.desk-download:hover,
.desk-download:active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  vertical-align: middle;
  width: 1.5em;
  height: 1.5em;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: fuchsia;
  color: white;
  font: inherit;
  line-height: 1;
  text-decoration: none;
  letter-spacing: normal;
  -webkit-text-stroke: 0;
}
.desk-download:focus-visible { outline: 2px solid blue; outline-offset: 3px; }

/* Shared schedule popup for both table downloads. */
#workshop-schedule {
  position: fixed;
  z-index: 10000;
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  background: #3000f5;
  color: white;
  border: 1px solid #b7b7b7;
  font: 300 clamp(14px, 2.5vw, 21px)/1.4 Arial, sans-serif;
  box-shadow: 0 8px 26px #0002;
}
#workshop-schedule[hidden] { display: none; }
#workshop-schedule .schedule-label {
  padding: 8px 14px;
  font: 12px/1.4 monospace;
  border-bottom: 1px solid #ffffff80;
}
#workshop-schedule table { width: 100%; border-collapse: collapse; text-align: center; }
#workshop-schedule th { font-weight: 300; padding: 22px 10px; border-bottom: 1px solid #ffffffb3; }
#workshop-schedule td { padding: 16px 10px; }
#workshop-schedule th:first-child,
#workshop-schedule td:first-child { width: 35%; border-right: 1px solid #ffffffb3; white-space: nowrap; }

/* Full-height edge areas reveal the workshop schedule. */
.schedule-edge {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  z-index: 10001;
  cursor: help;
}
.schedule-edge-left { left: 0; }
.schedule-edge-right { right: 0; }
.schedule-edge:hover,
.schedule-edge:focus-visible { background: #3000f526; }
.schedule-edge:focus-visible { outline: 2px solid #3000f5; outline-offset: -2px; }

/* Workshop generator entry point. */
.push-action {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 1000;
  margin: 0;
}
.push-button,
.push-button:link,
.push-button:visited,
.push-button:hover,
.push-button:active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #3000f5;
  color: white;
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}
.push-button:focus-visible { outline: 3px solid fuchsia; outline-offset: 6px; }

.generate-page .back-home {
  margin-bottom: 16px;
  padding: 6px 14px;
  color: #222;
  background: white;
  text-decoration: none;
}

.generate-page .back-home:hover,
.generate-page .back-home:focus-visible {
  color: blue;
}
