:root {
  --brand: #d97757;
  --brand-hover: #c96b4f;
  --brand-active: #b85c42;
  --brand-soft: #faf0e9;
  --bg-app: #f5f4f0;
  --surface: #ffffff;
  --surface-muted: #f9f8f6;
  --control: #e9e8e4;
  --border: #e7e0d8;
  --border-soft: rgba(109, 117, 130, 0.1);
  --text-strong: #191919;
  --text-main: #3b3c3c;
  --text-muted: #6a6a6b;
  --text-faint: #a9aaab;
  --shadow-popover: 0 16px 44px rgba(58, 45, 35, 0.14);
  --reader-font-size: 18px;
  --reader-line-height: 1.8;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: MiSans, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px 288px minmax(0, 1fr);
  width: 100vw;
  min-width: 1180px;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
  background: var(--bg-app);
  transition: grid-template-columns 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0px 288px minmax(0, 1fr);
  min-width: 916px;
}

.app-shell.guest-shell {
  grid-template-columns: 264px 288px minmax(0, 1fr);
  min-width: 1180px;
}

.app-shell.guest-shell.sidebar-collapsed {
  grid-template-columns: 0px 288px minmax(0, 1fr);
  min-width: 916px;
}

.app-shell.auth-flow-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  min-width: 1080px;
}

.app-shell.auth-flow-shell.sidebar-collapsed {
  grid-template-columns: 0px minmax(0, 1fr);
  min-width: 816px;
}

.sidebar,
.list-pane,
.reader-pane {
  min-width: 0;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 12px;
  border-right: 1px solid var(--border-soft);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.24s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.24s ease, border-right-width 0.3s ease, padding 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.app-shell.sidebar-collapsed .sidebar {
  pointer-events: none;
  border-color: transparent;
  border-right-width: 0;
  opacity: 0;
  padding-right: 0;
  padding-left: 0;
  transform: translateX(-16px);
}

.list-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 12px;
  border-right: 1px solid var(--border-soft);
  background: var(--surface-muted);
}

.reader-pane {
  position: relative;
  background: var(--surface);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding-left: 8px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.brand-logo svg {
  display: block;
  width: 28px;
  height: 28px;
}

.brand-name {
  margin: 0;
  color: #101713;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px;
  border-radius: 12px;
  background: transparent;
  transition: background-color 0.18s ease;
}

.profile-card:hover,
.profile-card:focus-within {
  background: var(--control);
}

.profile-user-button {
  flex: 1;
  border-radius: 8px;
  text-align: left;
}

.profile-user-button:hover {
  color: var(--text-strong);
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f332f, #7b6b5d);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

.avatar.has-image {
  color: transparent;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  white-space: nowrap;
}

.member-pill:hover {
  background: #fff7f2;
}

.sidebar-join-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 13px;
}

.sidebar-join-button:hover {
  background: var(--brand-soft);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: var(--control);
  color: var(--text-muted);
}

.search-box svg {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
}

.search-box input {
  width: 100%;
  height: 32px;
  border: 0;
  outline: 0;
  padding: 0 12px 0 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.nav-block {
  margin-bottom: 12px;
}

.primary-nav {
  margin-bottom: 18px;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 2px 12px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 20px;
}

.tag-section-label {
  padding-right: 6px;
}

.nav-item,
.tree-item,
.tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 8px;
  color: var(--text-main);
  text-align: left;
}

.nav-item:hover,
.tree-item:hover,
.tag-row:hover {
  background: var(--control);
}

.nav-item:hover .item-title,
.tree-item:hover .item-title,
.tag-row:hover .item-title {
  color: var(--text-strong);
  text-shadow: 0.25px 0 0 currentColor;
}

.nav-item:hover .item-main svg,
.tree-item:hover .item-main svg,
.tag-row:hover .item-main svg,
.tree-item:hover .tree-chevron {
  color: var(--text-strong);
  stroke-width: 2;
}

.nav-item.active,
.tree-item.active,
.tag-row.active {
  background: var(--control);
  color: var(--text-strong);
}

.nav-item.active:hover,
.tree-item.active:hover,
.tag-row.active:hover {
  background: var(--control);
}

.nav-item.active .item-title,
.tree-item.active .item-title,
.tag-row.active .item-title {
  color: var(--text-strong);
  text-shadow: 0.25px 0 0 currentColor;
}

.nav-item.active .item-main svg,
.tree-item.active .item-main svg,
.tag-row.active .item-main svg {
  color: var(--text-strong);
  stroke-width: 2;
}

.tree-item.active .tree-chevron {
  color: var(--text-strong);
}

.nav-item.active .item-count,
.tree-item.active .item-count,
.tag-row.active .item-count {
  color: var(--text-faint);
  font-weight: 400;
}

.primary-nav .nav-item {
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 8px;
}

.primary-nav .item-main {
  gap: 8px;
}

.item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tree-main {
  gap: 8px;
}

.tree-chevron {
  display: grid;
  place-items: center;
  width: 12px;
  height: 20px;
  margin-left: -6px;
  color: var(--text-muted);
  transition: transform 0.16s ease;
}

.tree-chevron.open {
  transform: rotate(90deg);
}

.tree-chevron svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.item-main svg,
.toolbar-icon svg,
.icon-button svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar .item-main svg,
.sidebar .icon-button svg {
  width: 18px;
  height: 18px;
}

.sidebar .tree-chevron svg {
  width: 12px;
  height: 12px;
}

.item-title {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-count {
  flex: 0 0 auto;
  width: 28px;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 22px;
  text-align: right;
}

.tree-item.child {
  padding-left: 24px;
}

.add-tag-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  color: var(--text-faint);
}

.add-tag-button svg {
  width: 12px;
  height: 12px;
}

.add-tag-button:hover {
  color: var(--text-strong);
  background: var(--control);
}

.inline-editor {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 10px;
}

.inline-editor.open {
  display: flex;
}

.inline-editor input {
  min-width: 0;
  height: 30px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  outline: none;
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
}

.inline-editor input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14);
}

.small-primary {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
}

.small-primary:hover {
  background: var(--brand-hover);
}

.small-ghost {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.small-ghost:hover {
  background: var(--control);
  color: var(--text-main);
}

.tag-row-shell {
  position: relative;
}

.tag-row-shell:hover .tag-row,
.tag-row-shell:focus-within .tag-row,
.tag-row-shell.menu-open .tag-row {
  background: var(--control);
}

.tag-row-shell:hover .tag-row .item-title,
.tag-row-shell:focus-within .tag-row .item-title,
.tag-row-shell.menu-open .tag-row .item-title {
  color: var(--text-strong);
  text-shadow: 0.25px 0 0 currentColor;
}

.tag-row-shell:hover .tag-row.active .item-title,
.tag-row-shell:focus-within .tag-row.active .item-title,
.tag-row-shell.menu-open .tag-row.active .item-title {
  text-shadow: 0.25px 0 0 currentColor;
}

.tag-row-shell:hover .tag-row .item-main svg,
.tag-row-shell:focus-within .tag-row .item-main svg,
.tag-row-shell.menu-open .tag-row .item-main svg {
  color: var(--text-strong);
  stroke-width: 2;
}

.tag-row-shell:hover .tag-row .item-count,
.tag-row-shell:focus-within .tag-row .item-count,
.tag-row-shell.menu-open .tag-row .item-count {
  opacity: 0;
}

.tag-row .item-count {
  transition: opacity 0.12s ease;
}

.tag-menu-button {
  position: absolute;
  top: 2px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.tag-menu-button svg {
  width: 16px;
  height: 16px;
}

.tag-row-shell:hover .tag-menu-button,
.tag-row-shell:focus-within .tag-menu-button,
.tag-row-shell.menu-open .tag-menu-button {
  opacity: 1;
  pointer-events: auto;
}

.tag-menu-button:hover,
.tag-row-shell.menu-open .tag-menu-button {
  background: var(--surface);
  color: var(--text-strong);
}

.tag-menu-popover {
  position: absolute;
  top: 34px;
  right: 4px;
  z-index: 20;
  width: 140px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.tag-menu-popover.editing {
  width: 210px;
  padding: 10px;
}

.tag-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 13px;
  text-align: left;
}

.tag-menu-item:hover {
  background: var(--control);
}

.tag-menu-item.danger {
  color: var(--brand-active);
}

.tag-menu-item.danger.confirming {
  background: var(--brand-soft);
  color: var(--brand-active);
}

.tag-menu-item svg {
  width: 16px;
  height: 16px;
}

.tag-menu-popover input {
  width: 100%;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  outline: none;
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
}

.tag-menu-popover input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14);
}

.tag-menu-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 12px;
}

.list-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
}

.list-subtitle {
  color: var(--text-faint);
  font-size: 12px;
  white-space: nowrap;
}

.list-header-meta {
  display: flex;
  align-items: center;
  min-width: 0;
}

.recent-range-dropdown {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  max-width: 100%;
}

.recent-range-dropdown::before {
  grid-area: 1 / 1;
  min-width: 0;
  height: 28px;
  padding: 0 25px 0 10px;
  color: transparent;
  content: attr(data-label);
  font-size: 12px;
  line-height: 28px;
  pointer-events: none;
  white-space: nowrap;
}

.recent-range-dropdown::after {
  position: absolute;
  top: calc(50% - 1px);
  right: 9px;
  width: 5px;
  height: 5px;
  border-right: 1.25px solid currentColor;
  border-bottom: 1.25px solid currentColor;
  color: var(--text-muted);
  content: "";
  pointer-events: none;
  transform: translateY(-50%) rotate(45deg);
}

.recent-range-dropdown select {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 0 24px 0 10px;
  outline: none;
  background: var(--control);
  color: var(--text-main);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.recent-range-dropdown select:hover {
  background: #deddd9;
  color: var(--text-strong);
}

.recent-range-dropdown select:focus {
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14);
}

.article-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 2px 20px 0;
  scrollbar-gutter: stable;
}

.article-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 8px;
  overflow: hidden;
  border: 1.5px solid rgba(109, 117, 130, 0.1);
  border-radius: 8px;
  padding: 0;
  background: #ffffff;
  color: inherit;
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.article-card:hover {
  border-color: rgba(217, 119, 87, 0.34);
}

.article-card.locked {
  background: #fcfbf9;
}

.article-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.article-card.active:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.article-card-body {
  padding: 12px;
}

.article-card-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
}

.article-card-title svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--brand);
}

.card-title-text {
  min-width: 0;
}

.article-card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 16px;
}

.article-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 0;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 16px;
}

.article-card.active .article-card-meta {
  background: #f2e5db;
}

.article-card-meta svg {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  stroke-width: 1.7;
  color: var(--text-muted);
}

.article-card-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.tool-card:hover,
.tool-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.tool-card:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14);
}

.tool-card-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.tool-card:hover .tool-card-icon,
.tool-card.active .tool-card-icon {
  background: #fff;
  color: var(--brand);
}

.tool-card svg {
  width: 16px;
  height: 16px;
}

.tool-card strong {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
}

.tool-card small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.external-tool-card {
  padding-right: 42px;
}

.tool-card.member-locked {
  padding-right: 96px;
}

.external-tool-card.member-locked {
  padding-right: 126px;
}

.tool-card-external {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--text-muted);
}

.external-tool-card:hover .tool-card-external,
.external-tool-card:focus-visible .tool-card-external {
  color: var(--brand);
}

.tool-card-external svg {
  width: 14px;
  height: 14px;
  transition: transform 0.16s ease;
}

.external-tool-card:hover .tool-card-external svg,
.external-tool-card:focus-visible .tool-card-external svg {
  transform: translate(1px, -1px);
}

.lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-active);
  font-size: 11px;
  line-height: 20px;
}

.lock-pill svg {
  width: 12px;
  height: 12px;
  margin-right: 0;
  color: currentColor;
  stroke-width: 1.8;
}

.tool-card-membership {
  position: absolute;
  top: 12px;
  right: 12px;
}

.external-tool-card .tool-card-membership {
  right: 42px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  max-width: 92px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f2f3f5;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 20px;
}

.article-card.active .tag-chip {
  background: #f2e5db;
}

.tag-chip.brand {
  background: var(--brand-soft);
  color: var(--brand);
}

.reader-toolbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 56px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.reader-toolbar.has-sidebar-toggle {
  justify-content: space-between;
}

.toolbar-left {
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}

.toolbar-right .icon-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.toolbar-right .icon-button .lucide-list-plus {
  width: 18px;
  height: 18px;
  color: currentColor;
  stroke-width: 1.75;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-main);
}

.icon-button:hover {
  background: var(--bg-app);
}

.icon-button.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.tool-share-button {
  color: var(--text-muted);
}

.tool-share-button:hover,
.tool-share-button:focus-visible {
  background: var(--control);
  color: var(--text-main);
}

.icon-button.active .lucide-star path {
  fill: currentColor;
}

.sidebar-toggle-button {
  overflow: visible;
}

.sidebar-toggle-button::after {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-popover);
  color: var(--text-main);
  content: attr(data-tooltip);
  font-size: 12px;
  line-height: 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  transition-delay: 0s;
  white-space: nowrap;
}

.brand-row .sidebar-toggle-button::after {
  right: 0;
  left: auto;
}

.sidebar-toggle-button:hover::after,
.sidebar-toggle-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1s;
}

.toolbar-right .tag-tool-button.has-count {
  display: inline-flex;
  gap: 4px;
  width: auto;
  min-width: 42px;
  padding: 0 8px;
}

.tag-tool-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.tag-tool-button.active .tag-tool-count {
  color: currentColor;
}

.toolbar-right .icon-button[data-tool="star"].active,
.toolbar-right .icon-button[data-tool="star"].active:hover {
  background: transparent;
  color: var(--brand);
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.popover {
  position: absolute;
  top: 44px;
  right: 20px;
  display: none;
  width: 286px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.popover.open {
  display: block;
}

.popover-title {
  margin: 0 0 10px;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
}

.popover-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-popover {
  width: 286px;
}

.article-tag-editor.inline-editor {
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
}

.article-tag-editor.open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.article-tag-editor input {
  width: 100%;
}

.article-tag-list {
  margin-bottom: 0;
}

.choice-button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
}

.choice-button:hover,
.choice-button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.reader-setting-group + .reader-setting-group {
  margin-top: 16px;
}

.reader-setting-label {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.reader-setting-slider {
  position: relative;
  display: grid;
  gap: 10px;
  --slider-thumb-size: 16px;
  --slider-tick-size: 5px;
  padding: 6px 2px 2px;
}

.reader-setting-range {
  width: 100%;
  height: 24px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.reader-setting-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--brand) 0%,
    var(--brand) var(--slider-progress),
    var(--control) var(--slider-progress),
    var(--control) 100%
  );
}

.reader-setting-range::-webkit-slider-thumb {
  width: var(--slider-thumb-size);
  height: var(--slider-thumb-size);
  margin-top: -6px;
  appearance: none;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(58, 45, 35, 0.18);
}

.reader-setting-range:focus-visible {
  outline: none;
}

.reader-setting-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(217, 119, 87, 0.16), 0 2px 8px rgba(58, 45, 35, 0.18);
}

.reader-setting-ticks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc((var(--slider-thumb-size) - var(--slider-tick-size)) / 2);
}

.reader-setting-tick {
  flex: 0 0 var(--slider-tick-size);
  width: var(--slider-tick-size);
  height: var(--slider-tick-size);
  border-radius: 50%;
  background: #d8d6d1;
}

.reader-setting-tick.active {
  background: var(--brand);
}

.tag-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
}

.tag-choice svg {
  width: 14px;
  height: 14px;
}

.tag-choice.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.reader-body {
  position: relative;
  height: calc(100vh - 56px);
  min-height: 664px;
  overflow: hidden;
}

.reader-scroll {
  height: 100%;
  overflow: auto;
  scroll-behavior: smooth;
}

.article-inner {
  width: min(680px, calc(100% - 176px));
  margin: 0 auto;
  padding: 40px 0 96px;
}

.article-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.article-heading h1 {
  margin: 0;
  color: var(--text-main);
  font-size: 28px;
  font-weight: 500;
  line-height: 36px;
  scroll-margin-top: 40px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #a9b1bb;
  font-size: 14px;
  line-height: 20px;
}

.prose {
  color: var(--text-main);
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.prose p {
  margin: 0 0 22px;
}

.prose h2 {
  margin: 38px 0 14px;
  color: var(--text-main);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.45;
  scroll-margin-top: 40px;
}

.prose h3 {
  margin: 30px 0 12px;
  color: var(--text-main);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
  scroll-margin-top: 40px;
}

.prose ul,
.prose ol {
  margin: 0 0 24px 1.2em;
  padding: 0;
}

.prose li {
  margin: 6px 0;
}

.prose a {
  color: var(--brand-active);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 0 0 28px;
  padding-left: 16px;
  border-left: 4px solid #edebe7;
  color: var(--text-muted);
  font-size: calc(var(--reader-font-size) - 2px);
}

.quote-block {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: calc(var(--reader-font-size) - 2px);
}

.quote-block::before {
  content: "";
  display: block;
  border-radius: 5px;
  background: #edebe7;
}

.prose-table,
.prose table {
  width: 100%;
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 20px;
}

.prose-table th,
.prose-table td,
.prose table th,
.prose table td {
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.prose-table th,
.prose table th {
  background: var(--bg-app);
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06px;
}

.prose-table tr:last-child td,
.prose table tr:last-child td {
  border-bottom: 0;
}

.code-block,
.prose pre {
  margin: 24px 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfaf8;
  color: var(--text-main);
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.locked-reader {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: min(560px, calc(100% - 176px));
  height: 100%;
  margin: 0 auto;
}

.locked-icon,
.checkout-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.locked-icon svg,
.checkout-icon svg {
  width: 22px;
  height: 22px;
}

.locked-eyebrow,
.flow-eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  line-height: 18px;
}

.locked-reader h1,
.membership-copy h1,
.checkout-panel h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 28px;
  font-weight: 500;
  line-height: 36px;
}

.locked-reader p,
.membership-copy p,
.checkout-panel p {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 24px;
}

.locked-reader .primary-action {
  margin-top: 24px;
}

.membership-pane {
  grid-column: 2 / -1;
  height: 100vh;
  min-height: 720px;
  overflow: auto;
  border-left: 1px solid var(--border-soft);
  background: var(--surface);
}

.membership-steps {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.membership-steps.has-sidebar-toggle {
  padding-left: 20px;
}

.membership-steps.has-sidebar-toggle .sidebar-toggle-button {
  position: absolute;
  left: 20px;
}

.membership-step-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.membership-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 20px;
}

.membership-step:not(:last-child)::after {
  display: block;
  width: 44px;
  height: 1px;
  margin: 0 14px;
  border-radius: 999px;
  background: var(--border);
  content: "";
}

.membership-step.completed::after {
  background: rgba(217, 119, 87, 0.42);
}

.membership-step span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
}

.membership-step.active {
  color: var(--text-main);
}

.membership-step.active span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.membership-step.current {
  color: var(--text-strong);
  font-weight: 500;
}

.membership-shell {
  width: min(980px, calc(100% - 80px));
  margin: 0 auto;
  padding: 56px 0;
}

.membership-shell.narrow {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
  padding: 32px 0;
}

.membership-copy {
  margin-bottom: 28px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.payment-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(109, 117, 130, 0.08);
  border-radius: 12px;
  background: #fbfaf7;
  box-shadow: none;
}

.payment-contact-copy {
  min-width: 0;
}

.payment-contact-copy span {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edeae4;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.payment-contact-copy h2 {
  margin: 10px 0 6px;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
}

.payment-contact-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 22px;
}

.payment-contact-qr {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.payment-contact-qr img {
  display: block;
  width: 96px;
  height: 96px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 384px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-main);
  text-align: left;
}

.plan-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.12);
}

.plan-card.featured {
  background: #fffaf7;
}

.plan-card.free-plan {
  border-color: rgba(109, 117, 130, 0.08);
  background: #fbfaf7;
  box-shadow: none;
}

.plan-card.free-plan.selected {
  border-color: var(--border);
  box-shadow: none;
}

.plan-badge {
  align-self: flex-start;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--control);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 22px;
}

.plan-card.selected .plan-badge {
  background: var(--brand-soft);
  color: var(--brand);
}

.plan-card.featured .plan-badge {
  background: var(--brand);
  color: #fff;
}

.plan-card.free-plan .plan-badge {
  background: #edeae4;
  color: var(--text-muted);
}

.plan-card h2 {
  margin: 18px 0 8px;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
}

.plan-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: var(--text-strong);
}

.plan-price span {
  font-size: 28px;
  font-weight: 500;
  line-height: 36px;
}

.plan-price small {
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.plan-price .plan-cycle {
  margin-left: -4px;
  color: var(--text-muted);
}

.plan-price .plan-note {
  color: var(--brand);
}

.plan-original-price {
  margin: 2px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 18px;
  text-decoration: line-through;
}

.plan-original-price.placeholder {
  visibility: hidden;
}

.plan-caption {
  min-height: 44px;
  margin: 8px 0 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 22px;
}

.plan-card ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-card li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-main);
  font-size: 13px;
  line-height: 20px;
}

.plan-card li svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--brand);
}

.plan-card.free-plan .plan-price span,
.plan-card.free-plan li {
  color: var(--text-muted);
}

.plan-card.free-plan h2 {
  color: var(--text-main);
}

.plan-card.free-plan li svg {
  color: var(--text-faint);
}

.flow-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.primary-action,
.ghost-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
}

.primary-action {
  background: var(--brand);
  color: #fff;
}

.primary-action:hover {
  background: var(--brand-hover);
}

.primary-action.compact {
  width: 100%;
  min-width: 0;
  height: 32px;
  font-size: 13px;
}

.ghost-action.compact {
  width: 100%;
  min-width: 0;
  height: 32px;
  font-size: 13px;
}

.plan-card-footer .plan-action-button {
  height: 38px;
  font-weight: 600;
}

.primary-action.wide {
  width: 100%;
  margin-top: 24px;
}

.ghost-action {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
}

.ghost-action:hover {
  background: var(--control);
}

.danger-action {
  margin-right: auto;
  border: 1px solid rgba(184, 92, 66, 0.28);
  background: #fff7f2;
  color: var(--brand-active);
}

.danger-action:hover {
  background: var(--brand-soft);
}

.checkout-panel {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(58, 45, 35, 0.08);
}

.payment-panel {
  width: min(720px, 100%);
}

.mock-payment-card,
.subscription-summary,
.subscription-result {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.mock-payment-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.mock-payment-card span,
.mock-payment-card small,
.subscription-summary span,
.subscription-result span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.mock-payment-card strong {
  color: var(--text-strong);
  font-size: 28px;
  font-weight: 500;
  line-height: 34px;
}

.payment-checkout-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.alipay-qr-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.payment-qr-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  aspect-ratio: 1;
  border: 1px dashed rgba(217, 119, 87, 0.36);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(217, 119, 87, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(217, 119, 87, 0.08) 1px, transparent 1px),
    #fffaf7;
  background-size: 18px 18px;
  color: var(--brand-active);
  text-align: center;
}

.payment-qr-placeholder span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
}

.payment-qr-placeholder strong {
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
}

.payment-qr-placeholder small {
  max-width: 140px;
  color: var(--text-muted);
}

.payment-code-field {
  margin-top: 8px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
}

.form-field span,
.avatar-picker > span {
  color: var(--text-main);
  font-size: 13px;
  line-height: 20px;
}

.form-field input {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
  background: var(--surface);
  color: var(--text-main);
  font-size: 14px;
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.verification-row .form-field {
  margin-top: 0;
}

.verification-action {
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  white-space: nowrap;
}

.form-hint {
  margin: 8px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 18px;
}

.form-field textarea {
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  outline: none;
  background: var(--surface);
  color: var(--text-main);
  font-size: 14px;
  line-height: 22px;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14);
}

.subscription-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.subscription-summary strong {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 500;
}

.checkout-icon.success {
  background: #eef7ef;
  color: #2f7d46;
}

.subscription-result {
  overflow: hidden;
}

.subscription-result div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.subscription-result div:last-child {
  border-bottom: 0;
}

.subscription-result strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(25, 25, 25, 0.18);
  backdrop-filter: blur(2px);
}

.account-panel,
.membership-modal {
  width: 420px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.membership-modal {
  width: min(980px, calc(100vw - 64px));
}

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

.account-panel-header h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
}

.account-current {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-muted);
}

.avatar.large {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.account-current div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.account-current strong {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
}

.account-current span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-picker {
  margin-top: 18px;
}

.avatar-upload-target {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-muted);
  cursor: pointer;
  overflow: hidden;
}

.avatar.preview {
  width: 64px;
  height: 64px;
  font-size: 18px;
}

.avatar-edit-indicator {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(25, 25, 25, 0.38);
  color: #fff;
  opacity: 0;
  transition: opacity 0.14s ease;
}

.avatar-edit-indicator svg {
  width: 22px;
  height: 22px;
}

.avatar-upload-target:hover {
  border-color: var(--brand);
}

.avatar-upload-target:hover .avatar-edit-indicator {
  opacity: 1;
}

.membership-modal-desc {
  margin: 12px 0 18px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 24px;
}

.modal-plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.membership-plan-card {
  cursor: default;
}

.membership-plan-card.unlocked {
  border-color: var(--brand);
}

.membership-plan-card.included {
  background: #fcfbf9;
}

.plan-card-footer {
  margin-top: auto;
  padding-top: 18px;
}

.unlocked-mark,
.included-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}

.included-mark {
  background: var(--control);
  color: var(--text-muted);
}

.unlocked-mark svg,
.included-mark svg {
  width: 15px;
  height: 15px;
}

.tool-workbench {
  width: min(640px, calc(100% - 176px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

.tool-heading {
  margin-bottom: 26px;
}

.tool-heading h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 28px;
  font-weight: 500;
  line-height: 36px;
}

.tool-heading p {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 24px;
}

.tool-output {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.tool-output span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.tool-output p {
  margin: 0;
  color: var(--text-main);
  font-size: 14px;
  line-height: 24px;
  white-space: pre-wrap;
}

.empty-state {
  display: grid;
  place-items: center;
  height: 240px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-faint);
  font-size: 14px;
}

.empty-state.rich {
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px 18px;
  border-color: var(--border-soft);
  background: rgba(248, 247, 244, 0.74);
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.empty-state-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.empty-state strong {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
}

.empty-state p,
.reader-empty-state p {
  max-width: 260px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 20px;
}

.empty-state-action {
  height: 30px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid rgba(217, 119, 87, 0.24);
  border-radius: 7px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
}

.empty-state-action:hover {
  background: var(--brand-soft);
}

.reader-empty-body {
  display: grid;
  place-items: center;
}

.reader-empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 360px;
  padding-bottom: 8vh;
  text-align: center;
}

.reader-empty-state h1 {
  margin: 6px 0 0;
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 500;
  line-height: 34px;
}

.article-toc {
  position: absolute;
  left: 20px;
  top: 50%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 28px;
  max-height: min(520px, calc(100% - 80px));
  overflow: hidden;
  padding: 4px 0;
  border-radius: 12px;
  transform: translateY(-50%);
  transition: width 0.2s ease, padding 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.article-toc:hover,
.article-toc:focus-within {
  width: 220px;
  overflow: auto;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-popover);
}

.toc-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 18px;
  padding: 2px 0;
  border-radius: 8px;
  color: var(--text-faint);
  text-align: left;
}

.article-toc:hover .toc-item,
.article-toc:focus-within .toc-item {
  justify-content: flex-start;
  min-height: 24px;
  padding: 3px 8px;
}

.toc-item:hover,
.toc-item:focus-visible {
  background: var(--control);
  color: var(--text-strong);
}

.toc-marker {
  flex: 0 0 auto;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: #f2f3f5;
  transition: width 0.16s ease, background 0.16s ease;
}

.toc-item.level-1 .toc-marker {
  width: 18px;
}

.toc-item.active .toc-title {
  color: var(--text-strong);
  text-shadow: 0.25px 0 0 currentColor;
}

.toc-title {
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-4px);
  transition: max-width 0.2s ease, opacity 0.18s ease, transform 0.2s ease;
}

.toc-item.level-2 .toc-title {
  padding-left: 8px;
}

.toc-item.level-3 .toc-marker {
  width: 10px;
  background: #f0efec;
}

.toc-item.active .toc-marker,
.toc-item.level-3.active .toc-marker {
  width: 18px;
  background: var(--text-muted);
}

.toc-item.level-3 .toc-title {
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-faint);
}

.article-toc:hover .toc-title,
.article-toc:focus-within .toc-title {
  max-width: 168px;
  opacity: 1;
  transform: translateX(0);
}

.article-toc:hover .toc-item.level-1 .toc-title,
.article-toc:focus-within .toc-item.level-1 .toc-title {
  color: var(--text-strong);
}

.article-toc:hover .toc-item.level-2 .toc-title,
.article-toc:focus-within .toc-item.level-2 .toc-title {
  color: #3f4041;
}

.article-toc:hover .toc-item.level-3 .toc-title,
.article-toc:focus-within .toc-item.level-3 .toc-title {
  color: #5f6163;
}

.article-toc:hover .toc-item.active .toc-title,
.article-toc:focus-within .toc-item.active .toc-title {
  color: var(--text-strong);
}

.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
}

.line-clamp-1 {
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  -webkit-line-clamp: 3;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  min-width: 220px;
  max-width: 360px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(25, 25, 25, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (min-width: 1600px) {
  .app-shell {
    grid-template-columns: 264px 288px minmax(0, 1fr);
  }

  .article-inner {
    width: 720px;
  }
}

@media (max-width: 1180px) {
  body {
    overflow-x: auto;
  }
}
