/*!
 * uc.css — 用户中心三页（/home、/home/password、/uc/support）的样式薄壳
 *
 * 定位：pico.min.css + km-site.css（品牌层，绿 #12B886）+ natui.css 之上的
 * 又一层薄壳，只补用户中心自己的部件：用户卡、分区 chips、区块卡片、
 * 表格滚动壳、居中表单卡、全屏聊天骨架。
 *
 * 纪律与 natui.css 相同：
 *   ① 零 CSS 嵌套（不用 &）；
 *   ② 色值硬编码且与 km-site / natui / natcomp 同源（#12B886 品牌绿、
 *      #E5EAF0 线、#5A6472 次要文字、#1A1F2E 主文字、状态色
 *      #1a7f37 / #b45309 / #c0392b）；
 *   ③ 移动优先：默认样式即 375px 单列（Pico 按钮默认全宽 = 天然的
 *      ≥44px 触控目标），>=640px 只放宽 padding / 收窄动作区。
 *      本层无暗色分支 —— 与 km-site 公开页同一口径（body 背景已固定浅色）。
 */

/* ======================== 布局骨架 ======================== */

.uc-main {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

/* 组件模板输出的纯文字节点；仅供读屏器/锚点使用 */
.uc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ======================== 用户卡（/home 顶栏） ======================== */

.uc-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
  padding: .9rem 1rem;
  background: #fff;
  border: 1px solid #E5EAF0;
  border-left: 3px solid #12B886;   /* 左侧品牌色条，与 km-home .vs 同一手法 */
  border-radius: .9rem;
  box-shadow: 0 1px 2px rgba(13, 17, 23, .04);
}

.uc-user-top {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 0;
}

.uc-user-ava {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #12B886, #0B7A5E);  /* km-site .brand-logo 同源 */
  color: #fff;
}

.uc-user-ava svg {
  width: 1.25rem;
  height: 1.25rem;
}

.uc-user-info {
  flex: 1;
  min-width: 0;
  font-size: .95rem;
  color: #1A1F2E;
  overflow-wrap: anywhere;   /* 用户名/会话时长一行放不下时能断，不顶破卡片 */
}

/* 动作按钮：用户信息右侧竖排小按钮（覆盖 Pico 默认全宽与大内边距） */
.uc-user-actions {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: none;
  margin: 0;
}

.uc-user-actions > * {
  margin: 0;
  width: auto;
  flex: none;
  padding: .3rem .7rem;
  font-size: .82rem;
  line-height: 1.4;
}

/* ======================== 分区 chips（页内锚点，noscript 可用） ======================== */

.uc-chips {
  display: flex;
  gap: .4rem;
  margin: 0 0 .9rem;
  padding: .1rem 0 .3rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.uc-chips a {
  flex: none;
  padding: .32rem .85rem;
  border: 1px solid #E5EAF0;
  border-radius: 999px;
  background: #fff;
  color: #5A6472;
  font-size: .85rem;
  text-decoration: none;
}

.uc-chips a:hover {
  color: #0CA678;
  border-color: #0CA678;
}

/* ======================== 区块卡片 ======================== */

.uc-card {
  margin-bottom: .75rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #E5EAF0;
  border-radius: .9rem;
  box-shadow: 0 1px 2px rgba(13, 17, 23, .04);
}

/* 区块标题是 TWebText h2 组件（U.Home RegisterSectionTitle），这里只调版式 */
.uc-card h2 {
  margin: 0 0 .6rem;
  font-size: 1rem;
  line-height: 1.4;
  color: #1A1F2E;
}

/* 「与客服对话」等块级链接（lblSupportChat 输出 <a role=button class=contrast>） */
.uc-card a[role="button"] {
  margin-bottom: 0;
}

/* 令牌：等宽字体便于肉眼校对前缀（轮换按钮保持 Pico 全宽 = 触控目标） */
#tunnelToken {
  font-family: var(--pico-font-family-monospace, Consolas, monospace);
  font-size: .85rem;
}

/* ======================== 表格滚动壳（宽表窄屏兜底） ======================== */

.table-scroll {
  margin-bottom: .25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  margin-bottom: 0;
}

/* 访问 URL / 令牌 / 邮箱这类长串在窄屏能断行，不撑破滚动壳 */
.table-scroll td {
  overflow-wrap: anywhere;
}

/* ======================== 修改密码页（对齐 km-site .auth-card） ======================== */

.uc-back {
  display: inline-block;
  margin-bottom: .6rem;
  color: #5A6472;
  font-size: .9rem;
  text-decoration: none;
}

.uc-back:hover {
  color: #0CA678;
}

.uc-auth {
  max-width: 24rem;
  margin-inline: auto;
}

.uc-auth h1 {
  margin: 0 0 .3rem;
  font-size: 1.35rem;
  color: #1A1F2E;
}

.uc-auth-hint {
  margin: 0 0 1rem;
  color: #5A6472;
  font-size: .82rem;
  line-height: 1.6;
}

/* 卡片底部的互跳链接行（登录 ↔ 注册），与 .uc-auth-hint 同族的居中淡色文字 */
.uc-auth-alt {
  margin: 1.1rem 0 0;
  color: #5A6472;
  font-size: .9rem;
  text-align: center;
}

.uc-auth-alt a {
  color: #0CA678;
}

/* ======================== 页脚 ======================== */

.uc-foot {
  margin-top: 1.5rem;
  text-align: center;
}

.uc-foot a {
  color: #5A6472;
  text-decoration: none;
}

.uc-foot a:hover {
  color: #0CA678;
}

/* ======================== /uc/support 全屏聊天骨架 ======================== */

/*
 * 三段式：顶栏 / 消息区(flex:1) / 输入栏。页面不整页滚动，滚动收敛在
 * .nat-chat-log 内 —— 因此覆盖 natcomp.css 的 max-height:60vh 封顶。
 * 高度链：body(100dvh) → main(flex:1) → article(flex:1) → .uc-chat-main
 * (flex:1) → .nat-chat(flex:1) → .nat-chat-log(flex:1, min-height:0)。
 */

body.uc-chat-page {
  height: 100vh;
  height: 100dvh;
}

body.uc-chat-page main.container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-top: .5rem;
  padding-bottom: .5rem;
}

/* Pico article 默认是带边距的卡片；聊天页降级为透明 flex 容器 */
body.uc-chat-page article {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.uc-topbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .5rem;
  padding: .45rem .25rem;
  border-bottom: 1px solid #E5EAF0;
}

/* btnBack 是 TWebButton(bvSecondary → class="secondary")，Pico 默认全宽要收窄 */
.uc-topbar #btnBack {
  margin: 0;
  width: auto;
  flex: none;
  padding-block: .3rem;
  font-size: .85rem;
}

.uc-topbar-title {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.uc-topbar-title .uc-topbar-name {
  display: block;
  font-weight: 600;
  color: #1A1F2E;
  font-size: 1rem;
}

.uc-topbar-title small {
  display: block;
  color: #5A6472;
  font-size: .75rem;
  overflow-wrap: anywhere;
}

.uc-topbar .ws-badge {
  flex: none;
}

.uc-chat-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.uc-chat-main .nat-chat {
  flex: 1;
  min-height: 0;
}

/* 消息区撑满剩余高度（覆盖 natcomp.css 的 60vh 封顶），滚动在 log 内部 */
.uc-chat-main .nat-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.uc-chat-main .nat-chat-edit {
  margin-bottom: 0;
}

.uc-chat-foot {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding-top: .45rem;
  font-size: .78rem;
}

.uc-chat-foot a {
  color: #5A6472;
  text-decoration: none;
}

.uc-chat-foot a:hover {
  color: #0CA678;
}

/* ======================== ≥640px 放宽 ======================== */

@media (min-width: 640px) {
  .uc-card {
    padding: 1.15rem 1.4rem;
  }

  .uc-user {
    padding: 1rem 1.25rem;
  }
}
