/* ============================================================
   账户页（我的 / 消息 / 卖账号）
   ============================================================ */

body.account {
  background: #f3f5f9;
}

.ac-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  background: #fff;
}

.ac-nav__back {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 44px;
  color: var(--kr-blue-500);
}

.ac-nav__back svg {
  width: 22px;
  height: 22px;
}

.ac-nav__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text);
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.ac-main {
  padding: 12px 12px 64px;
}

/* ---------- 个人信息 ---------- */
.ac-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #f2f5ff, #fff 60%);
  box-shadow: var(--shadow-card);
}

.ac-avatar {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
}

.ac-profile__info {
  flex: 1;
  min-width: 0;
}

.ac-phone {
  color: var(--color-text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .3px;
}

.ac-sub {
  margin-top: 4px;
  color: var(--color-text-weak);
  font-size: 12px;
}

.ac-state {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--kr-blue-100);
  color: var(--kr-blue-500);
  font-size: 11px;
}

/* ---------- 菜单 ---------- */
.ac-card {
  margin-top: 12px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.ac-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
}

.ac-row + .ac-row {
  position: relative;
}

.ac-row + .ac-row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 14px;
  left: 14px;
  height: 1px;
  background: var(--color-line);
  transform: scaleY(.5);
  transform-origin: 0 0;
}

.ac-row__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--kr-blue-100);
  color: var(--kr-blue-500);
}

.ac-row__icon svg {
  width: 17px;
  height: 17px;
}

.ac-row__text {
  flex: 1;
  color: var(--color-text);
  font-size: 15px;
}

.ac-chev {
  width: 14px;
  height: 14px;
  color: #c8ccd6;
}

/* ---------- 退出 ---------- */
.ac-logout {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 24px;
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--color-price);
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--shadow-card);
}


/* ---------- 空状态 ---------- */
.ac-empty {
  padding: 70px 24px 0;
  text-align: center;
}

.ac-empty__img {
  width: 76px;
  height: 76px;
  margin: 0 auto;
  color: #ccd5f2;
}

.ac-empty__title {
  margin-top: 18px;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 500;
}

.ac-empty__desc {
  margin-top: 8px;
  color: var(--color-text-weak);
  font-size: 12px;
  line-height: 1.6;
}

.ac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin-top: 22px;
  padding: 0 22px;
  border-radius: 19px;
  background: var(--kr-blue-500);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 14px rgba(84, 104, 255, .26);
}

@media (hover: hover) {
  .ac-row:hover .ac-row__text {
    color: var(--kr-blue-500);
  }

  .ac-btn:hover {
    background: #7587ff;
  }

  .ac-logout:hover {
    background: #fff5f5;
  }
}

/* ---------- 客服会话 ---------- */
.chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 170px);
  min-height: 320px;
}

.chat__scroll {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
  overflow-y: auto;
}

.chat__hint {
  margin: auto;
  padding: 0 24px;
  color: #a6acbb;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.chat__row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.chat__row.is-user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat__row.is-agent {
  align-self: flex-start;
  align-items: flex-start;
}

.chat__bubble {
  white-space: pre-line;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(31, 45, 96, .04);
}

.is-user .chat__bubble {
  border-bottom-right-radius: 4px;
  background: #5468ff;
  color: #fff;
}

.is-agent .chat__bubble {
  border-bottom-left-radius: 4px;
}

.chat__row time {
  margin-top: 4px;
  color: #b3b8c4;
  font-size: 10px;
}

.chat__bar {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #eef0f5;
}

.chat__bar input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e3e7f0;
  border-radius: 10px;
  outline: 0;
  background: #fff;
  font-size: 14px;
}

.chat__bar input:focus {
  border-color: #5468ff;
}

.chat__bar button {
  width: 64px;
  border: 0;
  border-radius: 10px;
  background: #5468ff;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.chat__bar button:disabled {
  opacity: .6;
}

/* ============================================================
   我的 / 消息列表
   ============================================================ */

.me-top {
  position: relative;
  margin: -12px -12px 0;
  padding: 26px 16px 46px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef2fb, #f3f5f9);
}

.me-top::after {
  content: "";
  position: absolute;
  top: -8px;
  right: -22px;
  width: 190px;
  height: 190px;
  opacity: .06;
  background: url("https://www.kejinshou.com/app-nuxt/image/home/home-top-logo.png") center / contain no-repeat;
}

.me-profile {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.me-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #dfe6ff;
}

.me-name {
  color: #1f2430;
  font-size: 17px;
  font-weight: 600;
}

.me-id {
  margin-top: 4px;
  color: #9aa0ae;
  font-size: 12px;
}

.me-quick {
  position: relative;
  z-index: 2;
  display: flex;
  margin-top: -30px;
  padding: 14px 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.me-quick a {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #4a5060;
  font-size: 12px;
}

.me-quick a + a {
  border-left: 1px solid #f0f2f7;
}

.me-quick svg {
  width: 18px;
  height: 18px;
  color: #3d4452;
}

.me-card {
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.me-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 4px;
}

.me-card__head b {
  color: #1f2430;
  font-size: 14px;
  font-weight: 600;
}

.me-card__head span {
  color: #c3c8d4;
  font-size: 11px;
}

.me-trade {
  display: flex;
  padding: 8px 0 16px;
}

.me-trade__item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #4a5060;
  font-size: 12px;
}

.me-trade__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f5f7fc;
}

.me-trade__icon svg {
  width: 19px;
  height: 19px;
}

.me-trade__icon.is-red { background: #fff0f1; color: #ff5a5f; }
.me-trade__icon.is-orange { background: #fff5e9; color: #ff9f2e; }
.me-trade__icon.is-blue { background: #edf4ff; color: #3b82f6; }
.me-trade__icon.is-indigo { background: #eef0ff; color: #5468ff; }

.me-rows {
  padding: 0;
}

.me-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  color: #333;
  font-size: 14px;
}

.me-row + .me-row {
  position: relative;
}

.me-row + .me-row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 14px;
  left: 44px;
  height: 1px;
  background: #f0f2f7;
  transform: scaleY(.5);
  transform-origin: 0 0;
}

.me-row__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #6b7280;
}

.me-row__icon svg {
  width: 18px;
  height: 18px;
}

.me-row__text {
  flex: 1;
}

.me-row__hint {
  margin-right: 4px;
  color: #a6acbb;
  font-size: 11px;
}

.me-chev {
  width: 14px;
  height: 14px;
  color: #ccd1dc;
}

.me-logout {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 20px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #e5484d;
  font-size: 14px;
}

.me-logout:disabled {
  opacity: .5;
}

/* ---------- 消息列表 ---------- */
.ml {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ml-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.ml-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
}

.ml-icon svg {
  width: 22px;
  height: 22px;
}

.ml-icon--bell { background: linear-gradient(145deg, #7b8bff, #5468ff); }
.ml-icon--qa { background: linear-gradient(145deg, #64c8ff, #2f8bff); }
.ml-icon--tag { background: linear-gradient(145deg, #9b8bff, #5468ff); }
.ml-icon--kf { overflow: hidden; border: 1px solid #eef0f5; background: #fff; }
.ml-icon--kf img { width: 100%; height: 100%; object-fit: cover; }

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

.ml-title {
  color: #333;
  font-size: 15px;
  font-weight: 500;
}

.ml-desc {
  margin-top: 4px;
  overflow: hidden;
  color: #b3b8c4;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ml-desc.is-strong {
  color: #8a90a0;
}

.ml-time {
  align-self: flex-start;
  color: #b3b8c4;
  font-size: 11px;
  white-space: nowrap;
}

.ml-dot {
  position: absolute;
  top: 12px;
  left: 46px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ff3b30;
}

/* ---------- 客服会话返回 ---------- */
.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 8px;
  color: #8a90a0;
  font-size: 12px;
}

.chat__head a {
  color: #5468ff;
}

/* ---------- 底栏未读角标 ---------- */
.tabbar__badge {
  position: absolute;
  top: 4px;
  left: 50%;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

/* ---------- 入群卡片 / 表单 ---------- */
.chat-card {
  width: 240px;
  padding: 12px;
  border: 1px solid #dfe5f5;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  box-shadow: 0 2px 8px rgba(31, 45, 96, .05);
}

.chat-card__title {
  color: #1f2430;
  font-size: 14px;
  font-weight: 600;
}

.chat-card__desc {
  margin-top: 6px;
  color: #8a90a0;
  font-size: 12px;
  line-height: 1.5;
}

.chat-card__group {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eef1ff;
  color: #5468ff;
  font-size: 11px;
}

.chat-card__btn {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: #5468ff;
  color: #fff;
  font-size: 13px;
}

.chat__bubble--form {
  line-height: 1.6;
}

.chat-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, .45);
}

.chat-modal {
  width: 300px;
  max-width: 86vw;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
}

.chat-modal h3 {
  margin-bottom: 14px;
  color: #1f2430;
  font-size: 16px;
  font-weight: 600;
}

.chat-modal label {
  display: block;
  margin-bottom: 12px;
  color: #666;
  font-size: 12px;
}

.chat-modal select,
.chat-modal input {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid #e3e7f0;
  border-radius: 9px;
  background: #fff;
  color: #333;
  font-size: 14px;
  outline: 0;
}

.chat-modal__btns {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.chat-modal__btns button {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 9px;
  font-size: 14px;
}

#formCancel { background: #f1f3f9; color: #666; }
#formSubmit { background: #5468ff; color: #fff; }
#formSubmit:disabled { opacity: .6; }

.chat-card__ok {
  display: inline-block;
  margin-top: 8px;
  color: #2f9e5b;
  font-size: 12px;
}

.chat-card__btn--ghost {
  margin-top: 8px;
  background: #f1f3f9;
  color: #5468ff;
}

.chat__bubble--status {
  background: #eaf8ef;
  color: #2f9e5b;
  font-size: 12px;
}

/* ---------- 端内群聊 ---------- */
.group {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 170px);
  min-height: 320px;
}

.group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 10px;
}

.group__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group__title b {
  color: #1f2430;
  font-size: 15px;
}

.group__role {
  padding: 2px 8px;
  border-radius: 10px;
  background: #eef1ff;
  color: #5468ff;
  font-size: 11px;
}

.group__role.is-agent {
  background: #eaf8ef;
  color: #2f9e5b;
}

.group__count {
  color: #a6acbb;
  font-size: 12px;
}

.group__sys {
  align-self: center;
  color: #b3b8c4;
  font-size: 11px;
  text-align: center;
}

.chat__name {
  margin-bottom: 4px;
  color: #a6acbb;
  font-size: 10px;
}

.ml-icon--group {
  background: linear-gradient(145deg, #7bd0a8, #2f9e5b);
}

.ml-badge {
  align-self: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.chat__row.is-left {
  align-self: flex-start;
  align-items: flex-start;
}

.chat__row.is-left time {
  text-align: left;
}

.chat__row {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  max-width: 86%;
}

.chat__row.is-left {
  align-self: flex-start;
  align-items: flex-start;
}

.chat__avatar {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef1ff;
  color: #5468ff;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
}

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

.chat__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}

.chat__row time {
  text-align: left;
}

.chat__row.is-user {
  flex-direction: row-reverse;
  align-self: flex-end;
  align-items: flex-start;
}

.chat__row.is-user .chat__main {
  align-items: flex-end;
}

.chat__row.is-user time {
  text-align: right;
}

.chat__row.is-user .chat__bubble {
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 12px;
}

.chat__read {
  margin-left: 6px;
  color: #9aa1b2;
  font-size: 10px;
}

.chat-trade {
  width: 100%;
  max-width: 300px;
  align-self: center;
  margin: 6px 0;
  padding: 14px;
  border: 1px solid #e3e7f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(31, 45, 96, .06);
}

.chat-trade__title {
  color: #1f2430;
  font-size: 15px;
  font-weight: 600;
}

.chat-trade__desc {
  white-space: pre-line;
  margin-top: 6px;
  color: #8a90a0;
  font-size: 12px;
  line-height: 1.5;
}

.chat-trade__btn {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 12px;
  border: 0;
  border-radius: 9px;
  background: #5468ff;
  color: #fff;
  font-size: 14px;
}

.chat-trade__ok {
  display: inline-block;
  margin-top: 10px;
  color: #2f9e5b;
  font-size: 12px;
}

.chat-info {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e8ebf5;
}

.chat-info div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.9;
}

.chat-info span { color: #8a90a0; }
.chat-info b { color: #1f2430; font-weight: 500; word-break: break-all; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 400;
  max-width: 70vw;
  padding: 9px 16px;
  border-radius: 18px;
  background: rgba(24, 28, 40, .86);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

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

.ml-official {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #5468ff;
  border-radius: 5px;
  color: #5468ff;
  font-size: 10px;
  line-height: 1.5;
  vertical-align: middle;
}

.sell {
  padding: 4px 0 20px;
}

.sell__head h2 {
  color: #1f2430;
  font-size: 20px;
  font-weight: 700;
}

.sell__head p {
  margin-top: 6px;
  color: #8a90a0;
  font-size: 12px;
}

.sell-form {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
}

.sell-row {
  display: block;
  margin-bottom: 14px;
  color: #666;
  font-size: 12px;
}

.sell-row input,
.sell-row select,
.sell-row textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid #e3e7f0;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font-size: 14px;
  outline: 0;
}

.sell-row input,
.sell-row select {
  height: 42px;
}

.sell-row textarea {
  padding: 10px 12px;
  line-height: 1.5;
  resize: none;
}

.sell-submit {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: #5468ff;
  color: #fff;
  font-size: 15px;
}

.sell-submit:disabled {
  opacity: .6;
}

.bought {
  padding: 4px 0 20px;
}

.bought-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: #fff;
}

.bought-tabs button {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8a90a0;
  font-size: 14px;
}

.bought-tabs button.is-active {
  background: #f2f4fa;
  color: #1f2430;
  font-weight: 600;
}

.bought-status {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.bought-status button {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #8a90a0;
  font-size: 13px;
}

.bought-status button.is-active {
  background: #eef1ff;
  color: #5468ff;
  font-weight: 600;
}

.bought-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0 40px;
}

.bought-empty img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .5;
}

.bought-empty p {
  margin-top: 14px;
  color: #b3b8c4;
  font-size: 13px;
}
