﻿:root {
  --bg: #e8f1fb;
  --bg2: #f5f9ff;
  --panel: #ffffffee;
  --line: #bfd0e3;
  --text: #1f3349;
  --muted: #587089;
  --accent: #2b6fb4;
  --accent2: #6483a5;
  --folder: #4f9b5f;
  --green-soft: #e7f4e8;
  --green-line: #b9d8bc;
  --row: #f5f9ff;
  --row-2: #edf4ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  background:
    radial-gradient(circle at 16% 8%, #d9e9fb 0%, transparent 38%),
    radial-gradient(circle at 84% 2%, #e2f3e3 0%, transparent 24%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}

.topbar {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  background: linear-gradient(180deg, #f8fbff 0%, #eaf3ff 100%);
  backdrop-filter: blur(4px);
}

.kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: #4f7196;
}

.kicker a,
.kicker a:visited {
  color: inherit;
  text-decoration: none;
}

.kicker a:hover,
.kicker a:focus-visible {
  text-decoration: underline;
}

h1 {
  margin: 0.25rem 0 0;
  font-size: 1.8rem;
  font-family: "Arial Black", "Impact", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #23476f;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  min-height: calc(100vh - 88px);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem;
  background: var(--panel);
  box-shadow: inset 0 1px 0 #ffffff, 0 12px 24px #8fa7c52e;
}

.panel.content {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fcffed 0%, #eaf5ffed 55%, #e4f2e8ed 100%);
  border-color: #b7cde0;
}

.panel.content::before {
  content: none;
}

.panel.sidebar {
  background: linear-gradient(180deg, #f8fcffed 0%, #eaf5ffed 55%, #e4f2e8ed 100%);
  border-color: #b7cde0;
}

.panel.content::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("stuntisl3.png") center calc(50% + 28px) / min(860px, 74vw) auto no-repeat;
  opacity: 0.14;
  pointer-events: none;
}

.panel.content > * {
  position: relative;
  z-index: 2;
}

.panel h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #2a4f79;
}

.tree {
  font-size: 0.95rem;
  line-height: 1.35;
}

.tree-level {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
  border-left: 1px dashed #b4cae3;
}

.tree-level.root {
  border-left: none;
  padding-left: 0;
}

.tree-item {
  margin: 0.2rem 0;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.tree-toggle,
.tree-toggle-spacer {
  width: 1.3rem;
  min-width: 1.3rem;
  text-align: center;
}

.tree-toggle {
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #4d7398;
  cursor: pointer;
  padding: 0.1rem 0;
}

.tree-toggle:hover {
  border-color: #a8c2df;
  background: #edf4ff;
}

.tree-link {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  padding: 0.28rem 0.45rem;
  font-size: 0.92rem;
}

.tree-link:hover {
  border-color: #abc3df;
  background: #edf4ff;
}

.tree-link.active {
  border-color: #8bb38d;
  background: linear-gradient(90deg, #e4f3e6, #edf6ff);
  color: #2b6a35;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #c2d6eb;
  border-radius: 10px;
  background: #f5f9ff;
}

.crumb-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.2rem;
}

.crumb-link {
  border: none;
  background: none;
  color: #2d5f9f;
  cursor: pointer;
  padding: 0.15rem 0.2rem;
  font-size: 0.94rem;
}

.crumb-link.current {
  color: #2e6f3a;
  font-weight: 700;
}

.crumb-sep {
  color: #88a5c5;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.listing-section {
  margin-top: 1rem;
}

.bbs-welcome {
  margin-top: 0.6rem;
  margin-bottom: 0.8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #a9bfd7;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff, #edf5ff);
  color: #25496f;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.listing-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: #50729a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  border: 1px solid #c8d9eb;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--row), var(--row-2));
  padding: 0.5rem 0.6rem;
}

.list-row.folder {
  border-color: var(--green-line);
  background: linear-gradient(180deg, #eef8ef, var(--green-soft));
}

.list-main {
  min-width: 0;
}

.entry-button {
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  font-size: 0.98rem;
  padding: 0;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.entry-button:hover { color: var(--accent); }

.file-thumb {
  width: 38px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #b7cae0;
  background: #f3f7fc;
}

.entry-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.14rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-folder { color: var(--folder); }
.icon-file { color: var(--accent2); }

.row-actions {
  display: flex;
  gap: 0.4rem;
}

.row-actions a,
.row-actions button {
  border: 1px solid #b8cde2;
  background: #f8fbff;
  color: #2a4f79;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.24rem 0.5rem;
  font-size: 0.78rem;
}

.row-actions .primary {
  border-color: #84bb8f;
  background: linear-gradient(180deg, #eef8ef, #dcecff);
  color: #2c6840;
}

.modal,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #eef4fcde;
}

.modal {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-shell {
  width: min(1100px, 96vw);
  height: min(86vh, 760px);
  border: 1px solid #bfd3e8;
  border-radius: 12px;
  background: #fdfefe;
  box-shadow: 0 18px 40px #8fa7c52e;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #d2e1ef;
  padding: 0.7rem 0.85rem;
}

.modal-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2a4f79;
}

.modal-actions {
  display: flex;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
}

.modal-actions a {
  border: 1px solid #b9cfe5;
  border-radius: 8px;
  text-decoration: none;
  color: #2a4f79;
  background: #f2f7ff;
  padding: 0.3rem 0.6rem;
  font-size: 0.83rem;
}

.modal-close {
  border: 1px solid #b8cee4;
  border-radius: 8px;
  background: #edf4ff;
  color: #2a4f79;
  cursor: pointer;
  padding: 0.35rem 0.62rem;
}

.text-frame {
  width: calc(100% - 1.2rem);
  height: calc(100% - 0.6rem);
  margin: 0 0.6rem 0.6rem;
  border: 1px solid #c7d9ec;
  border-radius: 10px;
  background: #ffffff;
}

.lightbox {
  display: grid;
  place-items: center;
}

.lightbox-figure {
  margin: 0;
  max-width: min(95vw, 1300px);
  max-height: 86vh;
  display: grid;
  place-items: center;
  gap: 0.4rem;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border: 1px solid #b7cbe3;
  border-radius: 10px;
  background: #ffffff;
}

.lightbox figcaption {
  color: #45658a;
  font-size: 0.9rem;
}

.lightbox-open,
.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid #b5cbe3;
  background: #edf5ff;
  color: #2a4f79;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.4rem 0.66rem;
}

.lightbox-open {
  top: 1rem;
  left: 1rem;
  font-weight: 700;
}

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); font-size: 1.4rem; }
.lightbox-nav.prev { left: 1rem; }
.lightbox-nav.next { right: 1rem; }

.bottom-links {
  padding: 0 1rem 1rem;
}

.bottom-links a,
.topnav a {
  display: inline-block;
  color: #204f85;
  text-decoration: none;
  background: linear-gradient(180deg, #ecf4ff, #dce9fb);
  border: 1px solid #a8bfdc;
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font-weight: 700;
}

.bottom-links a:hover,
.topnav a:hover {
  background: linear-gradient(180deg, #e4efff, #d0e2fd);
}

.panel.content ul {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
}

.panel.content li {
  margin: 0.2rem 0;
}

.panel.content li a,
.panel.content li a:visited {
  color: #2b67a7;
  text-decoration: none;
}

.panel.content li a:hover {
  color: #1f4f82;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .panel.content::after {
    background-size: min(760px, 100vw) auto;
    opacity: 0.11;
  }
}
