/* BAIZE-074: final visual alignment for the stable public-profile structure. */
.baize-public-profile {
  --bpp-blue: #1967f2;
  --bpp-ink: #152743;
  --bpp-muted: #71819a;
  --bpp-line: #dfe8f4;
  --bpp-surface: #fff;
  --bpp-shadow: 0 12px 30px rgba(35, 80, 143, .08);
  padding: 22px 0 64px;
  background: #f7faff;
  overflow: hidden;
}

.bpp-shell {
  width: min(var(--baize-shell-max, 1400px), calc(100% - 44px)) !important;
  max-width: var(--baize-shell-max, 1400px) !important;
  margin-right: auto;
  margin-left: auto;
  padding: 0 !important;
}

.bpp-hero {
  position: relative;
  min-height: 342px;
  overflow: hidden;
  border: 1px solid rgba(202, 220, 246, .82);
  border-radius: 18px;
  background: #eaf3ff;
  box-shadow: var(--bpp-shadow);
}

.bpp-cover,
.bpp-cover > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.bpp-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bpp-cover > span { background: linear-gradient(90deg, rgba(247, 252, 255, .98) 0%, rgba(246, 251, 255, .88) 38%, rgba(230, 243, 255, .18) 100%); }

.bpp-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  min-height: 342px;
  padding: 54px 52px 36px;
}

.bpp-avatar {
  width: 146px;
  height: 146px;
  padding: 6px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 12px 26px rgba(30, 86, 152, .18);
}

.bpp-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bpp-identity { min-width: 0; }

.bpp-identity h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #0e213d;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.bpp-identity h1 i { color: var(--bpp-blue); font-size: 18px; }
.bpp-identity > p { max-width: 760px; margin: 9px 0 14px; color: #37516f; font-size: 15px; line-height: 1.65; }
.bpp-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.bpp-badges span { padding: 5px 9px; border: 1px solid; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 1.2; }
.bpp-badges .is-developer { border-color: #a8cbff; background: #eaf3ff; color: #1767ec; }
.bpp-badges .is-cocreation { border-color: #b4e9cb; background: #eefff5; color: #228c57; }
.bpp-badges .is-membership { border-color: #ffd6a9; background: #fff7ed; color: #d97706; }
.bpp-badges .is-level { border-color: #c3d4ff; background: #f1f5ff; color: #4d63dc; }
.bpp-badges .is-honor { border-color: #dfc7ff; background: #fbf6ff; color: #8650d8; }

.bpp-role-line { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 11px; color: #526782; font-size: 13px; }
.bpp-role-line i { margin-right: 5px; color: #4b7fc2; }
.bpp-stats { display: flex; margin-top: 19px; }
.bpp-stats > div { min-width: 104px; padding: 0 21px; border-left: 1px solid #d7e4f2; }
.bpp-stats > div:first-child { padding-left: 0; border-left: 0; }
.bpp-stats strong, .bpp-stats span { display: block; }
.bpp-stats strong { color: #142846; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bpp-stats span { margin-top: 5px; color: #71839e; font-size: 12px; }

.bpp-follow .bpp-follow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  min-height: 44px;
  padding: 0 20px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--bpp-blue) !important;
  box-shadow: 0 8px 18px rgba(25, 103, 242, .21);
  color: #fff !important;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease;
}

.bpp-follow .bpp-follow-button:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(25, 103, 242, .26); }
.bpp-content {
  overflow: clip;
  isolation: isolate;
  margin-top: 20px;
  border: 1px solid var(--bpp-line);
  border-radius: 16px;
  background: var(--bpp-surface);
  box-shadow: var(--bpp-shadow);
}

.bpp-tabs {
  display: flex;
  gap: 0;
  padding: 0 18px;
  overflow-x: hidden;
  overflow-y: hidden;
  border-bottom: 1px solid var(--bpp-line);
  background: #fff;
}

.bpp-tabs a {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 18px;
  color: #61728c;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.bpp-tabs a > i { color: #77869a; font-size: 16px; }
.bpp-tabs a:hover, .bpp-tabs a.is-active { color: var(--bpp-blue); }
.bpp-tabs a:hover > i, .bpp-tabs a.is-active > i { color: var(--bpp-blue); }
.bpp-tabs a:focus-visible { outline: 2px solid var(--bpp-blue); outline-offset: -5px; }
.bpp-tabs a.is-active::after { position: absolute; right: 27%; bottom: -1px; left: 27%; height: 3px; border-radius: 3px 3px 0 0; background: var(--bpp-blue); content: ""; }

.bpp-panel-body { display: grid; gap: 36px; padding: 30px; }

.bpp-section {
  scroll-margin-top: 82px;
  min-width: 0;
}

.bpp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--bpp-line); }
.bpp-section-title { display: flex; align-items: center; gap: 10px; }
.bpp-section-title > i { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: #edf5ff; color: var(--bpp-blue); font-size: 16px; }
.bpp-section-title h2 { margin: 0; color: var(--bpp-ink); font-size: 19px; font-weight: 800; }
.bpp-more-link { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; min-height: 32px; color: #667d9a; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.bpp-more-link:hover { color: var(--bpp-blue); }
.bpp-more-link i { color: var(--bpp-blue); font-size: 16px; }

.bpp-project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.bpp-project-grid .bpm-card { min-width: 0; min-height: 322px; height: 100%; }
.bpp-project-grid .bpm-card--compact { display: block; }
.bpp-project-grid .bpm-card--compact .bpm-cover { height: auto; aspect-ratio: 1.48; }
.bpp-project-grid .bpm-card--compact .bpm-card-body { min-height: 168px; padding: 14px; }
.bpp-project-grid .bpm-card--compact .bpm-card h3 { margin-top: 9px; font-size: 16px; }
.bpp-project-grid .bpm-card--compact .bpm-card p { font-size: 12px; line-height: 1.65; }
.bpp-project-grid .bpm-card--compact .bpm-foot strong { font-size: 16px; }
.bpp-project-grid .bpm-card--compact .bpm-foot a { min-height: 32px; padding: 0 11px; }
.bpp-resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.bpp-resource-grid .bz2-card { min-width: 0; }

.bpp-resource-grid .bz2-resource-card.is-profile { display: flex; min-height: 190px; overflow: hidden; border: 1px solid #e1eaf6; border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(49, 81, 130, .035); }
.bpp-resource-grid .bz2-resource-cover { width: 118px; min-width: 118px; min-height: 100%; height: auto; aspect-ratio: auto; border-radius: 0; }
.bpp-resource-grid .bz2-resource-body { padding: 14px 15px 13px; }
.bpp-resource-grid .bz2-resource-type { min-height: 22px; padding: 2px 7px; border-radius: 5px; font-size: 11px; line-height: 18px; }
.bpp-resource-grid .bz2-resource-body h3 { min-height: 0; margin-top: 7px; font-size: 15px; line-height: 1.45; }
.bpp-resource-grid .bz2-resource-capabilities, .bpp-resource-grid .bz2-resource-scenarios { display: none; }
.bpp-resource-grid .bz2-resource-body > p { min-height: 0; margin: 7px 0 0; font-size: 12px; line-height: 1.58; -webkit-line-clamp: 2; }
.bpp-resource-grid .bz2-profile-metrics { display: flex; align-items: center; gap: 12px; margin-top: 9px; color: #8a9ab0; font-size: 11px; font-variant-numeric: tabular-nums; }
.bpp-resource-grid .bz2-profile-metrics i { margin-right: 4px; color: #6e8bb1; }
.bpp-resource-grid .bz2-card-actions { width: auto; margin-top: 9px; padding-top: 0; }
.bpp-resource-grid .bz2-card-actions a { display: inline-flex; width: auto; min-height: 28px; padding: 5px 10px; border: 1px solid #c7dbfa; border-radius: 6px; background: #fff; color: var(--bpp-blue); font-size: 12px; }
.bpp-resource-grid .bz2-card-actions a:hover { background: #edf5ff; box-shadow: none; }

.bpp-resource-fallback { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 14px; padding: 13px; border: 1px solid #e1eaf6; border-radius: 11px; background: #fff; }
.bpp-resource-fallback-cover { display: flex; align-items: center; justify-content: center; min-height: 105px; overflow: hidden; border-radius: 8px; background: #edf5ff; color: var(--bpp-blue); font-weight: 800; }
.bpp-resource-fallback-cover img { width: 100%; height: 100%; object-fit: cover; }
.bpp-resource-fallback span { color: #5c8fe4; font-size: 12px; font-weight: 700; }
.bpp-resource-fallback h3 { margin: 5px 0; color: #203756; font-size: 15px; line-height: 1.45; }
.bpp-resource-fallback p { margin: 0; color: #71819a; font-size: 12px; line-height: 1.6; }
.bpp-card-link { display: inline-block; margin-top: 8px; color: var(--bpp-blue); font-size: 12px; font-weight: 700; }

.bpp-article-list { display: grid; grid-template-columns: 1fr; gap: 0; }
.bpp-article-list article { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 16px; min-height: 116px; padding: 14px 0; border-bottom: 1px solid #edf1f5; }
.bpp-article-list article.is-without-thumbnail { grid-template-columns: minmax(0, 1fr); }
.bpp-article-list img { width: 148px; height: 96px; border-radius: 9px; object-fit: cover; }
.bpp-article-list h3 { display: -webkit-box; overflow: hidden; margin: 0; color: #1c3150; font-size: 16px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bpp-article-list p { display: -webkit-box; overflow: hidden; margin: 6px 0; color: #71819a; font-size: 13px; line-height: 1.58; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bpp-article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 13px; color: #90a0b4; font-size: 12px; }
.bpp-article-meta i { margin-right: 4px; color: #7891b2; }

.bpp-lower-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, .98fr); gap: 32px; align-items: start; }
.bpp-honor-panel { overflow: hidden; border: 1px solid #e2eaf5; border-radius: 12px; background: linear-gradient(180deg, #fbfdff 0, #fff 62%); }
.bpp-honor-summary, .bpp-medals { padding: 19px 20px; background: transparent; }
.bpp-honor-status { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #e8eef6; }
.bpp-honor-status > i { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: #eaf3ff; color: var(--bpp-blue); font-size: 18px; }
.bpp-honor-status strong, .bpp-honor-status span { display: block; }
.bpp-honor-status strong { color: #203756; font-size: 16px; }
.bpp-honor-status span { margin-top: 3px; color: #8290a3; font-size: 12px; }
.bpp-honor-summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 14px 0 0; }
.bpp-honor-summary dl > div { min-width: 0; padding: 0; }
.bpp-honor-summary dt { color: #8290a3; font-size: 12px; font-weight: 400; }
.bpp-honor-summary dd { overflow: hidden; margin: 4px 0 0; color: #315b96; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.bpp-medals { border-top: 1px solid #e8eef6; }
.bpp-medals h3 { margin: 0; color: #1d3352; font-size: 15px; }
.bpp-medals > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.bpp-medals article { text-align: center; }
.bpp-medals img, .bpp-medals article > i { display: block; width: 46px; height: 46px; margin: 0 auto 7px; border-radius: 50%; color: #e6a510; font-size: 36px; line-height: 46px; object-fit: contain; }
.bpp-medals strong, .bpp-medals small { display: block; }
.bpp-medals strong { overflow: hidden; color: #40536e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bpp-medals small { margin-top: 4px; color: #7f5ed0; font-size: 11px; }
.bpp-medals > p { margin: 15px 0 0; color: #75859b; font-size: 13px; }
.bpp-honor-panel.is-tab { display: grid; grid-template-columns: minmax(300px, .86fr) minmax(0, 1.34fr); }
.bpp-honor-panel.is-tab .bpp-medals { border-top: 0; border-left: 1px solid #e8eef6; }

.bpp-empty { margin: 0; padding: 0; color: #8a98aa; font-size: 13px; line-height: 1.55; }
.bpp-list-view .bpp-article-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; }
.bpp-pagination { margin-top: 28px; }
.bpp-pagination .page-numbers { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.bpp-pagination a, .bpp-pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; padding: 0 10px; border: 1px solid #dbe6f3; border-radius: 7px; background: #fff; color: #5d7391; font-size: 13px; font-weight: 700; text-decoration: none; }
.bpp-pagination .current { border-color: var(--bpp-blue); background: var(--bpp-blue); color: #fff; }
.bpp-pagination a:hover { border-color: #92b9fa; color: var(--bpp-blue); }

.baize-public-profile-unavailable { min-height: 45vh; padding: 58px 0; background: #f7faff; }
.baize-public-profile-unavailable section { max-width: 680px; margin: 0 auto; padding: 36px; border: 1px solid #dfe8f4; border-radius: 12px; background: #fff; box-shadow: 0 10px 26px rgba(35, 80, 143, .06); text-align: center; }
.baize-public-profile-unavailable h1 { margin: 0; color: #203552; font-size: 23px; }
.baize-public-profile-unavailable p { margin: 12px 0 22px; color: #71819a; }
.baize-public-profile-unavailable a { color: var(--bpp-blue, #1967f2); font-weight: 700; }

@media (max-width: 1120px) {
  .bpp-hero-content { padding-right: 32px; padding-left: 32px; }
  .bpp-project-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .bpp-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bpp-tabs a { padding: 0 18px; }
  .bpp-lower-grid { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .95fr); gap: 26px; }
}

@media (max-width: 920px) {
  .bpp-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .bpp-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bpp-lower-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 760px) {
  .baize-public-profile { padding: 14px 0 42px; }
  .bpp-shell { width: min(var(--baize-shell-max, 1400px), calc(100% - 28px)) !important; }
  .bpp-hero { min-height: 0; border-radius: 14px; }
  .bpp-cover { height: 166px; }
  .bpp-cover > span { background: linear-gradient(180deg, rgba(246, 251, 255, .24) 0%, rgba(247, 252, 255, .96) 78%); }
  .bpp-hero-content { display: flex; min-height: 0; flex-direction: column; align-items: flex-start; gap: 14px; padding: 82px 18px 22px; }
  .bpp-avatar { width: 108px; height: 108px; }
  .bpp-identity h1 { font-size: 28px; }
  .bpp-identity > p { font-size: 14px; }
  .bpp-role-line { gap: 8px 13px; }
  .bpp-stats { width: 100%; overflow-x: auto; }
  .bpp-stats > div { min-width: 88px; padding: 0 14px; }
  .bpp-follow { width: 100%; }
  .bpp-follow .bpp-follow-button { width: 100%; }
  .bpp-content { margin-top: 14px; border-radius: 12px; }
  .bpp-tabs { gap: 0; padding: 0 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; }
  .bpp-tabs::-webkit-scrollbar { display: none; }
  .bpp-tabs a { flex: 0 0 auto; min-height: 54px; padding: 0 13px; font-size: 13px; }
  .bpp-tabs a > i { font-size: 15px; }
  .bpp-tabs a.is-active::after { right: 20%; left: 20%; }
  .bpp-panel-body { gap: 28px; padding: 20px 14px 24px; }
  .bpp-section { scroll-margin-top: 66px; }
  .bpp-section-head { gap: 12px; margin-bottom: 16px; padding-bottom: 12px; }
  .bpp-section-title h2 { font-size: 18px; }
  .bpp-more-link { font-size: 12px; }
  .bpp-project-grid, .bpp-resource-grid, .bpp-article-list, .bpp-honor-panel, .bpp-lower-grid, .bpp-list-view .bpp-article-list { grid-template-columns: 1fr; }
  .bpp-project-grid .bpm-card { min-height: 0; }
  .bpp-project-grid .bpm-card--compact { display: grid; grid-template-columns: 124px minmax(0, 1fr); }
  .bpp-project-grid .bpm-card--compact .bpm-cover { height: 100%; aspect-ratio: auto; }
  .bpp-resource-grid .bz2-resource-card.is-profile { display: grid; grid-template-columns: 106px minmax(0, 1fr); min-height: 172px; }
  .bpp-resource-grid .bz2-resource-cover { width: auto; min-width: 0; min-height: 100%; height: 100%; }
  .bpp-article-list { gap: 0; }
  .bpp-article-list article { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
  .bpp-article-list img { width: 104px; height: 74px; }
  .bpp-medals > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bpp-honor-summary dl { grid-template-columns: 1fr; }
  .bpp-honor-summary dl > div:nth-child(-n+2) { border-top: 1px solid #edf2f7; }
  .bpp-honor-summary dl > div:first-child { border-top: 0; }
  .bpp-honor-panel.is-tab .bpp-medals { border-top: 1px solid #e8eef6; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) { .bpp-follow .bpp-follow-button { transition: none; } }
