/* =========================================================
 * 小王桌游站 · 个人中心 2.0 样式（#modal-profile.pf2）
 * ========================================================= */

#modal-profile.pf2 .modal-card.pf-card {
  width: min(600px, 100%);
  max-width: 600px;
  padding: 0;
  overflow: hidden;
  background: #fff !important;
  color: #1d1b29;
  font-size: 14px;
}
#modal-profile.pf2 .hidden { display: none !important; }

/* 头部 */
.pf2 .pf-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 56px 18px 22px;
  background:
    radial-gradient(360px 160px at 100% 0%, rgba(242, 196, 122, .35), transparent 60%),
    linear-gradient(128deg, #241e5c, #4a39c9);
  color: #fff;
}
.pf2 .pf-avatar {
  position: relative;
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5);
  cursor: pointer;
}
.pf2 .pf-avatar #avatar-preview {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 34px;
  border-radius: 20px;
  overflow: hidden;
  background: none;
  border: 0;
  margin: 0;
}
.pf2 .pf-avatar #avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.pf2 .pf-avatar-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f2b04f;
  color: #2a1d05;
  font-size: 12px;
  box-shadow: 0 0 0 2px #3b2f9a;
}
.pf2 .pf-who { flex: 1; min-width: 0; }
.pf2 .pf-name-row { display: flex; align-items: center; gap: 6px; }
.pf2 .pf-name { font-size: 21px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf2 .pf-name.empty { opacity: .7; font-weight: 600; }
.pf2 .pf-head .pf-icon-btn { color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .12); border-color: transparent; }
.pf2 .pf-head .pf-icon-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.pf2 .pf-nick-edit { display: flex; gap: 8px; margin: 8px 0 2px; }
.pf2 .pf-nick-edit #profile-nick {
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 10px;
  border: 0;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  color: #1d1b29;
  margin: 0;
}
.pf2 .pf-nick-edit #btn-profile-save { height: 36px; border-radius: 10px; padding: 0 16px; background: #f2b04f; border: 0; color: #2a1d05; font-weight: 700; }
.pf2 .pf-status { margin-top: 6px; font-size: 12.5px; color: rgba(236, 233, 255, .85); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pf2 .pf-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 11.5px; font-weight: 700; color: #fff; }
.pf2 .pf-badge.ok { background: #9ff0c6; color: #0f4d31; }
.pf2 .pf-head .pf-link { color: #ffe0a6; }
.pf2 .pf-close.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.pf2 .pf-close.modal-close:hover { background: rgba(255, 255, 255, .26); }

/* 头像选择 */
.pf2 .pf-avatar-sheet { padding: 14px 22px; background: #f7f5fe; border-bottom: 1px solid #ece9f7; }
.pf2 .pf-avatar-sheet .profile-block { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.pf2 .pf-avatar-sheet .profile-label { display: none; }
.pf2 .pf-avatar-sheet #avatar-preview { display: none; }

/* 标签 */
.pf2 .pf-tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid #eeebe5; background: #fff; }
.pf2 .pf-tab {
  position: relative;
  border: 0;
  background: none;
  padding: 10px 14px 12px;
  font: inherit;
  font-weight: 700;
  color: #827d8b;
  cursor: pointer;
}
.pf2 .pf-tab.on { color: #1d1b29; }
.pf2 .pf-tab.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: #4c3fd3; }
.pf2 .pf-pane { display: none; padding: 18px 22px 24px; max-height: min(62vh, 620px); overflow: auto; }
.pf2 .pf-pane.on { display: block; }

/* 通用 */
.pf2 .pf-sec-title { font-weight: 800; font-size: 13.5px; color: #45414f; margin: 18px 0 10px; }
.pf2 .pf-sec-title:first-child { margin-top: 0; }
.pf2 .pf-empty { color: #8a8592; font-size: 13px; padding: 10px 2px; }
.pf2 .pf-link { border: 0; background: none; padding: 0; color: #4c3fd3; font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pf2 .pf-icon-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid #ebe7e0;
  background: #fff;
  color: #6d6877;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.pf2 .pf-icon-btn:hover:not(:disabled) { border-color: #4c3fd3; color: #4c3fd3; }
.pf2 .pf-icon-btn:disabled { opacity: .35; cursor: default; }
.pf2 .pf-icon-btn.danger:hover { border-color: #c4432f; color: #c4432f; }
.pf2 .pf-input {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #e7e3dc;
  padding: 0 14px;
  font: inherit;
  outline: none;
  background: #fbfaf8;
}
.pf2 .pf-input.small { width: auto; flex: 1; min-width: 120px; height: 34px; }
.pf2 .pf-input:focus { border-color: #4c3fd3; background: #fff; box-shadow: 0 0 0 3px rgba(76, 63, 211, .14); }
.pf2 .pf-chip-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #f2f0fc; font-size: 17px; }
.pf2 .pf-chip-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf2 .pf-chip-sub { font-size: 11.5px; color: #8a8592; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 概况 */
.pf2 .pf-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.pf2 .pf-kpi { padding: 12px 8px; border-radius: 14px; background: #f7f5f1; text-align: center; }
.pf2 .pf-kpi-v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pf2 .pf-kpi-l { font-size: 12px; color: #8a8592; margin-top: 2px; }
.pf2 .pf-chip-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pf2 .pf-game-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #ece8e1;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  min-width: 0;
  transition: border-color .15s, transform .15s;
}
.pf2 .pf-game-chip:hover { border-color: #cdc8f3; transform: translateY(-1px); }
.pf2 .pf-chip-text { display: flex; flex-direction: column; min-width: 0; }

/* 收藏 */
.pf2 .pf-results { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 4px; }
.pf2 .pf-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #ece8e1;
  background: #fff;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.pf2 .pf-result:hover { border-color: #4c3fd3; }
.pf2 .pf-result .pf-chip-name { flex: 1; }
.pf2 .pf-add { color: #4c3fd3; font-weight: 700; font-size: 12.5px; }
.pf2 .pf-fav-list { display: flex; flex-direction: column; gap: 6px; }
.pf2 .pf-fav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid #eeebe5;
  background: #fff;
  transition: box-shadow .15s;
}
.pf2 .pf-fav-row.dragging { opacity: .45; }
.pf2 .pf-fav-row.drop-before { box-shadow: 0 -3px 0 #4c3fd3; }
.pf2 .pf-fav-row.drop-after { box-shadow: 0 3px 0 #4c3fd3; }
.pf2 .pf-handle { flex: none; width: 18px; color: #b8b3c0; cursor: grab; letter-spacing: -2px; user-select: none; touch-action: none; text-align: center; }
.pf2 .pf-fav-name { flex: 1; min-width: 0; height: 32px; border: 1px solid transparent; border-radius: 8px; padding: 0 8px; font: inherit; font-weight: 700; background: transparent; outline: none; }
.pf2 .pf-fav-name::placeholder { color: #1d1b29; opacity: 1; }
.pf2 .pf-fav-name:hover { border-color: #ebe7e0; }
.pf2 .pf-fav-name:focus { border-color: #4c3fd3; background: #fff; }
.pf2 .pf-fav-name:focus::placeholder { color: #aaa; }

/* 战绩 */
.pf2 .pf-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.pf2 .pf-seg { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid #ebe7e0; background: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: #45414f; }
.pf2 .pf-seg.on { background: #1d1b29; border-color: #1d1b29; color: #fff; }
.pf2 .pf-hist { display: flex; flex-direction: column; }
.pf2 .pf-hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #f2efea; }
.pf2 .pf-hist-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pf2 .pf-hist-time { flex: none; font-size: 12px; color: #8a8592; font-variant-numeric: tabular-nums; }
.pf2 .pf-res { flex: none; width: 36px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: #f0ede8; color: #6d6877; }
.pf2 .pf-res.win { background: #e3f4ea; color: #1f8f5c; }
.pf2 .pf-res.loss { background: #fbe9e5; color: #c4432f; }
.pf2 .pf-res.draw { background: #fdf3e2; color: #a8721f; }
.pf2 .pf-more { margin: 10px auto 0; display: block; height: 34px; padding: 0 18px; border-radius: 999px; border: 1px dashed #cdc8f3; background: #f7f6fe; color: #4c3fd3; font: inherit; font-weight: 700; cursor: pointer; }
.pf2 .pf-stat-table { border: 1px solid #eeebe5; border-radius: 12px; overflow: hidden; }
.pf2 .pf-stat-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 44px 56px; gap: 8px; padding: 8px 12px; border-top: 1px solid #f2efea; font-size: 13px; font-variant-numeric: tabular-nums; }
.pf2 .pf-stat-row span:not(:first-child) { text-align: right; }
.pf2 .pf-stat-row.head { border-top: 0; background: #faf9f7; color: #8a8592; font-weight: 700; font-size: 12px; }
.pf2 .pf-stat-game { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

/* 账号 */
.pf2 .pf-account-intro { color: #6d6877; font-size: 13px; line-height: 1.7; margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; background: #f7f5f1; }
.pf2 .pf-pane[data-tab="account"] .profile-block { border: 0; background: none; box-shadow: none; padding: 0; margin: 0; }
.pf2 .pf-pane[data-tab="account"] .profile-label { font-weight: 800; font-size: 14px; margin-bottom: 10px; color: #1d1b29; }
.pf2 .pf-pane[data-tab="account"] .rf-input { width: 100%; height: 42px; border-radius: 12px; margin-bottom: 10px; font-size: 15px; }
.pf2 .pf-pane[data-tab="account"] .btn.primary { height: 44px; border-radius: 12px; background: #4c3fd3; border-color: #4c3fd3; font-size: 15px; }
.pf2 .pf-pane[data-tab="account"] .profile-hint { color: #8a8592; font-size: 12.5px; margin-top: 8px; }
.pf2 #auth-logged-mini { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: static; padding: 0; border: 0; background: none; }
.pf2 #auth-logged-mini.hidden { display: none !important; }
.pf2 #auth-logged-mini .auth-mini-line { flex: 1 1 100%; font-weight: 700; font-size: 14px; color: #1d1b29; margin-bottom: 4px; }
.pf2 #auth-logged-mini .rf-input { flex: 1; min-width: 160px; height: 38px; margin: 0; }
.pf2 #auth-logged-mini .btn { height: 38px; border-radius: 10px; padding: 0 14px; }

@media (max-width: 640px) {
  #modal-profile.pf2 { align-items: stretch; }
  #modal-profile.pf2 .modal-card.pf-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 92vh;
    max-height: 92dvh;
  }
  .pf2 .pf-head, .pf2 .pf-avatar-sheet, .pf2 .pf-tabs { flex: 0 0 auto; }
  .pf2 .pf-head { padding: 18px 50px 14px 16px; gap: 12px; }
  .pf2 .pf-avatar { width: 56px; height: 56px; border-radius: 16px; }
  .pf2 .pf-avatar #avatar-preview { border-radius: 16px; font-size: 28px; }
  .pf2 .pf-name { font-size: 18px; }
  .pf2 .pf-tabs { padding: 6px 8px 0; overflow-x: auto; }
  .pf2 .pf-tab { padding: 10px 12px 12px; }
  .pf2 .pf-pane {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 14px 14px 22px;
  }
  .pf2 .pf-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf2 .pf-chip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf2 .pf-fav-row .pf-icon-btn:not(.danger) { display: none; }
}

/* 收藏 · 勾选游戏 */
.pf2 .pf-pick-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.pf2 .pf-select { height: 34px; border-radius: 10px; border: 1px solid #e7e3dc; padding: 0 10px; font: inherit; font-size: 13px; background: #fff; max-width: 140px; }
.pf2 .pf-pick-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pf2 .pf-pick-count { flex: 1; min-width: 140px; font-size: 13px; font-weight: 700; color: #45414f; }
.pf2 .pf-seg:disabled { opacity: .45; cursor: default; }
.pf2 .pf-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.pf2 .pf-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 11px;
  border: 1px solid #ece8e1;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.pf2 .pf-pick:hover { border-color: #cdc8f3; }
.pf2 .pf-pick.on { border-color: #4c3fd3; background: #f3f1fd; }
.pf2 .pf-pick input { width: 16px; height: 16px; accent-color: #4c3fd3; flex: none; margin: 0; }
.pf2 .pf-pick .pf-chip-icon { width: 26px; height: 26px; font-size: 15px; }
.pf2 .pf-pick-name { min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .pf2 .pf-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
