@charset "UTF-8";

/* ==========================================================================
   梦之朝霭 -Online-
   2006 年的外观，现代的写法：不做设计上的任何改动，只换实现。
   配色只有：白 / 黑 / 灰(#ccc #808080) / 链接蓝(#0000cc) / 纯红(#f00)。
   字号沿用原来的绝对关键字，保证和 <font size="1|2|3|4"> 算出同一个像素值。
   ========================================================================== */

:root {
  --paper: #fff;
  --ink: #000;
  --link: #0000cc;
  --accent: #ff0000;
  --rule: #ccc;
  --muted: #808080;

  --page-width: 760px;
  --text-width: 600px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: "宋体", SimSun, serif;
  font-size: 12px;
  /* 用百分比而不是无单位数值：百分比会在 body 上算成固定值 20.4px 再继承，
     这样 18px 的标题也保持 20.4px 行高，和原来的渲染结果一致。 */
  line-height: 170%;
  text-align: center;
}

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

a:hover,
a:active {
  color: var(--accent);
  text-decoration: underline;
}

p {
  margin: 12px 0;
}

/* 分隔线：保留浏览器默认的 inset 立体边框，只接管宽度与 1px 高度。
   border-box 是为了让总高度真正等于 1px（否则 1px 高度 + 上下边框 = 2px）。 */
hr {
  box-sizing: border-box;
  width: var(--page-width);
  height: 1px;
  margin: 0.5em auto;
}

hr.is-narrow {
  width: var(--text-width);
}

/* 页脚那条线前面原来有一个 <br> */
main + hr {
  margin-top: 26px;
}

/* --------------------------------------------------------------- 页头 --- */

.masthead {
  width: var(--page-width);
  margin: 0 auto;
  padding-top: 20px;
}

.masthead__title {
  display: block;
  margin: 0 auto;
}

.masthead__online {
  margin: 0;
  font-size: medium;
}

.masthead__motto {
  margin: 0 0 27px;
  font-size: x-small;
  color: var(--accent);
}

/* --------------------------------------------------------------- 公告 --- */

.notice {
  width: var(--page-width);
  margin: 0 auto;
  padding: 5px;
  border: 1px solid var(--rule);
}

.notice__label {
  font-size: small;
  font-weight: bold;
  color: var(--accent);
}

.ticker {
  display: inline-block;
  width: 620px;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: middle;
  font-size: small;
}

.ticker__text {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-scroll 52s linear infinite;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__text {
    padding-left: 0;
    animation: none;
  }
}

/* --------------------------------------------------------------- 导航 --- */

.site-nav {
  width: var(--page-width);
  margin: 0 auto;
  padding: 6px 0;
  font-size: small;
}

.site-nav ul {
  display: flex;
  justify-content: center;
  gap: 33px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li::before { content: "[ "; }
.site-nav li::after  { content: " ]"; }

/* --------------------------------------------------------------- 正文 --- */

.intro {
  display: flow-root;
  width: var(--text-width);
  margin: 0 auto;
}

/* 原版在每节前面有一个 <br>，这里换成 20px 的上边距。
   flow-root 是为了让节内 <p> 的下边距不要和这里的上边距合并
   （合并了会少掉 12px，和原来的间距对不上）。 */
.section {
  display: flow-root;
  margin: 20px 0 0;
}

/* 但第一节紧跟导语，原版没有那个 <br> */
.intro + .section {
  margin-top: 0;
}

.section__title {
  margin-top: 10px;
  font-size: large;
}

.section hr {
  margin: 0.5em auto;
}

.small { font-size: small; }
.tiny  { font-size: x-small; }
.muted { color: var(--muted); }

/* 只放一张图的段落：图片独立成块，段落高度就等于图片高度
   （原来由行内基线决定，图下方会多出 4px 左右的行间余量） */
.figure img {
  display: block;
  margin: 0 auto;
}

/* ----------------------------------------------------------- 更新履历 --- */

.log {
  width: var(--text-width);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  font-size: small;
}

.log li {
  display: grid;
  grid-template-columns: 110px 1fr;
  column-gap: 8px;
  padding: 4px;
  text-align: left;
}

.log__date {
  text-align: right;
  color: var(--accent);
}

/* ----------------------------------------------------------- 关于本站 --- */

.profile {
  display: grid;
  grid-template-columns: 96px 1fr;
  column-gap: 6px;
  row-gap: 6px;
  width: var(--text-width);
  margin: 0 auto;
  padding: 3px;
  font-size: small;
  text-align: left;
}

.profile dt { text-align: right; }
.profile dd { margin: 0; }

/* ----------------------------------------------------------- 访问统计 --- */

.counter {
  width: fit-content;
  margin: 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: small;
}

.counter__row {
  margin: 0;
}

.counter__row + .counter__row {
  margin-top: 12px;
}

/* 数字与左右文字之间各留 16px，对应原来表格 cellpadding="8" 的左右各 8px */
.counter__digits {
  display: inline-block;
  margin: 0 16px;
}

.counter__row--meta {
  display: block;
  font-size: x-small;
}

.counter__digits,
.counter__num {
  color: var(--accent);
}

.red {
  color: var(--accent);
}

/* ----------------------------------------------------------- 留言本 --- */

/* 表单默认收起，点「我要留言」才展开 */
[hidden] {
  display: none !important;
}

.gb-toggle-row {
  margin: 0 0 10px;
}

.gb-form {
  width: var(--text-width);
  margin: 0 auto 12px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: small;
  text-align: left;
}

.gb-field {
  display: grid;
  grid-template-columns: 92px 1fr;
  column-gap: 8px;
  align-items: start;
  margin-bottom: 6px;
}

.gb-field > label {
  padding-top: 3px;
  text-align: right;
}

.gb-field input[type="text"],
.gb-field textarea {
  border: 1px solid var(--muted);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  padding: 2px 3px;
}

.gb-field textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.6;
}

.gb-question {
  display: inline-block;
  min-width: 52px;
  color: var(--accent);
}

.gb-submit {
  border: 1px solid var(--muted);
  border-radius: 0;
  background: #eee;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  padding: 2px 10px;
  cursor: pointer;
}

.gb-submit:disabled {
  color: var(--muted);
}

.gb-status {
  margin-left: 8px;
  font-size: x-small;
}

.gb-status.is-ok {
  color: var(--ink);
}

.gb-status.is-error {
  color: var(--accent);
}

/* 蜜罐：给机器人看的，人看不见 */
.gb-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gb-count {
  margin: 0 0 6px;
}

.gb-list {
  width: var(--text-width);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  font-size: small;
  text-align: left;
}

.gb-item {
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.gb-item__head {
  margin: 0 0 2px;
}

.gb-item__head b {
  color: var(--accent);
}

.gb-item__body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.gb-item__foot {
  margin: 4px 0 0;
  font-size: x-small;
  color: var(--muted);
}

.gb-empty {
  padding: 8px 10px;
  border: 1px solid var(--rule);
}

/* 「查看全部留言」按钮 */
.gb-more {
  margin: 0;
}

.gb-more a {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--muted);
  background: #eee;
  color: var(--ink);
  text-decoration: none;
}

.gb-more a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* --------------------------------------------------------- 友情链接 --- */

.friend-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: var(--text-width);
  margin: 0 auto 10px;
  padding: 0;
  list-style: none;
}

/* 各家图标尺寸不一样，统一高度、宽度按比例缩放 */
.friend-links img {
  display: block;
  width: auto;
  height: 36px;
}

/* --------------------------------------------------------------- 页脚 --- */

.site-footer {
  width: var(--page-width);
  margin: 0 auto;
  font-size: x-small;
}

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

/* 页脚第一行原来直接跟在 <hr> 后面，没有上边距 */
.site-footer p:first-child {
  margin-top: 0;
}

.colophon {
  color: var(--muted);
}
