:root {
  --brand-plum: #4d144a;
  --brand-wine: #841d3c;
  --brand-red: #b2242f;
  --page-bg: #f3f0f7;
  --surface: #ffffff;
  --surface-pink: #f9eff6;
  --surface-muted: #f3eff9;
  --surface-lavender: #e2ddeb;
  --border: #e8e3ed;
  --text: #252525;
  --text-secondary: #606060;
  --text-muted: #8a858c;
  --brand-gradient: linear-gradient(90deg, #4d144a 0%, #841d3c 52%, #b2242f 100%);
  --surface-gradient: linear-gradient(110deg, #fcf2f8 0%, #f3eff9 52%, #e5ebfc 100%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family:
    "Source Han Sans CN", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-plum);
  outline-offset: 3px;
}

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

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 78px;
  padding: 0 clamp(24px, 4.2vw, 76px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(77, 20, 74, 0.07);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-gradient);
  color: white;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  color: var(--brand-plum);
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.brand-copy small {
  color: var(--text-secondary);
  font-size: 12px;
}

.topnav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 46px;
}

.topnav a {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
  color: #4d4a4e;
  font-size: 15px;
  font-weight: 650;
}

.topnav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--brand-gradient);
  transform: translateX(-50%);
  transition: width 180ms ease;
}

.topnav a:hover,
.topnav a.active {
  color: var(--brand-plum);
}

.topnav a.active::after,
.topnav a:hover::after {
  width: 28px;
}

.update-note {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.update-note i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #48b78a;
  box-shadow: 0 0 0 5px rgba(72, 183, 138, 0.12);
}

.workspace {
  min-height: calc(100vh - 78px);
  width: min(100%, 1920px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: clamp(320px, 22vw, 410px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 24px;
}

.overview-panel,
.library-panel {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
}

.overview-panel {
  position: sticky;
  top: 102px;
  height: calc(100vh - 126px);
  min-height: 0;
  padding: clamp(30px, 2.5vw, 44px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #cbbdcc transparent;
  touch-action: pan-y;
}

.overview-panel::-webkit-scrollbar {
  width: 8px;
}

.overview-panel::-webkit-scrollbar-track {
  background: transparent;
}

.overview-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #cbbdcc;
  background-clip: padding-box;
}

.eyebrow,
.hero-kicker {
  color: var(--brand-plum);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.overview-panel h1 {
  margin: 18px 0 16px;
  color: var(--text);
  font-size: clamp(28px, 2.45vw, 39px);
  line-height: 1.24;
  letter-spacing: -0.025em;
}

.overview-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.85;
}

.overview-stats {
  margin: 34px 0 32px;
  padding: 22px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.overview-stats div {
  display: grid;
  gap: 5px;
}

.overview-stats div + div {
  padding-left: 25px;
  border-left: 1px solid var(--border);
}

.overview-stats strong {
  color: var(--brand-plum);
  font-size: 28px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

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

.block-label {
  display: block;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.category-list {
  display: grid;
  gap: 10px;
}

.category-list button {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.category-list button span {
  font-size: 14px;
  font-weight: 620;
}

.category-list button b {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.category-list button:hover {
  background: var(--surface-muted);
}

.category-list button.active {
  color: var(--brand-plum);
  background: var(--surface-gradient);
  border-color: #dfd2e1;
}

.category-list button.active b {
  color: var(--brand-plum);
}

.contribution-card {
  margin-top: auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px dashed #d7c9d8;
  border-radius: 14px;
  background: #fcfaff;
}

.contribution-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-pink);
  color: var(--brand-plum);
  font-size: 19px;
}

.contribution-card strong {
  font-size: 13px;
}

.contribution-card p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.library-panel {
  padding: clamp(32px, 3.2vw, 56px);
  scroll-margin-top: 102px;
}

.library-hero {
  min-height: 210px;
  padding: clamp(30px, 3.2vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  overflow: hidden;
  border: 1px solid #e7deeb;
  border-radius: 18px;
  background:
    linear-gradient(110deg, rgba(252, 242, 248, 0.96), rgba(243, 239, 249, 0.92) 53%, rgba(229, 235, 252, 0.92)),
    white;
}

.library-hero h2 {
  margin: 16px 0 9px;
  color: var(--text);
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.library-hero p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.hero-index {
  flex: 0 0 auto;
  color: rgba(77, 20, 74, 0.38);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.library-toolbar {
  margin: 36px 0 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.search-field {
  width: min(500px, 100%);
  height: 50px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--surface-lavender);
  border-radius: 13px;
  background: white;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within {
  border-color: var(--brand-plum);
  box-shadow: 0 0 0 3px rgba(77, 20, 74, 0.07);
}

.search-icon {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 1.8px solid var(--brand-plum);
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 6px;
  height: 1.8px;
  border-radius: 99px;
  background: var(--brand-plum);
  transform: rotate(45deg);
}

.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-field input::placeholder {
  color: #aaa5ac;
}

.search-field button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: pointer;
}

.result-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.project-grid {
  min-height: 420px;
  display: grid;
  align-content: start;
  gap: 52px;
}

.project-card {
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(280px, 46%) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #e4dfe9;
  border-radius: 20px;
  background: white;
  box-shadow: 0 8px 28px rgba(77, 20, 74, 0.045);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
  border-color: #d6c7da;
  box-shadow: 0 22px 54px rgba(77, 20, 74, 0.1);
  transform: translateY(-2px);
}

.project-cover {
  position: relative;
  min-height: 440px;
  padding: 42px 34px;
  display: flex;
  align-items: center;
  background: var(--surface-gradient);
  overflow: hidden;
}

.project-cover-link {
  color: inherit;
  text-decoration: none;
}

.mobile-diagnosis-cover {
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(252, 242, 248, 0.98), rgba(239, 235, 248, 0.94) 54%, rgba(227, 234, 253, 0.96)),
    white;
}

.mock-phone {
  position: relative;
  z-index: 1;
  width: min(178px, 58%);
  aspect-ratio: 375 / 812;
  padding: 11px 9px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(77, 20, 74, 0.15);
  border-radius: 22px;
  background: white;
  box-shadow: 0 26px 55px rgba(77, 20, 74, 0.18);
  transform: rotate(1.6deg);
}

.mock-phone-status,
.mock-phone-header,
.mock-tree-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mock-phone-status {
  color: #171717;
  font-size: 6px;
}

.mock-phone-status span {
  letter-spacing: 1px;
}

.mock-phone-header {
  margin: 10px 0 12px;
  color: #252525;
  font-size: 7px;
}

.mock-phone-header strong {
  color: #e42b20;
  font-size: 9px;
}

.mock-phone-chat {
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.mock-user-message {
  width: 78%;
  margin-left: auto;
  padding: 6px 7px;
  border-radius: 7px 7px 2px 7px;
  background: linear-gradient(90deg, #fcf2f8, #e3eafd);
  color: #252525;
  font-size: 6px;
  line-height: 1.5;
}

.mock-advice-title {
  display: block;
  margin: 10px 0 6px;
  color: #4d144a;
  font-size: 7px;
}

.mock-answer-line {
  width: 92%;
  height: 4px;
  margin-top: 4px;
  border-radius: 99px;
  background: #ded9e2;
}

.mock-answer-line.short {
  width: 66%;
}

.mock-tree-card {
  margin-top: 10px;
  padding: 8px;
  display: grid;
  gap: 5px;
  border: 1px solid #e2ddeb;
  border-radius: 8px;
  background: white;
  box-shadow: 0 6px 16px rgba(77, 20, 74, 0.06);
}

.mock-tree-meta {
  color: #979797;
  font-size: 5px;
}

.mock-tree-meta b {
  color: #4d144a;
}

.mock-tree-card > strong {
  color: #252525;
  font-size: 6px;
  line-height: 1.4;
}

.mock-tree-card > i {
  height: 18px;
  border: 1px solid #e2ddeb;
  border-radius: 4px;
  background: #fff;
}

.mock-phone-composer {
  min-height: 22px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #4d144a;
  border-radius: 8px;
  color: #979797;
  font-size: 6px;
}

.mock-phone-composer b {
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #4d144a;
  color: white;
  font-size: 7px;
}

.cover-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.cover-orb-one {
  width: 180px;
  height: 180px;
  top: -72px;
  left: -40px;
  background: rgba(178, 36, 47, 0.08);
}

.cover-orb-two {
  width: 220px;
  height: 220px;
  right: -120px;
  bottom: -80px;
  background: rgba(77, 20, 74, 0.09);
}

.mock-window {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1.36;
  overflow: hidden;
  border: 1px solid rgba(77, 20, 74, 0.13);
  border-radius: 12px;
  background: white;
  box-shadow: 0 24px 55px rgba(77, 20, 74, 0.15);
  transform: rotate(-1.5deg);
}

.mock-topbar {
  height: 15%;
  padding: 0 5%;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid #eee9f0;
}

.mock-topbar span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ddd5e1;
}

.mock-topbar b {
  margin-left: auto;
  color: var(--brand-plum);
  font-size: clamp(6px, 0.6vw, 9px);
}

.mock-body {
  height: 85%;
  padding: 3%;
  display: grid;
  grid-template-columns: 37% 1fr;
  gap: 3%;
  background: var(--page-bg);
}

.mock-assistant,
.mock-content {
  padding: 7%;
  border-radius: 6px;
  background: white;
}

.mock-assistant {
  display: flex;
  flex-direction: column;
}

.mock-line {
  width: 82%;
  height: 4px;
  margin-bottom: 5px;
  border-radius: 99px;
  background: #ded9e2;
}

.mock-line-strong {
  width: 68%;
  background: #4d144a;
}

.mock-line-short {
  width: 48%;
}

.mock-prompt {
  height: 13%;
  margin-top: 6%;
  border: 1px solid #e2ddeb;
  border-radius: 4px;
  background: #fcfaff;
}

.mock-composer {
  height: 20%;
  margin-top: auto;
  border: 1px solid rgba(77, 20, 74, 0.6);
  border-radius: 5px;
}

.mock-heading {
  width: 38%;
  height: 6px;
  margin-bottom: 9%;
  border-radius: 99px;
  background: var(--brand-plum);
}

.mock-plan {
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 8%;
}

.mock-device {
  aspect-ratio: 1.05;
  border-radius: 7px;
  background: linear-gradient(145deg, #f3e7ef, #d9deef);
}

.mock-plan-copy {
  padding-top: 5%;
}

.mock-action {
  width: 58%;
  height: 14px;
  margin-top: 12%;
  border-radius: 4px;
  background: var(--brand-gradient);
}

.cover-label {
  position: absolute;
  z-index: 2;
  bottom: 19px;
  left: 34px;
  color: rgba(77, 20, 74, 0.58);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.project-card-body {
  padding: clamp(36px, 3.4vw, 52px);
  display: flex;
  flex-direction: column;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--text-muted);
  font-size: 11px;
}

.project-meta > span {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-pink);
  color: var(--brand-plum);
  font-weight: 700;
}

.project-meta time {
  align-self: center;
  font-variant-numeric: tabular-nums;
}

.project-heading {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.project-heading > span {
  padding-top: 5px;
  color: #b5acb6;
  font-size: 11px;
  font-weight: 750;
}

.project-heading h3 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.project-card-body > p {
  max-width: 720px;
  margin: 24px 0 0 38px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.85;
}

.tag-list {
  margin: 30px 0 0 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 11px;
}

.project-entry-list {
  margin: auto 0 0 38px;
  padding-top: 36px;
  display: grid;
  gap: 10px;
}

.project-entry {
  min-height: 58px;
  padding: 7px 8px 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fcfaff;
}

.device-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.device-label i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-plum);
  box-shadow: 0 0 0 4px rgba(77, 20, 74, 0.09);
}

.project-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.project-actions button,
.project-actions a,
.empty-state button {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.copy-button {
  border: 1px solid var(--surface-lavender);
  background: white;
  color: var(--brand-plum);
}

.copy-button:hover {
  background: var(--surface-muted);
}

.open-button {
  min-width: 118px;
  border: 1px solid var(--brand-plum);
  background: var(--brand-plum);
  color: white;
  transition: 160ms ease;
}

.open-button:hover {
  background: #65195f;
  box-shadow: 0 8px 22px rgba(77, 20, 74, 0.17);
}

.open-button span {
  font-size: 15px;
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px dashed #d7cfd9;
  border-radius: 18px;
  background: #fcfaff;
  text-align: center;
}

.empty-state > span {
  font-size: 20px;
  font-weight: 750;
}

.empty-state p {
  margin: 8px 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state button {
  border: 1px solid var(--brand-plum);
  background: var(--brand-plum);
  color: white;
}

.library-footer {
  margin-top: 52px;
  padding: 30px 2px 4px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
}

.library-footer p {
  margin: 0;
}

@media (max-width: 1050px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
  }

  .workspace {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .overview-panel {
    top: 96px;
    height: calc(100vh - 114px);
    padding: 30px 24px;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-cover {
    min-height: 360px;
  }

  .project-card-body {
    min-height: 340px;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: 68px;
    padding: 0 18px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .update-note {
    font-size: 11px;
  }

  .workspace {
    min-height: calc(100vh - 68px);
    padding: 12px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .overview-panel {
    position: static;
    height: auto;
    min-height: 0;
    padding: 30px 24px 24px;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .overview-panel h1 {
    font-size: 30px;
  }

  .overview-description {
    max-width: 560px;
  }

  .overview-stats {
    margin: 25px 0;
  }

  .category-block {
    display: block;
    margin-bottom: 24px;
    overflow: hidden;
  }

  .category-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .category-list::-webkit-scrollbar {
    display: none;
  }

  .category-list button {
    width: auto;
    min-width: 132px;
    flex: 0 0 auto;
    gap: 20px;
    scroll-snap-align: start;
  }

  .contribution-card {
    margin-top: 0;
  }

  .library-panel {
    padding: 20px;
  }

  .library-hero {
    min-height: 175px;
    padding: 26px 22px;
  }

  .library-hero h2 {
    font-size: 35px;
  }

  .library-hero p {
    line-height: 1.65;
  }

  .hero-index {
    display: none;
  }

  .library-toolbar {
    margin: 24px 0 20px;
    display: grid;
    gap: 9px;
  }

  .result-count {
    margin-left: 2px;
  }

  .project-cover {
    min-height: 280px;
    padding: 30px 24px;
  }

  .cover-label {
    left: 24px;
    bottom: 13px;
  }

  .project-card-body {
    min-height: 0;
    padding: 30px 24px;
  }

  .project-heading {
    margin-top: 22px;
  }

  .project-card-body > p,
  .tag-list,
  .project-entry-list {
    margin-left: 0;
  }

  .project-entry-list {
    margin-top: 18px;
    padding-top: 0;
  }

  .project-grid {
    gap: 30px;
  }

  .library-footer {
    margin-top: 34px;
    display: grid;
  }
}

@media (max-width: 420px) {
  .update-note {
    display: none;
  }

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

  .library-hero h2 {
    font-size: 31px;
  }

  .project-cover {
    min-height: 230px;
  }

  .project-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .project-entry {
    padding: 12px;
    display: grid;
  }

  .device-label {
    padding: 0 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
