:root {
  --bg: var(--yuan-bg-canvas);
  --panel: rgba(21, 16, 35, 0.88);
  --panel-soft: rgba(29, 22, 48, 0.88);
  --line: var(--yuan-line-subtle);
  --line-strong: var(--yuan-line-default);
  --text: var(--yuan-text-primary);
  --muted: var(--yuan-text-muted);
  --muted-2: #6e6386;
  --accent: var(--yuan-crimson-strong);
  --accent-soft: var(--yuan-crimson-soft);
  --gold: var(--yuan-gold);
  --font-serif: var(--yuan-font-serif);
  --font-sans: var(--yuan-font-sans);
  --shadow: var(--yuan-shadow-dialog);
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color-scheme: dark;
}
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
body.entry-locked {
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.ambient {
  position: fixed;
  z-index: 0;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(110px);
  opacity: 0.12;
}
.ambient--one {
  top: -18rem;
  left: -10rem;
  background: #d8355c;
}
.ambient--two {
  right: -18rem;
  bottom: -20rem;
  background: #7050a8;
  opacity: 0.08;
}

/* UID entry: a private archive book opens and releases one dossier page. */
.archive-entry {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(310px, 1fr) auto auto;
  align-items: center;
  justify-items: center;
  overflow: auto;
  padding: max(38px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 38%, rgba(201, 179, 240, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(13, 10, 22, 0.68), rgba(13, 10, 22, 0.92));
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}
.archive-entry::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(232, 198, 138, 0.05), transparent 62%);
}
.archive-entry__home {
  display: none;
  position: fixed;
  z-index: 4;
  top: 24px;
  left: 28px;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--yuan-radius-pill);
  background: rgba(21, 16, 35, 0.72);
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}
@media (min-width: 64rem) {
  .archive-entry__home {
    display: inline-flex;
  }
}
@media (hover: hover) and (pointer: fine) {
  .archive-entry__home:hover {
    border-color: rgba(232, 198, 138, 0.45);
    background: rgba(29, 22, 48, 0.86);
  }
}
.archive-entry__copy {
  position: relative;
  z-index: 2;
  text-align: center;
}
.archive-entry__copy h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 4rem);
  letter-spacing: -0.03em;
}
.archive-entry__copy > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.book-stage {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 520px);
  min-height: 330px;
  place-items: center;
  perspective: 1500px;
}
.archive-book {
  position: relative;
  width: 238px;
  height: 310px;
  transform: rotateX(5deg) rotateZ(-2deg);
  transform-style: preserve-3d;
}
.book-shadow {
  position: absolute;
  z-index: 0;
  right: -22px;
  bottom: -25px;
  left: -22px;
  height: 45px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  filter: blur(18px);
  transform: translateZ(-20px);
}
.book-back {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid #4b222d;
  border-radius: 3px 8px 8px 3px;
  background: #421722;
  box-shadow: 12px 18px 38px rgba(0, 0, 0, 0.46);
  transform-style: preserve-3d;
}
.book-back__edge {
  position: absolute;
  z-index: 1;
  inset: 8px -8px 8px 8px;
  border-radius: 0 8px 8px 0;
  background: #c6b9a7;
  box-shadow: inset -4px 0 6px rgba(65, 42, 33, 0.3);
  transform: translateZ(2px);
}
.book-pages {
  position: absolute;
  z-index: 2;
  inset: 11px -5px 11px 11px;
  overflow: hidden;
  border-radius: 1px 7px 7px 1px;
  background: repeating-linear-gradient(0deg, rgba(87, 65, 54, 0.15) 0 1px, transparent 1px 4px), #e2d8c9;
  transform: translateZ(5px);
}
.book-pages span {
  position: absolute;
  left: 20px;
  right: 18px;
  height: 1px;
  background: rgba(92, 70, 60, 0.13);
}
.book-pages span:nth-child(1) {
  top: 28%;
}
.book-pages span:nth-child(2) {
  top: 39%;
}
.book-pages span:nth-child(3) {
  top: 50%;
}
.book-pages span:nth-child(4) {
  top: 61%;
}
.book-pages span:nth-child(5) {
  top: 72%;
}
.dossier-page {
  position: absolute;
  z-index: 5;
  inset: 15px 3px 15px 15px;
  overflow: hidden;
  padding: 17px 16px;
  border: 1px solid rgba(77, 58, 49, 0.2);
  border-radius: 1px 6px 6px 1px;
  background: linear-gradient(rgba(109, 83, 69, 0.07) 1px, transparent 1px), #e8dfd0;
  background-size: 100% 21px;
  color: #3a3030;
  box-shadow: 3px 3px 10px rgba(45, 27, 23, 0.18);
  transform: translateZ(9px);
  transform-origin: bottom center;
}
.dossier-page__head {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(68, 45, 42, 0.3);
}
.dossier-seal {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid #8d374b;
  color: #8d374b;
  font-family: var(--font-serif);
  transform: rotate(45deg);
}
.dossier-page__head div {
  display: grid;
}
.dossier-page__head i {
  color: #8e7672;
  font-size: 0.35rem;
  font-style: normal;
  letter-spacing: 0.13em;
}
.dossier-page__head strong {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}
.dossier-page__head small {
  color: #9d8780;
  font-size: 0.4rem;
}
.dossier-page__identity {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 19px 0;
}
.dossier-avatar {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
  background: #34394e;
  color: #d8dceb;
  font-size: 0.75rem;
}
.dossier-page__identity div {
  display: grid;
  gap: 3px;
}
.dossier-page__identity b {
  font-size: 0.65rem;
}
.dossier-page__identity i {
  color: #9b8580;
  font-size: 0.36rem;
  font-style: normal;
  letter-spacing: 0.1em;
}
.dossier-page__lines {
  display: grid;
  gap: 14px;
}
.dossier-page__lines span {
  height: 5px;
  background: rgba(74, 51, 47, 0.12);
}
.dossier-page__lines span:nth-child(2) {
  width: 82%;
}
.dossier-page__lines span:nth-child(3) {
  width: 66%;
}
.dossier-page__stamp {
  position: absolute;
  right: 17px;
  bottom: 22px;
  padding: 5px 7px;
  border: 2px solid rgba(144, 48, 69, 0.4);
  color: rgba(144, 48, 69, 0.46);
  font-family: var(--font-serif);
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  transform: rotate(-9deg);
}
.book-cover {
  position: absolute;
  z-index: 10;
  inset: 0;
  overflow: hidden;
  border: 1px solid #6d2939;
  border-radius: 3px 9px 9px 3px;
  background:
    radial-gradient(circle at 75% 18%, rgba(255, 255, 255, 0.07), transparent 27%),
    linear-gradient(100deg, #491421, #731f33 60%, #541521);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.025),
    inset 18px 0 28px rgba(22, 5, 10, 0.25),
    10px 17px 30px rgba(0, 0, 0, 0.5);
  transform-origin: left center;
  transform: translateZ(24px) rotateY(0);
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.book-cover::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(213, 167, 130, 0.22);
  border-radius: 1px 6px 6px 1px;
}
.book-cover__spine {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 18px;
  width: 2px;
  background: rgba(238, 194, 157, 0.16);
  box-shadow: 6px 0 13px rgba(25, 5, 10, 0.35);
}
.book-cover__frame {
  position: absolute;
  z-index: 3;
  inset: 36px 28px 30px 42px;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: #e1c5b4;
  text-align: center;
}
.book-cover__mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 6px 0 25px;
  place-items: center;
  border: 1px solid rgba(232, 192, 158, 0.65);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  transform: rotate(45deg);
}
.book-cover__frame p {
  margin: 0 0 12px;
  color: rgba(228, 198, 179, 0.65);
  font-size: 0.43rem;
  letter-spacing: 0.24em;
}
.book-cover__frame strong {
  font-family: 'Songti SC', var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.22em;
}
.book-cover__frame i {
  width: 34px;
  height: 1px;
  margin: 19px 0;
  background: rgba(232, 192, 158, 0.46);
}
.book-cover__frame small {
  color: rgba(228, 198, 179, 0.48);
  font-size: 0.35rem;
  letter-spacing: 0.13em;
  white-space: nowrap;
}
.entry-form {
  position: relative;
  z-index: 3;
  width: min(100%, 490px);
}
.entry-form > label {
  display: block;
  margin-bottom: 8px;
  color: #a9a3a7;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}
.entry-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}
.entry-form .input-wrap input {
  height: 48px;
  border-right: 0;
}
.entry-form__row > button {
  min-width: 132px;
  border: 1px solid #cf4263;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}
.entry-form__row > button span {
  margin-left: 9px;
  font-size: 1rem;
}
.entry-form__message {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--muted-2);
  font-size: 0.64rem;
}
.entry-form__message.is-error {
  color: #e897aa;
}
.entry-skip {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  cursor: pointer;
}
.session-checking .archive-entry__copy,
.session-checking .entry-form,
.session-checking .entry-skip {
  visibility: hidden;
  opacity: 0;
}
.entry-opening .entry-form,
.entry-opening .archive-entry__copy,
.entry-opening .entry-skip {
  animation: entry-copy-out 0.35s ease forwards;
}
.entry-opening .book-cover {
  animation: archive-cover-open 1s cubic-bezier(0.22, 0.75, 0.2, 1) forwards;
}
.entry-opening .dossier-page {
  animation: dossier-pull-out 0.9s 0.52s cubic-bezier(0.18, 0.75, 0.22, 1) forwards;
}
.entry-opening .archive-book {
  animation: archive-book-focus 1.35s cubic-bezier(0.22, 0.75, 0.2, 1) forwards;
}
.entry-revealed .archive-entry {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.entry-locked .topbar,
.entry-locked .profile-shell {
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
}
.entry-revealed .topbar,
.entry-revealed .profile-shell {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease,
    visibility 0.55s ease;
}
@keyframes entry-copy-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes archive-cover-open {
  0% {
    transform: translateZ(24px) rotateY(0);
  }
  100% {
    transform: translateZ(24px) rotateY(-158deg);
    box-shadow: -14px 17px 32px rgba(0, 0, 0, 0.35);
  }
}
@keyframes dossier-pull-out {
  0% {
    transform: translateZ(9px) translateY(0) scale(1);
  }
  55% {
    transform: translateZ(80px) translateY(-92px) scale(1.06);
  }
  100% {
    transform: translateZ(145px) translateY(-62px) scale(1.18) rotateZ(1.5deg);
    box-shadow: 8px 18px 38px rgba(0, 0, 0, 0.35);
  }
}
@keyframes archive-book-focus {
  0% {
    transform: rotateX(5deg) rotateZ(-2deg) scale(1);
  }
  100% {
    transform: rotateX(1deg) rotateZ(0) scale(1.04);
  }
}
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  min-height: 86px;
  margin: 0 auto;
  padding-top: var(--yuan-safe-top);
  border-bottom: 1px solid var(--line);
}
.topbar__actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.topbar-avatar {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  outline: none;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(145deg, #3c4263, #11131e);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-serif);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.topbar-avatar:focus-visible {
  border-color: rgba(200, 52, 85, 0.74);
  box-shadow:
    0 0 0 3px rgba(200, 52, 85, 0.1),
    0 0 24px rgba(200, 52, 85, 0.2);
  transform: translateY(-1px);
}
@media (hover: hover) and (pointer: fine) {
  .topbar-avatar:hover {
    border-color: rgba(200, 52, 85, 0.74);
    box-shadow:
      0 0 0 3px rgba(200, 52, 85, 0.1),
      0 0 24px rgba(200, 52, 85, 0.2);
    transform: translateY(-1px);
  }
}
.topbar-avatar i {
  position: absolute;
  right: 0;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: #67c18c;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}
.brand__mark,
.sheet-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(200, 52, 85, 0.8);
  color: #f2dbe0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  transform: rotate(45deg);
  box-shadow:
    inset 0 0 0 4px var(--bg),
    0 0 24px rgba(200, 52, 85, 0.18);
}
.brand__mark::first-letter,
.sheet-icon {
  transform: rotate(45deg);
}
.brand__mark {
  line-height: 1;
}
.brand__mark + span {
  display: grid;
  gap: 1px;
}
.brand strong {
  font-size: 0.98rem;
  letter-spacing: 0.3em;
}
.brand small {
  color: var(--muted-2);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
}
.ghost-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .ghost-button:hover {
    border-color: rgba(200, 52, 85, 0.5);
    background: var(--accent-soft);
  }
}
.ghost-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.profile-shell {
  position: relative;
  z-index: 1;
  width: min(780px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0 80px;
}
.intro {
  margin-bottom: 30px;
}
.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}
.intro h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 4rem);
  letter-spacing: -0.03em;
}
.intro > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}
.profile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--yuan-radius-md);
  background: linear-gradient(145deg, rgba(220, 199, 242, 0.04), transparent 28%), var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.profile-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: linear-gradient(
    135deg,
    transparent 49.5%,
    rgba(200, 52, 85, 0.42) 50%,
    rgba(200, 52, 85, 0.42) 50.7%,
    transparent 51%
  );
  opacity: 0.4;
  pointer-events: none;
}
.profile-card__head {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 30px 34px;
  border-bottom: 1px solid var(--line);
}
.avatar {
  position: relative;
  display: grid;
  z-index: 1;
  flex: 0 0 auto;
  width: 82px;
  height: 82px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  outline: none;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(145deg, #3c4263, #11131e);
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-serif);
  font-size: 1.8rem;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.avatar:focus-visible {
  border-color: rgba(200, 52, 85, 0.7);
  box-shadow:
    0 0 0 4px rgba(200, 52, 85, 0.1),
    0 16px 32px rgba(0, 0, 0, 0.26);
  transform: translateY(-2px);
}
@media (hover: hover) and (pointer: fine) {
  .avatar:hover {
    border-color: rgba(200, 52, 85, 0.7);
    box-shadow:
      0 0 0 4px rgba(200, 52, 85, 0.1),
      0 16px 32px rgba(0, 0, 0, 0.26);
    transform: translateY(-2px);
  }
}
.avatar i {
  position: absolute;
  right: 2px;
  bottom: 6px;
  width: 13px;
  height: 13px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: #67c18c;
}
.avatar__qr-mark {
  position: absolute;
  top: -5px;
  right: -7px;
  width: 25px;
  height: 25px;
  padding: 5px;
  border: 1px solid rgba(200, 52, 85, 0.72);
  border-radius: 50%;
  background: #171318;
  fill: #e7b5c1;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.35);
}
.identity {
  min-width: 0;
  flex: 1;
}
.identity__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.status,
.privacy-badge {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
}
.status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #67c18c;
  box-shadow: 0 0 8px #67c18c;
}
.privacy-badge {
  letter-spacing: 0.04em;
}
.privacy-badge svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.identity h2 {
  margin: 10px 0 4px;
  font-size: 1.55rem;
  letter-spacing: 0.03em;
}
.identity p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}
.icon-copy {
  display: inline-grid;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  vertical-align: middle;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.profile-card__body {
  padding: 4px 34px 10px;
}
.data-section {
  padding: 27px 0 28px;
  border-bottom: 1px solid var(--line);
}
.data-section--last {
  border-bottom: 0;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-heading h3 {
  margin: 0;
  font-size: 0.97rem;
  letter-spacing: 0.08em;
}
.section-heading span {
  color: var(--muted-2);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
}
.section-action {
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(200, 52, 85, 0.45);
  background: none;
  color: #d98599;
  font-size: 0.68rem;
  cursor: pointer;
}
.section-locked {
  display: inline-flex;
  align-items: center;
  color: var(--muted-2) !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.04em !important;
}
.section-locked::before {
  content: '◇';
  margin-right: 6px;
  color: var(--accent);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.stat {
  min-width: 0;
  padding: 2px 18px;
  border-left: 1px solid var(--line);
}
.stat:first-child {
  padding-left: 0;
  border-left: 0;
}
.stat > span,
.private-grid > div > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}
.stat strong,
.private-grid strong {
  font-size: 1.12rem;
  font-weight: 500;
  white-space: nowrap;
}
.stat--wide strong {
  white-space: normal;
  overflow-wrap: anywhere;
}
.stat small,
.private-grid small {
  color: var(--muted);
  font-size: 0.65em;
  font-weight: 400;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: #c5c0c3;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.76rem;
}
.tag--active,
.tag--level {
  border-color: rgba(200, 52, 85, 0.43);
  background: var(--accent-soft);
  color: #f0bac7;
}
.tag--level {
  color: #e8c4cc;
  font-family: var(--font-serif);
}
.private-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.private-grid > div {
  position: relative;
  padding: 17px 18px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
}
.private-grid > div::after {
  content: 'PRIVATE';
  position: absolute;
  right: 12px;
  top: 12px;
  color: rgba(255, 255, 255, 0.09);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
}
.record-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.record-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}
.record-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.record-list li:last-child {
  padding-bottom: 0;
}
.record-list__index {
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 0.75rem;
}
.record-list p {
  margin: 0;
  color: #c9c5c7;
  font-size: 0.84rem;
  line-height: 1.65;
}
.record-list time {
  color: var(--muted-2);
  font-size: 0.65rem;
}
.record-list li.record-list__empty {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
  color: var(--muted-2);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-align: center;
}
.record-list li.record-list__empty::before {
  content: '◇';
  color: var(--accent);
  font-size: 0.68rem;
}
.page-note {
  margin: 22px 0 0;
  color: var(--muted-2);
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

/* Captain diary */
.diary-card {
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: linear-gradient(135deg, rgba(200, 52, 85, 0.055), transparent 32%), var(--panel);
  box-shadow: var(--shadow);
}
.diary-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 34px;
  border-bottom: 1px solid var(--line);
}
.diary-card__head .eyebrow {
  margin-bottom: 6px;
}
.diary-card__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.8rem;
}
.diary-card__head p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.diary-privacy {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
}
.diary-privacy svg {
  width: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}
.diary-card__flags {
  display: grid;
  flex: 0 0 auto;
  gap: 9px;
  justify-items: end;
}
.diary-reply-alert {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 6px 11px;
  border: 1px solid rgba(200, 52, 85, 0.45);
  background: var(--accent-soft);
  color: #eeb0bf;
  font-size: 0.68rem;
}
.diary-reply-alert strong {
  font-family: var(--font-serif);
  font-size: 0.82rem;
}
.diary-reply-alert button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(238, 176, 191, 0.5);
  background: none;
  color: #eeb0bf;
  font-size: 0.66rem;
  cursor: pointer;
}
.captain-notice {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(200, 52, 85, 0.4);
  background: linear-gradient(120deg, rgba(200, 52, 85, 0.15), rgba(200, 52, 85, 0.03));
}
.captain-notice__icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #eeb0bf;
}
.captain-notice__body {
  flex: 1;
  min-width: 0;
}
.captain-notice__body strong {
  display: block;
  font-size: 0.84rem;
}
.captain-notice__body p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
}
.captain-notice .secondary-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 15px;
  font-size: 0.7rem;
}
.diary-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 18px;
  padding: 28px 34px;
}
.diary-form__top {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.diary-form__date {
  width: min(220px, 100%);
}
.diary-form__top > p {
  max-width: 330px;
  margin: 0 0 10px;
  color: var(--muted-2);
  font-size: 0.67rem;
  line-height: 1.55;
  text-align: right;
}
.diary-form__top > p::before {
  content: '◇';
  margin-right: 7px;
  color: var(--accent);
}
.diary-form label > span {
  display: block;
  margin-bottom: 8px;
  color: #bbb6ba;
  font-size: 0.7rem;
}
.diary-form input,
.diary-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: none;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
}
.diary-form input {
  height: 44px;
  padding: 0 12px;
}
.diary-form textarea {
  min-height: 142px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.7;
}
.diary-form input:focus,
.diary-form textarea:focus {
  border-color: rgba(200, 52, 85, 0.65);
  box-shadow: 0 0 0 3px rgba(200, 52, 85, 0.09);
}
.diary-form input:disabled,
.diary-form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.diary-form__content {
  grid-column: 1 / -1;
  min-width: 0;
}
.diary-draft-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 9px 12px;
  border: 1px solid rgba(200, 52, 85, 0.28);
  border-radius: 2px;
  background: rgba(200, 52, 85, 0.08);
}
.diary-draft-bar__text {
  flex: 1 1 200px;
  min-width: 0;
  color: #e8cfd5;
  font-size: 0.7rem;
  line-height: 1.5;
}
.diary-draft-bar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.diary-draft-bar__chip,
.diary-draft-bar__clear {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.28);
  color: #ddd4d8;
  font-size: 0.68rem;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .diary-draft-bar__chip:hover {
    border-color: rgba(200, 52, 85, 0.65);
    color: #fff;
  }
  .diary-draft-bar__clear:hover {
    border-color: rgba(200, 52, 85, 0.72);
    color: #ffcbd7;
  }
}
.diary-form__meta {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 42px;
}
.diary-form__meta .form-message {
  margin: 0;
}
.diary-form__meta > span {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 0.65rem;
}
.diary-form__actions {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.diary-form__actions .secondary-button,
.diary-form__actions .primary-button {
  min-height: 42px;
}
.diary-history {
  padding: 25px 34px 30px;
  border-top: 1px solid var(--line);
}
.diary-history .section-heading {
  margin-bottom: 14px;
}
.diary-list {
  display: grid;
  gap: 10px;
}
.diary-entry {
  padding: 18px 19px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.13);
}
.diary-entry header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.diary-entry header time {
  color: #e9c1ca;
  font-family: var(--font-serif);
  font-size: 0.92rem;
}
.diary-entry header span {
  color: var(--muted-2);
  font-size: 0.62rem;
}
.diary-entry__content {
  margin: 14px 0;
  color: #d0cbce;
  font-size: 0.8rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.diary-entry footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}
.diary-entry footer button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(200, 52, 85, 0.35);
  background: none;
  color: #d98599;
  font-size: 0.68rem;
  cursor: pointer;
}
.diary-entry footer .diary-entry__delete {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}
.diary-entry__replies {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}
.diary-reply {
  padding: 13px 15px;
  border: 1px solid rgba(200, 52, 85, 0.22);
  border-left: 2px solid var(--accent);
  background: rgba(200, 52, 85, 0.06);
}
.diary-reply header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
}
.diary-reply .diary-reply__who {
  color: #eaa9b8;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}
.diary-reply header time {
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 0.6rem;
}
.diary-reply p {
  margin: 9px 0 0;
  color: #d7d2d5;
  font-size: 0.77rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.diary-reply footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 10px;
}
.diary-reply footer button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(200, 52, 85, 0.35);
  background: none;
  color: #d98599;
  font-size: 0.66rem;
  cursor: pointer;
}
.diary-reply footer .diary-reply__delete {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}
.diary-reply.is-unread {
  border-color: rgba(200, 52, 85, 0.5);
  background: rgba(200, 52, 85, 0.12);
}
.diary-reply .diary-new-chip {
  margin-left: 8px;
}
.diary-empty {
  margin: 0;
  padding: 24px 18px;
  border: 1px dashed var(--line);
  color: var(--muted-2);
  text-align: center;
  font-size: 0.74rem;
}
.diary-empty--error {
  color: #d78a9c;
}
.diary-load-more {
  width: 100%;
  margin-top: 12px;
}

.claim-sheet,
.editor-sheet {
  position: fixed;
  z-index: var(--yuan-z-sheet, 1200);
  inset: 0;
  display: grid;
  visibility: hidden;
  place-items: center;
  opacity: 0;
  transition: 0.24s ease;
}
.claim-sheet.is-open,
.editor-sheet.is-open {
  visibility: visible;
  opacity: 1;
}
.claim-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(9px);
}
.claim-sheet__panel {
  position: relative;
  width: min(440px, calc(100% - 32px));
  padding: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--yuan-radius-md);
  background: var(--yuan-bg-elevated, #1e1731);
  box-shadow: var(--shadow);
  transform: translateY(15px);
  transition: 0.24s ease;
}
.claim-sheet.is-open .claim-sheet__panel {
  transform: translateY(0);
}
.claim-sheet__handle {
  display: none;
}
.claim-sheet__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  width: var(--yuan-tap-min, 44px);
  height: var(--yuan-tap-min, 44px);
  min-width: var(--yuan-tap-min, 44px);
  min-height: var(--yuan-tap-min, 44px);
  place-items: center;
  border: 0;
  border-radius: var(--yuan-radius-pill);
  background: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.sheet-icon {
  width: 46px;
  height: 46px;
  margin: 5px 0 28px 5px;
  font-size: 1.2rem;
}
.claim-sheet h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.8rem;
}
.claim-sheet__desc {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}
.claim-form label,
.editor-form label > span {
  display: block;
  margin-bottom: 8px;
  color: #bbb6ba;
  font-size: 0.72rem;
}
.claim-form {
  display: grid;
  gap: 10px;
}
.claim-form > input,
.claim-form__field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: none;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
}
.claim-form > input:focus,
.claim-form__field input:focus {
  border-color: rgba(200, 52, 85, 0.65);
  box-shadow: 0 0 0 3px rgba(200, 52, 85, 0.09);
}
.claim-form > input[readonly],
.claim-form__field input[readonly] {
  color: var(--muted);
  cursor: default;
}
.claim-form__field {
  display: grid;
}
.qr-login-identity {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid rgba(200, 52, 85, 0.28);
  background: linear-gradient(135deg, rgba(200, 52, 85, 0.11), rgba(255, 255, 255, 0.018));
}
.qr-login-identity__avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: linear-gradient(145deg, #3c4263, #11131e);
  font-family: var(--font-serif);
}
.qr-login-identity > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.qr-login-identity small {
  color: var(--muted-2);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}
.qr-login-identity strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qr-login-identity i {
  color: #d88aa0;
  font-size: 0.58rem;
  font-style: normal;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.field-help {
  margin: -3px 0 14px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}
.input-wrap {
  position: relative;
}
.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
}
.input-wrap input,
.editor-form input,
.editor-form select,
.editor-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: none;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
}
.input-wrap input {
  height: 50px;
  padding: 0 14px 0 43px;
}
.input-wrap input:focus,
.editor-form input:focus,
.editor-form select:focus,
.editor-form textarea:focus {
  border-color: rgba(200, 52, 85, 0.65);
  box-shadow: 0 0 0 3px rgba(200, 52, 85, 0.09);
}
.form-message {
  min-height: 20px;
  margin: 8px 0 3px;
  color: #e59daf;
  font-size: 0.72rem;
}
.form-message.is-success {
  color: #78c99a;
}
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  cursor: pointer;
}
.primary-button {
  width: 100%;
  min-height: 48px;
  border: 1px solid #dc496b;
  background: var(--accent);
  color: white;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(200, 52, 85, 0.18);
}
.claim-sheet__tip {
  margin: 15px 0 0;
  color: var(--muted-2);
  text-align: center;
  font-size: 0.65rem;
}
.captain-qr-sheet__panel {
  width: min(500px, calc(100% - 32px));
  max-height: min(92vh, 820px);
  overflow-y: auto;
}
.password-sheet__panel {
  max-height: min(92vh, 720px);
  overflow-y: auto;
}
.captain-qr-sheet__panel .claim-sheet__desc {
  margin-bottom: 18px;
}
.captain-qr-preview {
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 9px;
  border: 1px solid rgba(201, 167, 117, 0.3);
  background: #09090b;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}
.captain-qr-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #171217;
}
.captain-qr-feedback {
  min-height: 18px;
  margin: 12px 0 5px;
  text-align: center;
}
.captain-qr-sheet__tip {
  margin: 13px 0 0;
  color: var(--muted-2);
  text-align: center;
  font-size: 0.65rem;
  line-height: 1.6;
}
.xp-sheet__panel {
  width: min(500px, calc(100% - 32px));
}
.xp-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.xp-options button {
  min-width: 48px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}
.xp-options button.is-selected {
  border-color: rgba(200, 52, 85, 0.55);
  background: var(--accent-soft);
  color: #efb8c5;
}
.custom-xp-field {
  display: block;
  margin-bottom: 8px;
  color: #bbb6ba;
  font-size: 0.72rem;
}
.custom-xp-input {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-bottom: 18px;
}
.custom-xp-input input,
.custom-xp-input textarea {
  min-width: 0;
  min-height: 43px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  outline: none;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  line-height: 1.5;
  resize: vertical;
}
.custom-xp-input input:focus,
.custom-xp-input textarea:focus {
  border-color: rgba(200, 52, 85, 0.65);
}
.custom-xp-input button {
  min-width: 68px;
  border: 1px solid rgba(200, 52, 85, 0.5);
  background: var(--accent-soft);
  color: #efb8c5;
  cursor: pointer;
}
.selected-xp {
  min-height: 86px;
  margin-bottom: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}
.selected-xp > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 0.65rem;
}
.selected-xp .tag {
  cursor: pointer;
}
.selected-xp .tag::after {
  content: '×';
  margin-left: 7px;
  color: var(--muted);
}
.xp-input-help {
  margin: -10px 0 17px;
  color: var(--muted-2);
  font-size: 0.65rem;
  line-height: 1.6;
}
.xp-input-help strong {
  color: #d5a3af;
  font-weight: 500;
}
.editor-form .xp-input-help {
  margin: 0 0 17px;
}
.form-message) {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.78rem;
}
.primary-button--compact {
  width: auto;
  min-height: 44px;
  padding: 0 20px;
  gap: 8px;
}
.mini-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}
.mini-avatar--blue {
  background: #252c46;
  color: #bac4ee;
}
.mini-avatar--plum {
  background: #40283c;
  color: #e7bad8;
}
.mini-avatar--gold {
  background: #433a28;
  color: #dfc88d;
}
.mini-avatar--green {
  background: #213a35;
  color: #acd7cb;
}
.claim-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.claim-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.claim-status--yes {
  color: #79b991;
}
.claim-status--yes i {
  background: #79b991;
}
.claim-status--no {
  color: #918c90;
}
.claim-status--no i {
  background: #686468;
}
.claim-status--review {
  color: #d6ad6a;
}
.claim-status--review i {
  background: #d6ad6a;
}
@media (hover: hover) and (pointer: fine) {
  .secondary-button--danger:hover {
    border-color: rgba(200, 52, 85, 0.7) !important;
    color: #e59daf !important;
  }
}
.diary-new-chip {
  padding: 3px 7px;
  border: 1px solid rgba(200, 52, 85, 0.5);
  background: var(--accent-soft);
  color: #f0a9b9;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}
button:disabled {
  cursor: progress;
  opacity: 0.6;
}

.editor-sheet {
  justify-items: end;
}
.editor-sheet__panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(590px, 94vw);
  height: 100%;
  overflow: hidden;
  background: var(--yuan-bg-elevated, #1e1731);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  transform: translateX(30px);
  transition: 0.25s ease;
}
.editor-sheet.is-open .editor-sheet__panel {
  transform: translateX(0);
}
.editor-head {
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding: 30px;
  border-bottom: 1px solid var(--line);
  background: var(--yuan-bg-elevated, #1e1731);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}
.editor-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.8rem;
}
.editor-head button {
  display: inline-grid;
  min-width: var(--yuan-tap-min, 44px);
  min-height: var(--yuan-tap-min, 44px);
  place-items: center;
  border: 0;
  border-radius: var(--yuan-radius-pill);
  background: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.editor-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}
.editor-form__body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 28px 30px 0;
}
.form-section {
  padding: 0 0 25px;
  margin: 0 0 25px;
  border-bottom: 1px solid var(--line);
}
.form-section h3 {
  margin: 0 0 17px;
  font-size: 0.85rem;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.editor-form label {
  min-width: 0;
}
.editor-form input,
.editor-form select {
  min-width: 0;
  max-width: 100%;
  height: 43px;
  padding: 0 12px;
}
.editor-form input[type='date'] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
}
.editor-form input[type='date']::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}
.editor-form textarea {
  resize: vertical;
  padding: 12px;
}
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 17px;
}
.choice-row label {
  margin: 0;
  cursor: pointer;
}
.choice-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.choice-row label > span {
  display: grid;
  min-width: 55px;
  height: 34px;
  margin: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  transition: 0.18s ease;
}
.choice-row input:checked + span {
  border-color: rgba(200, 52, 85, 0.6);
  background: var(--accent-soft);
  color: #eeb9c5;
}
.choice-row input:focus-visible + span {
  outline: 2px solid rgba(200, 52, 85, 0.5);
  outline-offset: 2px;
}
.full-field {
  display: block;
}
.add-record-button {
  margin-top: 10px;
  border: 0;
  background: none;
  color: #dd879b;
  font-size: 0.74rem;
  cursor: pointer;
}
.editor-actions {
  z-index: 2;
  display: flex;
  justify-content: end;
  gap: 10px;
  padding: 16px 30px;
  border-top: 1px solid var(--line);
  background: var(--yuan-bg-surface, #151023);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.2);
}
.secondary-button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
}
.onboarding-sheet {
  z-index: calc(var(--yuan-z-sheet, 1200) + 10);
}
.onboarding-sheet__panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(620px, 94vw);
}
.onboarding-note {
  margin: 0 30px 20px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  color: #d7b7be;
  font-size: 0.75rem;
  line-height: 1.65;
}
.onboarding-actions .primary-button {
  min-width: 210px;
}
.onboarding-bili-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.onboarding-bili-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.onboarding-bili-card strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.onboarding-bili-card small {
  color: var(--muted);
  font-size: 0.65rem;
}
.onboarding-feedback {
  min-height: 20px;
}
.lock-confirm {
  display: flex !important;
  gap: 9px;
  align-items: flex-start;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}
.lock-confirm input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.lock-confirm span {
  margin: 0 !important;
}
.onboarding-xp-options {
  margin-bottom: 14px;
}
.onboarding-location-hint {
  margin: -6px 0 14px;
  padding: 8px 11px;
  border-left: 2px solid rgba(104, 185, 255, 0.6);
  background: rgba(104, 185, 255, 0.07);
  color: #a9d1f5;
  font-size: 0.7rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .archive-entry {
    grid-template-rows: auto minmax(300px, 1fr) auto auto;
    padding-right: 16px;
    padding-left: 16px;
  }
  .archive-entry__copy h1 {
    font-size: 2.55rem;
  }
  .archive-entry__copy > p:last-child {
    font-size: 0.75rem;
  }
  .book-stage {
    min-height: 300px;
  }
  .archive-book {
    width: 214px;
    height: 280px;
  }
  .book-cover__frame {
    inset: 31px 24px 26px 37px;
  }
  .book-cover__mark {
    width: 38px;
    height: 38px;
    margin-bottom: 20px;
  }
  .book-cover__frame strong {
    font-size: 1.4rem;
  }
  .entry-form__row > button {
    min-width: 116px;
    font-size: 0.76rem;
  }
  .entry-form__message {
    line-height: 1.5;
  }
  .topbar {
    width: calc(100% - 32px);
    height: 70px;
  }
  .brand__mark {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  .brand strong {
    font-size: 0.84rem;
  }
  .brand small {
    font-size: 0.5rem;
  }
  .topbar__actions {
    gap: 7px;
  }
  .topbar-avatar {
    width: 38px;
    height: 38px;
  }
  .ghost-button {
    min-width: var(--yuan-tap-min, 44px);
    min-height: var(--yuan-tap-min, 44px);
    padding: 0 11px;
  }
  .ghost-button span {
    display: none;
  }
  .profile-shell {
    width: calc(100% - 24px);
    padding: 42px 0 60px;
  }
  .intro {
    padding-left: 7px;
    margin-bottom: 24px;
  }
  .intro h1 {
    font-size: 2.7rem;
  }
  .intro > p:last-child {
    font-size: 0.82rem;
  }
  .profile-card__head {
    align-items: flex-start;
    gap: 15px;
    padding: 24px 20px;
  }
  .avatar {
    width: 66px;
    height: 66px;
    font-size: 1.45rem;
  }
  .identity__top {
    align-items: flex-start;
  }
  .privacy-badge {
    display: none;
  }
  .identity h2 {
    margin-top: 8px;
    font-size: 1.2rem;
  }
  .profile-card__body {
    padding: 2px 20px 8px;
  }
  .data-section {
    padding: 24px 0;
  }
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
    row-gap: 23px;
  }
  .stat {
    padding: 2px 10px;
  }
  .stat:nth-child(1) {
    padding-left: 0;
  }
  .stat:nth-child(5) {
    grid-column: 1 / -1;
    padding-left: 0;
    border-left: 0;
  }
  .stat > span,
  .private-grid > div > span {
    font-size: 0.67rem;
  }
  .stat strong {
    font-size: 0.95rem;
  }
  .tag {
    min-height: 30px;
    padding: 0 11px;
    font-size: 0.72rem;
  }
  .private-grid {
    gap: 8px;
  }
  .private-grid > div {
    padding: 15px 13px;
  }
  .private-grid > div::after {
    display: none;
  }
  .private-grid strong {
    font-size: 1rem;
  }
  .record-list li {
    grid-template-columns: 27px 1fr;
    gap: 7px;
  }
  .record-list time {
    grid-column: 2;
    margin-top: -4px;
  }
  .record-list p {
    font-size: 0.78rem;
  }
  .diary-card {
    margin-top: 12px;
  }
  .diary-card__head {
    display: block;
    padding: 23px 20px;
  }
  .diary-card__head h2 {
    font-size: 1.55rem;
  }
  .diary-card__flags {
    justify-items: start;
    margin-top: 16px;
  }
  .captain-notice {
    flex-wrap: wrap;
    padding: 14px 16px;
  }
  .captain-notice__body {
    flex: 1 1 60%;
  }
  .captain-notice .secondary-button {
    flex: 1 1 100%;
  }
  .diary-form {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 23px 20px;
  }
  .diary-form__top,
  .diary-form__content,
  .diary-draft-bar,
  .diary-form__meta,
  .diary-form__actions {
    grid-column: 1;
    grid-row: auto;
  }
  .diary-form__top {
    display: grid;
    gap: 11px;
  }
  .diary-form__date {
    width: 100%;
  }
  .diary-form__top > p {
    max-width: none;
    margin: 0;
    text-align: left;
  }
  .diary-form__meta {
    min-height: 26px;
    margin-top: -4px;
  }
  .diary-form__actions {
    width: 100%;
  }
  .diary-form__actions .primary-button {
    flex: 1;
  }
  .diary-history {
    padding: 22px 20px 25px;
  }
  .diary-entry {
    padding: 16px;
  }
  .diary-entry header {
    align-items: flex-start;
  }
  .diary-entry header span {
    text-align: right;
  }
  .claim-sheet {
    align-items: end;
  }
  .claim-sheet__panel {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 27px 22px calc(24px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    transform: translateY(40px);
  }
  .claim-sheet__handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: -16px auto 24px;
    border-radius: 99px;
    background: var(--yuan-line-strong);
  }
  .sheet-icon {
    display: none;
  }
  .claim-sheet h2 {
    font-size: 1.55rem;
  }
  .captain-qr-sheet__panel {
    max-height: 94dvh;
  }
  .password-sheet__panel {
    max-height: 92dvh;
  }
  .captain-qr-preview {
    width: min(100%, 330px);
  }
  .qr-login-identity {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .qr-login-identity i {
    grid-column: 2;
  }
  .xp-sheet__panel {
    max-height: 88dvh;
    overflow-y: auto;
  }
  .editor-sheet {
    align-items: end;
  }
  .editor-sheet__panel {
    width: 100%;
    height: min(92dvh, 900px);
    border-radius: 16px 16px 0 0;
    transform: translateY(40px);
  }
  .editor-sheet.is-open .editor-sheet__panel {
    transform: translateY(0);
  }
  .editor-head {
    padding: 25px 20px 20px;
  }
  .onboarding-note {
    margin: 0 20px 18px;
  }
  .editor-form__body {
    padding: 24px 20px 0;
  }
  .editor-actions {
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  }
  .onboarding-actions .primary-button {
    width: 100%;
  }
  .field-grid {
    gap: 13px 10px;
  }
  .editor-form .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .onboarding-bili-card {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .onboarding-bili-card .claim-status {
    grid-column: 2;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .captain-qr-sheet__panel {
    padding: 26px 32px;
  }
  .captain-qr-sheet__panel h2 {
    font-size: 1.55rem;
  }
  .captain-qr-sheet__panel .claim-sheet__desc {
    margin-bottom: 12px;
    line-height: 1.5;
  }
  .captain-qr-preview {
    width: min(100%, 230px);
    padding: 7px;
  }
  .captain-qr-feedback {
    margin: 8px 0 4px;
  }
  .captain-qr-sheet__tip {
    margin-top: 8px;
    line-height: 1.4;
  }
}

@media (max-height: 700px) and (max-width: 760px) {
  .archive-entry {
    grid-template-rows: auto minmax(240px, 1fr) auto auto;
    padding-top: 24px;
  }
  .book-stage {
    min-height: 240px;
    transform: scale(0.82);
  }
  .archive-entry__copy h1 {
    font-size: 2.1rem;
  }
}

/* 手机端拉起软键盘导致布局视口缩矮时，收起装饰书册并压缩抽屉边距，保证输入框与提交按钮完整可见可滚动 */
@media (max-height: 540px) and (max-width: 760px) {
  .archive-entry {
    grid-template-rows: auto auto;
    align-content: start;
    gap: 16px;
    padding: max(18px, env(safe-area-inset-top)) 20px 20px;
  }
  .book-stage {
    display: none;
  }
  .archive-entry__copy h1 {
    font-size: 1.75rem;
  }
  .claim-sheet__panel {
    max-height: 100dvh;
    padding: 18px 20px calc(16px + env(safe-area-inset-bottom));
  }
  .claim-sheet__handle {
    display: none;
  }
  .claim-sheet .eyebrow,
  .claim-sheet__desc {
    display: none;
  }
  .claim-sheet h2 {
    margin-bottom: 12px;
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
:where(.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;
}

/* 舰长轮盘入口：只有从档案页进入（已登录舰长）才会拿到舰长级别轮盘 */
.roulette-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--yuan-radius-md);
  background: linear-gradient(135deg, rgba(217, 108, 146, 0.08), transparent 36%), var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.roulette-entry h2 {
  margin: 6px 0 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
}
.roulette-entry p {
  margin: 8px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}
.roulette-entry .primary-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 44px;
  padding: 0 22px;
  text-decoration: none;
}
@media (max-width: 63.99rem) {
  .archive-entry {
    padding-bottom: calc(var(--yuan-bottom-clearance) + 28px);
  }
  .profile-shell {
    padding-bottom: calc(var(--yuan-bottom-clearance) + 36px);
  }
}
@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 18px;
  }
  .stat:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .stat--wide {
    grid-column: 1 / -1;
    padding-left: 0;
    border-left: 0;
  }
  .roulette-entry {
    flex-direction: column;
    align-items: stretch;
  }
  .roulette-entry .primary-button {
    width: 100%;
  }
}
