:root {
  --paper: #fffdf2;
  --line: #8aa0bd;
  --blue: #2f6ec8;
  --light-blue: #dce9ff;
  --link: #0000cc;
  --visited: #800080;
  --red: #ff0000;
  --green: #6aa600;
  --cyan: #00a7d8;
  --shadow: #9aa8bf;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #c9d9f1 url("assets/page-grid.svg");
  color: #111;
  font-family: "Times New Roman", "SimSun", "Songti SC", serif;
  font-size: 13px;
  line-height: 1.35;
}

a {
  color: var(--link);
  text-decoration: underline;
}

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

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.mini-art,
.brand-badge img,
.pixel-map img {
  image-rendering: pixelated;
}

button {
  font-family: Arial, "SimSun", sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.page-shell {
  width: min(1000px, calc(100vw - 16px));
  margin: 8px auto 24px;
  background: #eaf2ff;
  border: 1px solid #6385bd;
  box-shadow: 2px 2px 0 var(--shadow);
}

.portal-top {
  background: #d7e5fb;
  border-bottom: 1px solid #6385bd;
}

.login-strip {
  min-height: 64px;
  display: grid;
  grid-template-columns: 170px 1fr 170px;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  background: linear-gradient(#eeeeee, #cdd8ea);
  border-bottom: 1px solid #fff;
}

.login-strip::after {
  content: "";
}

.brand-badge {
  text-align: center;
}

.site-id {
  display: grid;
  gap: 2px;
  color: #003399;
  text-align: center;
}

.site-id strong {
  color: #cc0000;
  font-size: 18px;
  line-height: 1.15;
}

.site-id span {
  display: block;
}

.quickbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 28px;
  padding: 3px 8px;
  background: #f5f7ff;
  border-top: 1px solid #aec7ef;
  border-bottom: 1px solid #aec7ef;
}

.quickbar a {
  padding: 0 8px;
  border-right: 1px solid #92aeda;
  font-size: 14px;
}

.quickbar a:first-child {
  border-left: 1px solid #92aeda;
}

.marquee-box {
  height: 26px;
  line-height: 25px;
  overflow: hidden;
  background: #fff;
  color: #003399;
  border-top: 1px solid #fff;
}

.rainbow-news {
  display: inline-block;
  padding: 0 7px;
  color: #ff0000;
  font: bold 13px Arial, sans-serif;
  text-shadow: 1px 0 #ffcc00, 2px 0 #00a651, 3px 0 #0066ff;
  animation: news-chase 0.7s steps(3, end) infinite;
}

.news-red {
  color: #cc0000;
  font-weight: bold;
}

.news-blue {
  color: #003399;
  font-weight: bold;
}

.blink {
  color: var(--red);
  font-weight: bold;
  animation: blink 0.9s steps(2, start) infinite;
}

@keyframes news-chase {
  0% {
    text-shadow: 1px 0 #ffcc00, 2px 0 #00a651, 3px 0 #0066ff;
  }

  50% {
    text-shadow: 1px 0 #00a651, 2px 0 #0066ff, 3px 0 #ff00aa;
  }

  100% {
    text-shadow: 1px 0 #0066ff, 2px 0 #ff00aa, 3px 0 #ffcc00;
  }
}

@keyframes blink {
  50% {
    visibility: hidden;
  }
}

.portal-grid {
  display: grid;
  grid-template-columns: 270px 1fr 230px;
  gap: 8px;
  padding: 8px;
}

.compact-grid {
  grid-template-columns: 284px 1fr;
}

.left-rail,
.center-stage {
  min-width: 0;
}

.panel {
  margin-bottom: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 1px 1px 0 #fff inset;
  overflow: hidden;
}

.panel h2 {
  margin: 0;
  padding: 3px 8px;
  min-height: 23px;
  color: #fff;
  background: var(--blue);
  border-bottom: 1px solid #244e98;
  font-size: 14px;
  line-height: 1.2;
  font-weight: bold;
}

.panel > p,
.panel > ul,
.panel > table,
.panel > form,
.panel .prof-head,
.panel .mini-art,
.paper {
  margin: 7px;
}

.blue h2 {
  background: #1f74d6;
}

.green h2 {
  background: var(--green);
  border-color: #4d7800;
}

.cyan h2 {
  background: var(--cyan);
  border-color: #00799e;
}

.profile-panel h2 {
  background: #ff7b00;
}

.prof-head {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  align-items: start;
}

.profile-photo {
  display: block;
  width: 90px;
  height: 120px;
  object-fit: cover;
  border: 1px solid #7a8ba7;
  background: #fff;
}

.prof-head h1 {
  margin: 0 0 3px;
  color: #cc0000;
  font-size: 24px;
  line-height: 1.05;
}

.rank {
  color: #003399;
  font-weight: bold;
}

.online-now {
  color: #006000;
}

.info-table,
.course-table {
  width: calc(100% - 14px);
  border-collapse: collapse;
  background: #fff;
}

.info-table th,
.info-table td,
.course-table th,
.course-table td {
  border: 1px solid #b9c5d6;
  padding: 3px 5px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.info-table th,
.course-table th {
  width: 72px;
  background: #edf3ff;
  color: #003399;
}

.mini-art {
  display: block;
  border: 1px solid #9ba8b7;
  background: #fff;
}

.link-list {
  padding-left: 20px;
}

.link-list li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.interest-list {
  margin-bottom: 8px;
}

.paper {
  padding: 7px;
  background: #fff;
  border: 1px solid #c4cce0;
}

.paper.is-hidden {
  display: none;
}

.paper h3 {
  margin: 3px 0 4px;
  font-size: 15px;
  line-height: 1.25;
}

.paper p {
  margin: 0;
}

.paper-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #666;
  font-family: Arial, sans-serif;
  font-size: 11px;
}

.tag {
  display: inline-block;
  min-width: 38px;
  padding: 1px 3px;
  background: #e60000;
  color: #fff;
  text-align: center;
  font-weight: bold;
}

.intro-panel p {
  margin: 8px;
  font-size: 14px;
}

.pixel-map {
  position: relative;
  margin: 7px;
  border: 1px solid #8aa0bd;
  background: #dce9ff;
  overflow: hidden;
}

.pixel-map img {
  display: block;
  width: 100%;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  padding: 0;
  background: #ff0000;
  border: 2px solid #fff7a8;
  box-shadow: 1px 1px 0 #003399, -1px -1px 0 #cc0000;
}

.map-pin.is-active,
.map-pin:hover,
.map-pin:focus {
  background: #ffff00;
  outline: 1px dotted #003399;
}

.map-pin span {
  position: absolute;
  top: -5px;
  left: 13px;
  padding: 1px 4px;
  color: #0000cc;
  background: #ffffcc;
  border: 1px solid #cc0000;
  box-shadow: 1px 1px 0 #003399;
  font: bold 10px Arial, sans-serif;
  line-height: 1.1;
  white-space: nowrap;
}

.map-pin.pin-left span {
  right: 13px;
  left: auto;
}

.map-pin.pin-top span {
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
}

.map-note {
  margin: 7px;
  min-height: 30px;
  padding: 5px 7px;
  background: #fff;
  border: 1px dotted #8aa0bd;
}

.timeline-table th {
  width: 96px;
}

.downloads {
  background: #fff9d8;
}

.download-btn {
  display: block;
  margin: 7px;
  padding: 5px 7px;
  color: #003399;
  background: #e7f1ff;
  border: 2px outset #d7e8ff;
  text-align: center;
  font-weight: bold;
}

.download-btn:visited {
  color: #003399;
}

.muted {
  color: #777;
  font-weight: normal;
}

.visitor-panel {
  background: #fffef0;
}

.visitor-plaque {
  margin: 7px;
  padding: 7px;
  background: #eaf2ff;
  border: 2px ridge #9fb6d8;
  text-align: center;
}

.visitor-welcome {
  margin-bottom: 5px;
  color: #003399;
  font-weight: bold;
}

.counter {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 5px 0 7px;
}

.counter span {
  display: inline-flex;
  width: 22px;
  height: 30px;
  align-items: center;
  justify-content: center;
  color: #00ff66;
  background: #030303;
  border: 1px solid #555;
  font: bold 20px "Courier New", monospace;
}

.visitor-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  background: #fff;
  text-align: left;
}

.visitor-table th,
.visitor-table td {
  border: 1px solid #b9c5d6;
  padding: 2px 4px;
  font-size: 11px;
}

.visitor-table th {
  width: 56px;
  color: #003399;
  background: #edf3ff;
}

.guestbook-link {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: #ffffcc;
  border: 2px outset #e8e8e8;
  font: bold 12px Arial, sans-serif;
}

.site-footer {
  padding: 14px 8px 22px;
  text-align: center;
  color: #000;
  background: #fff;
  border-top: 1px solid #9fb6d8;
  font-size: 12px;
}

.site-footer p {
  margin: 6px 0 0;
}

@media (max-width: 820px) {
  .page-shell {
    width: calc(100vw - 10px);
    margin: 5px auto 16px;
  }

  .login-strip {
    grid-template-columns: 1fr;
  }

  .login-strip::after {
    display: none;
  }

  .brand-badge {
    justify-content: center;
    text-align: center;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }

  .compact-grid {
    grid-template-columns: 1fr;
  }

  .left-rail {
    order: 2;
  }

  .center-stage {
    order: 1;
  }

  .prof-head {
    grid-template-columns: 82px 1fr;
  }

  .profile-photo {
    width: 82px;
    height: 109px;
  }

  .map-pin {
    width: 13px;
    height: 13px;
    padding: 0;
    border-radius: 0;
  }

  .map-pin span {
    display: none;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 12px;
  }

  .quickbar {
    justify-content: flex-start;
  }

  .quickbar a {
    padding: 2px 6px;
  }

  .prof-head h1 {
    font-size: 20px;
  }
}
