:root {
  --ground: #edf1f5;
  --surface: #ffffff;
  --surface-muted: #f6f9fc;
  --ink: #20303e;
  --muted: #5f7081;
  --line: #dce3ea;
  --line-soft: #eaf0f4;
  --blue: #245aa7;
  --blue-deep: #1f4c8d;
  --blue-tint: #eef5ff;
  --red: #d94b34;
  --font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  font-family: var(--font);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

button,
input,
textarea {
  font: inherit;
}

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

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  color: #fff;
  background: var(--blue-deep);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.profile-container {
  width: 1120px;
  max-width: calc(100% - 32px);
  margin-inline: auto;
}

.profile-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 1px 0 rgba(18, 48, 91, 0.18);
}

.profile-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 50px;
}

.profile-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.profile-brand-mark {
  display: grid;
  width: 30px;
  height: 27px;
  color: var(--blue);
  background: #fff;
  border-radius: 8px 8px 8px 2px;
  font-size: 16px;
  font-weight: 700;
  place-items: center;
}

.profile-brand-name {
  font-size: 18px;
  font-weight: 700;
}

.profile-brand-en {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.profile-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.brand-url {
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.profile-main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.profile-main-nav a {
  padding: 8px 14px;
  font-size: 13px;
}

.profile-main-nav a:hover,
.profile-main-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.profile-nav-user {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin-left: auto;
  padding: 3px 9px 3px 4px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
}

.profile-nav-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  color: var(--blue);
  background: #fff;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  place-items: center;
}

.profile-main {
  padding-top: 16px;
  padding-bottom: 34px;
}

.profile-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.profile-breadcrumb a:hover {
  color: var(--blue);
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.profile-hero {
  overflow: hidden;
}

.profile-cover {
  position: relative;
  height: 146px;
  background-color: #315e80;
  background-image: url("assets/campus-sunset.svg");
  background-position: center 57%;
  background-size: cover;
}

.profile-cover::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(17, 51, 78, 0.45);
}

.profile-cover span {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.profile-identity {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 0 20px 17px;
}

.profile-avatar {
  display: grid;
  position: relative;
  z-index: 2;
  width: 92px;
  height: 92px;
  margin-top: -35px;
  color: #fff;
  background: var(--blue);
  border: 3px solid #fff;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(20, 53, 95, 0.18);
  font-size: 35px;
  font-weight: 700;
  place-items: center;
}

.profile-copy {
  min-width: 0;
  padding-top: 14px;
}

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

.profile-name-row h1 {
  overflow: hidden;
  margin: 0;
  color: #1e3448;
  font-size: 25px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-badge,
.profile-level {
  flex: none;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 18px;
}

.profile-badge {
  color: #285a96;
  background: var(--blue-tint);
  border: 1px solid #c9ddf6;
}

.profile-level {
  color: #7a5b11;
  background: #fff7dd;
  border: 1px solid #f0dfaa;
}

.profile-bio {
  max-width: 640px;
  margin: 8px 0 6px;
  color: #43596e;
  font-size: 13px;
  line-height: 1.65;
}

.profile-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.profile-actions {
  display: flex;
  gap: 8px;
  padding-top: 15px;
}

.profile-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  color: #315779;
  background: #fff;
  border: 1px solid #cbd8e5;
  border-radius: 3px;
  font-size: 12px;
  white-space: nowrap;
}

.profile-button:hover,
.profile-button:focus-visible {
  border-color: #99b5d1;
  background: #f8fbfe;
}

.profile-button.primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.profile-button.primary:hover,
.profile-button.primary:focus-visible {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.profile-button.following {
  color: #5c6e7e;
  background: #f7f9fb;
  border-color: #d8e1e9;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 20px 18px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  gap: 1px;
}

.profile-stats div {
  padding: 10px 13px;
  background: #fbfcfd;
}

.profile-stats dt {
  color: var(--muted);
  font-size: 12px;
}

.profile-stats dd {
  margin: 2px 0 0;
  color: #344d63;
  font-size: 20px;
  font-weight: 700;
}

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

.profile-activity {
  min-width: 0;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 61px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.profile-section-head h2,
.profile-side-head h2 {
  margin: 0;
  color: #253b4f;
  font-size: 16px;
}

.profile-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-tabs {
  display: flex;
  min-height: 43px;
  align-items: stretch;
  gap: 4px;
  padding: 0 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.profile-tabs button {
  position: relative;
  flex: none;
  padding: 0 12px;
  color: #526779;
  background: transparent;
  border: 0;
  font-size: 13px;
}

.profile-tabs button span {
  margin-left: 3px;
  color: #718292;
  font-size: 11px;
}

.profile-tabs button::after {
  position: absolute;
  right: 9px;
  bottom: 0;
  left: 9px;
  height: 2px;
  content: "";
  background: transparent;
}

.profile-tabs button.active {
  color: var(--blue-deep);
  font-weight: 600;
}

.profile-tabs button.active::after {
  background: var(--blue);
}

.profile-panel {
  padding: 0 16px;
}

.profile-feed-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.profile-feed-item:last-child {
  border-bottom: 0;
}

.profile-feed-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.profile-feed-head h3 {
  overflow: hidden;
  margin: 0;
  color: #28558a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-feed-head h3 a:hover {
  color: var(--red);
  text-decoration: underline;
}

.profile-category {
  flex: none;
  padding: 1px 5px;
  color: #2b609c;
  background: var(--blue-tint);
  border: 1px solid #d2e3f8;
  border-radius: 2px;
  font-size: 11px;
  line-height: 17px;
}

.profile-feed-preview {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: #526779;
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.profile-feed-count {
  display: grid;
  width: 54px;
  align-self: center;
  padding: 7px 0;
  color: #526779;
  background: var(--surface-muted);
  border: 1px solid #e2e9f0;
  border-radius: 2px;
  text-align: center;
}

.profile-feed-count b {
  color: #3c566d;
  font-size: 16px;
}

.profile-feed-count span {
  font-size: 11px;
}

.profile-reply-context {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.profile-reply-context a {
  color: #28558a;
}

.profile-reply-content {
  margin: 0;
  color: #344d63;
  font-size: 13px;
  line-height: 1.65;
}

.profile-empty {
  display: grid;
  min-height: 250px;
  padding: 36px 20px;
  place-items: center;
  text-align: center;
}

.profile-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #344d63;
  font-size: 15px;
}

.profile-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-rail {
  display: grid;
  align-self: stretch;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
}

.profile-side-card {
  overflow: hidden;
}

.profile-side-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.profile-facts {
  margin: 0;
  padding: 5px 14px 9px;
}

.profile-facts div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f4f7;
  font-size: 12px;
}

.profile-facts div:last-child {
  border-bottom: 0;
}

.profile-facts dt {
  color: var(--muted);
}

.profile-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #334c62;
  text-align: right;
}

.profile-about-card p {
  margin: 0;
  padding: 13px 14px 15px;
  color: #526779;
  font-size: 12px;
  line-height: 1.7;
}

.profile-back-link {
  display: block;
  align-self: end;
  padding: 10px 14px;
  color: #315f94;
  background: #f5f9fe;
  border: 1px solid #d8e5f4;
  border-radius: 3px;
  font-size: 12px;
  text-align: center;
}

.profile-loading,
.profile-error {
  min-height: 420px;
  padding: 60px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.profile-loading-line {
  display: block;
  width: 100%;
  height: 18px;
  margin-bottom: 12px;
  background: #eef2f6;
  border-radius: 3px;
}

.profile-loading-line.short {
  width: 32%;
  height: 28px;
}

.profile-loading-line.medium {
  width: 68%;
}

.profile-error {
  display: grid;
  align-content: center;
  justify-items: start;
}

.profile-error h2 {
  margin: 0;
  font-size: 24px;
}

.profile-error p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.profile-error > div {
  display: flex;
  gap: 8px;
}

.profile-footer {
  padding: 22px 0;
  color: var(--muted);
  background: #f8fafc;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.profile-footer .profile-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.profile-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(21, 42, 65, 0.24);
}

.profile-dialog::backdrop {
  background: rgba(18, 34, 50, 0.46);
}

.profile-edit-form {
  padding: 0 20px 20px;
}

.profile-edit-form header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -20px 18px;
  padding: 17px 20px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}

.profile-edit-form h2 {
  margin: 0;
  font-size: 19px;
}

.profile-edit-form header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-dialog-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  color: #607383;
  background: #f5f8fa;
  border: 1px solid #dfe6ed;
  border-radius: 3px;
  place-items: center;
}

.profile-dialog-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 13px 10px;
  align-items: center;
}

.profile-form-grid label {
  color: #42586b;
  font-size: 13px;
}

.profile-form-grid input,
.profile-form-grid textarea {
  width: 100%;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd9e3;
  border-radius: 3px;
  outline: 0;
}

.profile-form-grid textarea {
  resize: vertical;
}

.profile-form-grid input:focus,
.profile-form-grid textarea:focus {
  border-color: #7da3cd;
  box-shadow: 0 0 0 3px rgba(36, 90, 167, 0.1);
}

.profile-form-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #b83e2e;
  font-size: 12px;
}

.profile-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.profile-toast {
  position: fixed;
  z-index: 60;
  bottom: 24px;
  left: 50%;
  padding: 9px 14px;
  color: #fff;
  background: rgba(25, 42, 57, 0.92);
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

@media (max-width: 800px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr) 244px;
    gap: 12px;
  }

  .profile-main-nav {
    display: none;
  }
}

@media (max-width: 680px) {
  .profile-container {
    max-width: calc(100% - 32px);
  }

  .profile-nav {
    height: 48px;
  }

  .profile-brand-copy,
  .profile-nav-name {
    display: none;
  }

  .profile-brand-name {
    font-size: 16px;
  }

  .profile-nav-user {
    min-height: 32px;
    padding-right: 7px;
  }

  .profile-main {
    padding-top: 7px;
    padding-bottom: 22px;
  }

  .profile-breadcrumb {
    margin-bottom: 7px;
  }

  .profile-cover {
    height: 108px;
  }

  .profile-cover span {
    right: 12px;
    bottom: 10px;
    font-size: 11px;
  }

  .profile-identity {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 10px;
    padding: 0 12px 12px;
  }

  .profile-avatar {
    width: 66px;
    height: 66px;
    margin-top: -25px;
    font-size: 27px;
  }

  .profile-copy {
    padding-top: 10px;
  }

  .profile-name-row {
    flex-wrap: wrap;
    gap: 5px;
  }

  .profile-name-row h1 {
    max-width: 100%;
    font-size: 20px;
  }

  .profile-bio {
    margin-top: 6px;
    font-size: 12px;
  }

  .profile-meta {
    font-size: 11px;
  }

  .profile-actions {
    grid-column: 1 / -1;
    padding-top: 2px;
  }

  .profile-actions .profile-button {
    flex: 1;
    min-height: 36px;
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 12px 12px;
  }

  .profile-stats div {
    padding: 8px 10px;
  }

  .profile-stats div:last-child {
    grid-column: 1 / -1;
  }

  .profile-stats dd {
    font-size: 18px;
  }

  .profile-layout {
    display: block;
    margin-top: 8px;
  }

  .profile-section-head {
    min-height: 54px;
    padding: 9px 12px;
  }

  .profile-tabs {
    padding: 0 8px;
  }

  .profile-tabs button {
    padding-inline: 9px;
    font-size: 12px;
  }

  .profile-panel {
    padding: 0 12px;
  }

  .profile-feed-item {
    grid-template-columns: minmax(0, 1fr) 43px;
    gap: 8px;
    padding: 13px 0;
  }

  .profile-feed-head h3 {
    font-size: 13px;
  }

  .profile-feed-preview,
  .profile-reply-content {
    font-size: 12px;
  }

  .profile-feed-count {
    width: 42px;
  }

  .profile-rail {
    margin-top: 8px;
  }

  .profile-footer {
    padding: 16px 0 24px;
  }

  .profile-footer .profile-container {
    flex-direction: column;
    gap: 4px;
  }

  .profile-dialog {
    width: 100%;
    max-height: calc(100vh - 12px);
    margin-bottom: 12px;
    border-radius: 8px 8px 0 0;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .profile-form-grid label:not(:first-child) {
    margin-top: 7px;
  }

  .profile-dialog-actions .profile-button {
    flex: 1;
    min-height: 38px;
  }
}

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