/* 프로필 (내 프로필 / 유저 프로필 공용) — 플랫 다크 */

.profile-banner {
  position: relative;
  padding-top: calc(var(--nav-h) + 18px);
  width: 100%;
  overflow: hidden;
}

/* 메인 페이지 배너와 동일한 그라데이션 + 시그니처 섀도 */
.profile-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #B24A4780 0%, #FFA17880 45%, #99614820 100%);
}

.profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/static/images/ui/Banner_signature_shadow.svg");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
  pointer-events: none;
}

.profile-banner > * { position: relative; z-index: 1; }

/* 배너 위 텍스트는 밝게 */
.profile-banner .profile-intro { color: rgba(255, 255, 255, 0.85); }
.profile-banner .fallow-info button { color: rgba(255, 255, 255, 0.78); }
.profile-banner .fallow-info button .cnt { color: #ffffff; }
.profile-banner .profile-tabs { border-bottom-color: rgba(255, 255, 255, 0.25); }

.profile-main { position: relative; padding-bottom: 10px; }

.profile-image-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto;
}

.profile-image-wrap > img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.profile-edit-btn {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-edit-btn:hover { background: var(--surface-3); }

.profile-edit-btn img {
  width: 14px;
  height: 14px;
  filter: invert(1);
}

.profile-nickname {
  text-align: center;
  font-size: 22px;
  margin: 12px 0 2px;
  color: var(--text);
}

.profile-intro {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  margin: 4px auto 0;
  max-width: 280px;
  line-height: 1.5;
  word-break: break-word;
}

.fallow-info {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.fallow-info button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.fallow-info button:hover { background: var(--surface); color: var(--text); }
.fallow-info button .cnt { color: var(--text); font-weight: 700; }

.follow-btn { margin: 12px auto 0; display: flex; }

/* 프로필 탭 */
.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-top: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.profile-tabs .tab-btn {
  position: relative;
  flex: 1 0 auto;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.profile-tabs .tab-btn { color: rgba(255, 255, 255, 0.72); }

.profile-tabs .tab-btn.active {
  color: #ffffff;
  font-weight: 700;
}

.profile-tabs .tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: #ffffff;
}

.tab-content { padding: 18px 16px calc(var(--bottom-nav-h) + 40px); }

.tab-count {
  font-size: 13px;
  color: var(--text-faint);
  margin: 0 0 14px;
}

/* 캐릭터 리스트 카드 */
.char-item { align-items: flex-start; padding: 12px; }

.char-item .thumb {
  width: 64px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.char-item .sub { -webkit-line-clamp: 2; white-space: normal; }

.char-item .side-action {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
}

.char-item .side-action img { width: 24px; height: 24px; }
.char-item .edit img { filter: invert(1); opacity: 0.7; }
.char-item .edit:hover img { opacity: 1; }

/* 계정 탭 */
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--border);
}

.account-row .k { font-size: 14px; font-weight: 700; color: var(--text); }
.account-row .v { font-size: 14px; color: var(--text-dim); }
.account-row .v.accent { color: var(--accent); font-weight: 700; }

.account-actions { margin-top: 24px; display: grid; gap: 10px; }

/* 페르소나 탭 */
.persona-selected-badge { flex-shrink: 0; }

.persona-add-form { margin-top: 24px; }

/* 팔로우 리스트 */
.follow-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 10px;
}

.follow-user { padding: 10px 12px; }

/* 프로필 수정 바텀시트 */
.profile-edit-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.profile-edit-modal.show { display: flex; opacity: 1; }
.profile-edit-modal.closing { display: flex; opacity: 0; }

.profile-edit-backdrop { position: absolute; inset: 0; }

.profile-edit-panel {
  position: relative;
  width: 100%;
  max-width: 37.5rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 28px 18px calc(28px + env(safe-area-inset-bottom));
  z-index: 1;
  max-height: 86vh;
  min-height: 60vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.profile-edit-modal.show .profile-edit-panel { transform: translateY(0); }
.profile-edit-modal.closing .profile-edit-panel { transform: translateY(100%); }

.profile-edit-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  cursor: grab;
  touch-action: none;
}

.profile-edit-handle:active { cursor: grabbing; }
body.profile-modal-open { overflow: hidden; }

.profile-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.profile-edit-header h2 { font-size: 17px; margin: 0; color: var(--text); }

.profile-edit-avatar {
  display: grid;
  place-items: center;
  margin: 4px 0 16px;
}

.profile-edit-avatar img {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--border);
}

.profile-edit-form input[type="file"] {
  font-size: 13px;
  color: var(--text-dim);
}

.profile-edit-form input[type="file"]::file-selector-button {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 10px;
}

.intro-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: -8px;
  margin-bottom: 10px;
}
