/* =========================================================
   拾光小站 · Journal & Changelog
   ========================================================= */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 30px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .05em;
}

.breadcrumb a {
  transition: color .2s ease;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span:nth-child(2) {
  opacity: .45;
}

/* ---------------- Journal hero ---------------- */

.journal-hero {
  padding-block: 26px clamp(46px, 6vw, 76px);
  overflow: clip;
}

.journal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr);
  align-items: end;
  gap: clamp(34px, 6vw, 84px);
}

.journal-hero h1 {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.4vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: 1.04;
}

.journal-hero h1 .marker {
  position: relative;
  display: inline-block;
  color: var(--green-deep);
  z-index: 0;
}

[data-theme="dark"] .journal-hero h1 .marker {
  color: var(--green);
}

.journal-hero h1 .marker::after {
  content: "";
  position: absolute;
  left: -1%;
  right: -1%;
  bottom: .12em;
  height: .22em;
  border-radius: 2px;
  background: var(--yellow);
  opacity: .72;
  transform: rotate(-1deg);
  z-index: -1;
}

.journal-hero p {
  max-width: 530px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.85;
}

.journal-issue {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--yellow) 22%, transparent), transparent 38%),
    color-mix(in srgb, var(--surface-solid) 72%, transparent);
  box-shadow: var(--shadow-sm);
}

.journal-issue::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -64px;
  width: 160px;
  height: 160px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
}

.journal-issue__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .13em;
}

.journal-issue__no {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 6vw, 5rem);
  font-weight: 600;
  letter-spacing: -.08em;
  line-height: 1;
  color: var(--green-deep);
}

[data-theme="dark"] .journal-issue__no {
  color: var(--green);
}

.journal-issue h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.journal-issue p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.journal-issue__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .04em;
}

/* ---------------- Essay layout ---------------- */

.journal-main {
  padding-bottom: clamp(58px, 8vw, 96px);
}

.essay-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(26px, 4vw, 56px);
  align-items: start;
}

.essay-aside {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  display: grid;
  gap: 14px;
}

.essay-toc {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 65%, transparent);
}

.essay-toc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
}

.essay-toc a {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  transition: color .2s ease;
}

.essay-toc a:last-child {
  border-bottom: 0;
}

.essay-toc a span {
  color: var(--line-strong);
  font-family: var(--font-mono);
  font-size: 8px;
  padding-top: 1px;
}

.essay-toc a:hover {
  color: var(--accent);
}

.essay-aside-note {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--yellow-soft);
}

.essay-aside-note span {
  color: #8a6a18;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
}

.essay-aside-note p {
  margin-top: 6px;
  color: #6d5b2a;
  font-size: 10px;
  line-height: 1.7;
}

[data-theme="dark"] .essay-aside-note p {
  color: #d9c58d;
}

[data-theme="dark"] .essay-aside-note span {
  color: var(--yellow);
}

.essay-aside-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 10px;
  transition: border-color .2s ease, color .2s ease;
}

.essay-aside-link:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.essay-list {
  display: grid;
  gap: 18px;
}

.essay-article {
  scroll-margin-top: calc(var(--header-h) + 20px);
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.essay-article--featured {
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--yellow) 14%, transparent), transparent 36%),
    var(--surface-solid);
}

.essay-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .04em;
}

.essay-meta .essay-tag {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  letter-spacing: .02em;
}

.essay-article h2 {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.essay-lead {
  margin-top: 12px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 15.5px;
  line-height: 1.8;
}

.essay-body {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 2;
}

.essay-body p + p {
  margin-top: 14px;
}

.essay-article--featured .essay-body > p:first-child::first-letter {
  float: left;
  margin: .08em .13em 0 0;
  color: var(--green-deep);
  font-family: var(--font-display);
  font-size: 3.2em;
  font-weight: 600;
  line-height: .86;
}

[data-theme="dark"] .essay-article--featured .essay-body > p:first-child::first-letter {
  color: var(--green);
}

.essay-body blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent-soft) 52%, transparent);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  line-height: 1.8;
}

.essay-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
}

.essay-end::before {
  content: "✦";
  color: var(--accent);
  font-size: 9px;
}

.journal-signoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 6px;
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--green-deep);
  color: #f7f1e2;
}

[data-theme="dark"] .journal-signoff {
  background: #264333;
}

.journal-signoff p {
  color: rgba(247, 241, 226, .65);
  font-size: 11px;
  line-height: 1.7;
}

.journal-signoff a {
  flex: none;
  color: var(--yellow);
  font-size: 11px;
  border-bottom: 1px solid rgba(239, 197, 95, .5);
  padding-bottom: 2px;
}

/* ---------------- Changelog ---------------- */

.log-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-bottom: clamp(58px, 8vw, 96px);
}

.log-aside {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  display: grid;
  gap: 14px;
}

.version-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(239, 197, 95, .18), transparent 38%),
    var(--green-deep);
  color: #f7f1e2;
}

[data-theme="dark"] .version-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(239, 197, 95, .2), transparent 38%),
    #294635;
}

.version-card span {
  color: rgba(247, 241, 226, .5);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
}

.version-card b {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -.06em;
  line-height: 1;
}

.version-card p {
  margin-top: 8px;
  color: rgba(247, 241, 226, .58);
  font-size: 10px;
  line-height: 1.6;
}

.version-card a {
  display: inline-flex;
  margin-top: 14px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(239, 197, 95, .5);
  color: var(--yellow);
  font-size: 10px;
}

.log-note {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 65%, transparent);
}

.log-note span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
}

.log-note p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
  padding-left: 24px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--line);
}

.log-entry {
  position: relative;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.log-entry::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 28px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.log-entry--latest::before {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
}

.log-entry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 14px;
}

.log-version {
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface-solid);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .03em;
}

.log-entry--latest .log-version {
  background: var(--accent);
  color: #fffaf2;
}

.log-entry__head time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .04em;
}

.log-latest {
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .08em;
}

.log-entry h2 {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.log-list {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  list-style: none;
}

.log-list li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.log-list li::before {
  content: "·";
  color: var(--accent);
  font-weight: 700;
}

.log-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.log-foot a {
  color: var(--ink-soft);
}

.log-foot a:hover {
  color: var(--accent);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 980px) {
  .journal-hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .journal-issue {
    display: none;
  }

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

  .essay-aside {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .essay-toc {
    grid-row: span 2;
  }

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

  .log-aside {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .journal-hero {
    padding-top: 18px;
  }

  .journal-hero h1 {
    font-size: clamp(2.6rem, 11vw, 3.8rem);
  }

  .journal-hero p {
    font-size: 13.5px;
  }

  .essay-aside {
    grid-template-columns: 1fr;
  }

  .essay-toc {
    grid-row: auto;
  }

  .essay-article {
    padding: 20px 17px;
  }

  .essay-article h2 {
    font-size: 1.65rem;
  }

  .journal-signoff {
    display: grid;
    gap: 14px;
    padding: 20px;
  }

  .log-aside {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 18px;
  }

  .log-entry {
    padding: 18px;
  }

  .log-entry::before {
    left: -18px;
  }

  .log-foot {
    display: grid;
    gap: 9px;
  }
}

/* ---------------- Writing space ---------------- */

.writing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: clamp(24px, 4vw, 50px);
  padding-bottom: clamp(58px, 8vw, 96px);
}

.writing-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.writing-board {
  padding: clamp(22px, 3.6vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.writer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.writer-head h2 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.writer-status {
  flex: none;
  margin-top: 4px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .04em;
  transition: color .2s ease, border-color .2s ease;
}

.writer-status.is-saved {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  color: var(--green);
}

.writer-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 22px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.writer-title {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.25;
}

.writer-title::placeholder {
  color: color-mix(in srgb, var(--muted) 58%, transparent);
}

.writer-count {
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .03em;
}

.writer-body {
  display: block;
  width: 100%;
  min-height: 360px;
  margin-top: 16px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 2;
  resize: vertical;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.writer-body:focus {
  border-color: var(--accent);
  background: var(--surface-solid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.writer-body::placeholder {
  color: color-mix(in srgb, var(--muted) 62%, transparent);
}

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

.writer-actions .btn {
  min-height: 40px;
  padding-inline: 16px;
  font-size: 11.5px;
}

.writer-mode {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .05em;
}

.writer-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.writer-note > span {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 8px;
}

.my-essays {
  padding: clamp(22px, 3.6vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-solid) 68%, transparent);
}

.my-essays__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.my-essays__head h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -.04em;
}

.my-essays__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.my-essays__tools .inline-copy {
  font-size: 8.5px;
}

.essay-empty {
  display: grid;
  justify-items: center;
  padding: 38px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
}

.essay-empty > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--yellow-soft);
  color: #8a6a18;
  font-family: var(--font-display);
  font-size: 21px;
}

.essay-empty h3 {
  margin-top: 11px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.025em;
}

.essay-empty p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.user-essay {
  position: relative;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease;
}

.user-essay:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.user-essay__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .04em;
}

.user-essay__meta span:first-child {
  color: var(--accent);
}

.user-essay h3 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.25;
}

.user-essay__excerpt {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.user-essay__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.user-essay__actions button {
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.user-essay__actions button:hover {
  border-color: var(--ink);
  background: var(--surface-soft);
  color: var(--ink);
}

.user-essay__actions button[data-action="delete"]:hover {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  color: var(--danger);
}

.writing-aside {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  display: grid;
  gap: 14px;
}

.writing-prompts-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 68%, transparent);
}

.writing-prompts-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 11px;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
}

.writing-prompts-card h2 {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.035em;
}

.writing-prompts {
  display: grid;
  gap: 0;
  margin-top: 8px;
  list-style: none;
  counter-reset: prompt;
}

.writing-prompts li {
  position: relative;
  padding: 10px 0 10px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
  counter-increment: prompt;
}

.writing-prompts li:last-child {
  border-bottom: 0;
}

.writing-prompts li::before {
  content: "0" counter(prompt);
  position: absolute;
  left: 0;
  top: 11px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 8px;
}

/* ---------------- Reading modal ---------------- */

.reading-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
}

.reading-modal__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #0c1410 58%, transparent);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.reading-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  animation: reading-in .25s var(--ease) both;
}

@keyframes reading-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
}

.reading-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.reading-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: background .2s ease, color .2s ease;
}

.reading-close:hover {
  background: var(--ink);
  color: var(--surface-solid);
}

.reading-modal__panel h2 {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.reading-body {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 2.05;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.reading-actions .btn {
  min-height: 40px;
  padding-inline: 16px;
  font-size: 11px;
}

@media (max-width: 980px) {
  .writing-layout {
    grid-template-columns: 1fr;
  }

  .writing-aside {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .writing-prompts-card {
    grid-row: span 2;
  }
}

@media (max-width: 700px) {
  .writing-board,
  .my-essays {
    padding: 19px 16px;
  }

  .writer-head {
    display: grid;
    gap: 10px;
  }

  .writer-status {
    justify-self: start;
    margin-top: 0;
  }

  .writer-title-row {
    align-items: flex-start;
    gap: 8px;
  }

  .writer-title {
    font-size: 1.55rem;
  }

  .writer-body {
    min-height: 280px;
    padding: 14px;
  }

  .writer-actions .btn {
    flex: 1 1 auto;
  }

  .writer-mode {
    width: 100%;
    margin-left: 0;
    padding-top: 4px;
  }

  .my-essays__head {
    display: grid;
    gap: 10px;
    align-items: start;
  }

  .my-essays__tools {
    justify-content: space-between;
  }

  .writing-aside {
    grid-template-columns: 1fr;
  }

  .writing-prompts-card {
    grid-row: auto;
  }

  .reading-modal {
    padding: 12px;
  }

  .reading-modal__panel {
    max-height: 90vh;
    padding: 22px 18px;
    border-radius: 14px;
  }
}
