﻿:root {
  --bg: #e8f1ff;
  --card: #ffffff;
  --line: #d3e2f7;
  --text: #1a2332;
  --muted: #6b7788;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --brand: #d91938;
  --brand-soft: rgba(255, 59, 79, 0.1);
  --warn: #9a6700;
  --mobile-nav-offset: 62px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-bottom: calc(var(--mobile-nav-offset) + env(safe-area-inset-bottom, 0px));
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}

button {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  width: min(920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: var(--card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 8px;
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #5f6d80;
  text-align: left;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.nav-emoji {
  width: 28px;
  text-align: center;
  flex: 0 0 auto;
  font-size: 16px;
}

.nav-btn:hover {
  background: #f4f6f8;
}

.nav-btn.active {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.22);
  background: var(--accent-soft);
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 12px 14px calc(24px + var(--mobile-nav-offset) + env(safe-area-inset-bottom, 0px));
}

.profile-card {
  max-width: 560px;
  margin: 0 auto 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 2px 10px rgba(26, 35, 50, 0.05);
}

.profile-card h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
  font-size: 14px;
}

.profile-row .label {
  color: var(--muted);
}

.profile-row .value {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.profile-balances {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.profile-divider {
  margin: 10px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.content {
  display: none;
  max-width: 560px;
  margin: 0 auto;
}

.content.active {
  display: block;
}

.msg-card {
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 2px 10px rgba(26, 35, 50, 0.05);
}

.page-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.page-hero-emoji {
  font-size: 28px;
  line-height: 1;
}

.page-hero-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.page-hero-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.msg-line {
  margin: 5px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.msg-line.accent {
  color: var(--accent);
  font-weight: 700;
}

.msg-line.warn {
  color: var(--warn);
}

.msg-line strong {
  color: var(--accent);
}

.msg-hint {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.msg-divider {
  margin: 10px 0;
  border: 0;
  border-top: 1px dashed var(--line);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.chip-toggle {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.chip-toggle:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.chip-toggle.active {
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.field-block {
  margin: 10px 0;
}

.field-block.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.field-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
}

.field-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.field-input:disabled {
  background: #f4f6f8;
  color: var(--muted);
}

.field-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.field-inline .field-label {
  margin: 0;
  flex: 1 1 100%;
}

.field-inline .field-input {
  flex: 1 1 160px;
  min-width: 0;
}

.copy-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 10px;
  color: var(--text);
  text-align: left;
  background: var(--accent-soft);
  cursor: pointer;
}

.copy-block code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
}

.copy-block span {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  cursor: pointer;
}

.btn-ghost {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.link-list {
  margin: 8px 0;
  padding-left: 18px;
}

.link-list li {
  margin: 4px 0;
}

.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.mobile-nav-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.mobile-nav-emoji {
  font-size: 18px;
  line-height: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--mobile-nav-offset) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  background: rgba(26, 35, 50, 0.92);
  font-size: 13px;
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.admin-hint {
  max-width: 560px;
  margin: 0 auto 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed var(--line);
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: grid;
  }

  body {
    --mobile-nav-offset: 58px;
  }
}

/* 手机端紧凑排版：6 个页面尽量一屏显示完整 */
@media (max-width: 760px) {
  .main {
    padding: 8px 12px calc(10px + var(--mobile-nav-offset) + env(safe-area-inset-bottom, 0px));
  }

  .profile-card {
    margin: 0 auto 8px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .profile-card h2 {
    margin: 0 0 6px;
    font-size: 14px;
  }

  .profile-row {
    margin: 3px 0;
    font-size: 13px;
  }

  .profile-balances {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
  }

  .profile-balances .profile-row {
    flex-direction: column;
    align-items: center;
    gap: 1px;
    margin: 0;
    font-size: 12px;
    text-align: center;
  }

  .profile-balances .profile-row .value {
    font-size: 14px;
    text-align: center;
  }

  .msg-card {
    padding: 10px 12px 12px;
    border-radius: 12px;
  }

  .page-hero {
    gap: 8px;
    margin: 0 0 8px;
    padding: 6px 10px;
  }

  .page-hero-emoji {
    font-size: 22px;
  }

  .page-hero-title {
    font-size: 15px;
  }

  .page-hero-desc {
    margin: 1px 0 0;
    font-size: 11px;
  }

  .msg-line {
    margin: 3px 0;
    font-size: 13px;
    line-height: 1.4;
  }

  .msg-hint {
    margin: 3px 0 6px;
    font-size: 11px;
    line-height: 1.35;
  }

  .msg-divider {
    margin: 6px 0;
  }

  .chip-row {
    gap: 6px;
    margin: 6px 0;
  }

  .chip-toggle {
    padding: 5px 10px;
    font-size: 12px;
  }

  .field-block {
    margin: 6px 0;
  }

  .field-label {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.35;
  }

  .field-input {
    padding: 8px 10px;
  }

  .field-inline {
    gap: 4px;
    margin: 6px 0;
  }

  .copy-block {
    margin: 6px 0;
    padding: 8px 10px;
  }

  .btn-primary {
    margin-top: 8px;
    padding: 10px 12px;
  }

  .link-list {
    margin: 4px 0;
    padding-left: 16px;
    font-size: 13px;
  }

  .link-list li {
    margin: 2px 0;
  }
}

/* 矮屏进一步精简 */
@media (max-width: 760px) and (max-height: 700px) {
  .profile-card h2,
  .page-hero-desc {
    display: none;
  }
}

/* 支付密码弹窗 */
.toast {
  z-index: 300;
}

.pin-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pin-modal[hidden] {
  display: none;
}

.pin-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, 0.5);
  animation: pin-fade 0.2s ease;
}

.pin-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 20px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  background: #fff;
  text-align: center;
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.18);
  animation: pin-up 0.25s ease;
}

@media (min-width: 761px) {
  .pin-modal {
    align-items: center;
  }

  .pin-sheet {
    border-radius: 20px;
    padding-bottom: 20px;
  }
}

.pin-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.pin-icon {
  font-size: 34px;
  line-height: 1;
}

.pin-title {
  margin: 8px 0 2px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.pin-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 6px;
}

.pin-dots i {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid #c3cbd8;
  border-radius: 50%;
  background: transparent;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.pin-dots i.filled {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.08);
}

.pin-dots.shake {
  animation: pin-shake 0.38s ease;
}

.pin-error {
  min-height: 18px;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #d92d20;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pin-keypad button {
  height: 52px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  background: #f1f4f9;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pin-keypad button:active {
  background: var(--accent-soft);
}

.pin-keypad .pin-key-fn {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
}

.pin-tip {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--muted);
}

@media (max-height: 640px) {
  .pin-sheet {
    padding-top: 14px;
  }

  .pin-icon {
    display: none;
  }

  .pin-dots {
    margin-top: 12px;
  }

  .pin-keypad {
    gap: 6px;
  }

  .pin-keypad button {
    height: 44px;
    font-size: 20px;
  }

  .pin-tip {
    margin-top: 8px;
  }
}

@keyframes pin-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pin-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* 支付密码：加载 / 失败状态页 */
.pin-view[hidden] {
  display: none;
}

.pin-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 10px 0 6px;
}

.pin-status-icon {
  font-size: 44px;
  line-height: 1;
}

.pin-status-text {
  margin: 18px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pin-retry {
  width: 70%;
  margin-top: 22px;
}

@media (max-height: 640px) {
  .pin-status {
    min-height: 220px;
  }
}

/* 资料卡上方 logo + 文案 */
.top-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 10px;
}

.top-brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(26, 35, 50, 0.12);
}

.top-brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}

@media (max-width: 760px) {
  .top-brand {
    margin-bottom: 8px;
    gap: 8px;
  }

  .top-brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .top-brand-name {
    font-size: 16px;
  }
}

/* 昵称 / ID / 用户名：等宽字体，不加粗 */
#profileNickname,
#profileUserId,
#profileUsername {
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, "Courier New", monospace;
  font-weight: 400;
}

/* 禁止页面自动缩放 / 变形（如点击输入框时放大） */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

input,
textarea,
select {
  /* iOS 在输入框字号小于 16px 时聚焦会自动放大页面 */
  font-size: 16px;
}

@media (max-width: 760px) {
  .field-input {
    font-size: 16px;
  }
}

/* 币种图标（沿用启动资料卡自定义表情图片，加载失败时回退为普通表情） */
.coin-icon {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

.coin-icon img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* 币种额度前缀：余额：0 */
#profileUsdt::before,
#profileTrx::before,
#profileCny::before {
  content: "余额：";
  font-weight: 400;
  color: var(--muted);
}
