/* ==========================================================================
   名道咨询 · 用户系统前端样式
   ==========================================================================
   承接整站「测算底稿」的语言：细线分隔、label/value 对齐、右对齐等宽数字、
   白纸 + 1px 边框而不是漂浮阴影卡。所有令牌直接复用 style.css 的 :root，
   改配色只需要改那一个文件。

   命名空间统一用 au__，避免和原站的 nav__ / svc__ 撞车。
   有一条刻意的克制：全站唯一的视觉重音是首屏「不给方向」那行酒红，
   所以这里除了「登录按钮」和「等级徽标」，其余一律保持安静。
   ========================================================================== */

/* ---------- 1. 导航右侧用户区 ---------- */
.au-entry { position: relative; }

.au-entry__guest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--navy);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s ease-out, color .2s ease-out;
}
.au-entry__guest:hover { border-color: var(--wine); color: var(--wine); }

/* 已登录：按钮本体 */
.au-entry__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .2s ease-out;
}
.au-entry__btn:hover { border-color: var(--line-soft); }

.au-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--wine);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  user-select: none;
}
.au-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.au-avatar--lg { width: 72px; height: 72px; border-radius: 8px; font-size: 26px; }

.au-entry__name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* 等级徽标：唯一允许上色的地方 */
.au-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  background: var(--paper);
}
.au-badge[data-level="S"] { border-color: var(--wine); color: #fff; background: var(--wine); }
.au-badge[data-level="A"] { border-color: var(--wine); color: var(--wine); background: var(--wine-mist); }
.au-badge[data-level="B"] { border-color: var(--navy); color: var(--navy); }
.au-badge[data-level="C"] { border-color: var(--line-soft); color: var(--muted); }

.au-entry__caret {
  display: inline-block;
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid var(--muted);
  transition: transform .2s ease-out;
}
.au-entry__btn[aria-expanded="true"] .au-entry__caret { transform: rotate(180deg); }

/* 下拉菜单 */
.au-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 236px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow-lift);
}
.au-menu__hd {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.au-menu__who { font-size: 14.5px; font-weight: 700; color: var(--navy); }

/* 账户概览：label / value 右对齐网格 */
.au-menu__grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 12px;
  margin-top: 6px;
  font-size: 12.5px;
}
.au-menu__k { color: var(--muted); }
.au-menu__v {
  text-align: right;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}

.au-menu__sep { height: 1px; background: var(--line); margin: 6px 0; }

.au-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease-out, color .15s ease-out;
}
.au-menu__item:hover { background: var(--bg); color: var(--wine); }
.au-menu__item--exit:hover { color: var(--wine); }

/* ---------- 2. 浮层通用（登录 / 注册 / 个人资料 共用） ---------- */
.au-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 41, 55, .44);
  overflow-y: auto;
}
.au-panel {
  width: 100%;
  max-width: 432px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.au-panel--wide { max-width: 544px; }

.au-panel__hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.au-panel__title { font-size: 18px; color: var(--navy); }
.au-panel__sub { margin-top: 4px; font-size: 13px; color: var(--muted); }

.au-x {
  flex: none;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease-out, color .15s ease-out;
}
.au-x:hover { background: var(--bg); color: var(--wine); }

.au-panel__bd { padding: 22px 24px 24px; }

/* tab 切换：文字 + 下滑线指示，不用胶囊开关 */
.au-tabs {
  display: flex;
  gap: 26px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.au-tab {
  position: relative;
  padding: 13px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.au-tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--wine);
  transform: scaleX(0);
  transition: transform .2s ease-out;
}
.au-tab[aria-selected="true"] { color: var(--wine); }
.au-tab[aria-selected="true"]::after { transform: scaleX(1); }

/* ---------- 3. 表单（label 左 / 输入右，保持底稿感） ---------- */
.au-field { margin-bottom: 16px; }
.au-field:last-child { margin-bottom: 0; }

.au-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.au-label span { font-weight: 400; color: var(--muted); font-size: 12px; }

.au-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color .15s ease-out;
}
.au-input::placeholder { color: #9AA3AE; }
.au-input:focus { outline: none; border-color: var(--wine); }
.au-input[aria-invalid="true"] { border-color: var(--wine); }

.au-help {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.au-err {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--wine);
}
.au-err.is-on { display: block; }

.au-btn-row { margin-top: 22px; }
.au-btn-full { width: 100%; padding: 13px 20px; }

.au-foot {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.au-foot button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: var(--wine);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 手机号行：输入框与「发送验证码」按钮并排。
   按钮上的倒计时文案会变长（「60 秒后重发」），所以给它 fixed 的留白，
   别让它一变宽就把输入框挤瘦。 */
.au-sms {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.au-sms .au-input { flex: 1 1 auto; min-width: 0; }
.au-sms__btn {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 0 14px;
  border: 1px solid var(--wine);
  border-radius: 6px;
  background: var(--paper);
  color: var(--wine);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease-out, color .15s ease-out;
}
.au-sms__btn:hover:not(:disabled) { background: var(--wine); color: #fff; }
.au-sms__btn:disabled {
  border-color: var(--line-soft);
  color: var(--muted);
  cursor: default;
}

.au-foot__sep { margin: 0 8px; color: var(--line-soft); }

/* ---------- 4. 个人资料面板 ---------- */
.au-prof {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.au-prof__av { position: relative; }
.au-prof__pick {
  margin-top: 8px;
  width: 100%;
  padding: 6px 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--paper);
  font: inherit;
  font-size: 12.5px;
  color: var(--navy);
  cursor: pointer;
  transition: border-color .15s ease-out;
}
.au-prof__pick:hover { border-color: var(--wine); color: var(--wine); }

/* 账户概览（资料页版，比下拉里那张更宽） */
.au-acct {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.au-acct__cell { padding: 0 14px; background: var(--paper); }
.au-acct__k { font-size: 12px; color: var(--muted); }
.au-acct__v {
  margin-top: 2px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

/* 资料面板内的分区小标题 */
.au-sub {
  margin: 22px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}
.au-sub:first-of-type { margin-top: 20px; }

/* 邀请码展示条：码本身可点复制，右侧是 5 分钟倒计时 */
.au-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 4px;
  padding: 12px 16px;
  border: 1px dashed var(--line-soft);
  border-radius: 6px;
  background: var(--bg);
}
.au-invite__code {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--navy);
  cursor: pointer;
  user-select: all;
  word-break: break-all;
}
.au-invite__code.is-dead {
  color: var(--muted);
  text-decoration: line-through;
  cursor: default;
}
.au-invite__timer {
  flex: none;
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 5. 轻提示 ---------- */
.au-toast-wrap {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  left: 0; right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.au-toast {
  max-width: 88vw;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--wine);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow-lift);
  font-size: 14px;
  color: var(--ink);
}
.au-toast--ok { border-left-color: #2F6F44; }
.au-toast--err { border-left-color: var(--wine); }

/* ---------- 6. 浮层打开时锁住背景滚动 ---------- */
.au-no-scroll { overflow: hidden; }

/* ---------- 7. 窄屏 ---------- */
@media (max-width: 768px) {
  .au-mask { padding: 0; align-items: flex-end; }
  .au-panel,
  .au-panel--wide { max-width: none; border-radius: 0; border: 0; }
  .au-entry__name { max-width: 76px; }
  .au-menu { position: fixed; top: auto; bottom: 0; right: 0; left: 0; min-width: 0; border-radius: 0; }
  .au-acct { grid-template-columns: 1fr; }
  .au-acct__cell { padding: 10px 14px; }
  .au-invite { flex-direction: column; align-items: flex-start; gap: 6px; }
  .au-invite__code { font-size: 19px; letter-spacing: 2px; }
  /* 窄屏放不下并排的输入框 + 按钮，按钮整行落到下面 */
  .au-sms { flex-wrap: wrap; }
  .au-sms__btn { width: 100%; min-width: 0; padding: 11px 14px; }
}

/* ---------- 8. 尊重「减少动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  .au-entry__guest,
  .au-entry__btn,
  .au-entry__caret,
  .au-menu__item,
  .au-tab,
  .au-tab::after,
  .au-input,
  .au-sms__btn,
  .au-x,
  .au-prof__pick { transition: none; }
}

/* ---------- 9. 打印时不渲染浮层 ---------- */
@media print {
  .au-mask, .au-toast-wrap, .au-menu { display: none !important; }
}
