/* 册集 — member workspace */

.app-page {
  background:
    radial-gradient(45% 35% at 90% 0%, rgba(180, 81, 46, 0.055), transparent 65%),
    #f2ece2;
}

.app-boot {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.app-boot .brand-mark {
  background: var(--ink);
  color: var(--cream);
}

.boot-error {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.boot-error h1 {
  font-size: 26px;
}

.boot-error p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.app-layout {
  display: flex;
  min-height: 100dvh;
}

/* Sidebar ----------------------------------------------------------- */

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: 246px;
  display: flex;
  flex-direction: column;
  padding: 24px 17px 17px;
  background:
    radial-gradient(70% 30% at 100% 0%, rgba(180, 81, 46, 0.16), transparent 60%),
    #1b1914;
  color: rgba(246, 239, 226, 0.64);
  overflow-y: auto;
}

.app-sidebar::-webkit-scrollbar {
  width: 0;
}

.sidebar-brand {
  padding: 0 8px;
}

.sidebar-brand .brand-mark {
  background: rgba(246, 239, 226, 0.09);
  color: var(--cream);
  border: 1px solid rgba(246, 239, 226, 0.14);
}

.sidebar-brand .brand-word {
  color: var(--cream);
}

.sidebar-brand .brand-latin {
  color: rgba(246, 239, 226, 0.34);
}

.workspace-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  padding: 11px 10px;
  border: 1px solid rgba(246, 239, 226, 0.09);
  border-radius: 12px;
  background: rgba(246, 239, 226, 0.035);
}

.workspace-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
}

.workspace-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.workspace-text strong {
  font-size: 11.5px;
  font-weight: 550;
  color: rgba(246, 239, 226, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-text small {
  font-size: 8px;
  letter-spacing: 0.02em;
  color: rgba(246, 239, 226, 0.32);
}

.workspace-link {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: rgba(246, 239, 226, 0.35);
}

.workspace-link:hover {
  color: var(--cream);
  background: rgba(246, 239, 226, 0.07);
}

.workspace-link svg {
  width: 13px;
  height: 13px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 27px;
}

.nav-section-label {
  margin: 0 10px 9px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.15em;
  color: rgba(246, 239, 226, 0.26);
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
  color: rgba(246, 239, 226, 0.57);
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover {
  background: rgba(246, 239, 226, 0.05);
  color: var(--cream);
}

.sidebar-nav a.is-active {
  background: rgba(246, 239, 226, 0.09);
  color: var(--cream);
}

.sidebar-nav a.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 2px;
  border-radius: 999px;
  background: #d7a582;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
}

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

.nav-count {
  margin-left: auto;
  min-width: 19px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(246, 239, 226, 0.07);
  font-family: var(--mono);
  font-size: 8px;
  color: rgba(246, 239, 226, 0.44);
}

.nav-count:empty {
  display: none;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 22px;
}

.sidebar-free-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(246, 239, 226, 0.1);
  border-radius: 12px;
  background:
    radial-gradient(110% 100% at 100% 0%, rgba(180, 81, 46, 0.23), transparent 60%),
    rgba(246, 239, 226, 0.035);
}

.sidebar-free-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 11px;
  font-weight: 550;
  color: rgba(246, 239, 226, 0.86);
}

.sidebar-free-card p {
  font-size: 9px;
  line-height: 1.75;
  color: rgba(246, 239, 226, 0.36);
}

.free-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(215, 165, 130, 0.13);
  border: 1px solid rgba(215, 165, 130, 0.22);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: #d7a582;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 4px 0;
  border-top: 1px solid rgba(246, 239, 226, 0.08);
}

.sidebar-user .avatar {
  background: rgba(246, 239, 226, 0.08);
  color: rgba(246, 239, 226, 0.7);
  border: 1px solid rgba(246, 239, 226, 0.09);
}

.sidebar-user-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sidebar-user-text strong {
  font-size: 10.5px;
  font-weight: 550;
  color: rgba(246, 239, 226, 0.7);
}

.sidebar-user-text small {
  max-width: 140px;
  margin-top: 1px;
  font-size: 8px;
  color: rgba(246, 239, 226, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: rgba(246, 239, 226, 0.3);
}

.sidebar-logout:hover {
  color: var(--cream);
  background: rgba(246, 239, 226, 0.06);
}

.sidebar-logout svg {
  width: 14px;
  height: 14px;
}

/* Body / topbar ------------------------------------------------------ */

.app-body {
  min-width: 0;
  flex: 1;
  margin-left: 246px;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 67px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(242, 236, 226, 0.86);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-brand {
  display: none;
  align-items: baseline;
  gap: 5px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mobile-brand span {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.topbar-divider {
  width: 1px;
  height: 13px;
  background: var(--line);
}

.topbar-crumb {
  font-size: 11px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-public {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.topbar-public:hover {
  color: var(--ink);
}

.topbar-public svg {
  width: 12px;
  height: 12px;
  color: var(--muted-light);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6f8e72;
  box-shadow: 0 0 0 3px rgba(111, 142, 114, 0.12);
}

.topbar-user-wrap {
  position: relative;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.55);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.topbar-user:hover {
  background: var(--paper-raised);
  border-color: rgba(33, 30, 24, 0.24);
}

.topbar-user .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 10px;
}

.topbar-user-name {
  max-width: 70px;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user > svg {
  width: 12px;
  height: 12px;
  color: var(--muted-light);
  transform: rotate(90deg);
}

.user-pop {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 228px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-raised);
  box-shadow: 0 30px 60px -30px rgba(33, 30, 24, 0.4);
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-pop.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-pop-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 5px;
}

.user-pop-head .avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 11px;
}

.user-pop-head strong {
  display: block;
  font-size: 11.5px;
}

.user-pop-head small {
  display: block;
  margin-top: 1px;
  font-size: 8.5px;
  color: var(--muted);
}

.user-pop > a,
.user-pop > button {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 8px 9px;
  border-radius: 7px;
  font-size: 11px;
  color: var(--ink-soft);
  text-align: left;
}

.user-pop > a:hover,
.user-pop > button:hover {
  background: rgba(33, 30, 24, 0.05);
  color: var(--ink);
}

.user-pop > button {
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 7px 7px;
  color: #9b4b3b;
}

.app-view {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 36px 36px 90px;
}

/* Page heading ------------------------------------------------------ */

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

.page-kicker {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.page-heading h1 {
  margin-top: 9px;
  font-size: clamp(27px, 2.6vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.04em;
  font-weight: 650;
}

.page-description {
  max-width: 620px;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.page-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: 2px;
}

.page-heading-actions .btn {
  font-size: 11.5px;
  min-height: 38px;
  padding: 0 15px;
}

.page-heading-actions .btn svg {
  width: 14px;
  height: 14px;
}

/* Overview ---------------------------------------------------------- */

.library-banner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(230px, 0.6fr);
  gap: 20px;
  min-height: 226px;
  padding: 28px 32px;
  border-radius: 20px;
  background:
    radial-gradient(70% 100% at 100% 0%, rgba(219, 178, 119, 0.24), transparent 58%),
    radial-gradient(60% 100% at 0% 100%, rgba(7, 20, 12, 0.75), transparent 60%),
    linear-gradient(135deg, #465f4d 0%, #2b4232 55%, #1c2e22 100%);
  color: var(--cream);
  box-shadow: 0 30px 60px -45px rgba(33, 30, 24, 0.65);
}

.library-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  opacity: 0.12;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.library-banner-main {
  position: relative;
  z-index: 2;
  align-self: center;
}

.library-banner .badge {
  border-color: rgba(246, 239, 226, 0.2);
  background: rgba(246, 239, 226, 0.07);
  color: rgba(246, 239, 226, 0.68);
}

.library-banner .badge::before {
  background: #a8c5a1;
  opacity: 1;
}

.library-banner h2 {
  margin-top: 12px;
  max-width: 540px;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.3;
  letter-spacing: -0.025em;
  font-weight: 550;
  color: var(--cream);
}

.library-url {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: rgba(246, 239, 226, 0.42);
}

.library-url span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a8c5a1;
}

.library-banner-desc {
  max-width: 480px;
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.8;
  color: rgba(246, 239, 226, 0.47);
}

.library-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.library-banner-actions .btn {
  min-height: 34px;
  font-size: 10px;
  padding: 0 13px;
}

.library-banner-actions .btn svg {
  width: 13px;
  height: 13px;
}

.library-banner-visual {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}

.cover-stack {
  position: relative;
  width: 196px;
  height: 172px;
}

.cover-stack-item {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 96px;
  aspect-ratio: 794 / 1123;
  margin-left: -48px;
  border-radius: 2px 4px 4px 2px;
  transform-origin: center bottom;
  transform: translateX(calc((var(--i) - 1) * 46px)) rotate(calc((var(--i) - 1) * 7deg));
  box-shadow: 12px 20px 30px -14px rgba(0, 0, 0, 0.58);
  overflow: hidden;
  transition: transform 0.5s var(--ease);
}

.cover-stack-item:nth-child(2) {
  z-index: 2;
  transform: translateX(calc((var(--i) - 1) * 46px)) translateY(-8px) rotate(calc((var(--i) - 1) * 7deg));
}

.library-banner:hover .cover-stack-item:nth-child(1) {
  transform: translateX(-88px) rotate(-10deg);
}

.library-banner:hover .cover-stack-item:nth-child(3) {
  transform: translateX(88px) rotate(9deg);
}

.cover-stack-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-stack-item i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #657b64, #263b2c);
}

.banner-count {
  position: absolute;
  right: 0;
  bottom: -2px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(18, 31, 21, 0.62);
  border: 1px solid rgba(246, 239, 226, 0.13);
  font-family: var(--mono);
  font-size: 7.5px;
  color: rgba(246, 239, 226, 0.55);
}

.onboarding-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 40px;
  align-items: center;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(60% 100% at 100% 0%, rgba(180, 81, 46, 0.08), transparent 65%),
    var(--paper-raised);
}

.onboarding-copy .free-badge {
  background: rgba(180, 81, 46, 0.08);
  border-color: rgba(180, 81, 46, 0.18);
  color: var(--accent);
}

.onboarding-copy h2 {
  margin-top: 13px;
  font-size: 28px;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.onboarding-copy p {
  max-width: 470px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.85;
  color: var(--muted);
}

.onboarding-copy .btn {
  margin-top: 20px;
  font-size: 11.5px;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.onboarding-steps span {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(33, 30, 24, 0.035);
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink-soft);
}

.onboarding-steps span:last-child {
  border-bottom: 0;
}

.onboarding-steps strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 17px;
}

.stat-card {
  padding: 16px 18px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper-raised);
  min-height: 102px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(33, 30, 24, 0.04);
  color: var(--muted);
}

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

.stat-card > strong {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.stat-card > strong em {
  margin-left: 4px;
  font-family: var(--sans);
  font-size: 9px;
  font-style: normal;
  font-weight: 400;
  color: var(--muted-light);
}

.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 0.72fr);
  gap: 17px;
  margin-top: 20px;
  align-items: start;
}

.overview-aside {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper-raised);
}

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

.panel-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  color: var(--accent);
}

.panel-head h3 {
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}

.text-link:hover {
  color: var(--ink);
}

.text-link svg {
  width: 12px;
  height: 12px;
}

.recent-list {
  margin-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.recent-book {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}

.recent-book:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.recent-book:hover .recent-copy strong {
  color: var(--accent);
}

.recent-cover {
  display: block;
  width: 36px;
  height: 50px;
  flex: 0 0 auto;
  border-radius: 3px;
  overflow: hidden;
  background: var(--sage);
  box-shadow: 0 5px 10px -5px rgba(33, 30, 24, 0.4);
}

.recent-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-cover i {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-style: normal;
  font-family: var(--serif);
  color: var(--cream);
  font-size: 14px;
}

.recent-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.recent-copy strong {
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.recent-copy span {
  font-size: 8.5px;
  color: var(--muted);
}

.recent-book > svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: var(--muted-light);
}

.recent-book .badge {
  min-height: 19px;
  padding: 1px 7px;
  font-size: 8px;
}

.mini-empty {
  padding: 24px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin-top: 13px;
  font-size: 10px;
  text-align: center;
  color: var(--muted);
}

.trend-total {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.trend-total em {
  margin-left: 2px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 8px;
  color: var(--muted-light);
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 78px;
  margin-top: 17px;
  padding-top: 5px;
  border-bottom: 1px solid var(--line-soft);
}

.trend-bar {
  flex: 1;
  height: var(--h);
  min-height: 3px;
  border-radius: 2px 2px 0 0;
  background: rgba(63, 87, 71, 0.25);
}

.trend-bar:nth-last-child(-n + 3) {
  background: var(--accent);
}

.trend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 6.5px;
  color: var(--muted-light);
}

.free-panel {
  background:
    radial-gradient(80% 90% at 100% 0%, rgba(180, 81, 46, 0.09), transparent 60%),
    #efe7d9;
}

.free-panel h3 {
  margin-top: 10px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.free-panel p {
  margin-top: 7px;
  font-size: 9.5px;
  line-height: 1.8;
  color: var(--muted);
}

.free-panel ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.free-panel li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--ink-soft);
}

.free-panel li svg {
  width: 11px;
  height: 11px;
  color: var(--sage);
}

/* Books ------------------------------------------------------------- */

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.toolbar-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.5);
}

.toolbar-tabs button {
  height: 29px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 9.5px;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.toolbar-tabs button span {
  margin-left: 3px;
  font-family: var(--mono);
  font-size: 7px;
  color: var(--muted-light);
}

.toolbar-tabs button:hover {
  color: var(--ink);
}

.toolbar-tabs button.is-active {
  background: var(--ink);
  color: var(--cream);
}

.toolbar-tabs button.is-active span {
  color: rgba(246, 239, 226, 0.45);
}

.toolbar-search {
  position: relative;
  width: 230px;
}

.toolbar-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--muted-light);
}

.toolbar-search input {
  width: 100%;
  height: 35px;
  padding: 0 12px 0 31px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.65);
  font-size: 10px;
  outline: none;
}

.toolbar-search input:focus {
  border-color: rgba(33, 30, 24, 0.4);
  background: var(--paper-raised);
}

.book-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.book-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-raised);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.book-row:hover {
  border-color: rgba(33, 30, 24, 0.23);
  box-shadow: 0 12px 28px -24px rgba(33, 30, 24, 0.4);
}

.book-row.is-hidden {
  display: none;
}

.book-row-cover {
  position: relative;
  width: 55px;
  height: 78px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 3px;
  background: var(--sage);
  box-shadow: 0 7px 14px -8px rgba(33, 30, 24, 0.5);
}

.book-row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-row-cover > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--cream);
}

.book-row-cover em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(22, 18, 13, 0.45);
  color: var(--cream);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.book-row-cover:hover em {
  opacity: 1;
}

.book-row-cover em svg {
  width: 16px;
  height: 16px;
}

.book-row-main {
  min-width: 0;
  flex: 1;
}

.book-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.book-row-title h3 {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-row-title .badge {
  min-height: 19px;
  padding: 1px 7px;
  font-size: 8px;
}

.book-row-main > p {
  max-width: 620px;
  margin-top: 3px;
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
}

.book-row-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--line);
}

.book-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.book-row-actions .btn {
  min-height: 30px;
  font-size: 9.5px;
  padding: 0 10px;
}

.book-row-actions .btn svg {
  width: 12px;
  height: 12px;
}

.book-row-actions .icon-btn {
  width: 30px;
  height: 30px;
}

.book-row-actions .icon-btn svg {
  width: 13px;
  height: 13px;
}

.order-actions {
  display: flex;
  gap: 1px;
  margin-right: 2px;
}

.order-actions [data-action="move-up"] svg {
  transform: rotate(90deg);
}

.order-actions [data-action="move-down"] svg {
  transform: rotate(90deg);
}

.order-actions .icon-btn:disabled {
  opacity: 0.25;
  pointer-events: none;
}

.danger-hover:hover {
  color: #9b3b2c;
  border-color: rgba(155, 59, 44, 0.3);
  background: rgba(155, 59, 44, 0.06);
}

.book-empty {
  padding: 70px 24px;
}

.filter-empty {
  border-style: dashed;
}

.list-footnote {
  margin-top: 15px;
  font-size: 8.5px;
  color: var(--muted-light);
  text-align: center;
}

/* Upload modal ------------------------------------------------------ */

.upload-modal {
  min-height: 220px;
}

.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 258px;
  padding: 30px;
  border: 1px dashed rgba(33, 30, 24, 0.24);
  border-radius: 14px;
  background:
    radial-gradient(60% 70% at 50% 0%, rgba(180, 81, 46, 0.05), transparent 70%),
    rgba(33, 30, 24, 0.02);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-drop:hover,
.upload-drop.is-dragging {
  border-color: var(--accent);
  background: rgba(180, 81, 46, 0.04);
}

.upload-drop.hidden {
  display: none;
}

.upload-drop-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink-soft);
}

.upload-drop-icon svg {
  width: 21px;
  height: 21px;
}

.upload-drop h4 {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
}

.upload-drop p {
  margin-top: 5px;
  font-size: 9.5px;
  color: var(--muted);
}

.upload-drop-hint {
  margin-top: 16px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 9px;
  color: var(--ink-soft);
}

.upload-parsing {
  min-height: 258px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 11px;
  color: var(--muted);
}

.upload-ready.hidden,
.upload-parsing.hidden {
  display: none;
}

.upload-file-preview {
  display: flex;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f7f2e8;
}

.upload-file-preview img {
  width: 92px;
  height: 130px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 10px 20px -12px rgba(33, 30, 24, 0.5);
  background: var(--paper-deep);
}

.upload-file-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.upload-file-meta .badge {
  font-size: 8px;
  min-height: 19px;
}

.upload-file-meta h4 {
  margin-top: 9px;
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-file-meta p {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--muted);
}

.upload-file-meta .text-link {
  margin-top: auto;
  padding-top: 12px;
  font-size: 9px;
  border-bottom: 1px solid var(--line);
}

.upload-fields {
  margin-top: 18px;
}

.upload-fields .checkbox {
  margin: 2px 0;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(63, 87, 71, 0.06);
  color: var(--sage);
  font-size: 10px;
}

.upload-progress.hidden {
  display: none;
}

.upload-fields .form-error {
  margin-top: 2px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Settings ---------------------------------------------------------- */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.form-section {
  padding: 25px 27px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper-raised);
}

.form-section > header {
  display: flex;
  gap: 13px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.form-section > header > span {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--accent);
}

.form-section > header h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.form-section > header p {
  margin-top: 3px;
  font-size: 9.5px;
  color: var(--muted);
}

.form-section > .field + .field,
.form-section > .field-row + .field,
.form-section > .field + .field-row,
.form-section > .field-row + .field-row,
.form-section > .theme-picker + .field,
.form-section > .field + .theme-picker {
  margin-top: 16px;
}

.slug-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(251, 248, 241, 0.7);
  overflow: hidden;
}

.slug-field:focus-within {
  border-color: rgba(33, 30, 24, 0.55);
  background: #fffdf8;
}

.slug-field > span {
  padding-left: 13px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-light);
  white-space: nowrap;
}

.slug-field input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 1px;
  font-family: var(--mono);
  font-size: 11px;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 18px;
}

.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.theme-option:has(input:checked) {
  border-color: var(--ink);
  background: rgba(33, 30, 24, 0.025);
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-swatch {
  position: relative;
  height: 58px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 8px 8px 10px;
  border-radius: 7px;
  overflow: hidden;
}

.theme-swatch i {
  display: block;
  width: 19px;
  height: 40px;
  border-radius: 1px;
  background: rgba(246, 239, 226, 0.35);
  box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.2);
}

.theme-swatch i:nth-child(2) {
  height: 44px;
  background: rgba(246, 239, 226, 0.55);
}

.theme-swatch-wood {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 6px),
    linear-gradient(150deg, #9b704b, #5a3b27);
}

.theme-swatch-paper {
  background: linear-gradient(150deg, #eadfcd, #d6c4a8);
}

.theme-swatch-paper i {
  background: rgba(33, 30, 24, 0.25);
}

.theme-swatch-ink {
  background: linear-gradient(150deg, #38362f, #14120e);
}

.theme-option strong {
  margin: 8px 2px 0;
  font-size: 10px;
  font-weight: 600;
}

.theme-option small {
  margin: 1px 2px 0;
  font-size: 7.5px;
  line-height: 1.5;
  color: var(--muted);
}

.category-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(251, 248, 241, 0.7);
}

.category-editor:focus-within {
  border-color: rgba(33, 30, 24, 0.55);
  background: #fffdf8;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 4px 0 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 9px;
}

.category-tag button {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(246, 239, 226, 0.5);
}

.category-tag button:hover {
  background: rgba(246, 239, 226, 0.12);
  color: var(--cream);
}

.category-tag svg {
  width: 10px;
  height: 10px;
}

.category-editor input {
  flex: 1;
  min-width: 130px;
  height: 27px;
  border: 0;
  background: transparent;
  font-size: 10px;
  outline: none;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-field input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-raised);
  cursor: pointer;
}

.color-field span {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-soft);
}

.color-field .color-note {
  font-family: var(--sans);
  font-size: 8.5px;
  color: var(--muted-light);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
}

.switch-row > span {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.switch-row strong {
  font-size: 11.5px;
  font-weight: 550;
}

.switch-row small {
  font-size: 9px;
  color: var(--muted);
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row > i {
  position: relative;
  width: 40px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(33, 30, 24, 0.14);
  transition: background 0.2s ease;
}

.switch-row > i::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--paper-raised);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s var(--ease);
}

.switch-row input:checked + i {
  background: var(--sage);
}

.switch-row input:checked + i::after {
  transform: translateX(17px);
}

.settings-save {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(251, 248, 241, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px -22px rgba(33, 30, 24, 0.45);
}

.save-hint {
  margin-right: auto;
  font-size: 8.5px;
  color: var(--muted-light);
}

.settings-save .btn {
  min-height: 36px;
  font-size: 10.5px;
}

.settings-aside {
  position: sticky;
  top: 87px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.preview-panel {
  padding: 18px;
}

.mini-shelf {
  margin-top: 14px;
  padding: 13px 12px 11px;
  border-radius: 11px;
  color: var(--cream);
  overflow: hidden;
  position: relative;
}

.mini-shelf.theme-wood {
  background:
    radial-gradient(70% 80% at 100% 0%, rgba(226, 196, 141, 0.18), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.045) 0 2px, transparent 2px 7px),
    linear-gradient(150deg, #795638, #4b3221);
}

.mini-shelf.theme-paper {
  background: linear-gradient(150deg, #ebe0cd, #d8c6aa);
  color: var(--ink);
}

.mini-shelf.theme-ink {
  background: linear-gradient(150deg, #34312a, #17150f);
}

.mini-shelf-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 6.5px;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

.mini-shelf-head span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-shelf-head em {
  font-family: var(--mono);
  font-style: normal;
  flex: 0 0 auto;
}

.mini-shelf-books {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 9px;
  height: 104px;
  padding-top: 14px;
}

.mini-shelf-books span {
  width: 58px;
  height: 82px;
  flex: 0 0 auto;
  border-radius: 1px 3px 3px 1px;
  overflow: hidden;
  background: rgba(246, 239, 226, 0.16);
  box-shadow: 3px 6px 10px rgba(0, 0, 0, 0.28);
}

.mini-shelf-books span:nth-child(2) {
  height: 90px;
  margin-bottom: 3px;
}

.mini-shelf-books img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-shelf-rail {
  height: 7px;
  border-radius: 1px;
  background: linear-gradient(180deg, rgba(246, 239, 226, 0.32), rgba(0, 0, 0, 0.25));
  box-shadow: 0 8px 12px -5px rgba(0, 0, 0, 0.5);
}

.mini-shelf.theme-paper .mini-shelf-rail {
  background: linear-gradient(180deg, rgba(96, 70, 43, 0.36), rgba(70, 48, 26, 0.24));
}

.mini-shelf-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 6.5px;
  opacity: 0.5;
}

.preview-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 13px;
  font-size: 9px;
  color: var(--muted);
}

.preview-link:hover {
  color: var(--ink);
}

.preview-link svg {
  width: 12px;
  height: 12px;
}

.share-panel {
  padding: 18px;
}

.share-qr {
  width: 142px;
  height: 142px;
  margin: 15px auto 11px;
  padding: 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
}

.share-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.share-qr.has-qr {
  box-shadow: 0 10px 22px -18px rgba(33, 30, 24, 0.4);
}

.share-url {
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-panel .btn + .btn {
  margin-top: 7px;
}

.share-panel .btn {
  min-height: 33px;
  font-size: 9px;
}

.share-panel .btn svg {
  width: 12px;
  height: 12px;
}

.tips-panel {
  padding: 18px;
}

.tips-panel h3 {
  margin-top: 10px;
  font-size: 14px;
}

.tips-panel p {
  margin-top: 6px;
  font-size: 9px;
  line-height: 1.8;
  color: var(--muted);
}

/* Profile ----------------------------------------------------------- */

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.profile-preview {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: 26px;
  border-radius: 18px;
  background:
    radial-gradient(80% 70% at 100% 0%, rgba(219, 178, 119, 0.22), transparent 60%),
    linear-gradient(145deg, #415a48, #1e3023);
  color: var(--cream);
  display: flex;
  flex-direction: column;
}

.profile-preview::after {
  content: "册";
  position: absolute;
  right: -18px;
  bottom: -62px;
  font-family: var(--serif);
  font-size: 220px;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(246, 239, 226, 0.1);
  pointer-events: none;
}

.profile-preview-kicker {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  color: rgba(246, 239, 226, 0.42);
}

.profile-preview-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: 20px;
  border: 1px solid rgba(246, 239, 226, 0.2);
  border-radius: 12px;
  font-family: var(--serif);
  font-size: 15px;
  color: rgba(246, 239, 226, 0.86);
}

.profile-preview h3 {
  margin-top: 14px;
  font-size: 21px;
  font-weight: 550;
  letter-spacing: -0.01em;
}

.profile-preview p {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  max-width: 260px;
  font-size: 10px;
  line-height: 1.9;
  color: rgba(246, 239, 226, 0.5);
}

.profile-preview-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: auto;
  padding-top: 30px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: rgba(246, 239, 226, 0.4);
}

/* Mini program ------------------------------------------------------ */

.mini-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 305px;
  gap: 20px;
  align-items: start;
}

.mini-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini-link-card {
  padding: 22px;
}

.mini-link-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.mini-platform-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(63, 87, 71, 0.08);
  color: var(--sage);
}

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

.mini-link-head h3 {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
}

.mini-link-head .badge {
  margin-left: auto;
  min-height: 20px;
  font-size: 8px;
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 7px 7px 7px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(33, 30, 24, 0.025);
}

.copy-field > span {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-field button,
.code-card-head button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  font-size: 8px;
  color: var(--ink-soft);
}

.copy-field button:hover,
.code-card-head button:hover {
  border-color: var(--ink);
}

.copy-field svg,
.code-card-head svg {
  width: 11px;
  height: 11px;
}

.panel-note {
  margin-top: 10px;
  font-size: 8.5px;
  line-height: 1.8;
  color: var(--muted-light);
}

.steps-panel {
  padding: 22px;
}

.number-steps {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.number-steps li {
  display: flex;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.number-steps li > span {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 7px;
  color: var(--accent);
}

.number-steps strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.number-steps p {
  margin-top: 3px;
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
}

.number-steps code {
  font-family: var(--mono);
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(33, 30, 24, 0.055);
}

.code-panel {
  padding: 22px;
}

.code-card {
  margin-top: 13px;
  overflow: hidden;
  border-radius: 10px;
  background: #1d1a15;
  color: #e8dfd1;
}

.code-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 32px;
  padding: 0 10px 0 13px;
  border-bottom: 1px solid rgba(246, 239, 226, 0.09);
  font-family: var(--mono);
  font-size: 7.5px;
  color: rgba(246, 239, 226, 0.4);
}

.code-card-head button {
  background: transparent;
  border-color: rgba(246, 239, 226, 0.15);
  color: rgba(246, 239, 226, 0.5);
}

.code-card pre {
  margin: 0;
  padding: 13px;
  overflow-x: auto;
  font-size: 9px;
  line-height: 1.8;
}

.code-card code {
  font-family: var(--mono);
}

.qr-panel {
  padding: 18px;
}

.phone-preview {
  position: relative;
  width: 247px;
  height: 486px;
  margin: 0 auto;
  padding: 0 8px 10px;
  border: 8px solid #17140f;
  border-radius: 36px;
  background: #f6f0e5;
  overflow: hidden;
  box-shadow: 0 30px 50px -30px rgba(33, 30, 24, 0.5);
}

.phone-preview-top {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px 6px;
  font-family: var(--mono);
  font-size: 6px;
  color: var(--ink);
}

.phone-preview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 8px;
  font-size: 8px;
}

.phone-preview-nav strong {
  font-weight: 550;
}

.phone-preview-nav span {
  color: var(--muted);
  font-size: 8px;
}

.phone-preview-body {
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  height: 380px;
  background: var(--sage);
}

.phone-preview-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-preview-body span {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 6px 8px;
  border-radius: 5px;
  background: rgba(23, 20, 15, 0.68);
  font-size: 7px;
  color: var(--cream);
}

.phone-preview-placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(60% 50% at 80% 10%, rgba(226, 196, 141, 0.4), transparent 60%),
    linear-gradient(145deg, #536b57, #1d2f23);
}

.phone-preview-home {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 74px;
  height: 3px;
  border-radius: 999px;
  background: rgba(33, 30, 24, 0.3);
  transform: translateX(-50%);
}

/* Share modal / mobile menu ----------------------------------------- */

.share-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.share-modal .share-qr {
  width: 180px;
  height: 180px;
  margin-top: 0;
}

.share-modal-copy {
  width: 100%;
  text-align: center;
}

.share-modal-label {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--muted-light);
}

.share-modal-copy p {
  margin: 5px 0 11px;
  font-family: var(--mono);
  font-size: 8.5px;
  word-break: break-all;
  color: var(--muted);
}

.mobile-more-list {
  display: flex;
  flex-direction: column;
}

.mobile-more-list a,
.mobile-more-list button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-soft);
  text-align: left;
}

.mobile-more-list svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.mobile-more-list span {
  flex: 1;
}

/* Loading & error --------------------------------------------------- */

.skeleton-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

.skeleton-title {
  width: 240px;
  height: 34px;
}

.skeleton-sub {
  width: 380px;
  height: 13px;
}

.skeleton-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin-top: 22px;
}

.skeleton-stat {
  height: 102px;
  border-radius: 15px;
}

.skeleton-panel {
  height: 300px;
  margin-top: 13px;
  border-radius: 17px;
}

.view-error {
  margin-top: 30px;
}

.view-loading {
  opacity: 0.9;
}

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

@media (max-width: 1220px) {
  .app-view {
    padding-left: 26px;
    padding-right: 26px;
  }

  .overview-columns {
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.75fr);
  }

  .book-row {
    flex-wrap: wrap;
  }

  .book-row-actions {
    width: 100%;
    padding-left: 71px;
  }

  .settings-layout,
  .profile-layout {
    grid-template-columns: minmax(0, 1fr) 292px;
  }

  .mini-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 1040px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .library-banner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .library-banner-visual {
    display: none;
  }

  .settings-layout,
  .profile-layout,
  .mini-layout {
    grid-template-columns: 1fr;
  }

  .settings-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .tips-panel {
    grid-column: span 2;
  }

  .profile-layout .settings-aside {
    grid-template-columns: 1fr;
  }

  .mini-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .mini-aside .phone-preview {
    grid-row: span 2;
  }
}

@media (max-width: 900px) {
  .app-sidebar {
    display: none;
  }

  .app-body {
    margin-left: 0;
  }

  .app-topbar {
    height: 59px;
    padding: 0 var(--gutter);
  }

  .mobile-brand {
    display: inline-flex;
  }

  .topbar-divider {
    display: none;
  }

  .topbar-crumb {
    font-size: 10px;
  }

  .topbar-public {
    font-size: 0;
    gap: 5px;
  }

  .topbar-public svg {
    width: 14px;
    height: 14px;
  }

  .topbar-public .live-dot {
    display: none;
  }

  .topbar-user-name {
    display: none;
  }

  .topbar-user {
    padding: 3px;
  }

  .topbar-user > svg {
    display: none;
  }

  .app-view {
    padding: 24px 20px 96px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .page-heading-actions {
    width: 100%;
  }

  .page-heading-actions .btn {
    flex: 1;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    min-height: 58px;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(248, 243, 234, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .mobile-tabs a,
  .mobile-tabs button {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 8px;
    font-size: 8px;
    color: var(--muted);
  }

  .mobile-tabs a.is-active {
    color: var(--ink);
    background: rgba(33, 30, 24, 0.045);
  }

  .mobile-tabs svg {
    width: 17px;
    height: 17px;
  }

  .skeleton-stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .onboarding-card {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 26px;
  }
}

@media (max-width: 680px) {
  .app-topbar {
    gap: 10px;
  }

  .topbar-actions {
    gap: 10px;
    margin-left: auto;
  }

  .topbar-public {
    width: 30px;
    height: 30px;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
  }

  .topbar-user {
    border: 0;
    background: transparent;
  }

  .topbar-user .avatar {
    width: 29px;
    height: 29px;
  }

  .app-view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-heading {
    margin-bottom: 21px;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .page-description {
    font-size: 11px;
  }

  .page-heading-actions {
    gap: 6px;
  }

  .page-heading-actions .btn {
    font-size: 10.5px;
    min-height: 38px;
    padding: 0 10px;
  }

  .library-banner {
    padding: 22px;
    border-radius: 16px;
  }

  .library-banner h2 {
    font-size: 23px;
  }

  .library-banner-actions {
    margin-top: 16px;
  }

  .library-banner-actions .btn {
    flex: 1;
  }

  .stats-grid {
    gap: 8px;
    margin-top: 12px;
  }

  .stat-card {
    padding: 14px;
    min-height: 94px;
    border-radius: 13px;
  }

  .stat-card > strong {
    font-size: 26px;
  }

  .overview-columns {
    margin-top: 13px;
    gap: 12px;
  }

  .overview-aside {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
    border-radius: 14px;
  }

  .recent-book .badge {
    display: none;
  }

  .library-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
  }

  .toolbar-tabs {
    width: 100%;
  }

  .toolbar-tabs button {
    flex: 1;
    padding: 0 6px;
  }

  .toolbar-search {
    width: 100%;
  }

  .book-row {
    padding: 12px;
    gap: 11px;
    border-radius: 13px;
  }

  .book-row-cover {
    width: 48px;
    height: 68px;
  }

  .book-row-main > p {
    display: none;
  }

  .book-row-meta {
    gap: 3px 7px;
    font-size: 6.8px;
    line-height: 1.5;
  }

  .book-row-meta span + span::before {
    margin-right: 7px;
  }

  .book-row-actions {
    width: 100%;
    padding-left: 59px;
    gap: 3px;
    flex-wrap: wrap;
  }

  .book-row-actions .btn {
    min-height: 28px;
    font-size: 8.5px;
  }

  .order-actions .icon-btn {
    width: 26px;
    height: 26px;
  }

  .form-section {
    padding: 20px 17px;
    border-radius: 14px;
  }

  .form-section > header {
    margin-bottom: 18px;
    padding-bottom: 13px;
  }

  .settings-save {
    bottom: 70px;
    padding: 10px 12px;
  }

  .save-hint {
    font-size: 7.5px;
  }

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

  .tips-panel {
    grid-column: span 1;
  }

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

  .mini-aside .phone-preview {
    grid-row: auto;
  }

  .phone-preview {
    width: 230px;
    height: 455px;
  }

  .theme-picker {
    grid-template-columns: 1fr;
  }

  .theme-option {
    display: grid;
    grid-template-columns: 74px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 10px;
    padding: 7px;
  }

  .theme-swatch {
    grid-row: span 2;
    height: 48px;
  }

  .theme-option strong {
    margin: 0;
  }

  .theme-option small {
    margin: 2px 0 0;
  }

  .upload-file-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .upload-file-preview img {
    width: 74px;
    height: 104px;
  }

  .upload-file-meta .text-link {
    margin-top: 8px;
  }

  .upload-fields .field-row {
    grid-template-columns: 1fr;
  }

  .share-modal .share-qr {
    width: 150px;
    height: 150px;
  }

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

@media (min-width: 901px) {
  .mobile-tabs {
    display: none;
  }
}
