:root {
  --ink: #1a1c14;
  --muted: #5c5848;
  --paper: #f3ead4;
  --sheet: #fffaf0;
  --line: #d7ccb0;
  --stamp: #c45c2a;
  --trail: #2c4a32;
  --moss: #3d6b45;
  --gold: #c9a227;
  --danger: #9b2c1a;
  --shadow: 0 18px 40px rgba(42, 36, 18, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196, 92, 42, 0.12), transparent 50%),
    radial-gradient(900px 420px at 100% 0%, rgba(44, 74, 50, 0.14), transparent 46%),
    linear-gradient(180deg, #efe4c8 0%, var(--paper) 28%, #e7dcc0 100%);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  z-index: 0;
}

.mast {
  position: relative;
  z-index: 2;
  padding: 28px 20px 22px;
  color: #f7f1dc;
  background:
    linear-gradient(160deg, rgba(18, 28, 20, 0.92), rgba(28, 42, 30, 0.88)),
    #142018;
  border-bottom: 6px solid var(--gold);
}
.mast .wrap { max-width: 880px; margin: 0 auto; }
.brand {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.72;
}
.mast h1 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(26px, 5vw, 36px);
  margin: 8px 0 10px;
  line-height: 1.25;
}
.mast p { margin: 0; max-width: 46em; font-size: 14px; opacity: 0.9; }
.cred {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(201, 162, 39, 0.2);
  border: 1px solid rgba(247, 241, 220, 0.35);
  max-width: 36em;
}
.cred-k {
  font-size: 12px;
  letter-spacing: 0.12em;
  opacity: 0.72;
  margin-bottom: 6px;
}
.cred-v {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.cred code {
  font-family: ui-monospace, "SF Mono", Consolas, "Microsoft YaHei", monospace;
  font-weight: 700;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 8px;
  border-radius: 8px;
  color: #fff6c8;
}
.cred-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.cred-list .cred { margin-top: 0; max-width: none; }
.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.roles a {
  color: #f7f1dc;
  text-decoration: none;
  border: 1px solid rgba(247, 241, 220, 0.28);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.roles a.on {
  background: var(--gold);
  color: #1a1c14;
  border-color: var(--gold);
  font-weight: 700;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 22px 16px 88px;
}

.who-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.who-bar label { font-size: 13px; color: var(--muted); }
.who-bar input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  background: #fff;
}
.hint a { color: var(--trail); font-weight: 700; }

.trail {
  position: relative;
  margin: 28px 0 0;
  padding-left: 8px;
}
.trail::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: repeating-linear-gradient(
    180deg,
    var(--trail) 0 10px,
    transparent 10px 18px
  );
}

.node {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  margin: 0 0 22px;
}
.badge {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sheet);
  border: 3px solid var(--trail);
  color: var(--trail);
  font-family: "Bebas Neue", "Noto Serif SC", serif;
  font-size: 20px;
  display: grid;
  place-items: center;
  letter-spacing: 0.02em;
}
.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  margin: 0 0 8px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #efe3c4;
  color: var(--trail);
}
.chip.where-mp { background: #dcead9; }
.chip.where-h5 { background: #f3ddc8; color: #7a3d12; }
.chip.where-pc { background: #dce4ef; color: #24344a; }
.chip.where-workshop { background: #ead9f0; color: #5a2d6b; }
.do, .expect { font-size: 14px; margin: 0 0 6px; }
.expect { color: var(--muted); }
.expect b { color: var(--moss); }

.comments { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.comments h3 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.note {
  background: #fff8e7;
  border: 1px solid #ead9a8;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 8px;
}
.note .who { font-weight: 700; font-size: 13px; }
.note .when { font-size: 12px; color: var(--muted); margin-left: 8px; }
.note p { margin: 6px 0; font-size: 14px; white-space: pre-wrap; }
.note .shots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.note .shots img,
.note img {
  display: block;
  max-width: min(100%, 220px);
  max-height: 160px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  background: #fff;
}
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.thumb {
  position: relative;
  display: inline-block;
}
.thumb img {
  width: 112px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  cursor: zoom-in;
  background: #fff;
}
.thumb .rm {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(26, 28, 20, 0.75);
  color: #fff;
  font: 14px/22px sans-serif;
  cursor: pointer;
  padding: 0;
}
.note .ops { display: flex; gap: 8px; margin-top: 6px; }
.note .ops button {
  border: 0;
  background: transparent;
  color: var(--stamp);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.note .ops button.danger { color: var(--danger); }
.composer .ghost {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.composer {
  background: #fff;
  border: 1px dashed #c9b98a;
  border-radius: 12px;
  padding: 10px;
}
.composer textarea {
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}
.composer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.composer .primary {
  border: 0;
  background: var(--trail);
  color: #f7f1dc;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.composer .file {
  font-size: 13px;
  color: var(--muted);
}
.preview {
  margin-top: 8px;
  max-width: 220px;
  max-height: 140px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.empty { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1a1c14;
  color: #f7f1dc;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 20;
  display: none;
}
.toast.show { display: block; }
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 14, 10, 0.86);
  z-index: 30;
  place-items: center;
  padding: 24px;
}
.lightbox.show { display: grid; }
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 8px; }

@media (max-width: 640px) {
  .trail { padding-left: 0; }
  .trail::before { left: 19px; }
  .node { grid-template-columns: 32px 1fr; }
  .badge { width: 32px; height: 40px; font-size: 16px; }
}
