/* 我的页面 · me.css
 * 依赖 brand-tokens.css 的设计变量；仅负责本页布局，不改动全站样式。
 */

.me-body {
  background: var(--color-surface-2);
}

.me-main {
  min-height: 62vh;
  padding: 26px 20px 56px;
}

.me-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 类选择器的 display 会盖掉 [hidden] 的 UA 规则，未登录时会露出空资料卡与全 0 统计，必须显式兜底 */
.me-shell[hidden] {
  display: none;
}

/* ---------- L1-A 资料区 ---------- */

.me-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raise);
  overflow: hidden;
}

/* 横幅文案顶对齐，给下方留出头像压边的空间，避免头像遮住文案 */
.me-banner {
  height: 96px;
  padding: 16px 26px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
  color: #fff;
  background: linear-gradient(112deg, var(--color-brand-grad-start), var(--color-brand-grad-end));
  position: relative;
  overflow: hidden;
}

.me-banner::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -78px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 30px solid rgba(255, 255, 255, .12);
}

.me-banner-kicker {
  font-size: 10.5px;
  letter-spacing: .16em;
  font-weight: 500;
  opacity: .9;
}

.me-banner-sub {
  font-size: 13px;
  opacity: .95;
}

/* 只让头像上提压住横幅底边；昵称与徽标必须留在白底上，否则深色字压宝蓝底不可读 */
.me-profile-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 0 26px 22px;
  position: relative;
  z-index: 1;
}

.me-avatar {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  margin-top: -34px;
  border-radius: 50%;
  border: 3px solid var(--color-surface);
  background: var(--color-brand-soft);
  color: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
  overflow: hidden;
}

.me-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-profile-id {
  flex: 1;
  min-width: 0;
  padding-top: 8px;
}

.me-name {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-uid {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-text-3);
  font-variant-numeric: tabular-nums;
}

.me-profile-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 8px;
}

.me-chip {
  font-size: 11.5px;
  color: var(--color-text-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  white-space: nowrap;
}

.me-chip b {
  color: var(--color-brand);
  font-weight: 500;
}

.me-nick-btn {
  font: inherit;
  font-size: 11.5px;
  color: var(--color-brand);
  background: transparent;
  border: 1px solid var(--color-brand-border-hover);
  border-radius: var(--radius-full);
  padding: 4px 11px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.me-nick-btn:hover {
  background: var(--color-brand-soft);
}

.me-nick-form {
  padding: 0 26px 22px;
  border-top: 1px dashed var(--color-border);
  margin-top: 2px;
  padding-top: 16px;
}

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

.me-nick-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.me-nick-input {
  flex: 1 1 220px;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

.me-nick-input:focus {
  outline: 2px solid var(--color-brand-soft);
  border-color: var(--color-brand-border-hover);
}

.me-nick-tip {
  margin: 9px 0 0;
  font-size: 11.5px;
  color: var(--color-text-3);
}

.me-nick-tip.is-error { color: var(--color-danger); }
.me-nick-tip.is-ok { color: var(--color-success); }

.me-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}

.me-btn-primary {
  background: var(--color-brand);
  color: #fff;
}

.me-btn-primary:hover { background: var(--color-brand-hover); }

.me-btn-ghost {
  background: transparent;
  color: var(--color-text-2);
  border-color: var(--color-border);
}

.me-btn-ghost:hover {
  color: var(--color-brand);
  border-color: var(--color-brand-border-hover);
}

.me-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* ---------- L1-B 概览区 ---------- */

.me-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-raise);
}

.me-stat {
  font: inherit;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  padding: 8px 4px 9px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}

button.me-stat:hover {
  background: var(--color-brand-soft);
  border-color: var(--color-brand-border-hover);
  transform: translateY(-1px);
}

/* 不可跳转的统计格：与可点格保持同一视觉重量，靠「无 hover 反应」区分，
   不能用底色填充——填充会让不可点格看起来比可点格更突出，语义相反 */
.me-stat-plain {
  cursor: default;
  background: transparent;
  border-color: transparent;
}

.me-stat b {
  display: block;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.me-stat span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--color-text-2);
}

.me-stat em {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  font-style: normal;
  color: var(--color-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- L1-C 分类区 ---------- */

.me-filter {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-raise);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.me-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.me-tabs::-webkit-scrollbar { display: none; }

.me-tab {
  font: inherit;
  font-size: 13.5px;
  color: var(--color-text-2);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 14px 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

.me-tab span {
  font-size: 11px;
  color: var(--color-text-3);
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}

.me-tab.is-active {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
  font-weight: 500;
}

.me-tab.is-active span { color: var(--color-brand); }

.me-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.me-chips::-webkit-scrollbar { display: none; }

.me-chip-btn {
  font: inherit;
  font-size: 12px;
  color: var(--color-text-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.me-chip-btn span {
  margin-left: 4px;
  color: var(--color-text-3);
  font-variant-numeric: tabular-nums;
}

.me-chip-btn.is-active {
  background: var(--color-brand-soft);
  color: var(--color-brand);
  border-color: var(--color-brand-border-hover);
}

.me-chip-btn.is-active span { color: var(--color-brand); }

/* ---------- L1-D 列表区 ---------- */

.me-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raise);
  overflow: hidden;
}

.me-panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--color-border);
}

.me-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.me-panel-note {
  font-size: 11.5px;
  color: var(--color-text-3);
}

.me-list {
  display: flex;
  flex-direction: column;
}

.me-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  transition: background .15s;
}

.me-row:last-child { border-bottom: 0; }
.me-row:hover { background: var(--color-surface-2); }

.me-row.is-muted .me-row-media,
.me-row.is-muted .me-row-title,
.me-row.is-muted .me-row-meta {
  opacity: .58;
}

.me-row-media {
  position: relative;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--color-text-3);
  text-decoration: none;
}

.me-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-row-ph { font-size: 18px; }

.me-row-badge {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 9.5px;
  line-height: 1;
  padding: 3px 4px;
  color: #fff;
  background: rgba(20, 22, 30, .62);
  border-top-right-radius: 4px;
  letter-spacing: .02em;
}

.me-row-body {
  flex: 1;
  min-width: 0;
}

.me-row-title {
  display: block;
  font-size: 13.5px;
  color: var(--color-text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-row-title:hover { color: var(--color-brand); }

.me-row-meta {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--color-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-row-state {
  margin: 6px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.me-pill {
  font-size: 10.5px;
  color: var(--color-fav);
  background: rgba(186, 117, 23, .1);
  border: 1px solid rgba(186, 117, 23, .22);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  white-space: nowrap;
}

.me-flag {
  font-size: 10.5px;
  color: var(--color-text-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  white-space: nowrap;
}

.me-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.me-row-btn {
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-2);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}

.me-row-btn:hover {
  color: var(--color-brand);
  border-color: var(--color-brand-border-hover);
  background: var(--color-brand-soft);
}

.me-row-btn:disabled { opacity: .55; cursor: not-allowed; }

.me-row-btn-ghost { border-color: transparent; background: transparent; }

/* 空态 */

.me-empty {
  padding: 46px 20px 50px;
  text-align: center;
}

.me-empty-ico {
  font-size: 26px;
  color: var(--color-brand-border-hover);
  line-height: 1;
}

.me-empty-t {
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--color-text);
}

.me-empty-s {
  margin: 6px 0 16px;
  font-size: 12px;
  color: var(--color-text-3);
}

.me-list-foot {
  padding: 12px 18px 16px;
  text-align: center;
}

.me-more {
  font: inherit;
  font-size: 12.5px;
  color: var(--color-brand);
  background: var(--color-brand-soft);
  border: 1px solid var(--color-brand-border-hover);
  border-radius: var(--radius-full);
  padding: 8px 20px;
  cursor: pointer;
}

.me-end {
  margin: 0;
  font-size: 11.5px;
  color: var(--color-text-3);
}

.me-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 6px 0 0;
}

/* ---------- L1-E 状态区 ---------- */

.me-gate {
  width: min(560px, 100%);
  margin: 40px auto;
}

.me-gate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raise);
  padding: 34px 26px 32px;
  text-align: center;
}

.me-gate-ico {
  font-size: 26px;
  color: var(--color-brand);
  line-height: 1;
}

.me-gate-t {
  margin: 14px 0 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
}

.me-gate-s {
  margin: 8px 0 20px;
  font-size: 12.5px;
  color: var(--color-text-2);
  line-height: 1.65;
}

.me-gate-link {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--color-text-3);
  text-decoration: none;
}

.me-gate-link:hover { color: var(--color-brand); }

.me-skel {
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  animation: me-pulse 1.2s ease-in-out infinite;
}

.me-skel-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 0 auto 18px;
}

.me-skel-line {
  height: 14px;
  margin: 0 auto 10px;
  width: 70%;
}

.me-skel-line.short { width: 42%; }
.me-skel-box { height: 120px; margin-top: 20px; }

@keyframes me-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  .me-skel { animation: none; }
  .me-row, .me-stat, .me-tab, .me-chip-btn, .me-btn { transition: none; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 760px) {
  .me-main { padding: 16px 12px 44px; }

  .me-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px; }

  .me-profile-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 0 16px 18px;
  }

  .me-avatar { width: 54px; height: 54px; flex-basis: 54px; font-size: 21px; margin-top: -30px; }

  .me-profile-id { padding-top: 6px; }

  .me-profile-badges {
    width: 100%;
    justify-content: flex-start;
    padding-top: 0;
  }

  .me-banner { height: 86px; padding: 14px 16px; }

  .me-nick-form { padding-left: 16px; padding-right: 16px; }

  .me-row { padding: 11px 13px; gap: 10px; }

  .me-row-actions { flex-direction: column; gap: 6px; }

  .me-row-btn { padding: 6px 9px; font-size: 11px; }

  .me-panel-head { padding: 13px 13px 10px; }

  .me-panel-note { display: none; }

  .me-empty { padding: 38px 16px 40px; }
}
