:root {
  color-scheme: light;
  --bg: #f4f7fa;
  --bg-soft: #f6fbfa;
  --panel: #ffffff;
  --ink: #152522;
  --ink-soft: #344743;
  --muted: #71827f;
  --line: #dbe8e5;
  --line-strong: #c8ddd8;
  --teal: #087c73;
  --teal-deep: #045f58;
  --teal-soft: #e6f5f2;
  --teal-pale: #f3faf9;
  --orange: #ff9f72;
  --orange-soft: #fff4ec;
  --gold: #d79b36;
  --shadow: 0 14px 36px rgba(31, 45, 43, 0.05);
  --shadow-hover: 0 18px 42px rgba(16, 62, 56, 0.09);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --header-h: 52px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background:
    linear-gradient(90deg, #eef3f7 0%, #f9fbfc 28%, #f9fbfc 72%, #eef3f7 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
}

::selection {
  background: rgba(8, 124, 115, 0.18);
  color: #052f2c;
}

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

button,
input,
select {
  font: inherit;
}

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

.siteHeader {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--header-h);
  border-bottom: 1px solid #e6edf0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(53, 73, 72, 0.035);
  backdrop-filter: blur(18px);
}

.headerInner {
  display: grid;
  grid-template-columns: max-content max-content minmax(280px, 1fr) minmax(220px, 360px) max-content;
  align-items: center;
  gap: 18px;
  width: min(1280px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
}

.brandMark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--teal-deep);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
  transition: color 180ms var(--ease), transform 180ms var(--ease);
}

.brandMark:hover {
  color: #034c46;
  transform: translateY(-1px);
}

.headerPill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 159, 114, 0.36);
  border-radius: 6px;
  background: var(--orange-soft);
  color: #d77a42;
  font-size: 13px;
  font-weight: 900;
}

.brandIcon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
}

.categoryNav {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.categoryNav::-webkit-scrollbar {
  display: none;
}

.navButton,
.pill,
.expandButton,
.railPanel button,
.headerAction {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 180ms var(--ease),
    border-color 180ms var(--ease),
    color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 180ms var(--ease);
}

.navButton {
  position: relative;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  color: #425551;
  font-size: 14px;
  font-weight: 700;
}

.navButton.active,
.navButton:hover {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.navButton.active::after {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: var(--teal);
  content: "";
}

.headerSearch {
  position: relative;
}

.headerSearch::before {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 12px;
  height: 12px;
  border: 2px solid #8aa19d;
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
}

.headerSearch::after {
  position: absolute;
  top: 36px;
  left: 25px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: #8aa19d;
  content: "";
  transform: rotate(45deg);
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfa;
  color: var(--ink);
  outline: none;
  transition:
    background-color 180ms var(--ease),
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

input {
  padding: 0 14px 0 38px;
}

select {
  padding: 0 14px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--teal);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(8, 124, 115, 0.14);
  outline: none;
}

.headerAction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-color: rgba(8, 124, 115, 0.22);
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.headerAction:hover {
  border-color: rgba(8, 124, 115, 0.34);
  background: #daf1ec;
  transform: translateY(-1px);
}

.page {
  display: grid;
  grid-template-columns: minmax(0, 680px) 250px;
  gap: 12px;
  width: min(944px, calc(100% - 40px));
  margin: 0 auto 48px;
}

.feedColumn {
  min-width: 0;
}

.feedHead {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: end;
  overflow: hidden;
  gap: 24px;
  min-height: 180px;
  border: 1px solid #e8eef1;
  border-top: 0;
  border-radius: 0;
  background:
    linear-gradient(140deg, #ffffff 0%, #ffffff 58%, #f1fbf8 100%);
  box-shadow: none;
  padding: 26px 24px 22px;
}

.feedHead::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), rgba(255, 159, 114, 0.8));
  content: "";
}

.introBadge,
.profileLogo {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(88, 224, 201, 0.22), transparent 38%),
    linear-gradient(160deg, #0b7f73, #045f58);
  color: #ffffff;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 24px rgba(4, 95, 88, 0.16);
}

.introBadge {
  width: 108px;
  height: 108px;
  font-size: 42px;
}

.introCopy {
  min-width: 0;
}

.breadcrumb {
  margin-bottom: 16px;
  color: #60716d;
  font-size: 13px;
  font-weight: 800;
}

.breadcrumb span {
  margin: 0 7px;
  color: #aab9b6;
}

.metaLine {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 10px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.feedHead h1 {
  margin: 0;
  color: #063d39;
  font-size: 34px;
  line-height: 1.15;
}

.subline {
  max-width: 560px;
  margin: 10px 0 0;
  color: #667a76;
  font-size: 14px;
  line-height: 1.7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 74px);
  gap: 8px;
  grid-column: 2;
  margin-top: 14px;
}

.stat {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.stat:hover {
  box-shadow: 0 10px 22px rgba(16, 62, 56, 0.06);
  transform: translateY(-1px);
}

.statValue {
  display: block;
  color: var(--teal-deep);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.statLabel {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.activeFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin: 10px 0 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-color: rgba(8, 124, 115, 0.18);
  background: rgba(230, 245, 242, 0.9);
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 700;
}

.bookmarkList {
  display: grid;
  gap: 0;
  border: 1px solid #e8eef1;
  border-top: 0;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(23, 46, 43, 0.035);
}

.bookmark {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  border-bottom: 1px solid #edf2f4;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  padding: 22px 24px;
  transition:
    background-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 180ms var(--ease);
  animation: feedIn 220ms var(--ease) both;
}

.bookmark:hover {
  background: #fbfdfd;
  box-shadow: inset 3px 0 0 rgba(8, 124, 115, 0.72);
  transform: translateY(-1px);
}

.bookmark.featured {
  background:
    linear-gradient(90deg, rgba(230, 245, 242, 0.95), #ffffff 38%);
  box-shadow:
    inset 3px 0 0 var(--orange),
    0 16px 34px rgba(16, 62, 56, 0.08);
}

.bookmark:last-child {
  border-bottom: 0;
}

.bookmarkMain {
  min-width: 0;
}

.bookmarkMeta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 900;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}

.bookmark:hover .avatar {
  background: var(--teal);
  color: #ffffff;
  transform: scale(1.04);
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b7c6c2;
}

.authorLine {
  min-width: 0;
}

.authorName {
  display: inline;
  color: var(--ink);
  font-weight: 800;
}

.handle {
  color: var(--muted);
}

.bookmarkText {
  max-height: 156px;
  overflow: hidden;
  margin-top: 10px;
  color: #273733;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.bookmark.expanded .bookmarkText {
  max-height: none;
}

.bookmarkTags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.bookmarkTags span,
.categoryBadge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.bookmarkTags span {
  background: #f1f6f4;
  color: #60716d;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

.categoryBadge {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.footerActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.bookmarkLink,
.expandButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  transition:
    background-color 180ms var(--ease),
    border-color 180ms var(--ease),
    color 180ms var(--ease),
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.bookmarkLink {
  color: var(--teal-deep);
}

.bookmarkLink:hover,
.expandButton:hover {
  background: #eef8f6;
  color: var(--teal-deep);
  transform: translateY(-1px);
}

.rightRail {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  display: grid;
  align-self: start;
  gap: 12px;
  max-height: calc(100vh - var(--header-h) - 36px);
  overflow: auto;
  padding-right: 2px;
}

.profilePanel {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 18px;
}

.profileLogo {
  width: 66px;
  height: 66px;
  font-size: 28px;
}

.profileTitle {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.profileDesc {
  width: 100%;
  border-radius: 8px;
  background: #f6faf9;
  color: #60716d;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  padding: 12px;
}

.railPanel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(3, 77, 69, 0.045);
  padding: 16px;
  transition: box-shadow 180ms var(--ease), transform 180ms var(--ease), border-color 180ms var(--ease);
}

.railPanel:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.panelTitle {
  margin-bottom: 12px;
  color: #163a35;
  font-size: 15px;
  font-weight: 900;
}

summary.panelTitle {
  cursor: pointer;
  list-style: none;
}

summary.panelTitle::-webkit-details-marker {
  display: none;
}

summary.panelTitle::after {
  float: right;
  color: var(--muted);
  content: "收起";
  font-size: 12px;
  font-weight: 800;
}

.controlPanel:not([open]) summary.panelTitle {
  margin-bottom: 0;
}

.controlPanel:not([open]) summary.panelTitle::after {
  content: "展开";
}

.actionPanel {
  display: grid;
  gap: 10px;
  background:
    linear-gradient(135deg, #fff8f1 0%, #ffffff 44%, #effbf8 100%);
}

.actionPanel p {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.railPanel label {
  display: block;
  margin: 12px 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.railPanel label:first-of-type {
  margin-top: 0;
}

.railPanel button {
  width: 100%;
  min-height: 38px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink-soft);
  font-weight: 800;
}

.railPanel button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.railPanel button:hover {
  border-color: rgba(8, 124, 115, 0.28);
  background: #f2faf8;
  color: var(--teal-deep);
  transform: translateY(-1px);
}

#randomButton {
  border-color: var(--teal);
  background: linear-gradient(135deg, #087c73, #049582);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(8, 124, 115, 0.18);
}

#randomButton:hover {
  background: linear-gradient(135deg, #046d65, #078d7d);
  color: #ffffff;
}

.ghostButton {
  margin-top: 14px;
}

.overviewList {
  display: grid;
  gap: 10px;
}

.overviewList.compact {
  gap: 8px;
}

.overviewRow {
  display: grid;
  gap: 7px;
}

.overviewMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
}

.overviewMeta span {
  overflow: hidden;
  color: #435753;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overviewMeta strong {
  color: #60716d;
  font-size: 12px;
  font-weight: 900;
}

.overviewTrack {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf5f2;
}

.overviewTrack span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #6ee2cf);
}

.emptyState {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1080px) {
  .headerInner {
    grid-template-columns: max-content max-content minmax(0, 1fr) max-content;
  }

  .categoryNav {
    order: 5;
    grid-column: 1 / -1;
    width: 100%;
    padding-bottom: 10px;
  }

  .siteHeader {
    height: auto;
  }

  .headerInner {
    min-height: var(--header-h);
    padding: 12px 0;
  }

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

  .rightRail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 760px) {
  .headerInner,
  .page {
    width: min(100% - 24px, 1120px);
  }

  .siteHeader {
    position: static;
  }

  .headerInner {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 10px 12px;
  }

  .headerPill,
  .headerAction {
    display: none;
  }

  .categoryNav {
    order: 5;
    grid-column: 1 / -1;
    padding-bottom: 4px;
  }

  .headerSearch {
    grid-column: 1 / -1;
  }

  .page {
    row-gap: 10px;
  }

  .feedColumn {
    display: contents;
  }

  .feedHead {
    order: 1;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    min-height: 0;
    padding: 18px 16px;
  }

  .introBadge {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .feedHead h1 {
    font-size: 25px;
  }

  .breadcrumb {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .metaLine {
    max-width: 100%;
    min-height: 0;
    margin-bottom: 8px;
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.45;
  }

  .subline {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.65;
  }

  .stats {
    order: 3;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .stat {
    min-height: 58px;
    padding: 10px;
  }

  .statValue {
    font-size: 20px;
  }

  .activeFilters {
    order: 2;
    margin: 0;
  }

  .rightRail {
    order: 3;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
  }

  .profilePanel,
  .overviewPanel,
  .authorsPanel {
    display: none;
  }

  .actionPanel {
    padding: 14px;
  }

  .actionPanel p {
    display: none;
  }

  .controlPanel {
    padding: 14px;
  }

  .controlPanel .panelTitle {
    margin-bottom: 10px;
  }

  .controlPanel:not([open]) .panelTitle {
    margin-bottom: 0;
  }

  .controlPanel label {
    margin: 10px 0 6px;
  }

  .bookmark {
    grid-template-columns: 34px minmax(0, 1fr);
    order: 4;
  }

  .bookmarkList {
    order: 4;
    border-top: 1px solid #e8eef1;
  }

  .emptyState {
    order: 5;
  }

  .avatar {
    width: 30px;
    height: 30px;
  }

  .bookmarkText {
    max-height: 220px;
    font-size: 16px;
    line-height: 1.82;
  }

  .footerActions {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .bookmark {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 16px;
  }

  .bookmarkMeta {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .feedHead h1 {
    font-size: 24px;
  }

  .stats {
    grid-column: 1 / -1;
  }
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
