/* ================================================================
   迷宫图书馆 · MAZE LIBRARY
   A private archive of worlds, characters, and stories.
   ================================================================ */

:root {
  color-scheme: dark;
  --bg: #090b09;
  --bg-raised: #0e110d;
  --bg-soft: #131710;
  --bg-deep: #060806;
  --paper: #e7dfcd;
  --paper-soft: #cfc7b5;
  --paper-dim: #a9a393;
  --muted: #7e8175;
  --muted-deep: #5d6258;
  --line: rgba(231, 223, 205, 0.11);
  --line-strong: rgba(231, 223, 205, 0.21);
  --gold: #c8a86b;
  --gold-bright: #e5cb96;
  --gold-soft: rgba(200, 168, 107, 0.12);
  --moss: #81927f;
  --wine: #8e4e47;
  --danger: #c87767;
  --success: #91a985;
  --serif: "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", "Source Han Serif SC",
    "Songti SC", SimSun, serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Noto Sans Mono CJK SC", monospace;
  --sidebar-width: 300px;
  --content-pad: clamp(24px, 4.2vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 78% 4%, rgba(91, 108, 82, 0.13), transparent 42rem),
    radial-gradient(circle at 14% 92%, rgba(142, 78, 71, 0.075), transparent 44rem),
    var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  content: "";
  opacity: 0.38;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.012) 2px,
      rgba(255, 255, 255, 0.012) 3px
    ),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.2));
  mix-blend-mode: soft-light;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  color: #11130e;
  background: var(--gold);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0a0c09;
}

::-webkit-scrollbar-thumb {
  border: 3px solid #0a0c09;
  border-radius: 10px;
  background: #353a31;
}

::-webkit-scrollbar-thumb:hover {
  background: #4c5144;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  color: #11130e;
  background: var(--gold);
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================================ Layout ================================ */

.site-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex: 0 0 var(--sidebar-width);
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 22, 16, 0.94), rgba(9, 12, 9, 0.985)),
    var(--bg-deep);
}

.sidebar::after {
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 1px;
  content: "";
  background: linear-gradient(
    180deg,
    transparent,
    rgba(200, 168, 107, 0.3) 13%,
    transparent 38%,
    transparent 72%,
    rgba(200, 168, 107, 0.12) 93%,
    transparent
  );
  pointer-events: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 27px 24px 23px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: var(--gold);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.42);
  box-shadow: inset 0 0 0 4px var(--bg-deep);
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.brand:hover .brand-mark {
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow:
    inset 0 0 0 4px var(--bg-deep),
    0 0 24px rgba(200, 168, 107, 0.14);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.45;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.brand-copy small {
  margin-top: 6px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.34em;
}

.sidebar-close {
  display: none;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  padding: 21px 18px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-caption {
  display: flex;
  justify-content: space-between;
  padding: 0 10px 11px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.sidebar-caption span:first-child {
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    color 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
}

.nav-item::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -19px;
  width: 1px;
  content: "";
  background: transparent;
  transition: background 0.22s ease;
}

.nav-item:hover {
  color: var(--paper-soft);
  background: rgba(255, 255, 255, 0.018);
}

.nav-item.is-active {
  color: var(--paper);
  background: linear-gradient(90deg, rgba(200, 168, 107, 0.095), rgba(200, 168, 107, 0.012));
  border-color: rgba(200, 168, 107, 0.15);
}

.nav-item.is-active::before {
  background: var(--gold);
}

.nav-serial {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  transition: color 0.22s ease;
}

.nav-item.is-active .nav-serial {
  color: var(--gold);
}

.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--muted-deep);
  transition: color 0.22s ease;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.4;
}

.nav-item:hover .nav-icon,
.nav-item.is-active .nav-icon {
  color: var(--gold);
}

.nav-label {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-count {
  min-width: 19px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 9px;
  text-align: right;
}

.nav-item.is-active .nav-count {
  color: var(--paper-dim);
}

.nav-lock {
  display: grid;
  color: var(--muted-deep);
  place-items: center;
}

.nav-lock svg {
  width: 12px;
  height: 12px;
}

.sidebar-note {
  position: relative;
  margin-top: 32px;
  padding: 24px 10px 8px 25px;
  border-top: 1px solid var(--line);
}

.thread-mark {
  position: absolute;
  top: -1px;
  bottom: 28px;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--gold), transparent);
}

.thread-mark::before {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 7px;
  height: 7px;
  content: "";
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--bg-deep);
}

.sidebar-note p {
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.08em;
}

.sidebar-note small {
  display: block;
  margin-top: 12px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.sidebar-account {
  flex: 0 0 auto;
  padding: 17px 18px 20px;
  border-top: 1px solid var(--line);
  background: rgba(5, 7, 5, 0.22);
}

.account-button {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition:
    border-color 0.22s ease,
    background 0.22s ease;
}

.account-button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 16px;
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.4);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(200, 168, 107, 0.22), #11170f 65%);
}

.avatar.is-guest {
  color: var(--muted);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
}

.avatar-lg {
  width: 58px;
  height: 58px;
  font-size: 23px;
}

.account-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}

.account-copy strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-caret {
  color: var(--muted-deep);
}

.account-caret svg {
  width: 14px;
  height: 14px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  border: 1px solid rgba(200, 168, 107, 0.3);
  background: rgba(200, 168, 107, 0.06);
}

/* ================================= Main ================================= */

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 var(--content-pad);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 9, 0.74);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right {
  display: flex;
  gap: 18px;
  align-items: center;
}

.menu-button {
  display: none;
}

.breadcrumb {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.breadcrumb span:last-child {
  color: var(--paper-dim);
}

.breadcrumb i {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--line-strong);
}

.archive-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.archive-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 3px rgba(129, 146, 127, 0.09);
  animation: status-pulse 3.6s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(129, 146, 127, 0.13);
  }
}

.topbar-auth {
  display: flex;
  align-items: center;
}

.mini-auth {
  padding: 7px 12px;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.mini-auth:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.topbar-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 12px;
  cursor: pointer;
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.35);
  border-radius: 50%;
  background: rgba(200, 168, 107, 0.07);
}

.view {
  flex: 1;
  min-height: 60vh;
}

.board-page {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

/* ================================ Buttons ================================ */

.button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  transition:
    color 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease,
    transform 0.22s ease;
}

.button svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.6;
}

.button:hover {
  color: var(--gold-bright);
  border-color: rgba(200, 168, 107, 0.5);
  background: rgba(200, 168, 107, 0.055);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button-primary {
  color: #13150f;
  border-color: var(--paper);
  background: var(--paper);
}

.button-primary:hover {
  color: #0e100c;
  border-color: var(--gold-bright);
  background: var(--gold-bright);
}

.button-gold {
  color: #10130e;
  border-color: var(--gold);
  background: var(--gold);
}

.button-gold:hover {
  color: #0c0e0b;
  border-color: var(--gold-bright);
  background: var(--gold-bright);
}

.button-quiet {
  color: var(--muted);
  border-color: transparent;
}

.button-quiet:hover {
  color: var(--paper);
  border-color: var(--line);
  background: transparent;
}

.button-danger {
  color: var(--danger);
  border-color: rgba(200, 119, 103, 0.34);
}

.button-danger:hover {
  color: #e5a094;
  border-color: var(--danger);
  background: rgba(200, 119, 103, 0.08);
}

.button-full {
  width: 100%;
}

.button-small {
  padding: 7px 11px;
  font-size: 10px;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover {
  color: var(--paper);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

/* Desktop navigation controls are only shown once the side rail collapses. */
.sidebar .sidebar-close,
.topbar .menu-button {
  display: none;
}

.icon-button.danger:hover {
  color: var(--danger);
  border-color: rgba(200, 119, 103, 0.3);
}

.text-button {
  padding: 0;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(200, 168, 107, 0.35);
  text-underline-offset: 4px;
}

.text-button:hover {
  color: var(--gold-bright);
  text-decoration-color: var(--gold);
}

/* ================================= Hero ================================= */

.board-hero {
  position: relative;
  padding: clamp(44px, 6.5vw, 78px) 0 33px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-kicker {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 13px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.hero-kicker .kicker-number {
  color: var(--gold);
}

.hero-kicker .kicker-rule {
  width: 44px;
  height: 1px;
  background: var(--line-strong);
}

.hero-kicker .kicker-private {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--gold);
}

.hero-kicker .kicker-private svg {
  width: 10px;
  height: 10px;
}

.hero-watermark {
  position: absolute;
  right: -1.5vw;
  bottom: -0.23em;
  color: transparent;
  font-family: var(--serif);
  font-size: clamp(90px, 13vw, 220px);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.03em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.075;
  -webkit-text-stroke: 1px var(--paper);
  user-select: none;
}

.hero-main {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 48px;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: clamp(30px, 4.2vw, 52px);
}

.hero-title-block {
  min-width: 0;
}

.hero-en {
  margin-bottom: 13px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.hero-title {
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(50px, 6.2vw, 88px);
  font-weight: 400;
  line-height: 0.99;
  letter-spacing: -0.015em;
}

.hero-desc {
  max-width: 440px;
  margin-top: 21px;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.07em;
}

.hero-side {
  display: flex;
  flex: 0 0 auto;
  gap: 20px;
  align-items: flex-end;
  padding-bottom: 10px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hero-stat strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-stat span {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.hero-stat-rule {
  width: 1px;
  height: 38px;
  margin-bottom: 8px;
  background: var(--line);
}

.hero-folder-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hero-folder-stat strong {
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.hero-folder-stat span {
  margin-top: 8px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ================================ Toolbar ================================ */

.collection-toolbar {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 23px 0 20px;
  border-bottom: 1px solid var(--line);
}

.folder-filters-wrap {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.filter-caption {
  flex: 0 0 auto;
  margin-right: 18px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.folder-filters {
  display: flex;
  gap: 4px;
  align-items: center;
  padding-bottom: 1px;
  overflow-x: auto;
  scrollbar-width: none;
}

.folder-filters::-webkit-scrollbar {
  display: none;
}

.folder-chip {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.folder-chip:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.025);
}

.folder-chip .chip-count {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
}

.folder-chip.is-active {
  color: var(--gold-bright);
  border-color: rgba(200, 168, 107, 0.22);
  background: rgba(200, 168, 107, 0.07);
}

.folder-chip.is-active .chip-count {
  color: var(--gold);
}

.folder-chip.is-folder {
  max-width: 190px;
}

.folder-chip .chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.toolbar-note {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.toolbar-note svg {
  width: 11px;
  height: 11px;
}

/* ================================= Works ================================= */

.works-section {
  padding: 27px 0 80px;
}

.section-head {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 23px;
}

.section-label {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.section-label small {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.section-count {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 38px 22px;
}

.work-card {
  min-width: 0;
  animation: card-in 0.55s var(--ease) both;
  animation-delay: calc(var(--index, 0) * 45ms);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.work-cover {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.work-card:hover .work-cover {
  border-color: rgba(200, 168, 107, 0.32);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.work-cover > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.02);
  transition:
    transform 0.8s var(--ease),
    filter 0.4s ease;
}

.work-cover > .cover-fallback {
  position: absolute;
  inset: 0;
}

.work-card:hover .work-cover > img {
  filter: saturate(1) contrast(1.03);
  transform: scale(1.035);
}

.work-cover-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(4, 6, 4, 0.32), transparent 26%),
    linear-gradient(0deg, rgba(4, 6, 4, 0.7), transparent 30%);
  opacity: 0.75;
  transition: opacity 0.35s ease;
}

.work-card:hover .work-cover-shade {
  opacity: 0.9;
}

.work-cover-index {
  position: absolute;
  top: 12px;
  left: 13px;
  z-index: 3;
  color: rgba(231, 223, 205, 0.8);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
}

.work-cover-favorite {
  position: absolute;
  top: 10px;
  right: 11px;
  z-index: 3;
  display: grid;
  width: 26px;
  height: 26px;
  color: var(--gold-bright);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.32);
  border-radius: 50%;
  background: rgba(7, 9, 7, 0.55);
  backdrop-filter: blur(6px);
}

.work-cover-favorite svg {
  width: 12px;
  height: 12px;
  fill: rgba(200, 168, 107, 0.22);
}

.work-cover-open {
  position: absolute;
  right: 14px;
  bottom: 13px;
  z-index: 3;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  opacity: 0;
  transform: translateY(5px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.work-cover-open svg {
  width: 11px;
  height: 11px;
}

.work-card:hover .work-cover-open,
.work-cover:focus-visible .work-cover-open {
  opacity: 1;
  transform: translateY(0);
}

.cover-fallback {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 66% 28%, rgba(200, 168, 107, 0.1), transparent 46%),
    linear-gradient(145deg, #171d15 0%, #0c100c 58%, #141813 100%);
}

.cover-fallback::before {
  position: absolute;
  top: 8%;
  right: -22%;
  width: 85%;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(200, 168, 107, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 30px rgba(200, 168, 107, 0.025),
    0 0 0 66px rgba(200, 168, 107, 0.018),
    0 0 0 108px rgba(200, 168, 107, 0.012);
}

.cover-fallback[data-board="characters"] {
  background:
    radial-gradient(circle at 30% 22%, rgba(142, 78, 71, 0.24), transparent 45%),
    linear-gradient(145deg, #1b1513 0%, #0f0d0c 65%);
}

.cover-fallback[data-board="gallery"] {
  background:
    radial-gradient(circle at 70% 68%, rgba(173, 132, 76, 0.2), transparent 42%),
    linear-gradient(145deg, #1b1811 0%, #0f100c 64%);
}

.cover-fallback[data-board="novels"] {
  background:
    radial-gradient(circle at 30% 20%, rgba(74, 93, 100, 0.23), transparent 42%),
    linear-gradient(145deg, #12181a 0%, #0b0f10 65%);
}

.cover-fallback[data-board="comics"] {
  background:
    radial-gradient(circle at 74% 30%, rgba(151, 92, 65, 0.22), transparent 46%),
    linear-gradient(145deg, #1a1511 0%, #100e0b 66%);
}

.cover-fallback[data-board="fanworks"] {
  background:
    radial-gradient(circle at 30% 75%, rgba(113, 139, 109, 0.22), transparent 45%),
    linear-gradient(145deg, #141b14 0%, #0b100c 67%);
}

.cover-fallback-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-fallback-mark svg {
  width: 26px;
  height: 26px;
  color: var(--gold);
  opacity: 0.7;
}

.cover-fallback-title {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cover-fallback-title span:first-child {
  display: -webkit-box;
  overflow: hidden;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.cover-fallback-title span:last-child {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.work-card-body {
  padding: 14px 1px 0;
}

.work-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.work-card-meta span:first-child {
  overflow: hidden;
  color: var(--gold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card-lock {
  display: inline-flex;
  margin-left: 5px;
  vertical-align: -2px;
}

.work-card-lock svg {
  width: 9px;
  height: 9px;
  color: var(--gold);
  opacity: 0.75;
}

.work-card-title {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 0;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  background: transparent;
  transition: color 0.2s ease;
}

.work-card-title:hover {
  color: var(--gold-bright);
}

.work-card-summary {
  display: -webkit-box;
  min-height: 3.1em;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.58;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.work-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  align-items: center;
  margin-top: 11px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.work-card-foot span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.work-card-foot span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card-foot svg {
  width: 11px;
  height: 11px;
}

/* ================================ Empty state ============================ */

.empty-archive {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 54px 24px;
  text-align: center;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 45%, rgba(200, 168, 107, 0.045), transparent 23rem),
    rgba(255, 255, 255, 0.012);
}

.empty-labyrinth {
  width: 92px;
  height: 92px;
  margin-bottom: 22px;
  color: var(--gold);
  opacity: 0.38;
}

.empty-labyrinth svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.1;
}

.empty-kicker {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.empty-title {
  margin-top: 11px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.09em;
}

.empty-desc {
  max-width: 390px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 24px;
}

/* ================================ Loading ================================ */

.board-skeleton {
  padding-bottom: 80px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.045),
    transparent
  );
  transform: translateX(-100%);
  animation: skeleton-sweep 1.8s infinite;
}

@keyframes skeleton-sweep {
  to {
    transform: translateX(100%);
  }
}

.skeleton-kicker {
  width: 160px;
  height: 9px;
}

.skeleton-title {
  width: min(420px, 60%);
  height: 64px;
  margin-top: 38px;
}

.skeleton-desc {
  width: min(330px, 52%);
  height: 12px;
  margin-top: 22px;
}

.skeleton-toolbar {
  height: 38px;
  margin-top: 34px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 38px 22px;
  margin-top: 30px;
}

.skeleton-card .skeleton-cover {
  aspect-ratio: 4 / 5;
}

.skeleton-card .skeleton-line {
  width: 70%;
  height: 10px;
  margin-top: 14px;
}

.skeleton-card .skeleton-line.short {
  width: 42%;
  height: 8px;
  margin-top: 9px;
}

/* ================================= Error ================================= */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62vh;
  padding: 50px 24px;
  text-align: center;
}

.error-code {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.55;
}

.error-title {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.error-desc {
  max-width: 390px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

/* ================================ Favorites gate ========================= */

.favorites-lock {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 58vh;
  padding: 72px 24px 110px;
  overflow: hidden;
  text-align: center;
}

.lock-sigil {
  position: relative;
  display: grid;
  width: 118px;
  height: 118px;
  margin-bottom: 29px;
  color: var(--gold);
  place-items: center;
}

.lock-sigil::before,
.lock-sigil::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 1px solid rgba(200, 168, 107, 0.18);
  border-radius: 50%;
}

.lock-sigil::after {
  inset: 13px;
  border-color: rgba(200, 168, 107, 0.09);
}

.lock-sigil-ring {
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(200, 168, 107, 0.3);
  border-radius: 50%;
}

.lock-sigil svg {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  stroke-width: 1.2;
}

.lock-kicker {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.lock-title {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(32px, 4.8vw, 52px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.04em;
}

.lock-title em {
  color: var(--gold);
  font-style: normal;
}

.lock-desc {
  max-width: 380px;
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.05em;
}

.lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 27px;
}

.lock-footnote {
  margin-top: 36px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

/* ================================ Footer ================================= */

.site-footer {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 22px var(--content-pad) 28px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

.footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.55;
}

/* ================================= Modal ================================= */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-layer + .modal-layer {
  z-index: 110;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 3, 0.78);
  backdrop-filter: blur(13px);
  animation: backdrop-in 0.25s ease both;
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid rgba(200, 168, 107, 0.24);
  background:
    linear-gradient(155deg, rgba(24, 29, 21, 0.98), rgba(10, 13, 10, 0.995) 58%),
    var(--bg-raised);
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
  animation: modal-in 0.4s var(--ease) both;
}

.modal-panel::before,
.modal-panel::after {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  pointer-events: none;
  content: "";
}

.modal-panel::before {
  top: 8px;
  left: 8px;
  border-top: 1px solid rgba(200, 168, 107, 0.4);
  border-left: 1px solid rgba(200, 168, 107, 0.4);
}

.modal-panel::after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid rgba(200, 168, 107, 0.25);
  border-bottom: 1px solid rgba(200, 168, 107, 0.25);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-panel.modal-wide {
  width: min(1100px, 100%);
}

.modal-panel.modal-lg {
  width: min(800px, 100%);
}

.modal-panel.modal-sm {
  width: min(430px, 100%);
}

.modal-head {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 27px 31px 21px;
  border-bottom: 1px solid var(--line);
}

.modal-head-copy {
  min-width: 0;
}

.modal-kicker {
  margin-bottom: 8px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal-title {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.05em;
}

.modal-subtitle {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.modal-close {
  position: relative;
  z-index: 3;
  margin: -4px -8px 0 0;
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 25px 31px 31px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-body.no-padding {
  padding: 0;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
  padding: 17px 31px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.13);
}

/* ================================ Forms ================================= */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  display: flex;
  gap: 7px;
  align-items: baseline;
  justify-content: space-between;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.field-label small {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 13px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: rgba(3, 5, 3, 0.42);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-deep);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--line-strong);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(200, 168, 107, 0.65);
  background: rgba(3, 5, 3, 0.62);
  box-shadow: 0 0 0 3px rgba(200, 168, 107, 0.06);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.textarea.body-textarea {
  min-height: 170px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.85;
}

.select {
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

.select option {
  color: var(--paper);
  background: #121610;
}

.form-hint {
  color: var(--muted-deep);
  font-size: 10px;
  line-height: 1.65;
  letter-spacing: 0.015em;
}

.form-error {
  display: none;
  padding: 9px 11px;
  color: #e7a196;
  font-size: 11px;
  line-height: 1.55;
  border: 1px solid rgba(200, 119, 103, 0.25);
  background: rgba(142, 78, 71, 0.12);
}

.form-error.is-visible {
  display: block;
}

.form-success {
  display: none;
  padding: 9px 11px;
  color: #bcd0af;
  font-size: 11px;
  line-height: 1.55;
  border: 1px solid rgba(145, 169, 133, 0.25);
  background: rgba(95, 123, 85, 0.12);
}

.form-success.is-visible {
  display: block;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
}

.form-actions .button[type="submit"] {
  flex: 1;
}

.field-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.field-check input {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 2px;
  accent-color: var(--gold);
}

/* ================================ Auth modal ============================= */

.auth-intro {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.auth-intro-mark {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  color: var(--gold);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.26);
}

.auth-intro-mark svg {
  width: 21px;
  height: 21px;
}

.auth-intro p {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  position: relative;
  flex: 1;
  padding: 10px 8px 12px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.auth-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  content: "";
  background: transparent;
}

.auth-tab.is-active {
  color: var(--gold-bright);
}

.auth-tab.is-active::after {
  background: var(--gold);
}

.auth-switch {
  margin-top: 18px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.auth-switch .text-button {
  margin-left: 4px;
  font-size: 10px;
}

.auth-legal {
  margin-top: 17px;
  padding-top: 15px;
  color: var(--muted-deep);
  font-size: 9px;
  line-height: 1.7;
  border-top: 1px solid var(--line);
}

/* ================================ Recovery =============================== */

.recovery-banner {
  padding: 13px 15px;
  margin-bottom: 20px;
  color: var(--paper-soft);
  font-size: 11px;
  line-height: 1.75;
  border: 1px solid rgba(200, 168, 107, 0.25);
  border-left: 2px solid var(--gold);
  background: rgba(200, 168, 107, 0.055);
}

.recovery-banner strong {
  color: var(--gold-bright);
  font-weight: 500;
}

.recovery-banner p + p {
  margin-top: 6px;
}

.recovery-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 17px 0 20px;
}

.recovery-code {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 11px;
  color: var(--paper-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.025em;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.recovery-code span {
  color: var(--muted-deep);
  font-size: 8px;
}

.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recovery-warning {
  margin-top: 17px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

/* ================================ Account ================================ */

.account-hero {
  display: flex;
  gap: 17px;
  align-items: center;
  padding-bottom: 23px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--line);
}

.account-hero-copy {
  min-width: 0;
}

.account-hero-name {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
}

.account-hero-handle {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.025em;
}

.account-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 17px;
  margin-top: 11px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.035em;
}

.settings-section {
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.settings-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.settings-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 13px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.settings-title svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.settings-copy {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.security-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}

.security-strip-copy {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.security-strip-copy strong {
  display: block;
  color: var(--paper-soft);
  font-weight: 400;
}

.account-logout {
  display: flex;
  justify-content: flex-end;
  padding-top: 18px;
}

details.security-details {
  margin-top: 13px;
  border: 1px solid var(--line);
}

details.security-details summary {
  padding: 11px 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  list-style: none;
}

details.security-details summary::-webkit-details-marker {
  display: none;
}

details.security-details summary::before {
  display: inline-block;
  margin-right: 7px;
  content: "+";
  color: var(--gold);
}

details.security-details[open] summary::before {
  content: "−";
}

details.security-details .details-body {
  padding: 3px 14px 14px;
  border-top: 1px solid var(--line);
}

/* ================================ Upload ================================= */

.upload-sections {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.upload-block {
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.upload-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.upload-block-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 14px;
}

.upload-block-num {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.upload-block-title {
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.07em;
}

.upload-block-note {
  margin-left: auto;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-files {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 112px;
  padding: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 1px dashed var(--line-strong);
  background: rgba(0, 0, 0, 0.12);
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.file-drop:hover,
.file-drop.is-dragging {
  border-color: rgba(200, 168, 107, 0.5);
  background: rgba(200, 168, 107, 0.035);
}

.file-drop.has-file {
  border-style: solid;
  border-color: rgba(200, 168, 107, 0.32);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-drop-icon {
  display: grid;
  width: 28px;
  height: 28px;
  margin-bottom: 9px;
  color: var(--gold);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.25);
}

.file-drop-icon svg {
  width: 14px;
  height: 14px;
}

.file-drop-label {
  color: var(--paper-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.file-drop-hint {
  margin-top: 4px;
  color: var(--muted-deep);
  font-size: 9px;
  line-height: 1.55;
}

.file-drop-selected {
  display: none;
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-drop.has-file .file-drop-label {
  color: var(--paper-soft);
}

.file-drop.has-file .file-drop-selected {
  display: block;
}

.file-drop.has-file .file-drop-hint {
  display: none;
}

.upload-preview {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 53px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}

.upload-submit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 4px;
}

.upload-submit-note {
  margin-right: auto;
  color: var(--muted-deep);
  font-size: 9px;
  line-height: 1.5;
}

.upload-submit-row .button[type="submit"] {
  min-width: 160px;
}

/* ================================ Work detail ============================ */

.detail-panel .modal-head {
  padding: 22px 27px 17px;
}

.detail-head-board {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-head-board i {
  width: 12px;
  height: 1px;
  background: var(--line-strong);
}

.detail-head-board span:last-child {
  color: var(--muted-deep);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.detail-media {
  position: sticky;
  top: 0;
  padding: 31px;
  border-right: 1px solid var(--line);
}

.detail-cover-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-deep);
}

.detail-cover-frame > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-cover-frame > .cover-fallback {
  position: absolute;
  inset: 0;
}

.detail-cover-frame .cover-fallback {
  padding: 25px;
}

.detail-cover-link {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 7px 9px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 1px solid rgba(231, 223, 205, 0.28);
  background: rgba(7, 9, 7, 0.66);
  backdrop-filter: blur(8px);
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.detail-cover-link:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.detail-cover-link svg {
  width: 11px;
  height: 11px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
  align-items: center;
  margin-top: 13px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.detail-side-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  align-items: center;
  padding-top: 15px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
  border-top: 1px solid var(--line);
}

.detail-side-info strong {
  color: var(--paper-dim);
  font-weight: 400;
}

.detail-copy {
  min-width: 0;
  padding: 33px 35px 36px;
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.detail-kicker .folder-sep {
  color: var(--muted-deep);
}

.detail-title {
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(32px, 3.8vw, 48px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.detail-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
  align-items: center;
  margin-top: 17px;
  padding-bottom: 21px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.035em;
  border-bottom: 1px solid var(--line);
}

.detail-byline strong {
  color: var(--paper-dim);
  font-family: var(--sans);
  font-weight: 400;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 22px;
}

.detail-actions .spacer {
  flex: 1;
}

.favorite-button.is-active {
  color: var(--gold-bright);
  border-color: rgba(200, 168, 107, 0.45);
  background: rgba(200, 168, 107, 0.07);
}

.favorite-button.is-active svg {
  fill: rgba(200, 168, 107, 0.28);
}

.favorite-folder-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.favorite-folder-row label {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.favorite-folder-row .select {
  flex: 1;
  min-width: 150px;
  padding: 7px 29px 7px 9px;
  font-size: 10px;
  background-position:
    calc(100% - 13px) 50%,
    calc(100% - 8px) 50%;
}

.detail-body-text {
  margin-top: 26px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 2;
  letter-spacing: 0.035em;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.detail-summary {
  margin-top: 23px;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.035em;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.attachment-card {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  padding: 13px 14px;
  color: var(--paper-dim);
  text-decoration: none;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.018);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.attachment-card:hover {
  color: var(--gold-bright);
  border-color: rgba(200, 168, 107, 0.45);
  background: rgba(200, 168, 107, 0.035);
}

.attachment-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: var(--gold);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.24);
}

.attachment-icon svg {
  width: 16px;
  height: 16px;
}

.attachment-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.attachment-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-copy small {
  margin-top: 2px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.attachment-card > svg {
  width: 14px;
  height: 14px;
  color: var(--muted-deep);
}

/* ================================ Comments =============================== */

.comments-section {
  padding: 29px 35px 35px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.08);
}

.comments-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 19px;
}

.comments-title {
  display: flex;
  gap: 9px;
  align-items: baseline;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.comments-title span {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
}

.comments-note {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comment-form {
  margin-bottom: 25px;
}

.comment-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-form-row .avatar {
  width: 32px;
  height: 32px;
  margin-top: 1px;
  font-size: 13px;
}

.comment-input-wrap {
  flex: 1;
  min-width: 0;
}

.comment-input-wrap .textarea {
  min-height: 76px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.7;
}

.comment-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.comment-form-actions .form-hint {
  font-size: 9px;
}

.comment-login-prompt {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 15px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.comment-login-prompt p {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.comment-list {
  display: flex;
  flex-direction: column;
}

.comment {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  gap: 11px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.comment:first-child {
  border-top: 0;
}

.comment .avatar {
  width: 31px;
  height: 31px;
  font-size: 12px;
}

.comment-content {
  min-width: 0;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.comment-author {
  color: var(--paper-dim);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.comment-time {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
}

.comment-delete {
  width: 22px;
  height: 22px;
  margin-left: auto;
  color: var(--muted-deep);
  opacity: 0;
  transition:
    opacity 0.2s ease,
    color 0.2s ease;
}

.comment:hover .comment-delete,
.comment-delete:focus-visible {
  opacity: 1;
}

.comment-delete:hover {
  color: var(--danger);
}

.comment-delete svg {
  width: 12px;
  height: 12px;
}

.comment-body {
  margin-top: 4px;
  color: var(--paper-soft);
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-empty {
  padding: 18px 0 5px;
  color: var(--muted-deep);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: center;
  border-top: 1px solid var(--line);
}

/* ================================ Confirm ================================ */

.confirm-body {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.confirm-body strong {
  color: var(--paper-soft);
  font-weight: 400;
}

.confirm-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 23px;
}

/* ================================ Toast ================================= */

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(350px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  color: var(--paper-soft);
  font-size: 11px;
  line-height: 1.6;
  border: 1px solid rgba(200, 168, 107, 0.28);
  border-left: 2px solid var(--gold);
  background: rgba(17, 22, 15, 0.97);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  animation: toast-in 0.35s var(--ease) both;
}

.toast.is-error {
  border-color: rgba(200, 119, 103, 0.32);
  border-left-color: var(--danger);
}

.toast svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--gold);
}

.toast.is-error svg {
  color: var(--danger);
}

.toast.is-leaving {
  animation: toast-out 0.25s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ============================ Fanwork & notices ========================== */

.nav-item .nav-count.is-unread,
.nav-item.is-active .nav-count.is-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  color: #11140f;
  font-size: 8px;
  line-height: 1;
  border-radius: 999px;
  background: var(--gold);
}

.work-cover-type {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  padding: 3px 7px;
  color: var(--gold-bright);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(200, 168, 107, 0.32);
  background: rgba(7, 9, 7, 0.58);
  backdrop-filter: blur(7px);
}

.fanwork-type-tag {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 2px 7px;
  color: var(--gold-bright);
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  border: 1px solid rgba(200, 168, 107, 0.24);
  background: rgba(200, 168, 107, 0.055);
}

.fanwork-type-tag i {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-type-tag {
  margin-left: auto;
}

.fanwork-type-picker {
  min-width: 0;
  padding: 0;
  margin: 0 0 4px;
  border: 0;
}

.fanwork-type-picker legend {
  width: 100%;
  margin-bottom: 8px;
}

.fanwork-type-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.fanwork-type-option {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.fanwork-type-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.fanwork-type-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.13);
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.fanwork-type-option:hover .fanwork-type-card {
  border-color: var(--line-strong);
}

.fanwork-type-option input:checked + .fanwork-type-card {
  border-color: rgba(200, 168, 107, 0.68);
  background:
    linear-gradient(145deg, rgba(200, 168, 107, 0.13), rgba(200, 168, 107, 0.025)),
    rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(200, 168, 107, 0.12);
}

.fanwork-type-option input:focus-visible + .fanwork-type-card {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.fanwork-type-en {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fanwork-type-label {
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.fanwork-type-option input:checked + .fanwork-type-card .fanwork-type-en {
  color: var(--gold);
}

.audio-block {
  margin-top: 24px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.13);
}

.audio-block .field-label {
  margin-bottom: 10px;
}

.audio-player {
  width: 100%;
  height: 38px;
  accent-color: var(--gold);
  filter: sepia(0.12) saturate(0.7);
}

/* -------------------------------- Messages ------------------------------- */

.messages-page {
  --message-icon-size: 40px;
}

.messages-shell {
  padding: 24px 0 80px;
}

.messages-toolbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.messages-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.messages-toolbar-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.06em;
}

.messages-toolbar-title small {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
}

.messages-toolbar-note {
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.messages-toolbar .button:disabled {
  opacity: 0.4;
}

.message-list {
  border-top: 0;
}

.message-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--message-icon-size) minmax(0, 1fr) 20px;
  gap: 15px;
  align-items: start;
  width: 100%;
  padding: 19px 15px 19px 21px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

.message-item:hover {
  background: rgba(255, 255, 255, 0.026);
}

.message-item.is-unread {
  background: linear-gradient(90deg, rgba(200, 168, 107, 0.065), transparent 74%);
}

.message-unread-dot {
  position: absolute;
  top: 50%;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  transform: translateY(-50%);
}

.message-item.is-unread .message-unread-dot {
  opacity: 1;
}

.message-icon {
  display: grid;
  width: var(--message-icon-size);
  height: var(--message-icon-size);
  margin-top: 1px;
  color: var(--muted);
  place-items: center;
  border: 1px solid var(--line-strong);
}

.message-icon svg {
  width: 17px;
  height: 17px;
}

.message-icon.is-comment {
  color: var(--moss);
  border-color: rgba(129, 146, 127, 0.27);
  background: rgba(129, 146, 127, 0.05);
}

.message-icon.is-favorite {
  color: var(--gold);
  border-color: rgba(200, 168, 107, 0.28);
  background: rgba(200, 168, 107, 0.055);
}

.message-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.message-title {
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0.025em;
  overflow-wrap: anywhere;
}

.message-title strong {
  color: var(--paper);
  font-weight: 500;
}

.message-title em {
  color: var(--gold-bright);
  font-style: normal;
}

.message-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.message-meta span + span::before {
  margin-right: 8px;
  content: "·";
}

.message-arrow {
  display: grid;
  min-height: var(--message-icon-size);
  color: var(--muted-deep);
  place-items: center;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.message-arrow svg {
  width: 14px;
  height: 14px;
}

.message-item:hover .message-arrow {
  color: var(--gold);
  transform: translateX(2px);
}

.messages-footnote {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 17px 4px;
  color: var(--muted-deep);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.messages-footnote svg {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  color: var(--gold);
}

.message-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 48px 24px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 50% 42%, rgba(200, 168, 107, 0.045), transparent 21rem);
}

.message-empty-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
  color: var(--gold);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.25);
  border-radius: 50%;
  opacity: 0.7;
}

.message-empty-icon svg {
  width: 25px;
  height: 25px;
}

.message-empty .button {
  margin-top: 22px;
}

.message-skeleton {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 22px 16px;
  border-bottom: 1px solid var(--line);
}

.message-skeleton-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.message-skeleton-copy {
  flex: 1;
  padding-top: 4px;
}

.message-skeleton-copy .skeleton-line {
  height: 10px;
}

.message-skeleton-copy .skeleton-line + .skeleton-line {
  margin-top: 10px;
}

.messages-hero .hero-side {
  gap: 24px;
}

/* ============================ Protection & notices ======================= */

.protection-notice {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 15px 16px;
  color: var(--paper-dim);
  border: 1px solid rgba(200, 168, 107, 0.24);
  border-left: 2px solid var(--gold);
  background:
    linear-gradient(100deg, rgba(200, 168, 107, 0.075), rgba(200, 168, 107, 0.012)),
    rgba(0, 0, 0, 0.12);
}

.protection-notice-icon {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: var(--gold);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.28);
}

.protection-notice-icon svg {
  width: 15px;
  height: 15px;
}

.protection-notice strong {
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.protection-notice p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.protection-notice .protection-notice-caveat {
  color: var(--muted-deep);
  font-size: 9px;
}

.download-policy {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.download-policy legend {
  width: 100%;
  margin-bottom: 9px;
}

.download-policy-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.download-policy-option {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.download-policy-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.download-policy-card {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 57px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.13);
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.download-policy-option:hover .download-policy-card {
  border-color: var(--line-strong);
}

.download-policy-option input:checked + .download-policy-card {
  border-color: rgba(200, 168, 107, 0.65);
  background: rgba(200, 168, 107, 0.075);
}

.download-policy-option input:focus-visible + .download-policy-card {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.download-policy-icon {
  display: grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  color: var(--gold);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.22);
}

.download-policy-icon svg {
  width: 13px;
  height: 13px;
}

.download-policy-card > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.download-policy-card strong {
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.download-policy-card small {
  color: var(--muted-deep);
  font-size: 8px;
  line-height: 1.5;
}

.protection-badge {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 2px 7px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(200, 168, 107, 0.26);
  background: rgba(200, 168, 107, 0.05);
}

.protection-badge svg {
  width: 10px;
  height: 10px;
}

.detail-protection-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.1);
}

.detail-protection-row .button {
  margin-left: auto;
}

.protected-download-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px 13px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  border: 1px dashed var(--line-strong);
}

.protected-download-note svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--gold);
}

.detail-body-text,
.detail-summary {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.protected-media {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.audio-player[data-protected="true"] {
  color-scheme: dark;
}

.fanwork-announcement {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 15px 17px;
  overflow: hidden;
  border: 1px solid rgba(200, 168, 107, 0.22);
  border-left: 2px solid var(--gold);
  background:
    linear-gradient(100deg, rgba(200, 168, 107, 0.075), transparent 72%),
    rgba(0, 0, 0, 0.12);
}

.fanwork-announcement::after {
  position: absolute;
  top: -35px;
  right: 20px;
  width: 110px;
  height: 110px;
  content: "";
  border: 1px solid rgba(200, 168, 107, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.fanwork-announcement-icon {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: var(--gold);
  place-items: center;
  border: 1px solid rgba(200, 168, 107, 0.28);
}

.fanwork-announcement-icon svg {
  width: 15px;
  height: 15px;
}

.fanwork-announcement-copy {
  position: relative;
  z-index: 1;
}

.fanwork-announcement-kicker {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.fanwork-announcement-kicker::after {
  width: 20px;
  height: 1px;
  content: "";
  background: rgba(200, 168, 107, 0.3);
}

.fanwork-announcement p {
  margin-top: 5px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.fanwork-announcement p strong {
  color: var(--gold-bright);
  font-weight: 500;
}

.fanwork-announcement small {
  display: block;
  margin-top: 3px;
  color: var(--muted-deep);
  font-size: 9px;
  letter-spacing: 0.02em;
}

/* ================================ Responsive ============================= */

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 266px;
  }

  .hero-main {
    gap: 30px;
  }

  .works-grid,
  .skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 33px 19px;
  }

  .detail-media {
    padding: 24px;
  }

  .detail-copy {
    padding: 28px;
  }

  .comments-section {
    padding: 26px 28px 30px;
  }
}

@media (max-width: 940px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    transform: translateX(-102%);
    transition: transform 0.42s var(--ease);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.4);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    background: rgba(3, 5, 3, 0.72);
    backdrop-filter: blur(4px);
  }

  body.sidebar-open .sidebar-scrim {
    display: block;
  }

  .sidebar-close {
    display: inline-grid;
  }

  .sidebar .sidebar-close {
    display: inline-grid;
  }

  .menu-button {
    display: inline-grid;
  }

  .topbar .menu-button {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 84px;
    height: 42px;
    padding: 0 12px;
    color: var(--gold-bright);
    border-color: rgba(200, 168, 107, 0.34);
    background: linear-gradient(145deg, rgba(200, 168, 107, 0.1), rgba(200, 168, 107, 0.035));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  }

  .topbar .menu-button:hover {
    color: var(--paper);
    border-color: var(--gold);
    background: rgba(200, 168, 107, 0.13);
  }

  .menu-button svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.7;
  }

  .menu-button-label {
    color: var(--paper-soft);
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .topbar {
    height: 62px;
  }

  .hero-main {
    align-items: flex-end;
  }

  .hero-title {
    font-size: clamp(46px, 8vw, 72px);
  }

  .hero-watermark {
    font-size: clamp(90px, 18vw, 170px);
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-media {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-cover-frame {
    max-width: 360px;
  }

  .detail-media-meta {
    padding-top: 2px;
  }
}

@media (max-width: 720px) {
  :root {
    --content-pad: 21px;
  }

  .topbar {
    padding: 0 18px;
  }

  .archive-status {
    display: none;
  }

  .topbar-right {
    gap: 8px;
  }

  .breadcrumb {
    gap: 8px;
    font-size: 8px;
  }

  .breadcrumb i {
    width: 10px;
  }

  .board-hero {
    padding-top: 37px;
    padding-bottom: 25px;
  }

  .hero-kicker {
    gap: 8px;
    font-size: 7px;
    letter-spacing: 0.1em;
  }

  .hero-kicker .kicker-rule {
    width: 20px;
  }

  .hero-main {
    display: block;
    margin-top: 33px;
  }

  .hero-title {
    font-size: clamp(43px, 13vw, 62px);
  }

  .hero-desc {
    max-width: 85%;
    margin-top: 16px;
    font-size: 12px;
  }

  .hero-side {
    justify-content: flex-start;
    padding: 25px 0 3px;
  }

  .hero-stat {
    align-items: flex-start;
  }

  .hero-stat span {
    text-align: left;
  }

  .hero-folder-stat {
    align-items: flex-start;
  }

  .hero-watermark {
    right: -30px;
    bottom: -0.1em;
    font-size: 100px;
    opacity: 0.055;
  }

  .collection-toolbar {
    display: block;
    padding: 17px 0 16px;
  }

  .folder-filters-wrap {
    display: block;
  }

  .filter-caption {
    display: none;
  }

  .folder-filters {
    margin: 0 -21px;
    padding: 0 21px 1px;
  }

  .board-tools {
    justify-content: flex-start;
    margin-top: 15px;
  }

  .toolbar-note {
    margin-left: 3px;
  }

  .works-section {
    padding-top: 22px;
    padding-bottom: 55px;
  }

  .section-head {
    margin-bottom: 17px;
  }

  .works-grid,
  .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 13px;
  }

  .work-cover-index {
    top: 9px;
    left: 9px;
    font-size: 7px;
  }

  .work-cover-favorite {
    top: 7px;
    right: 7px;
    width: 23px;
    height: 23px;
  }

  .work-cover-open {
    right: 9px;
    bottom: 9px;
    font-size: 7px;
  }

  .work-card-body {
    padding-top: 10px;
  }

  .work-card-title {
    margin-top: 4px;
    font-size: 16px;
  }

  .work-card-summary {
    min-height: 2.9em;
    font-size: 10px;
    -webkit-line-clamp: 2;
  }

  .work-card-meta {
    font-size: 7px;
  }

  .work-card-foot {
    gap: 9px;
    margin-top: 7px;
    font-size: 7px;
  }

  .cover-fallback {
    padding: 13px;
  }

  .cover-fallback-title span:first-child {
    font-size: 16px;
  }

  .cover-fallback-mark {
    font-size: 7px;
  }

  .cover-fallback-mark svg {
    width: 19px;
    height: 19px;
  }

  .empty-archive {
    min-height: 320px;
    padding: 38px 18px;
  }

  .empty-labyrinth {
    width: 70px;
    height: 70px;
  }

  .empty-title {
    font-size: 20px;
  }

  .empty-desc {
    font-size: 11px;
  }

  .favorites-lock {
    min-height: 55vh;
    padding: 50px 18px 80px;
  }

  .lock-title {
    font-size: 29px;
  }

  .lock-desc {
    font-size: 12px;
  }

  .site-footer {
    padding-bottom: 22px;
    font-size: 6px;
  }

  .modal-layer {
    padding: 0;
    align-items: stretch;
  }

  .modal-panel,
  .modal-panel.modal-wide,
  .modal-panel.modal-lg,
  .modal-panel.modal-sm {
    width: 100%;
    max-height: none;
    height: 100dvh;
    border: 0;
  }

  .modal-panel::before,
  .modal-panel::after {
    display: none;
  }

  .modal-head {
    padding: 20px 20px 16px;
  }

  .modal-title {
    font-size: 24px;
  }

  .modal-body {
    padding: 21px 20px 28px;
  }

  .input,
  .textarea,
  .select {
    font-size: 16px;
  }

  .textarea.body-textarea {
    font-size: 16px;
  }

  .modal-foot {
    padding: 14px 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .recovery-codes {
    grid-template-columns: 1fr;
  }

  .fanwork-type-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .protection-notice {
    padding: 12px 12px;
  }

  .protection-notice p {
    font-size: 10px;
  }

  .download-policy-options {
    grid-template-columns: 1fr;
  }

  .fanwork-announcement {
    gap: 10px;
    padding: 13px 13px;
    margin-top: 16px;
  }

  .fanwork-announcement p {
    font-size: 12px;
  }

  .detail-protection-row {
    align-items: flex-start;
    padding: 10px;
  }

  .detail-protection-row .button {
    width: 100%;
    margin-left: 0;
  }

  .work-cover-type {
    bottom: 9px;
    left: 9px;
    font-size: 8px;
  }

  .detail-type-tag {
    margin-left: 0;
  }

  .messages-shell {
    padding: 18px 0 55px;
  }

  .messages-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 15px;
  }

  .messages-toolbar .button {
    align-self: stretch;
  }

  .message-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    padding: 16px 8px 16px 17px;
  }

  .message-icon {
    --message-icon-size: 34px;
    width: 34px;
    height: 34px;
  }

  .message-icon svg {
    width: 15px;
    height: 15px;
  }

  .message-title {
    font-size: 13px;
  }

  .message-snippet {
    font-size: 10px;
  }

  .message-unread-dot {
    left: 4px;
  }

  .message-arrow {
    display: none;
  }

  .message-empty {
    min-height: 300px;
    padding: 38px 18px;
  }

  .audio-block {
    margin-top: 20px;
  }

  .account-hero {
    gap: 13px;
  }

  .account-hero-name {
    font-size: 21px;
  }

  .upload-files {
    grid-template-columns: 1fr;
  }

  .upload-submit-row {
    flex-wrap: wrap;
  }

  .upload-submit-note {
    flex: 1 0 100%;
    margin: 0 0 2px;
  }

  .upload-submit-row .button {
    flex: 1;
  }

  .detail-panel .modal-head {
    padding: 18px 20px 14px;
  }

  .detail-media {
    display: block;
    padding: 20px;
  }

  .detail-cover-frame {
    width: min(100%, 330px);
    margin: 0 auto;
  }

  .detail-cover-frame .cover-fallback {
    padding: 20px;
  }

  .detail-meta {
    justify-content: center;
  }

  .detail-media-meta {
    padding-top: 14px;
  }

  .detail-copy {
    padding: 23px 20px 26px;
  }

  .detail-title {
    font-size: 32px;
  }

  .detail-byline {
    margin-top: 14px;
    padding-bottom: 17px;
  }

  .detail-summary,
  .detail-body-text {
    font-size: 13px;
    line-height: 1.9;
  }

  .comments-section {
    padding: 23px 20px 27px;
  }

  .comment-login-prompt {
    display: block;
  }

  .comment-login-prompt .button {
    margin-top: 10px;
  }

  .comment-delete {
    opacity: 0.65;
  }

  .toast-root {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .auth-tabs {
    margin-bottom: 18px;
  }

  .form-actions {
    display: block;
  }

  .form-actions .button[type="submit"] {
    width: 100%;
  }

  .form-actions .text-button {
    display: block;
    margin-top: 13px;
    text-align: center;
  }

  .site-footer {
    gap: 8px;
  }
}

@media (max-width: 390px) {
  .works-grid,
  .skeleton-grid {
    gap: 24px 11px;
  }

  .work-card-title {
    font-size: 15px;
  }

  .board-tools {
    flex-wrap: wrap;
  }

  .filter-caption {
    display: none;
  }

  .lock-title {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
