:root {
  --ink: #151319;
  --muted: #6f6b76;
  --line: #e7e3ea;
  --paper: #fbfafc;
  --white: #ffffff;
  --violet: #6d45ff;
  --violet-dark: #5630e8;
  --violet-soft: #eee9ff;
  --lime: #d9ff6f;
  --danger: #d9405a;
  --shadow: 0 18px 48px rgba(29, 21, 48, 0.08);
  --radius: 18px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(231, 227, 234, 0.9);
  background: rgba(251, 250, 252, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.7px;
}

.brand-mark {
  position: relative;
  width: 27px;
  height: 27px;
  border-radius: 50% 50% 50% 10%;
  background: var(--violet);
  transform: rotate(-18deg);
}

.brand-mark::after {
  position: absolute;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--lime);
  right: 4px;
  top: 4px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: var(--white);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 210px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--muted);
  text-align: left;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--violet);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--violet-dark);
}

.btn-dark {
  background: var(--ink);
  color: var(--white);
}

.btn-light {
  border-color: var(--line);
  background: var(--white);
}

.btn-ghost {
  color: var(--muted);
}

.btn-small {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 13px;
}

.avatar {
  display: inline-flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.avatar.large {
  width: 76px;
  height: 76px;
  font-size: 24px;
}

.avatar.purple {
  background: var(--violet);
}

.avatar.lime {
  background: var(--lime);
  color: var(--ink);
}

.page {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 90px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 410px;
  border-radius: 28px;
  background: var(--ink);
  color: var(--white);
}

.hero::after {
  position: absolute;
  width: 410px;
  height: 410px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  right: -140px;
  top: -160px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 56px 64px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--lime);
}

.hero h1 {
  max-width: 650px;
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: clamp(46px, 6vw, 76px);
  font-weight: 500;
  letter-spacing: -2.8px;
  line-height: 0.95;
}

.hero p {
  max-width: 550px;
  margin: 0 0 30px;
  color: #c9c5cf;
  font-size: 17px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero .btn-light {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.hero-art {
  position: relative;
  min-height: 410px;
}

.floating-cover {
  position: absolute;
  overflow: hidden;
  display: flex;
  padding: 22px;
  border-radius: 12px 20px 20px 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  flex-direction: column;
  justify-content: space-between;
}

.floating-cover strong {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 0.96;
}

.floating-cover small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.cover-one {
  width: 210px;
  height: 300px;
  left: 9%;
  top: 50px;
  background: var(--violet);
  transform: rotate(-7deg);
}

.cover-two {
  width: 195px;
  height: 280px;
  right: 14%;
  top: 84px;
  background: var(--lime);
  color: var(--ink);
  transform: rotate(9deg);
}

.section {
  margin-top: 58px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2,
.page-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -1.2px;
}

.section-heading p,
.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--violet);
  font-weight: 800;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
}

.book-card {
  min-width: 0;
  cursor: pointer;
}

.book-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 0.68;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 8px 16px 16px 8px;
  color: var(--white);
  box-shadow: 0 12px 28px rgba(31, 22, 48, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-cover::before {
  position: absolute;
  width: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.25);
  inset: 0 auto 0 8px;
}

.book-cover::after {
  position: absolute;
  width: 100px;
  height: 100px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  right: -24px;
  bottom: -20px;
}

.book-card:hover .book-cover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(31, 22, 48, 0.18);
}

.book-cover h3 {
  position: relative;
  z-index: 1;
  max-width: 150px;
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: clamp(23px, 2vw, 31px);
  line-height: 0.98;
}

.book-cover span {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.cover-violet { background: #6d45ff; }
.cover-night { background: #24212c; }
.cover-rose { background: #d75073; }
.cover-blue { background: #2b60d8; }
.cover-moss { background: #506b50; }
.cover-red { background: #bd3f37; }
.cover-gold { background: #ad762b; }
.cover-cyan { background: #198793; }
.cover-plum { background: #713d76; }

.book-info h3 {
  overflow: hidden;
  margin: 0 0 5px;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-info p {
  overflow: hidden;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.star {
  color: #ffba3b;
}

.genre-row {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.genre-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chip.active,
.chip:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.explore-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.field,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--white);
  color: var(--ink);
}

.field,
.select {
  height: 46px;
  padding: 0 14px;
}

.field:focus,
.select:focus,
.textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}

.toolbar-search {
  min-width: min(340px, 100%);
  flex: 1;
}

.toolbar-select {
  width: auto;
  min-width: 160px;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
}

.composer,
.post-card,
.side-card,
.form-card,
.profile-card,
.library-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.composer-trigger {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  text-align: left;
}

.post-card {
  padding: 22px;
  margin-bottom: 16px;
}

.post-head,
.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-meta {
  min-width: 0;
}

.post-meta strong {
  display: block;
  font-size: 14px;
}

.post-meta span {
  color: var(--muted);
  font-size: 12px;
}

.post-body {
  margin: 18px 0;
  line-height: 1.65;
}

.post-body h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 25px;
}

.linked-work {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--paper);
}

.linked-cover {
  width: 43px;
  height: 58px;
  border-radius: 4px 7px 7px 4px;
  background: var(--violet);
}

.linked-work strong,
.linked-work span {
  display: block;
}

.linked-work span {
  color: var(--muted);
  font-size: 12px;
}

.post-actions {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.action-btn:hover,
.action-btn.liked {
  background: var(--violet-soft);
  color: var(--violet);
}

.side-card {
  padding: 20px;
  margin-bottom: 16px;
}

.side-card h3 {
  margin: 0 0 16px;
  font-size: 15px;
}

.trend {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.trend:first-of-type {
  padding-top: 0;
  border: 0;
}

.trend strong,
.trend span {
  display: block;
}

.trend strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.trend span {
  color: var(--muted);
  font-size: 12px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  padding: 42px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line);
}

.detail-cover {
  aspect-ratio: 0.68;
  padding: 25px;
  border-radius: 10px 20px 20px 10px;
  color: var(--white);
  box-shadow: var(--shadow);
}

.detail-cover h2 {
  margin: 32px 0 0;
  font-family: var(--serif);
  font-size: 38px;
  line-height: 0.95;
}

.detail-cover span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.detail-copy h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1;
}

.detail-copy .author {
  color: var(--muted);
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}

.detail-stat strong,
.detail-stat span {
  display: block;
}

.detail-stat strong {
  font-size: 16px;
}

.detail-stat span {
  color: var(--muted);
  font-size: 11px;
}

.synopsis {
  max-width: 750px;
  color: #49454e;
  line-height: 1.7;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 11px;
  font-weight: 800;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  margin-top: 34px;
}

.chapter-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.chapter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.chapter-row:last-child {
  border: 0;
}

.chapter-row:hover {
  background: var(--paper);
}

.chapter-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
}

.chapter-data {
  flex: 1;
}

.chapter-data strong,
.chapter-data span {
  display: block;
}

.chapter-data span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.review-summary {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.big-rating {
  font-family: var(--serif);
  font-size: 52px;
  line-height: 1;
}

.interactive-stars {
  display: flex;
  gap: 5px;
  margin: 12px 0 8px;
}

.star-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: #d8d4dd;
  font-size: 27px;
}

.star-btn.active,
.star-btn:hover {
  color: #ffba3b;
}

.comments-section {
  margin-top: 32px;
}

.comment-box {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.comment-box .field {
  flex: 1;
}

.comment {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.comment p {
  margin: 10px 0 0 48px;
  color: #49454e;
  line-height: 1.55;
}

.reader {
  min-height: 100vh;
  background: #f7f4ee;
}

.reader.dark {
  background: #17151a;
  color: #e9e5eb;
}

.reader-toolbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(128, 120, 132, 0.2);
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(16px);
}

.reader.dark .reader-toolbar {
  background: rgba(23, 21, 26, 0.92);
}

.reader-title {
  overflow: hidden;
  flex: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-title strong,
.reader-title span {
  display: block;
}

.reader-title strong {
  font-size: 13px;
}

.reader-title span {
  color: var(--muted);
  font-size: 11px;
}

.reader-content {
  width: min(720px, calc(100% - 42px));
  margin: 0 auto;
  padding: 70px 0 120px;
}

.reader-content h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 45px;
  line-height: 1.1;
}

.reader-content .chapter-label {
  margin-bottom: 54px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.prose {
  font-family: var(--serif);
  font-size: var(--reader-size, 21px);
  line-height: 1.85;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.prose p {
  margin: 0 0 1.4em;
}

.reader-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.write-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 30px;
}

.write-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.step-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  font-size: 11px;
}

.step.active {
  background: var(--violet-soft);
  color: var(--violet);
}

.step.active .step-index {
  border-color: var(--violet);
  background: var(--violet);
  color: var(--white);
}

.form-card {
  padding: 30px;
}

.form-card h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 32px;
}

.form-card > p {
  margin: 0 0 28px;
  color: var(--muted);
}

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

.form-group {
  min-width: 0;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}

.form-hint {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

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

.textarea.editor {
  min-height: 420px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
}

.story-editor {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  overflow: hidden;
  min-height: 650px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f5f2f7;
}

.editor-chapters {
  padding: 16px;
  border-right: 1px solid var(--line);
  background: var(--white);
}

.editor-chapters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.editor-chapters-head strong {
  font-size: 13px;
}

.editor-chapter {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.editor-chapter:hover,
.editor-chapter.active {
  background: var(--violet-soft);
  color: var(--violet);
}

.editor-chapter-number {
  font-size: 11px;
  font-weight: 800;
}

.editor-chapter-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-main {
  min-width: 0;
}

.editor-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 52px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.format-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #514c57;
  font-family: var(--sans);
}

.format-btn:hover {
  background: var(--violet-soft);
  color: var(--violet);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--line);
}

.editor-paper {
  width: min(760px, calc(100% - 40px));
  min-height: 520px;
  margin: 28px auto;
  padding: 56px 64px;
  background: var(--white);
  box-shadow: 0 8px 32px rgba(38, 27, 54, 0.07);
}

.editor-title {
  width: 100%;
  margin-bottom: 26px;
  padding: 0 0 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: none;
  background: transparent;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
}

.rich-editor {
  min-height: 360px;
  outline: none;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.8;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #aaa3ad;
}

.rich-editor p {
  margin: 0 0 1.25em;
}

.editor-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
}

.editor-pagination {
  display: flex;
  gap: 7px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.profile-copy {
  flex: 1;
}

.profile-copy h1 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 35px;
}

.profile-copy p {
  margin: 0;
  color: var(--muted);
}

.profile-stats {
  display: flex;
  gap: 28px;
}

.profile-stats strong,
.profile-stats span {
  display: block;
  text-align: center;
}

.profile-stats span {
  color: var(--muted);
  font-size: 11px;
}

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

.tab {
  padding: 12px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab.active {
  border-bottom-color: var(--violet);
  color: var(--violet);
}

.empty-state {
  padding: 60px 20px;
  border: 1px dashed #cbc5d1;
  border-radius: var(--radius);
  text-align: center;
}

.empty-state .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 27px;
}

.empty-state h3 {
  margin: 0 0 7px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 12, 17, 0.62);
  inset: 0;
  backdrop-filter: blur(5px);
}

.modal {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 32px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.28);
}

.modal.wide {
  width: min(650px, 100%);
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-size: 20px;
}

.modal h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 34px;
}

.modal-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
}

.modal .form-group {
  margin-bottom: 16px;
}

.auth-switch {
  margin: 20px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.auth-switch button {
  border: 0;
  background: transparent;
  color: var(--violet);
  font-weight: 800;
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 12px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.search-result:hover {
  background: var(--paper);
}

.search-mini-cover {
  width: 35px;
  height: 49px;
  flex: 0 0 auto;
  border-radius: 4px 7px 7px 4px;
}

.crop-backdrop {
  z-index: 70;
}

.crop-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.crop-canvas-wrap {
  overflow: hidden;
  width: 270px;
  aspect-ratio: 0.68;
  margin: 0 auto;
  border-radius: 9px 18px 18px 9px;
  background: #ded9e2;
  box-shadow: var(--shadow);
}

.crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.crop-canvas:active {
  cursor: grabbing;
}

.crop-control {
  margin-bottom: 18px;
}

.crop-control label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.crop-control input[type="range"] {
  width: 100%;
  accent-color: var(--violet);
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result span {
  color: var(--muted);
  font-size: 12px;
}

#toast-root {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
}

.toast {
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  animation: toast-in 0.25s ease;
}

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

.mobile-nav {
  display: none;
}

@media (max-width: 980px) {
  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-trigger {
    min-width: auto;
  }

  .search-trigger span {
    display: none;
  }

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

  .community-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .detail-hero {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .brand {
    margin-right: 0;
    font-size: 20px;
  }

  .desktop-nav,
  .top-actions .btn,
  .search-trigger {
    display: none;
  }

  .page {
    width: min(100% - 30px, 1240px);
    padding-top: 24px;
    padding-bottom: 100px;
  }

  .hero {
    display: block;
    min-height: auto;
  }

  .hero-copy {
    padding: 40px 28px 32px;
  }

  .hero h1 {
    font-size: 49px;
  }

  .hero-art {
    min-height: 280px;
  }

  .cover-one {
    width: 155px;
    height: 225px;
    left: 14%;
    top: 16px;
  }

  .cover-two {
    width: 145px;
    height: 210px;
    right: 14%;
    top: 40px;
  }

  .floating-cover strong {
    font-size: 22px;
  }

  .section {
    margin-top: 42px;
  }

  .section-heading h2,
  .page-heading h1 {
    font-size: 31px;
  }

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 14px;
  }

  .book-cover {
    padding: 14px;
  }

  .book-cover h3 {
    font-size: 25px;
  }

  .page-heading {
    display: block;
  }

  .page-heading .btn {
    margin-top: 18px;
  }

  .community-sidebar {
    display: block;
  }

  .detail-hero {
    display: block;
    padding: 25px;
  }

  .detail-cover {
    width: 160px;
    margin: 0 auto 28px;
  }

  .detail-copy h1 {
    font-size: 39px;
  }

  .write-layout {
    display: block;
  }

  .write-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 5px;
    margin-bottom: 18px;
  }

  .step {
    flex: 0 0 auto;
  }

  .step span:last-child {
    display: none;
  }

  .form-card {
    padding: 22px;
  }

  .story-editor {
    display: block;
  }

  .editor-chapters {
    overflow-x: auto;
    display: flex;
    gap: 6px;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .editor-chapters-head {
    flex: 0 0 auto;
    margin: 0;
  }

  .editor-chapters-head strong {
    display: none;
  }

  .editor-chapter {
    width: auto;
    flex: 0 0 130px;
  }

  .editor-paper {
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 35px 24px;
  }

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

  .crop-canvas-wrap {
    width: 210px;
  }

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

  .form-group.full {
    grid-column: auto;
  }

  .profile-hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .profile-copy {
    min-width: calc(100% - 100px);
  }

  .profile-stats {
    width: 100%;
    justify-content: space-around;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 68px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    inset: auto 0 0;
    backdrop-filter: blur(15px);
  }

  .mobile-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    flex-direction: column;
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-link.active {
    color: var(--violet);
  }

  .mobile-link .icon {
    width: 20px;
    height: 20px;
  }

  .reader-toolbar {
    padding: 0 12px;
  }

  .reader-toolbar .reader-control-label {
    display: none;
  }

  .reader-content {
    padding-top: 45px;
  }
}
