/* ============================================================
   account-redesign.css
   心语客服台 · 账号 / 到期 / 余额 卡片全新 UI
   仅重新设计版式与视觉，保留原有配色（蓝 #1677ff + 琥珀金 + 状态色）
   通过 JS 给 .info-card 加上 .acc-redesigned 后生效，Vue 安全
   ============================================================ */

/* ---- 容器：由堆叠三行 → 顶部账号头 + 左右两个统计瓦片 ---- */
.info-card.acc-redesigned {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas: "header header" "expire balance";
  gap: 12px;
  padding: 16px 16px 18px !important;
  box-sizing: border-box;
  animation: acc-card-in .5s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes acc-card-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* 删除顶部横条彩线（含原 app.css 的 1px 渐变 + 重塑版的 3px 渐变） */
.info-card.acc-redesigned::before {
  content: none !important;
  display: none !important;
  height: 0 !important;
  background: none !important;
}

/* 清除原 info-row 默认行内边框，统一交给网格控制 */
.info-card.acc-redesigned > .info-row {
  border-bottom: none !important;
  border-radius: 18px !important;
  box-sizing: border-box;
}

/* ============================================================
   账号头部行
   ============================================================ */
.info-card.acc-redesigned > .acc-row-account {
  grid-area: header;
  display: flex !important;
  align-items: center;
  gap: 13px;
  padding: 6px 12px 14px !important;
  min-height: auto !important;
  border-bottom: 1px solid rgba(18, 31, 54, .07) !important;
  border-radius: 0 !important;
}

/* 头像圆（可点击上传） */
.acc-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #1677ff 0%, #6aa8ff 50%, #c79a35 130%);
  box-shadow: 0 6px 16px rgba(22, 119, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .5);
  flex-shrink: 0;
  cursor: pointer;
  transition: box-shadow .18s ease, transform .18s ease;
}
.acc-avatar:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(22, 119, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.acc-avatar:active { transform: scale(.96); }
.acc-avatar svg { width: 24px; height: 24px; }
.acc-avatar .acc-avatar-default { transition: opacity .15s ease; }

/* 上传后的真实头像图片 */
.acc-avatar .acc-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.acc-avatar.has-img { background: none !important; box-shadow: 0 6px 16px rgba(22, 119, 255, .28); }
.acc-avatar.has-img .acc-avatar-default { opacity: 0; }
.acc-avatar.has-img .acc-avatar-img { display: block; }

/* 悬浮相机遮罩提示上传 */
.acc-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .42) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5A2.5 2.5 0 0 1 5.5 6h2l1.2-1.6a1 1 0 0 1 .8-.4h3a1 1 0 0 1 .8.4L15.5 6h2A2.5 2.5 0 0 1 20 8.5v8A2.5 2.5 0 0 1 17.5 19h-11A2.5 2.5 0 0 1 4 16.5z'/><circle cx='12' cy='12.5' r='3.2'/></svg>") center/18px 18px no-repeat;
  opacity: 0;
  transition: opacity .15s ease;
}
.acc-avatar:hover::after { opacity: 1; }
.acc-avatar.has-img:hover::after { opacity: 1; }

/* 上传中转圈 */
.acc-avatar.uploading::after {
  opacity: 1;
  background: rgba(0, 0, 0, .42) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round'><path d='M12 3a9 9 0 1 0 9 9'/></svg>") center/18px 18px no-repeat;
  animation: acc-spin .8s linear infinite;
}
@keyframes acc-spin { to { transform: rotate(360deg); } }

/* 账号文字栈（label + value）用伪包装：靠 flex 自然堆叠 */
.info-card.acc-redesigned > .acc-row-account .info-label {
  width: auto !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 1.5px !important;
  color: #9aa4b5 !important;
  margin: 0 0 1px !important;
  order: 2;
}
.info-card.acc-redesigned > .acc-row-account .acc-account-value {
  order: 3;
  font-size: 17px !important;
  font-weight: 800 !important;
  letter-spacing: .4px;
  color: #1f2937 !important;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 头像占 order1，文字占 order2/3，角色徽标推到最右 */
.info-card.acc-redesigned > .acc-row-account .acc-role-tag {
  order: 9;
  margin-left: auto;
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #1677ff !important;
  background: rgba(22, 119, 255, .09) !important;
  border: 1px solid rgba(22, 119, 255, .18);
  white-space: nowrap;
}
/* 头部不再需要箭头 */
.info-card.acc-redesigned > .acc-row-account .arrow { display: none !important; }

/* ============================================================
   统计瓦片（到期 / 余额）通用
   ============================================================ */
.info-card.acc-redesigned > .acc-row-expire,
.info-card.acc-redesigned > .acc-row-balance {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "icon label arrow"
    "value value arrow"
    "badge badge arrow";
  gap: 3px 10px;
  padding: 15px 15px 14px !important;
  min-height: auto !important;
  border: 1px solid rgba(18, 31, 54, .06) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(248, 250, 253, .5)) !important;
  box-shadow: 0 6px 16px rgba(24, 45, 83, .05) !important;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.info-card.acc-redesigned > .acc-row-expire:hover,
.info-card.acc-redesigned > .acc-row-balance:hover {
  transform: translateY(-3px);
  border-color: rgba(22, 119, 255, .22) !important;
  box-shadow: 0 12px 26px rgba(24, 45, 83, .10) !important;
}
.info-card.acc-redesigned > .acc-row-expire:active,
.info-card.acc-redesigned > .acc-row-balance:active {
  transform: scale(.975) !important;
}

/* 图标格 */
.acc-tile-icon {
  grid-area: icon;
  align-self: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.acc-tile-icon svg { width: 21px; height: 21px; }
.acc-icon-expire { color: #c79a35; background: linear-gradient(135deg, #fff8e4, #ffefc4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.acc-icon-balance { color: #1677ff; background: linear-gradient(135deg, #eef4ff, #dbe8ff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }

/* 瓦片标题（到期：/余额：） */
.info-card.acc-redesigned > .acc-row-expire .info-label,
.info-card.acc-redesigned > .acc-row-balance .info-label {
  grid-area: label;
  align-self: center;
  width: auto !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 1.2px !important;
  color: #9aa4b5 !important;
}

/* 主数值 */
.info-card.acc-redesigned .acc-expire-date {
  grid-area: value;
  font-size: 14px !important;
  font-weight: 750;
  color: #202734 !important;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info-card.acc-redesigned .acc-balance-value {
  grid-area: value;
  font-size: 20px !important;
  font-weight: 850 !important;
  letter-spacing: .2px;
  color: #1677ff !important;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 底部状态条（到期徽标 / 充值提示） */
.info-card.acc-redesigned .acc-row-expire .expire-days {
  grid-area: badge;
  align-self: start;
  margin-right: 0 !important;
  margin-top: 2px;
}
.info-card.acc-redesigned .acc-row-balance .refresh-hint {
  grid-area: badge;
  align-self: start;
  margin-right: 0 !important;
  margin-top: 3px;
  font-size: 12px !important;
  color: #9aa4b5 !important;
  font-weight: 600;
}

/* 箭头居右垂直居中 */
.info-card.acc-redesigned > .acc-row-expire .arrow,
.info-card.acc-redesigned > .acc-row-balance .arrow {
  grid-area: arrow;
  align-self: center;
  color: #c3c8d2 !important;
  font-size: 22px !important;
  font-weight: 300;
  transition: transform .18s ease;
}
.info-card.acc-redesigned > .acc-row-expire:hover .arrow,
.info-card.acc-redesigned > .acc-row-balance:hover .arrow { transform: translateX(3px); }

/* ============================================================
   桌面端：面板较窄时瓦片仍保持两列
   ============================================================ */
.desktop-home-scroll .info-card.acc-redesigned { padding: 14px 14px 16px !important; }

/* ============================================================
   极窄屏：两瓦片纵向堆叠，保证可读
   ============================================================ */
@media (max-width: 359px) {
  .info-card.acc-redesigned {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "expire" "balance";
  }
}

/* ============================================================
   桌面首页面板较窄（默认 340px）时，瓦片纵向堆叠，
   避免日期 / 余额被截断。用容器查询响应面板实际宽度。
   ============================================================ */
.desktop-home-scroll { container-type: inline-size; }
@container (max-width: 400px) {
  .info-card.acc-redesigned {
    grid-template-columns: 1fr !important;
    grid-template-areas: "header" "expire" "balance" !important;
  }
}

/* ============================================================
   状态色：保留原配色，仅微调阴影使其在瓦片内更融合
   ============================================================ */
.info-card.acc-redesigned .expire-days.expire-normal  { box-shadow: 0 6px 14px rgba(39, 174, 96, .14) !important; }
.info-card.acc-redesigned .expire-days.expire-warning { box-shadow: 0 6px 14px rgba(180, 107, 0, .14) !important; }
.info-card.acc-redesigned .expire-days.expire-critical,
.info-card.acc-redesigned .expire-days.expire-expired { box-shadow: 0 6px 14px rgba(199, 53, 34, .14) !important; }

/* ============================================================
   点击到期 / 余额瓦片的提示弹层
   ============================================================ */
.acc-tip-layer {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  padding-top: 18vh;
  pointer-events: none;
  animation: acc-tip-in .28s cubic-bezier(.2, .7, .2, 1) both;
}
.acc-tip-layer.acc-tip-out { animation: acc-tip-out .22s ease both; }
@keyframes acc-tip-in {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes acc-tip-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-10px); }
}
.acc-tip-box {
  pointer-events: auto;
  max-width: 86vw;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1677ff 0%, #6aa8ff 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .4px;
  line-height: 1.4;
  box-shadow: 0 12px 32px rgba(22, 119, 255, .32), 0 2px 8px rgba(0, 0, 0, .08);
}
.acc-tip-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .22);
}
.acc-tip-icon svg { width: 20px; height: 20px; }
.acc-tip-text { flex: 1; }
.acc-tip-text strong { font-weight: 800; }

/* ============================================================
   TG 频道通知块：金色 → 页面渐变色（蓝/灰底）
   与 .page-wrapper 背景保持一致，去除金色边框 / 金色光晕 / 金色标题
   ============================================================ */
.tg-notice[data-v-cc0fe95a],
.tg-notice[data-v-fa2b0e12] {
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .84)) !important;
  border: 1px solid var(--mzd-border) !important;
  box-shadow: var(--mzd-shadow) !important;
}
/* 去除右上角金色光晕 */
.tg-notice[data-v-cc0fe95a]::after,
.tg-notice[data-v-fa2b0e12]::after {
  display: none !important;
  content: none !important;
}
/* 标题由金色 → 深墨蓝，与页面整体文字色调统一 */
.tg-title[data-v-cc0fe95a],
.tg-title[data-v-fa2b0e12] {
  color: var(--mzd-ink) !important;
}
