/* 电脑端布局：保留原站配色、字体和组件，拉开宽屏空间 */

.desktop-nav,
.home-stage,
.map-sidebar,
.map-detail,
.home-count,
.home-stage-link {
  display: none;
}

html,
body {
  overflow-x: hidden;
}

.leaflet-container {
  width: 100% !important;
  max-width: 100%;
}

.brand {
  color: inherit;
  text-decoration: none;
}

@media (min-width: 720px) {
  body {
    padding: 0 !important;
  }

  .app-shell {
    width: 100% !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .app-shell.map-app-shell,
  .app-shell.register-shell {
    width: 100% !important;
  }
}

@media (min-width: 900px) {
  :root {
    --desktop-gutter: clamp(24px, 4vw, 56px);
    --desktop-topbar: 72px;
    --desktop-max: 1280px;
    --campus-gold: #d4b27c;
  }

  body {
    background:
      radial-gradient(1200px 480px at 12% -10%, rgba(22, 127, 95, 0.14), transparent 58%),
      radial-gradient(900px 420px at 92% 0%, rgba(49, 91, 185, 0.12), transparent 60%),
      var(--bg);
  }

  .topbar {
    position: sticky;
    min-height: var(--desktop-topbar);
    padding: 14px var(--desktop-gutter);
    gap: 24px;
    background: rgba(247, 248, 251, 0.88);
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

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

  .brand-copy span {
    font-size: 13px;
  }

  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }

  .nav-link {
    border-radius: 999px;
    padding: 8px 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
  }

  .nav-link.is-active {
    background: rgba(22, 127, 95, 0.1);
    color: var(--primary-dark);
  }

  .nav-link:hover {
    background: rgba(23, 32, 51, 0.05);
    color: var(--text);
  }

  .topbar-actions {
    margin-left: 0;
  }

  .topbar-actions .nav-pill {
    min-height: 40px;
    padding: 8px 16px;
  }

  .screen {
    width: min(100%, var(--desktop-max));
    margin: 0 auto;
    padding: 28px var(--desktop-gutter) 48px;
  }

  h1 {
    max-width: 14em;
    font-size: clamp(40px, 4.6vw, 64px);
  }

  .button {
    width: auto;
    min-width: 168px;
  }

  /* —— 首页 —— */
  .home-shell {
    overflow: hidden !important;
  }

  .home-shell .topbar {
    background: rgba(245, 249, 251, 0.78);
  }

  .home-shell .screen {
    display: grid;
    grid-template-columns: minmax(420px, 540px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "intro stage"
      "actions stage";
    align-items: stretch;
    column-gap: 48px;
    row-gap: 8px;
    width: min(100%, 1320px);
    min-height: calc(100vh - var(--desktop-topbar));
    padding-top: 28px;
    padding-bottom: 40px;
  }

  .home-shell .screen::before {
    display: none;
  }

  .home-shell .home-intro {
    grid-area: intro;
    justify-items: start;
    align-content: end;
    min-height: 0;
    padding: 12px 0 0;
    text-align: left;
  }

  .home-shell .home-mapline {
    display: none;
  }

  .home-stage {
    display: grid;
    grid-area: stage;
    align-self: stretch;
    min-width: 0;
    min-height: 560px;
    padding: 8px 0;
  }

  .home-shell .home-actions {
    grid-area: actions;
    align-self: start;
    width: 100%;
    max-width: 520px;
    margin-top: 8px;
  }

  .home-shell h1 {
    max-width: 8.2em;
    color: #0b263d;
    font-size: clamp(40px, 4.2vw, 58px);
    white-space: normal;
  }

  .home-subtitle {
    max-width: 22em;
    text-align: left;
    font-size: 18px;
  }

  .home-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    border: 1px solid rgba(22, 127, 95, 0.16);
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 750;
  }

  .home-count::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(22, 127, 95, 0.16);
  }

  .home-shell .home-action {
    min-height: 64px;
    border-radius: 16px;
    font-size: 18px;
  }

  .home-stage-card {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-height: 100%;
    overflow: hidden;
    border: 1px solid rgba(217, 225, 234, 0.9);
    border-radius: 28px;
    background: #eef3f6;
    box-shadow: 0 28px 80px rgba(23, 32, 51, 0.16);
  }

  .home-stage-label {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1100;
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
  }

  .home-preview-map,
  .home-preview-map.leaflet-container {
    min-width: 0;
    min-height: 0;
    height: 100% !important;
  }

  .home-stage-link {
    display: inline-flex;
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 1100;
    align-items: center;
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    padding: 0 14px;
    background: rgba(7, 26, 61, 0.86);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
  }

  .home-preview-map .leaflet-control-attribution {
    display: none;
  }

  /* —— 校友地图 —— */
  .map-app-shell {
    height: 100vh;
    overflow: hidden;
    background: #e8eef3;
  }

  .map-app-shell .topbar {
    z-index: 600;
  }

  .map-app-shell .screen {
    width: 100%;
    max-width: none;
    height: calc(100vh - var(--desktop-topbar));
    min-height: calc(100vh - var(--desktop-topbar));
    padding: 0;
    display: block;
  }

  .alumni-map-panel {
    position: relative;
    display: block;
    height: 100%;
    min-height: 100%;
    gap: 0;
  }

  .map-workspace {
    position: relative;
    height: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .map-app-shell .map-panel-header,
  .map-app-shell .alumni-map-panel > .alumni-map-actions,
  .map-app-shell .alumni-map-panel > .location-status {
    display: none;
  }

  .alumni-map-shell {
    position: absolute;
    inset: 0;
    height: 100%;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .map-sidebar {
    position: absolute;
    top: 16px;
    left: 16px;
    bottom: 16px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(360px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    padding: 18px 16px 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 22px 60px rgba(23, 32, 51, 0.16);
    backdrop-filter: blur(18px);
  }

  .map-sidebar-head {
    display: grid;
    gap: 8px;
    padding: 0 4px;
  }

  .map-sidebar-head h2 {
    font-size: 26px;
  }

  .map-sidebar .map-count,
  .alumni-map-count {
    justify-self: start;
  }

  .map-search input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
  }

  .year-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .year-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }

  .year-chip.is-active {
    border-color: rgba(22, 127, 95, 0.3);
    background: rgba(22, 127, 95, 0.12);
    color: var(--primary-dark);
  }

  .alumni-list {
    display: grid;
    flex: 1;
    gap: 8px;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
  }

  .alumni-list-empty {
    padding: 18px 8px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
  }

  .alumni-list-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 8px;
    background: transparent;
    color: inherit;
    text-align: left;
  }

  .alumni-list-item img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    background: #d9e1ea;
  }

  .alumni-list-item span {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .alumni-list-item strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .alumni-list-item small {
    color: var(--muted);
    font-size: 12px;
  }

  .alumni-list-item:hover,
  .alumni-list-item.is-active {
    border-color: rgba(22, 127, 95, 0.18);
    background: rgba(22, 127, 95, 0.08);
  }

  .map-sidebar-actions .home-action {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
  }

  .map-sidebar-status {
    min-height: 0;
    color: var(--muted);
    font-size: 12px;
  }

  .map-detail {
    position: absolute;
    top: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 500;
    display: none;
    flex-direction: column;
    gap: 14px;
    width: min(400px, calc(100vw - 408px));
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 22px 60px rgba(23, 32, 51, 0.16);
    backdrop-filter: blur(18px);
  }

  .map-detail:not([hidden]) {
    display: flex;
  }

  .map-detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--muted);
    font-size: 18px;
  }

  .map-detail-hero {
    overflow: hidden;
    border-radius: 18px;
    background: #0b263d;
  }

  .map-detail-hero img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
  }

  .map-detail-hero .map-detail-hero-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    font-weight: 700;
  }

  .map-detail-profile {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
  }

  .map-detail-profile img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
  }

  .map-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
  }

  .map-detail-moment {
    color: #344054;
    font-size: 14px;
    line-height: 1.7;
  }

  .map-app-shell .leaflet-top.leaflet-left {
    top: 12px;
    left: 408px;
  }

  .map-app-shell .leaflet-bottom.leaflet-right {
    right: 16px;
    margin-bottom: 8px;
  }

  .map-app-shell .leaflet-control-zoom {
    border: 0 !important;
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.14);
  }

  .register-shell.app-shell {
    overflow: visible !important;
  }

  .register-shell .topbar-actions {
    display: none;
  }

  .register-shell .screen {
    width: min(100%, 1180px);
    padding-top: 20px;
    padding-bottom: 108px;
  }

  .register-shell .intro {
    padding-top: 8px;
  }

  .register-shell .intro h1 {
    max-width: none;
    font-size: 42px;
  }

  .register-shell .stepper {
    grid-template-columns: repeat(2, minmax(140px, 200px));
    max-width: 440px;
  }

  .register-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 1.15fr);
    grid-template-areas:
      "fields map"
      "avatar map";
    gap: 22px 28px;
    align-items: start;
  }

  .register-split > .form-grid {
    grid-area: fields;
  }

  .register-split > .form-grid > .field:nth-child(3) {
    grid-column: 1 / -1;
  }

  .register-map-col {
    grid-area: map;
  }

  .register-avatar-col {
    grid-area: avatar;
  }

  .register-shell .location-map-shell {
    min-height: 380px;
    height: 440px;
    border-radius: 18px;
  }

  .moment-split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 22px;
    align-items: start;
  }

  .register-shell .photo-upload {
    min-height: 360px;
  }

  .register-shell .form-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0;
    padding: 16px var(--desktop-gutter) 20px;
    background: linear-gradient(180deg, transparent, rgba(247, 251, 255, 0.96) 36%);
  }

  .register-shell .form-actions.is-first,
  .register-shell .form-actions.is-middle,
  .register-shell .form-actions.is-last {
    grid-template-columns: none;
  }

  .register-shell .button {
    width: auto;
    min-width: 168px;
  }

  .poster-preview-shell {
    width: min(100%, 380px);
  }

  /* —— 资料页 —— */
  .profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 24px;
    align-items: start;
  }

  .profile-welcome-title {
    font-size: 44px;
    white-space: normal;
  }

  .profile-cta {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .profile-poster-summary .poster-preview-shell {
    width: min(100%, 380px);
  }
}

@media (min-width: 900px) and (hover: hover) {
  .nav-link,
  .year-chip,
  .alumni-list-item,
  .home-stage-link,
  .map-detail-close {
    transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
  }

  .home-stage-link:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 899px) {
  .home-shell h1 {
    white-space: normal;
  }

  .register-split,
  .moment-split,
  .moment-photo-col,
  .register-avatar-col,
  .register-map-col,
  .profile-layout {
    display: contents;
  }

  .map-workspace {
    display: contents;
  }
}
