/* ============================================================
   甬派账号管理台 · 纸白控制台
   纸白背景 + 极光氛围 + 甬派红强调 + 墨黑主按钮
   ============================================================ */

:root {
  --bg: #ffffff;
  --paper: #fcfcfd;
  --ink: #14161b;
  --ink-soft: #3a3f4a;
  --muted: #828995;
  --muted-2: #a6acb6;
  --line: #ededf1;
  --line-strong: #e2e3e9;
  --field-bg: #fafbfc;

  --accent: #ff4d4d;          /* 甬派红，仅作强调 */
  --accent-press: #e93237;
  --accent-tint: #fff1f0;
  --ok: #149b5a;
  --ok-tint: #e9faf0;
  --warn: #c9760a;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(20, 22, 27, .05), 0 1px 1px rgba(20, 22, 27, .04);
  --sh-md: 0 10px 30px -12px rgba(20, 22, 27, .18), 0 2px 8px -4px rgba(20, 22, 27, .08);
  --sh-lg: 0 30px 70px -28px rgba(20, 22, 27, .28), 0 6px 18px -10px rgba(20, 22, 27, .12);

  --font-display: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --font-ui: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;

  --ease: cubic-bezier(.22, .68, 0, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- 轻量静态背景：保留氛围，避免大面积动态模糊造成卡顿 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 90, 90, .22), transparent 30%),
    radial-gradient(circle at 28% 72%, rgba(178, 122, 255, .14), transparent 34%),
    radial-gradient(circle at 86% 70%, rgba(96, 152, 255, .14), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(255, 168, 92, .12), transparent 28%),
    #fff;
}
.orb {
  display: none;
  position: absolute;
  border-radius: 50%;
  filter: none;
  opacity: .55;
  will-change: transform;
}
.orb--1 {
  width: 48vmax; height: 48vmax; left: -12vmax; top: -16vmax;
  background: radial-gradient(circle at 35% 35%, rgba(255, 96, 96, .7), rgba(255, 96, 96, 0) 70%);
  animation: float1 23s var(--ease) infinite alternate;
}
.orb--2 {
  width: 42vmax; height: 42vmax; right: -14vmax; top: -10vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 168, 92, .62), rgba(255, 168, 92, 0) 70%);
  animation: float2 27s var(--ease) infinite alternate;
}
.orb--3 {
  width: 46vmax; height: 46vmax; right: -10vmax; bottom: -18vmax;
  background: radial-gradient(circle at 50% 50%, rgba(96, 152, 255, .55), rgba(96, 152, 255, 0) 70%);
  animation: float3 31s var(--ease) infinite alternate;
}
.orb--4 {
  width: 38vmax; height: 38vmax; left: -8vmax; bottom: -14vmax;
  background: radial-gradient(circle at 50% 50%, rgba(178, 122, 255, .5), rgba(178, 122, 255, 0) 70%);
  animation: float4 25s var(--ease) infinite alternate;
}
@keyframes float1 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(16vmax, 9vmax, 0) scale(1.16); } }
@keyframes float2 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-13vmax, 13vmax, 0) scale(1.1); } }
@keyframes float3 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-11vmax, -11vmax, 0) scale(1.2); } }
@keyframes float4 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(13vmax, -9vmax, 0) scale(1.08); } }

.grain {
  display: none;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 5vw, 56px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(150deg, #ff5a5a, #e93237);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  box-shadow: 0 8px 18px -8px rgba(233, 50, 55, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand__sub { font-size: 10.5px; letter-spacing: 2px; color: var(--muted-2); font-weight: 600; }

/* 正式模式状态牌：部署环境固定调用真实后端 */
.mode-pill { display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.mode-pill__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-tint);
}
.mode-pill__label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }

/* ---------- 主体 ---------- */
.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(8px, 3vw, 28px) clamp(18px, 5vw, 32px) 64px;
}

/* 介绍区 */
.intro { margin: 18px 0 26px; }
.eyebrow {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 2.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}
.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 7vw, 46px);
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}
.title em {
  font-style: normal;
  position: relative;
  color: var(--accent);
}
.title em::after {
  content: "";
  position: absolute; left: -2px; right: -2px; bottom: 4px; height: 9px;
  background: var(--accent-tint);
  z-index: -1;
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  animation: underline 1s .8s var(--ease-out) forwards;
}
@keyframes underline { to { transform: scaleX(1); } }
.lede { margin: 0; color: var(--muted); font-size: 15px; max-width: 42ch; }

/* ---------- 选项卡 ---------- */
.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 5px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(20, 22, 27, .08);
  border-radius: var(--r-pill);
  box-shadow: 0 10px 30px -16px rgba(20, 22, 27, .2), inset 0 1px 0 rgba(255, 255, 255, .6);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 18px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  border: 0;
  background: transparent;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color .25s var(--ease);
}
.tab:hover { color: var(--ink-soft); }
.tab.is-active { color: #fff; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs__ink {
  position: absolute;
  z-index: 0;
  top: 5px;
  height: calc(100% - 10px);
  border-radius: var(--r-pill);
  background: var(--ink);
  box-shadow: var(--sh-md);
  transition: transform .24s var(--ease), width .24s var(--ease);
  will-change: transform, width;
}

/* ---------- 面板 / 卡片 ---------- */
.panel {
  position: relative;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(20, 22, 27, .08);
  border-radius: var(--r-xl);
  box-shadow:
    0 30px 70px -28px rgba(20, 22, 27, .26),
    0 2px 10px -4px rgba(20, 22, 27, .06),
    inset 0 1px 0 rgba(255, 255, 255, .75);
  padding: clamp(22px, 5vw, 34px);
  overflow: hidden;
}
.panel::before {
  /* 顶部一道极淡的渐变高光 */
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .55;
}
.views { position: relative; transition: height .24s var(--ease); will-change: height; }

.view { display: flex; flex-direction: column; gap: 16px; }
.view[hidden] { display: none; }
/* 切走的视图脱离文档流，叠在上层滑出，让新视图直接决定卡片高度 */
.view.is-leaving { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }

/* 视图切换：方向性滑动 + 淡入淡出 */
.anim-in-right  { animation: slideInRight .24s var(--ease-out) both; }
.anim-in-left   { animation: slideInLeft  .24s var(--ease-out) both; }
.anim-out-left  { animation: slideOutLeft .18s var(--ease) both; }
.anim-out-right { animation: slideOutRight .18s var(--ease) both; }
@keyframes slideInRight { from { opacity: 0; transform: translate3d(46px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft  { from { opacity: 0; transform: translate3d(-46px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes slideOutLeft { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(-46px, 0, 0); } }
@keyframes slideOutRight{ from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(46px, 0, 0); } }

/* 查询结果卡淡入复用此动画 */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
  to   { opacity: 1; transform: none; }
}
.view__head { margin-bottom: 2px; }
.view__title { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
.view__hint { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- 表单字段 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); letter-spacing: .2px; }
.field__input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, .5);
  border: 1.5px solid rgba(20, 22, 27, .09);
  border-radius: var(--r-md);
  padding: 13px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .25s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field__input::placeholder { color: var(--muted-2); }
.field__input:hover { border-color: rgba(20, 22, 27, .16); background: rgba(255, 255, 255, .62); }
.field__input:focus {
  outline: none;
  background: rgba(255, 255, 255, .92);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}
.field__input.is-error {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
  animation: shake .4s var(--ease);
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  30%, 70% { transform: translateX(3px); }
  50%      { transform: translateX(-4px); }
}
.field__inline { display: flex; gap: 10px; align-items: stretch; }
.field__inline .field__input { flex: 1; }

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  padding: 14px 20px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:active { transform: translateY(1px) scale(.99); }

.btn--primary {
  margin-top: 6px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(20, 22, 27, .8);
}
.btn--primary:hover { background: #000; box-shadow: 0 16px 32px -14px rgba(20, 22, 27, .9); transform: translateY(-1px); }

.btn--danger {
  margin-top: 6px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(233, 50, 55, .75);
}
.btn--danger:hover { background: var(--accent-press); transform: translateY(-1px); box-shadow: 0 16px 32px -14px rgba(233, 50, 55, .9); }

.btn--ghost {
  background: rgba(255, 255, 255, .5);
  color: var(--ink-soft);
  border-color: rgba(20, 22, 27, .1);
}
.btn--ghost:hover { border-color: rgba(20, 22, 27, .18); background: rgba(255, 255, 255, .75); }

.btn--code { flex: 0 0 auto; padding: 0 16px; font-size: 13px; white-space: nowrap; }
.btn--code:disabled { color: var(--muted-2); border-color: var(--line); cursor: not-allowed; background: var(--field-bg); }

/* 加载态 */
.btn__spin {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  display: none;
}
.btn--ghost .btn__spin { border-color: rgba(20,22,27,.2); border-top-color: var(--ink); }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__label { opacity: .55; }
.btn.is-loading .btn__spin { display: block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 查询结果 ---------- */
.result {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  padding: 18px 18px 6px;
  animation: viewIn .24s var(--ease-out) both;
}
.result[hidden] { display: none; }
.result__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.result__tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--accent); background: var(--accent-tint);
  padding: 4px 10px; border-radius: var(--r-pill);
}
.reveal-btn {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; color: var(--muted);
  padding: 4px 6px; border-radius: 8px; transition: color .2s var(--ease);
}
.reveal-btn:hover { color: var(--ink); }
.reveal-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.result__grid { margin: 0; }
.result__row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 2px;
  border-top: 1px dashed var(--line);
}
.result__row:first-child { border-top: 0; }
.result__row dt { color: var(--muted); font-size: 13.5px; margin: 0; }
.result__row dd {
  margin: 0; font-weight: 700; font-size: 15px; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: .3px;
  text-align: right; word-break: break-all;
}

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__scrim {
  position: absolute; inset: 0;
  background: rgba(20, 22, 27, .34);
  animation: fade .18s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal__card {
  position: relative;
  width: min(400px, 92vw);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255, 255, 255, .8);
  padding: 26px 24px 22px;
  animation: pop .22s var(--ease-out) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.modal__title { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin: 0 0 8px; }
.modal__body { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.modal__actions { display: flex; gap: 10px; }
.modal__actions .btn { flex: 1; margin-top: 0; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  z-index: 60;
  top: 18px; right: 18px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .6);
  border-left: 4px solid var(--muted-2);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255, 255, 255, .7);
  padding: 13px 15px;
  animation: toastIn .22s var(--ease-out) both;
}
.toast.is-out { animation: toastOut .18s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
.toast--ok { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--accent); }
.toast--info { border-left-color: #5a82ff; }
.toast__icon {
  flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px;
  display: grid; place-items: center; border-radius: 50%;
  font-size: 12px; font-weight: 800; color: #fff;
}
.toast--ok .toast__icon { background: var(--ok); }
.toast--err .toast__icon { background: var(--accent); }
.toast--info .toast__icon { background: #5a82ff; }
.toast__text { font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }
.toast__text strong { color: var(--ink); display: block; font-size: 14px; margin-bottom: 1px; }

/* ---------- 页脚 ---------- */
.foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 22px;
  font-size: 12.5px; color: var(--muted);
}
.foot strong { color: var(--ink-soft); font-weight: 700; }
.foot__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-tint); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ---------- 进场动画 ---------- */
.reveal { opacity: 0; transform: translateY(12px); animation: revealUp .42s var(--ease-out) forwards; animation-delay: calc(var(--d, 0) * 60ms + 40ms); }
@keyframes revealUp { to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
  .topbar { padding: 16px 18px; }
  .brand__sub { display: none; }
  .shell { padding-bottom: 48px; }
  .toasts { top: auto; bottom: 16px; right: 12px; left: 12px; max-width: none; }
  @keyframes toastIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  @keyframes toastOut { to { opacity: 0; transform: translateY(24px); } }
}

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .title em::after { transform: scaleX(1); }
}
