@font-face {
  font-family: "Libertinus Serif";
  src: url("fonts/LibertinusSerif-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Libertinus Serif";
  src: url("fonts/LibertinusSerif-Semibold.otf") format("opentype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Libertinus Sans";
  src: url("fonts/LibertinusSans-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #fcfcfb;
  --paper-deep: #e5e7e8;
  --paper-light: #ffffff;
  --ink: #000000;
  --ink-soft: #171819;
  --muted: #43484c;
  --rule: #000000;
  --rule-soft: #8c9297;
  --accent: #6b2f24;
  --accent-dark: #4e2019;
  --danger: #8b261f;
  --serif: "STZhongsong", "华文中宋", "STSong", "华文宋体", "SimSun", "宋体", "Libertinus Serif", serif;
  --sans: "STZhongsong", "华文中宋", "STSong", "华文宋体", "SimSun", "宋体", "Libertinus Sans", serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper-deep); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.66 var(--serif);
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button, input, textarea, select { color: inherit; font: inherit; }

.site-header {
  position: relative;
  z-index: 1;
  min-height: 92px;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper-light);
  border-top: 5px solid var(--ink);
  border-bottom: 4px double var(--ink);
}
.site-header::after {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(30vw, 380px);
  content: "";
  background: linear-gradient(90deg, rgba(247, 249, 251, 1) 0%, rgba(247, 249, 251, .52) 35%, rgba(247, 249, 251, .12) 100%), url("art/portrait-seal.webp") center 39% / contain no-repeat;
  filter: grayscale(1);
  opacity: .22;
}
.masthead-row {
  width: min(1220px, calc(100% - 40px));
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0 auto;
}
.brand {
  flex: 0 0 auto;
  font: 600 clamp(25px, 3vw, 38px)/1 var(--serif);
  letter-spacing: .14em;
  white-space: nowrap;
}
.site-header nav {
  min-height: 82px;
  display: flex;
  align-self: flex-start;
  align-items: flex-start;
  gap: 10px;
}
.site-header nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  font: 13px/1 var(--sans);
  letter-spacing: .08em;
}
.account-actions {
  display: flex;
  align-self: flex-start;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding-top: 4px;
  font-family: var(--sans);
}
.inline-form { display: inline-flex; margin: 0; }

.primary-button, .quiet-button, .text-button,
.forum-toolbar button, .filter-bar button, .library-filter button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--rule);
  border-radius: 0;
  cursor: pointer;
  font: 13px/1 var(--sans);
  letter-spacing: .04em;
}
.primary-button, .forum-toolbar button, .filter-bar button, .library-filter button {
  color: var(--paper-light);
  background: var(--ink);
  border-color: var(--ink);
}
.primary-button:hover, .forum-toolbar button:hover, .filter-bar button:hover, .library-filter button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.quiet-button:hover, .text-button:hover { color: var(--accent); border-color: var(--accent); }
.site-header .quiet-button, .site-header .text-button { background: rgba(255, 255, 255, .96); }
.site-header .text-button { border-color: transparent; }
.site-header nav a,
.site-header .account-actions > .quiet-button {
  position: relative;
  isolation: isolate;
  min-width: 112px;
  min-height: 76px;
  padding: 17px 22px 22px;
  color: var(--ink);
  background: var(--rule);
  border: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 14px), 0 100%);
  filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, .13));
  transition: color .16s ease, transform .16s ease;
}
.site-header nav a::before,
.site-header .account-actions > .quiet-button::before {
  position: absolute;
  z-index: -1;
  inset: 1px;
  content: "";
  background: var(--paper-light);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 13px), 0 100%);
}
.site-header nav a::after,
.site-header .account-actions > .quiet-button::after {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 5px;
  height: 5px;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translateX(-50%);
}
.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-header .account-actions > .quiet-button:hover,
.site-header .account-actions > .quiet-button:focus-visible {
  color: var(--paper-light);
  transform: translateY(4px);
}
.site-header nav a:hover::before,
.site-header nav a:focus-visible::before,
.site-header .account-actions > .quiet-button:hover::before,
.site-header .account-actions > .quiet-button:focus-visible::before {
  background: var(--ink);
}
.site-header .account-actions > .quiet-button {
  min-width: 106px;
  min-height: 70px;
  padding: 17px 18px 20px;
  clip-path: polygon(0 0, 100% 0, 100% 79%, 50% 100%, 0 79%);
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, .16));
  letter-spacing: .12em;
}
.site-header .account-actions > .quiet-button::before {
  inset: 1px 1px 2px;
  background:
    linear-gradient(90deg, transparent 7px, rgba(0, 0, 0, .16) 7px, rgba(0, 0, 0, .16) 8px, transparent 8px, transparent calc(100% - 8px), rgba(0, 0, 0, .16) calc(100% - 8px), rgba(0, 0, 0, .16) calc(100% - 7px), transparent calc(100% - 7px)),
    var(--paper-light);
  clip-path: polygon(0 0, 100% 0, 100% 79%, 50% 100%, 0 79%);
}
.site-header .account-actions > .quiet-button:hover::before,
.site-header .account-actions > .quiet-button:focus-visible::before {
  background:
    linear-gradient(90deg, transparent 7px, rgba(255, 255, 255, .24) 7px, rgba(255, 255, 255, .24) 8px, transparent 8px, transparent calc(100% - 8px), rgba(255, 255, 255, .24) calc(100% - 8px), rgba(255, 255, 255, .24) calc(100% - 7px), transparent calc(100% - 7px)),
    var(--ink);
}
.notification-count {
  min-width: 18px;
  margin-left: 7px;
  padding: 1px 5px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-size: 10px;
  text-align: center;
}

.messages { width: min(1220px, calc(100% - 40px)); margin: 14px auto 0; }
.messages p {
  margin: 0 0 8px;
  padding: 10px 13px;
  background: #f0f1f1;
  border: 1px solid var(--rule);
  border-left-width: 5px;
}
main { min-height: calc(100vh - 92px); }
.content-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 60px;
}
.content-shell::before {
  display: block;
  width: 100%;
  height: 5px;
  margin-bottom: 18px;
  content: "";
  border-top: 1px solid var(--rule);
  border-bottom: 2px solid var(--rule);
}
.narrow-shell { width: min(660px, calc(100% - 40px)); }
.wide-form { width: min(880px, calc(100% - 40px)); }
.main-column { min-width: 0; }

.page-title, .thread-heading h1 {
  margin: 0;
  font: 600 clamp(26px, 3.4vw, 39px)/1.18 var(--serif);
  letter-spacing: .035em;
}
.page-heading {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.page-lead { margin: 6px 0 0; color: var(--ink-soft); font-size: 16px; }
.panel-heading {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  background: transparent;
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.panel-heading h1, .panel-heading h2 {
  margin: 0;
  font: 600 19px/1.2 var(--serif);
  letter-spacing: .08em;
}
.panel-heading a, .panel-heading span { color: var(--muted); font: 11px/1 var(--sans); }
.panel-heading a:hover { color: var(--accent); text-decoration: underline; }
.panel-heading.secondary { margin-top: 28px; background: transparent; }

.forum-table, .topic-table, .notification-list {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--rule);
}
.forum-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 76px 76px;
  gap: 12px;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid var(--rule-soft);
}
.forum-row:last-child, .topic-row:last-child { border-bottom: 0; }
.forum-row:hover, .topic-row:hover { background: var(--paper-deep); }
.forum-disclaimer {
  margin: 28px 0 0;
  color: var(--muted);
  font: 11px/1.6 var(--sans);
  text-align: right;
}
.character-forum-row { grid-template-columns: 56px minmax(0, 1fr) 112px 112px; }
.character-thumb {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--paper-light);
  background: var(--ink-soft);
  border: 1px solid var(--rule);
  font-size: 19px;
}
.character-thumb img { width: 100%; height: 100%; object-fit: cover; }
.forum-row.child-board { min-height: 64px; padding-left: 35px; background: rgba(229, 231, 232, .9); }
.forum-icon { color: var(--accent); font: 18px/1 var(--serif); text-align: center; }
.forum-name b, .topic-title b {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .015em;
}
.forum-name small, .topic-title small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font: 12px/1.45 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forum-stat, .topic-number { text-align: center; }
.forum-stat b { display: block; font-size: 16px; font-weight: 400; }
.forum-stat small, .topic-number small { display: block; color: var(--muted); font: 10px/1.3 var(--sans); }
.topic-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 58px 58px 105px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.topic-row.unread .topic-title b { color: var(--accent-dark); font-weight: 600; }
.topic-status {
  padding: 3px 4px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule);
  font: 10px/1.2 var(--sans);
  text-align: center;
}
.topic-row.unread .topic-status { color: var(--paper-light); background: var(--accent); border-color: var(--accent); }
.topic-row time { color: var(--muted); font: 11px/1.2 var(--sans); text-align: right; }
.empty-row { padding: 34px 18px; color: var(--muted); background: rgba(255, 255, 255, .96); text-align: center; }

.side-panel { background: rgba(255, 255, 255, .96); border-top: 4px double var(--rule); border-bottom: 1px solid var(--rule); }
.side-panel > h2, .side-title {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0 12px;
  background: transparent;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.side-title h2 { margin: 0; font-size: 15px; }
.side-title a { color: var(--muted); font: 11px/1 var(--sans); }
.side-panel dl { margin: 0; }
.side-panel dl div { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px dotted var(--rule-soft); }
.side-panel dt { color: var(--muted); }
.side-panel dd { margin: 0; font-weight: 600; }
.side-panel dd a, .back-link, .text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.compact-list { margin: 0; padding: 0; list-style: none; }
.compact-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px dotted var(--rule-soft); }
.compact-list li:last-child { border-bottom: 0; }
.compact-list a:hover { color: var(--accent); }
.compact-list small { color: var(--muted); font-family: var(--sans); }

.forum-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}
.forum-toolbar p { margin: 5px 0 0; color: var(--muted); }
.forum-toolbar form { display: flex; width: min(440px, 100%); border-bottom: 2px solid var(--rule); }
.forum-toolbar input {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  outline: 0;
}
.forum-toolbar button { border-bottom: 0; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--muted);
  font: 12px/1.4 var(--sans);
}
.breadcrumbs a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.list-controls {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.list-controls div { display: flex; gap: 2px; }
.list-controls a { padding: 5px 9px; color: var(--muted); font: 12px/1 var(--sans); }
.list-controls a.active { color: var(--paper-light); background: var(--ink); }
.list-controls > span { color: var(--muted); font: 11px/1 var(--sans); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 0; margin: 25px 0; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--rule); border-right: 0; }
.pagination :last-child { border-right: 1px solid var(--rule); }

.thread-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.thread-heading p { margin: 8px 0 0; color: var(--muted); }
.thread-actions, .thread-actions form { display: flex; align-items: start; gap: 6px; margin: 0; }
.forum-tag, .tag-row span {
  display: inline-block;
  margin-right: 5px;
  padding: 2px 6px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule-soft);
  font: 10px/1.4 var(--sans);
}
.moderator-bar { margin-bottom: 12px; padding: 8px; background: #eceeef; border: 1px solid var(--rule); }
.moderator-bar form { display: flex; gap: 6px; }
.moderator-bar button { padding: 4px 9px; background: transparent; border: 1px solid var(--rule); cursor: pointer; }
.role-post {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  margin-bottom: 15px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid var(--rule);
}
.role-post > aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  background: rgba(229, 231, 232, .96);
  border-right: 1px solid var(--rule);
  text-align: center;
}
.role-post > aside img, .role-post > aside > span {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  object-fit: cover;
  color: var(--paper-light);
  background: var(--ink-soft);
  border: 1px solid var(--rule);
  font-size: 26px;
}
.role-post > aside b { font-size: 15px; }
.role-post > aside small { color: var(--muted); font: 10px/1.3 var(--sans); }
.role-post > div > header {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--rule-soft);
  font: 11px/1 var(--sans);
}
.role-post > div > header nav { display: flex; gap: 10px; margin-left: auto; }
.role-post > div > header nav a, .link-button { color: var(--accent); }
.role-post > div > header nav form { margin: 0; }
.link-button { padding: 0; background: transparent; border: 0; cursor: pointer; font: inherit; }
.post-body { min-height: 150px; padding: 24px; word-break: break-word; }
.post-body p { margin: 0 0 1em; }
.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 240px));
  gap: 12px;
  margin-top: 20px;
}
.post-images a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, .98);
}
.post-images img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: contain;
}
.reply-form { margin-top: 30px; }
.reply-form h2, .prose-block h2 { font: 600 20px/1.2 var(--serif); letter-spacing: .05em; }
.notice { padding: 14px; border: 1px solid var(--rule); text-align: center; }
.posting-as {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 19px;
  padding: 10px 12px;
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.posting-as span, .posting-as small { color: var(--muted); }

.paper-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding: 24px;
  background: rgba(255, 255, 255, .96);
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.paper-form > div { display: grid; gap: 7px; }
.paper-form label, .review-list label { font: 600 12px/1.3 var(--sans); letter-spacing: .04em; }
.optional-field-note {
  margin-left: .35em;
  color: var(--muted);
  font: 400 10px/1 var(--sans);
  letter-spacing: 0;
  opacity: .55;
}
.paper-form input, .paper-form textarea, .paper-form select, .review-list textarea {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--rule);
  border-radius: 0;
  outline: 0;
}
.paper-form input:focus, .paper-form textarea:focus, .paper-form select:focus { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.paper-form .helptext, .paper-form ul { margin: 0; color: var(--muted); font: 11px/1.5 var(--sans); }
.paper-form .errorlist { color: var(--danger); }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 17px; }
.form-foot { color: var(--muted); }
.locked-id, .target-line { padding: 9px 11px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.binding-box, .account-status {
  margin-top: 19px;
  padding: 20px;
  background: rgba(255, 255, 255, .96);
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.binding-box dl { margin: 0; }
.binding-box dl div { display: grid; grid-template-columns: 110px 1fr; padding: 9px 0; border-bottom: 1px dotted var(--rule-soft); }
.binding-box dd { margin: 0; }
.binding-code { font-size: 25px; font-weight: 600; letter-spacing: .16em; }
.binding-box code { padding: 3px 6px; background: var(--paper-deep); }
.account-status { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.account-status > div { display: grid; gap: 4px; }
.account-status span { color: var(--muted); }
.account-status a { color: var(--accent); text-decoration: underline; }

.profile-summary {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 21px;
  margin-top: 17px;
  padding: 20px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--rule);
}
.profile-summary h2 { margin: 5px 0; }
.profile-summary p { color: var(--muted); }
.portrait {
  width: 112px;
  height: 128px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--paper-light);
  background: var(--ink-soft);
  border: 1px solid var(--rule);
  font-size: 32px;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.character-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .96);
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.character-card:hover { background: var(--paper-deep); }
.character-card .portrait { width: 84px; height: 98px; }
.character-card h3 { margin: 3px 0; font-size: 18px; }
.character-card small, .character-card p, .character-card em { display: block; color: var(--muted); font: 11px/1.45 var(--sans); font-style: normal; }
.filter-bar, .library-filter {
  display: flex;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, .96);
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.filter-bar input, .library-filter input, .library-filter select {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule-soft);
  outline: 0;
}
.library-filter select { flex: 0 0 145px; }
.character-profile { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 34px; }
.character-profile > aside { min-height: 430px; background: var(--paper-deep); border: 1px solid var(--rule); }
.full-art { width: 100%; height: 100%; max-height: 620px; object-fit: cover; object-position: top; }
.art-placeholder { min-height: 430px; display: grid; place-items: center; color: var(--paper-light); background: var(--ink-soft); font-size: 72px; }
.fact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.fact-row span { padding: 11px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.fact-row small { display: block; color: var(--muted); font: 10px/1.3 var(--sans); }
.status { display: inline-block; padding: 3px 7px; border: 1px solid var(--rule); font: 11px/1.3 var(--sans); }
.status.draft { background: var(--paper-deep); }
.status.pending { background: #f2e5b9; }
.status.approved { background: #dfe6d6; }
.status.rejected { color: var(--danger); background: #efdbd7; }
.owner-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 10px 0; border-top: 4px double var(--rule); border-bottom: 1px solid var(--rule); }
.owner-toolbar form { margin: 0; }
.review-note { padding: 10px; background: #eceeef; border: 1px solid var(--rule); }
.prose-block { margin-top: 26px; }
.prose-block h2 { padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.prose-block p { line-height: 1.9; }

.library-list-page.content-shell::before,
.world-list-page.content-shell::before {
  height: 1px;
  border-top: 1px solid var(--rule);
  border-bottom: 0;
}
.library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.library-card {
  position: relative;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, .99);
  border: 1px solid var(--rule);
  box-shadow: 6px 7px 0 var(--paper-deep);
  transition: box-shadow .16s ease, transform .16s ease;
}
.library-card::before,
.library-card::after,
.library-detail::before,
.library-detail::after {
  position: absolute;
  right: 7px;
  left: 7px;
  height: 10px;
  content: "";
  pointer-events: none;
}
.library-card::before,
.library-detail::before {
  top: 7px;
  border-top: 1px solid var(--rule-soft);
  border-left: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
}
.library-card::after,
.library-detail::after {
  bottom: 7px;
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  border-left: 1px solid var(--rule-soft);
}
.library-card:hover {
  background: #fff;
  box-shadow: 3px 4px 0 var(--paper-deep);
  transform: translate(2px, 2px);
}
.library-card > div:last-child { padding-top: 2px; }
.library-card h2 { margin: 7px 0 9px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-soft); font-size: 19px; line-height: 1.25; }
.library-card p { margin: 4px 0; color: var(--muted); font-size: 13px; }
.library-card small, .item-kind { color: var(--accent); font: 11px/1.4 var(--sans); letter-spacing: .05em; }
.cover {
  position: relative;
  width: 90px;
  height: 124px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--paper-light);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .13) 0, rgba(255, 255, 255, .03) 9px, transparent 10px),
    var(--ink-soft);
  border: 3px double var(--rule);
  box-shadow: 3px 3px 0 var(--paper-deep);
  font: 12px/1.3 var(--sans);
}
.cover::after {
  position: absolute;
  inset: 5px;
  content: "";
  border: 1px solid currentColor;
  opacity: .3;
  pointer-events: none;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.large { width: 240px; height: 340px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag-row span { margin: 0; }
.library-detail {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 34px;
  padding: 28px;
  background: rgba(255, 255, 255, .99);
  border: 1px solid var(--rule);
  box-shadow: 7px 8px 0 var(--paper-deep);
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.danger-text { color: var(--danger); border-color: var(--danger); }

.world-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.world-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 170px;
  overflow: hidden;
  background: rgba(255, 255, 255, .96);
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.world-card:hover { background: var(--paper-deep); }
.world-card img { width: 150px; height: 100%; object-fit: cover; filter: grayscale(.25); }
.world-card div { padding: 16px; }
.world-card h2 { margin: 4px 0 9px; font-size: 21px; }
.world-card p { margin: 0; color: var(--muted); line-height: 1.7; }
.world-card small { color: var(--accent); font: 11px/1.4 var(--sans); }
.world-detail { padding: 0 0 24px; }
.world-cover { width: 100%; max-height: 420px; margin-bottom: 24px; object-fit: cover; filter: grayscale(.18); border: 1px solid var(--rule); }

.editor-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.editor-summary a {
  display: grid;
  gap: 5px;
  padding: 20px;
  background: rgba(255, 255, 255, .96);
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.editor-summary b { font-size: 30px; }
.editor-summary span { color: var(--muted); font: 12px/1.4 var(--sans); }

.review-list, .report-list { display: grid; gap: 14px; }
.review-list article, .report-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 25px;
  padding: 20px;
  background: rgba(255, 255, 255, .96);
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
}
.review-list article h2, .report-list article h3 { margin: 4px 0; }
.review-list article p, .report-list article p { color: var(--muted); }
.review-list form { display: grid; gap: 8px; }
.review-list form div, .report-list form { display: flex; justify-content: end; align-items: end; gap: 7px; }
.danger { color: var(--danger); border-color: var(--danger); }
.notification-list { border-top: 4px double var(--rule); }
.notification-list > a {
  display: grid;
  grid-template-columns: 130px 1fr 130px;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.notification-list > a.unread { background: var(--paper-deep); }
.notification-list time { color: var(--muted); text-align: right; }
.back-link { display: inline-block; margin-bottom: 17px; }

@media (max-width: 920px) {
  .masthead-row { width: min(100% - 28px, 1220px); flex-wrap: wrap; gap: 8px 18px; padding: 12px 0; }
  .brand { margin-right: auto; }
  .site-header nav { order: 3; width: 100%; min-height: 66px; overflow-x: auto; padding-bottom: 5px; }
  .site-header nav a { min-width: 100px; min-height: 60px; padding: 15px 13px 19px; white-space: nowrap; }
  .account-actions { margin-left: 0; }
  .character-profile, .library-detail { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .review-list article, .report-list article { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  body { font-size: 14px; }
  .site-header::after { width: 66vw; opacity: .1; }
  .brand { font-size: 25px; }
  .site-header .account-actions .quiet-button:not(:last-of-type) { display: none; }
  .content-shell { width: min(100% - 22px, 1220px); padding: 24px 0 52px; }
  .content-shell::before { margin-bottom: 18px; }
  .forum-toolbar, .page-heading, .thread-heading { align-items: stretch; flex-direction: column; }
  .forum-toolbar form { width: 100%; }
  .forum-row { grid-template-columns: 28px minmax(0, 1fr) 46px; padding-inline: 9px; }
  .character-forum-row { grid-template-columns: 48px minmax(0, 1fr) 64px; }
  .forum-row .forum-stat:last-child { display: none; }
  .topic-row { grid-template-columns: 46px minmax(0, 1fr) 45px; padding-inline: 8px; }
  .topic-row time, .topic-row .topic-number:nth-last-of-type(1) { display: none; }
  .card-grid, .library-grid, .world-grid, .editor-summary { grid-template-columns: 1fr; }
  .world-card { grid-template-columns: 105px minmax(0, 1fr); }
  .world-card img { width: 105px; }
  .role-post { grid-template-columns: 1fr; }
  .role-post > aside {
    flex-direction: row;
    gap: 10px;
    justify-content: start;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .role-post > aside img, .role-post > aside > span { width: 42px; height: 42px; margin: 0; }
  .post-body { min-height: 110px; padding: 17px; }
  .filter-bar, .library-filter { flex-wrap: wrap; }
  .filter-bar input, .library-filter input { flex-basis: 100%; border-bottom: 1px solid var(--rule-soft); }
  .library-filter select { flex: 1; }
  .cover.large { width: 180px; height: 255px; }
  .fact-row, .account-status { grid-template-columns: 1fr; }
  .notification-list > a { grid-template-columns: 86px 1fr; }
  .notification-list time { display: none; }
  footer { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* 内网论坛：以原始版画建立环境层次，不影响公网模板。 */
.internal-site.forum-surface {
  background-color: #cbd2d8;
  background-image:
    linear-gradient(90deg, rgba(20, 23, 26, .3), rgba(238, 242, 245, .56) 18%, rgba(238, 242, 245, .56) 82%, rgba(20, 23, 26, .3)),
    linear-gradient(rgba(236, 241, 244, .62), rgba(57, 62, 66, .16)),
    url("forum-grotto.jpg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}
.internal-site.forum-surface .site-header {
  background: rgba(255, 255, 255, .99);
  box-shadow: 0 8px 28px rgba(25, 25, 22, .31);
  backdrop-filter: blur(3px);
}
.internal-site.forum-surface .site-header::after { opacity: .12; }
.internal-site.forum-surface main {
  padding: 30px 0 70px;
  background: linear-gradient(rgba(20, 20, 18, .04), rgba(20, 20, 18, .26));
}
.internal-site.forum-surface .content-shell {
  padding: 0;
}
.internal-site.forum-surface .content-shell::before { display: none; }
.internal-site.forum-surface .main-column,
.internal-site.forum-surface .narrow-shell {
  position: relative;
  padding: clamp(20px, 3vw, 42px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .052) 1px, transparent 1px) 0 0 / 23px 23px,
    rgba(255, 255, 255, .995);
  border: 1px solid #282824;
  outline: 1px solid rgba(255, 255, 255, .96);
  outline-offset: 6px;
  box-shadow: 0 24px 70px rgba(24, 21, 16, .46), inset 0 0 70px rgba(105, 90, 63, .08);
}
.internal-site.forum-surface .main-column::before,
.internal-site.forum-surface .narrow-shell::before {
  position: absolute;
  inset: 7px;
  z-index: 0;
  content: "";
  border: 1px solid rgba(0, 0, 0, .4);
  pointer-events: none;
}
.internal-site.forum-surface .main-column > *,
.internal-site.forum-surface .narrow-shell > * {
  position: relative;
  z-index: 1;
}
.forum-engraving {
  min-height: clamp(210px, 29vw, 355px);
  margin: calc(clamp(20px, 3vw, 42px) * -1) calc(clamp(20px, 3vw, 42px) * -1) 30px;
  background-image:
    linear-gradient(to bottom, rgba(37, 33, 26, .02) 50%, rgba(35, 31, 24, .7) 100%),
    url("forum-grotto.jpg");
  background-position: center 42%;
  background-size: cover;
  border-bottom: 5px double var(--rule);
  box-shadow: inset 0 0 0 8px rgba(249, 249, 246, .3), inset 0 0 75px rgba(14, 13, 10, .3);
  filter: sepia(.18) contrast(1.08) saturate(.72);
}
.internal-site.forum-surface .forum-toolbar {
  padding-bottom: 17px;
  border-bottom: 4px double var(--rule);
}
.internal-site.forum-surface .forum-toolbar .page-title,
.internal-site.forum-surface .thread-heading h1 {
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .98);
}
.internal-site.forum-surface .forum-table,
.internal-site.forum-surface .topic-table {
  overflow: hidden;
  background: rgba(255, 255, 255, .99);
  border: 1px solid var(--rule);
  border-top: 5px double var(--rule);
  box-shadow: 5px 6px 0 rgba(63, 57, 47, .11);
}
.internal-site.forum-surface .forum-row {
  grid-template-columns: 54px minmax(0, 1fr) 76px 76px;
  min-height: 86px;
  padding-inline: 18px;
  background: linear-gradient(90deg, rgba(107, 47, 36, .055), transparent 31%);
}
.internal-site.forum-surface .forum-row:hover,
.internal-site.forum-surface .topic-row:hover {
  background-color: rgba(221, 224, 226, .9);
}
.internal-site.forum-surface .forum-icon {
  width: 38px;
  height: 38px;
  display: block;
  background:
    linear-gradient(rgba(249, 249, 246, .2), rgba(38, 38, 34, .14)),
    url("forum-grotto.jpg") 53% 73% / 300px auto no-repeat;
  border: 3px double var(--rule);
  box-shadow: inset 0 0 0 3px rgba(249, 249, 246, .46);
  filter: sepia(.15) contrast(1.12);
}
.internal-site.forum-surface .forum-index-page .forum-icon {
  background:
    linear-gradient(rgba(249, 249, 246, .1), rgba(38, 38, 34, .1)),
    url("forum-tree-source.png") center 43% / 122% auto no-repeat;
}
.internal-site.forum-surface .forum-stat,
.internal-site.forum-surface .topic-number {
  border-left: 1px solid rgba(0, 0, 0, .38);
}
.internal-site.forum-surface .topic-row {
  min-height: 72px;
  padding-inline: 17px;
}
.internal-site.forum-surface .breadcrumbs {
  margin: -7px 0 21px;
  padding: 8px 11px;
  color: var(--paper-light);
  background: rgba(29, 27, 22, .9);
  border-left: 5px solid var(--accent);
}
.internal-site.forum-surface .breadcrumbs a { color: #eadfc4; }
.internal-site.forum-surface .list-controls {
  background: rgba(229, 232, 234, .97);
}
.internal-site.forum-surface .role-post {
  background: rgba(255, 255, 255, .99);
  border-top: 5px double var(--rule);
  box-shadow: 6px 7px 0 rgba(63, 57, 47, .12);
}
.internal-site.forum-surface .role-post > aside {
  background:
    linear-gradient(rgba(220, 226, 230, .94), rgba(220, 226, 230, .985)),
    url("forum-grotto.jpg") 8% 50% / auto 330px no-repeat;
}
.internal-site.forum-surface .character-profile > div {
  align-self: start;
  padding: clamp(20px, 2.8vw, 38px);
  color: var(--ink);
  background: rgba(255, 255, 255, .99);
  border: 1px solid rgba(37, 37, 33, .76);
  box-shadow:
    7px 8px 0 rgba(48, 43, 35, .14),
    inset 0 0 42px rgba(121, 102, 72, .08);
  backdrop-filter: blur(2px);
}
.internal-site.forum-surface .character-profile > div .page-lead,
.internal-site.forum-surface .character-profile > div .fact-row small {
  color: #50585e;
}
.internal-site.forum-surface .paper-form,
.internal-site.forum-surface .notice,
.internal-site.forum-surface .posting-as {
  background: rgba(255, 255, 255, .99);
}

@media (max-width: 660px) {
  .internal-site.forum-surface { background-attachment: scroll; background-size: auto 100vh; }
  .internal-site.forum-surface main { padding: 18px 0 48px; }
  .internal-site.forum-surface .main-column,
  .internal-site.forum-surface .narrow-shell { padding: 16px; outline-offset: 3px; }
  .forum-engraving { min-height: 165px; margin: -16px -16px 22px; background-position: center 43%; }
  .internal-site.forum-surface .forum-row { grid-template-columns: 38px minmax(0, 1fr) 48px; padding-inline: 10px; }
  .internal-site.forum-surface .forum-icon { width: 30px; height: 30px; }
  .internal-site.forum-surface .role-post { box-shadow: 3px 4px 0 rgba(63, 57, 47, .12); }
  .internal-site.forum-surface .character-profile > div { padding: 18px; }
}
.site-footer {
  padding: 28px 20px 32px;
  text-align: center;
  font-size: 14px;
  color: rgba(17, 17, 15, 0.64);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #11110f;
  text-decoration: underline;
}
