/* Siqvex Account 视觉层 与官网共用颜色 字体 按钮和标识动画 只有亮色 */
:root {
  color-scheme: light;

  --bg: #f4f7fa;
  --surface: #fff;
  --text: #101723;
  --logo: #111317;
  --muted: #4f5b6b;
  --faint: #647080;
  --line: #e1e6ec;
  --line-strong: #c3ccd6;
  --accent: #0f9488;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-line: #fbd5d0;
  --info-bg: #eef2f6;

  --gutter: 24px;
  --radius-card: 20px;
  --radius-control: 10px;

  --ease-out: cubic-bezier(0, 0, .58, 1);
  --ease-strong: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.42, 0, .58, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);

  --t-press: 120ms;
  --t-shadow: 140ms;
  --t-color: 160ms;
  --t-move: 240ms;
  --t-size: 280ms;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-autospace: normal;
  text-spacing-trim: trim-start;
}

h1, p { margin: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button, input { font: inherit; color: inherit; }

::selection { background: #5fd3c8; color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 切换视图时焦点落在标题上 只给读屏器和键盘落点 不画焦点框 */
h1:focus, h1:focus-visible { outline: none; }

.defs { position: absolute; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 顶部 */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand svg { width: 28px; height: auto; fill: var(--logo); }

.language {
  display: inline-flex;
  gap: 2px;
}
.language button {
  position: relative;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  color: var(--faint);
  cursor: pointer;
  transition:
    color var(--t-press) var(--ease-out),
    background-color var(--t-press) var(--ease-out);
}
.language button::after {
  content: "";
  position: absolute;
  inset: -8px 0;
}
.language button[aria-pressed="true"] {
  color: var(--text);
  background: rgb(16 23 35 / .06);
}
@media (hover: hover) {
  .language button:hover { color: var(--text); }
}

/* 登录和注册页背景点阵 由account-view.js绘制 上下渐隐 读作质感而不是噪点 */
.dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms var(--ease-in-out);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}
[data-view="login"] .dots,
[data-view="register"] .dots { opacity: 1; }
.top, .column, .side-mark { position: relative; z-index: 1; }

/* 版式 与官网首屏同样是左内容右标识 */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  padding-top: clamp(32px, 8vh, 88px);
  padding-bottom: 64px;
}

.column { min-width: 0; }

.side-mark {
  justify-self: end;
  width: 100%;
  max-width: 440px;
  padding-top: 24px;
}

/* 卡片高度由account-view.js跟随内容 用CSS过渡 随时可反向 */
.card {
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 2px rgb(40 55 80 / .04),
    0 8px 24px -12px rgb(40 55 80 / .1);
}
.card.can-size { transition: height var(--t-size) var(--ease-in-out); }

.card-body { padding: 16px 24px 24px; }

/* 登录和注册切换 */
.switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 24px;
  background: var(--bg);
  border-radius: 12px;
}
.switch a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 0;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--faint);
  transition: color var(--t-color) var(--ease-out);
}
.switch-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--surface);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgb(16 23 35 / .05),
    0 1px 2px rgb(40 55 80 / .1);
  transition: transform var(--t-move) var(--ease-in-out);
}
[data-view="login"] .switch a[data-account-route="login"],
[data-view="register"] .switch a[data-account-route="register"] { color: var(--text); }
[data-view="register"] .switch-pill { transform: translateX(100%); }
[data-view="verify"] .switch,
[data-view="manage"] .switch { display: none; }
@media (hover: hover) {
  .switch a:hover { color: var(--text); }
}

.panel { will-change: opacity, transform; }

.title {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.015em;
}

.lead {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.address { font-weight: 500; color: var(--text); }

/* 表单 */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.title + .lead + .form { margin-top: 24px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label, .field-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.field input, .field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-control);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 16px;
  outline: none;
  transition: box-shadow var(--t-shadow) var(--ease-out);
}
@media (hover: hover) {
  .field input:hover:not(:disabled), .field select:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #9aa6b5; }
}
.field input:focus, .field select:focus {
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 3px rgb(15 148 136 / .14);
}
.field input:disabled, .field select:disabled {
  background: var(--bg);
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  cursor: not-allowed;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23647080' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}
.field input:user-invalid {
  box-shadow: inset 0 0 0 1.5px var(--danger);
}
.field input:user-invalid:focus {
  box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 0 3px rgb(180 35 24 / .12);
}
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 0 0 100px #f2f7fb;
}
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--accent), inset 0 0 0 100px #f2f7fb, 0 0 0 3px rgb(15 148 136 / .14);
}

.field .code {
  font: 500 20px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .32em;
  text-align: center;
  padding-left: calc(12px + .32em);
}

.hint { font-size: 13px; line-height: 1.5; color: var(--faint); }
.hint:empty { display: none; }

.readonly {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-control);
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* 人机验证 区域始终可见 组件和状态都来自核心 这里不画任何假控件 */
.human {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.human-label { font-size: 14px; font-weight: 500; line-height: 1.5; }
.human-status {
  padding: 10px 12px;
  background: var(--info-bg);
  border-radius: var(--radius-control);
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.human-status:empty:not(:has(+ .turnstile:empty)) { display: none; }
.human-status:empty:has(+ .turnstile:empty)::before { content: "尚未就绪"; }
:root:lang(en) .human-status:empty:has(+ .turnstile:empty)::before { content: "Not ready yet"; }
.turnstile { max-width: 100%; overflow-x: auto; }
.turnstile:empty { display: none; }

/* 按钮 与官网主按钮同一套五层 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--t-press) var(--ease-strong),
    box-shadow var(--t-shadow) var(--ease-strong),
    color var(--t-color) var(--ease-out),
    opacity var(--t-color) var(--ease-out);
}

.btn-primary {
  margin-top: 8px;
  color: #fff;
  background: linear-gradient(180deg, #2c3648, #161e2c);
  box-shadow:
    0 0 0 1px #0b111b,
    inset 0 1px 0 rgb(255 255 255 / .16),
    inset 0 -1px 0 rgb(0 0 0 / .2),
    0 1px 2px rgb(16 23 35 / .24),
    0 4px 10px -3px rgb(16 23 35 / .32);
}
@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #364154, #1e2737);
    box-shadow:
      0 0 0 1px #0b111b,
      inset 0 1px 0 rgb(255 255 255 / .2),
      inset 0 -1px 0 rgb(0 0 0 / .2),
      0 2px 3px rgb(16 23 35 / .24),
      0 8px 16px -4px rgb(16 23 35 / .36);
  }
}
.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  background: linear-gradient(180deg, #131a27, #232c3c);
  box-shadow:
    0 0 0 1px #0b111b,
    inset 0 1px 2px rgb(0 0 0 / .4),
    inset 0 0 0 rgb(0 0 0 / 0),
    0 0 0 rgb(16 23 35 / 0),
    0 0 0 rgb(16 23 35 / 0);
}

.btn-secondary {
  background: linear-gradient(180deg, #fff, #f6f8fa);
  box-shadow:
    0 0 0 1px var(--line-strong),
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgb(16 23 35 / .03),
    0 1px 2px rgb(40 55 80 / .06),
    0 2px 6px -3px rgb(40 55 80 / .1);
}
@media (hover: hover) {
  .btn-secondary:hover:not(:disabled) {
    box-shadow:
      0 0 0 1px #aab4c1,
      inset 0 1px 0 #fff,
      inset 0 -1px 0 rgb(16 23 35 / .03),
      0 2px 3px rgb(40 55 80 / .08),
      0 6px 12px -4px rgb(40 55 80 / .14);
  }
}
.btn-secondary:active:not(:disabled) {
  transform: translateY(1px);
  background: linear-gradient(180deg, #eef1f5, #f6f8fa);
  box-shadow:
    0 0 0 1px #aab4c1,
    inset 0 1px 2px rgb(16 23 35 / .1),
    inset 0 0 0 rgb(16 23 35 / 0),
    0 0 0 rgb(40 55 80 / 0),
    0 0 0 rgb(40 55 80 / 0);
}

.btn-text {
  font-weight: 500;
  color: var(--muted);
}
@media (hover: hover) {
  .btn-text:hover:not(:disabled) { color: var(--text); background: rgb(16 23 35 / .04); }
}
.btn-text:active:not(:disabled) { transform: translateY(1px); }

/* 不可用 稍晚变淡 刷新连接的瞬间不闪 */
.btn-small {
  width: auto;
  min-height: 36px;
  margin-top: 0;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
}
.btn-small::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transition-delay: 0ms, 0ms, 0ms, 150ms;
}

/* 提交中 */
form[aria-busy="true"] .btn-primary:disabled,
.btn[aria-busy="true"]:disabled { opacity: .72; transition-delay: 0ms; }
form[aria-busy="true"] .btn-primary::before,
.btn-primary[aria-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / .3);
  border-top-color: #fff;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 用户页 */
.avatar-settings {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
  padding-top: 8px;
}

.avatar-frame {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e6ebf1;
  box-shadow: inset 0 0 0 1px rgb(16 23 35 / .06);
  transition: box-shadow var(--t-shadow) var(--ease-out);
}
.avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
}
.avatar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  animation: fade 200ms var(--ease-out) backwards;
}

/* 已选择未保存 头像外多一圈强调色 */
.avatar-settings:has(#avatar-save:not(:disabled):not([hidden])) .avatar-frame {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

/* 头像处理中 */
.avatar-settings[aria-busy="true"] .avatar-image,
.avatar-settings[aria-busy="true"] .avatar-fallback { opacity: .5; }
.avatar-settings[aria-busy="true"] .avatar-frame::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  border: 2px solid rgb(16 23 35 / .2);
  border-top-color: var(--text);
  animation: spin 800ms linear infinite;
}

.avatar-side { min-width: 0; }

.identity-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 8px;
}
.avatar-actions #avatar-save { order: -1; }

/* 当前用不上的头像操作不占位 处理中保留 */
.avatar-settings:not([aria-busy="true"]):not(:has([aria-busy="true"])) :is(#avatar-save, #avatar-cancel, #avatar-remove):disabled { display: none; }

.avatar-status { grid-column: 1 / -1; }

.inline-status {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.inline-status:empty { display: none; }

.profile-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* 状态 */
.notice {
  padding: 10px 12px;
  background: var(--info-bg);
  border-radius: var(--radius-control);
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.error {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--danger-bg);
  border-radius: var(--radius-control);
  box-shadow: inset 0 0 0 1px var(--danger-line);
  font-size: 14px;
  line-height: 1.55;
  color: var(--danger);
  overflow-wrap: anywhere;
  animation: message-in 240ms var(--ease-strong) backwards;
}

/* 高度预留 文字出现时卡片不移动 */
.status {
  min-height: 22px;
  margin-top: 12px;
  padding: 0 4px;
  font-size: 14px;
  line-height: 22px;
  color: var(--faint);
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* 标识 路径取自Siqvex_mark.ai 蒙版只控制显现 形状与原稿一致 时序与官网相同 */
.mark { width: 100%; height: auto; overflow: visible; fill: var(--logo); }
.mark-s { fill: none; stroke: #fff; stroke-width: 31; stroke-linejoin: miter; stroke-linecap: round; }
.mark .stroke {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 0;
  animation: draw var(--t) var(--ease-in-out) var(--d) backwards;
}
.mark .s1, .mark .s2 { --d: 270ms; --t: 580ms; }
.mark .s3 { --d: 850ms; --t: 300ms; }
.mark .dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: pop 260ms var(--ease-pop) 1150ms backwards;
}
@keyframes draw {
  0% { stroke-dashoffset: 1; opacity: 0; }
  1% { stroke-dashoffset: 1; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@supports (corner-shape: superellipse(1.25)) {
  .btn-primary, .btn-secondary, .card, .switch, .field input, .field select { corner-shape: superellipse(1.25); }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 440px);
    justify-content: center;
    gap: 24px;
    padding-top: 16px;
  }
  .side-mark {
    order: -1;
    justify-self: start;
    max-width: 88px;
    padding: 0 0 0 4px;
  }
  .top .brand svg { display: none; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .top { height: 64px; }
  .layout { padding-bottom: 40px; }
  .card-body { padding: 12px 20px 20px; }
  .switch { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .dots, .card.can-size, .switch-pill, .btn, .field input, .field select, .switch a, .language button, .avatar-frame { transition: none; }
  .avatar-image { animation: fade 150ms var(--ease-out) backwards; }
  .avatar-settings[aria-busy="true"] .avatar-frame::after { animation: none; }
  .btn-primary[aria-busy="true"]::before { animation: none; border-top-color: rgb(255 255 255 / .3); }
  .mark .stroke, .mark .dot { animation: none; }
  .side-mark { animation: fade 150ms var(--ease-out) backwards; }
  .error { animation: fade 150ms var(--ease-out) backwards; }
  .btn:active { transform: none !important; }
  form[aria-busy="true"] .btn-primary::before { animation: none; border-top-color: rgb(255 255 255 / .3); }
}
