* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 金额等 number 输入：隐藏浏览器步进箭头，点击后直接键盘输入 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg, #06060f);
  overflow-x: hidden;
}

/* 首帧路由（head 设置 data-ww-boot-page）：禁用 .page 过渡，避免欢迎页→目标页出现滑动/淡入闪屏 */
html.ww-boot-route .page {
  transition: none !important;
}

/* 单次导航（如助记词验证后进首页）：禁用 .page 过渡，避免与布局稳定化叠加产生跳变 */
html.ww-instant-route .page {
  transition: none !important;
}

/* 与 head 中 data-ww-boot-page 同步的静态规则（避免再注入 <style>，首帧更早可用） */
/* 首帧目标为 page-welcome 时不得套用「藏欢迎页」，否则 data-ww-boot-page 未清除时按钮无法点击 */
html[data-ww-boot-page]:not([data-ww-boot-page="page-welcome"]) #page-welcome.page {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
html[data-ww-boot-page="page-welcome"] #page-welcome.page,
html[data-ww-boot-page="page-home"] #page-home.page,
html[data-ww-boot-page="page-password-restore"] #page-password-restore.page,
html[data-ww-boot-page="page-key"] #page-key.page,
html[data-ww-boot-page="page-key-verify"] #page-key-verify.page,
html[data-ww-boot-page="page-addr"] #page-addr.page,
html[data-ww-boot-page="page-transfer"] #page-transfer.page,
html[data-ww-boot-page="page-settings"] #page-settings.page,
html[data-ww-boot-page="page-convert-mnemonic"] #page-convert-mnemonic.page,
html[data-ww-boot-page="page-swap"] #page-swap.page,
html[data-ww-boot-page="page-import"] #page-import.page,
html[data-ww-boot-page="page-hongbao"] #page-hongbao.page,
html[data-ww-boot-page="page-claim"] #page-claim.page,
html[data-ww-boot-page="page-claimed"] #page-claimed.page,
html[data-ww-boot-page="page-hb-records"] #page-hb-records.page,
html[data-ww-boot-page="page-faq"] #page-faq.page,
html[data-ww-boot-page="page-swoosh"] #page-swoosh.page,
html[data-ww-boot-page="page-transfer-success"] #page-transfer-success.page,
html[data-ww-boot-page="page-hb-keyword"] #page-hb-keyword.page,
html[data-ww-boot-page="page-verify-success"] #page-verify-success.page {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translate3d(0, 0, 0) !important;
  z-index: 3 !important;
}

/* 万语地址就绪前隐藏占位符，避免 38294651/92847361 与持久化数据切换闪烁 */
html.ww-addr-pending #homeAddrChip,
html.ww-addr-pending #addrOneLine {
  visibility: hidden;
}

:root {
  /* —— Brand —— */
  --gold: #e4c56c;
  --gold-light: #f2e6b0;
  --gold-muted: rgba(228, 197, 108, 0.38);
  /* —— Surfaces（深空 + 层级） —— */
  --bg: #06060f;
  --bg2: #0c0c18;
  --bg3: #141428;
  --border: rgba(255, 255, 255, 0.085);
  /* —— Text —— */
  --text: #f1f3f8;
  --text-dim: #9aa3b8;
  --text-muted: #6b7588;
  /* —— Semantic —— */
  --green: #4cd964;
  --red: #ff6b6b;
  /* —— Layout —— */
  --nav-h: 56px;
  --page-pad-x: 18px;
  --page-pad-y: 16px;
  /* 首页「我的资产 / 最近交易」与搜索框同一水平内边距 */
  --home-section-pad-x: 16px;
  --line-body: 1.55;
  --line-tight: 1.35;
  /* —— Design System v1 tokens —— */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-gold: 0 4px 28px rgba(228, 197, 108, 0.22);
  --shadow-float: 0 16px 48px rgba(0, 0, 0, 0.45);
  /* 主内容区为 fixed 底栏让路：一行图标约 56px + 与底栏 padding-bottom 中的 home indicator 区 env(safe-area) 对齐，避免 70px+safe 与底栏真实高度不一致产生大块空带 */
  --ww-tabbar-clearance: calc(56px + env(safe-area-inset-bottom, 0px));
}

[data-theme="light"] {
  --gold: #b8922a;
  --gold-light: #d4af37;
  --gold-muted: rgba(184, 146, 42, 0.4);
  --bg: #f2f3f7;
  --bg2: #ffffff;
  --bg3: #eaeaef;
  --border: rgba(0, 0, 0, 0.09);
  --text: #12121a;
  --text-dim: #4a5060;
  --text-muted: #737a8c;
  --green: #2a9d4a;
  --red: #d04040;
  --shadow-gold: 0 4px 24px rgba(184, 146, 42, 0.18);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
  background: #e4e4ea !important;
}

body {
  background: #0d0d18;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'PingFang SC','Noto Sans CJK SC','Microsoft YaHei','Segoe UI',system-ui,-apple-system,sans-serif;
  line-height: var(--line-body, 1.55);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
}

.phone {
  transform-origin: top center;
}

/* 竖屏窄宽度或「手机横屏」（视口宽常 >768）：均套用全屏壳层；仅 max-width:768 时横屏会退回桌面手机框导致布局不随方向变化 */
@media (max-width: 768px),
       (min-aspect-ratio: 1/1) and (max-height: 520px) and (max-width: 1100px) {
  /* 真机：去掉模拟手机框，直接全屏 */
  html {
    margin: 0 !important;
    padding: 0 !important;
    /* head 写入 --ww-app-width，横竖屏切换后与 visualViewport 同宽，避免壳层宽度滞后 */
    width: var(--ww-app-width, 100%) !important;
    max-width: 100% !important;
    height: 100% !important;
    height: -webkit-fill-available !important;
    /* head 脚本写入的 --ww-app-height：与 inner/visualViewport 取大，避免仅 100%/fill-available 偏短时整页偏短、屏底露出系统黑边 */
    min-height: 100% !important;
    min-height: -webkit-fill-available !important;
    min-height: var(--ww-app-height, 100%) !important;
    overflow-x: hidden !important;
    /* 与 .phone 同色，避免顶部/两侧露缝 */
    background: var(--bg, #06060f) !important;
  }
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--bg, #06060f) !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    width: var(--ww-app-width, 100%) !important;
    max-width: 100% !important;
    min-height: 100% !important;
    min-height: -webkit-fill-available !important;
    min-height: var(--ww-app-height, 100%) !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }
  .phone {
    width: var(--ww-app-width, 100%) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    /* 勿在 .phone 上再 pad safe-area：.page 已有左右 inset，重复 pad 会出现约一指宽「多余栏」 */
    padding: 0 !important;
    /* 全屏壳层：用四边钉住拉满布局视口。勿与 100dvh 同时写死高度 — 在部分 PWA/WebView 中 dvh 小于可视区域时会出现壳层偏短、底栏与 Home Indicator 之间大块留白 */
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    min-height: -webkit-fill-available !important;
    min-height: var(--ww-app-height, -webkit-fill-available) !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    /* 勿在壳层使用非 none 的 transform，否则会新建包含块，子项 position:fixed 会相对 .phone 而非视口 */
    transform: none !important;
    will-change: auto !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    background: var(--bg, #06060f) !important;
  }
  .status-bar { display: none !important; }
  /* 装饰性状态栏已隐藏：顶栏安全区只在这里加一次，避免与 .phone 双重留白 */
  .page {
    top: 0 !important;
    padding-top: env(safe-area-inset-top, 20px);
  }
  /* 浅色主题下避免 body 与壳层异色露边（原 [data-theme="light"] body 为 #e4e4ea） */
  html[data-theme="light"] body {
    background: var(--bg, #06060f) !important;
  }
  html[data-theme="light"] {
    background: var(--bg, #06060f) !important;
  }
  [data-theme="light"] .phone {
    background: var(--bg, #06060f) !important;
  }
}

/* iOS：输入框字号小于 16px 时聚焦会强制缩放页面，关键表单区统一 16px */
@media (max-width: 500px) {
  #page-import textarea,
  #page-import input[type="text"],
  #verifyQuestions input[type="text"],
  #page-transfer textarea,
  #page-hongbao input#hbBlessing {
    font-size: 16px !important;
  }
}

/* ── 礼物页 · 礼金展示区与主按钮 ── */
/* 礼物页主内容区：减少标题框上方的空隙 */
#page-hongbao > .key-content {
  padding-top: 6px;
}
#page-hongbao .gift-hero {
  margin-bottom: 8px;
}
#page-hongbao .gift-preview-shell {
  position: relative;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(148deg, rgba(255, 214, 140, 0.65) 0%, rgba(160, 110, 50, 0.35) 45%, rgba(40, 18, 12, 0.75) 100%);
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 200, 120, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
#page-hongbao .gift-preview-orbit {
  position: absolute;
  inset: -10px;
  border-radius: 24px;
  background: radial-gradient(ellipse 75% 50% at 50% 0%, rgba(255, 220, 140, 0.2), transparent 58%);
  pointer-events: none;
  z-index: 0;
}
#page-hongbao .gift-preview-panel {
  position: relative;
  border-radius: 16px;
  padding: 6px 14px 7px;
  text-align: center;
  overflow: hidden;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 3px 28px rgba(0, 0, 0, 0.28);
}
#page-hongbao .gift-preview-shine {
  position: absolute;
  top: -42%;
  left: -28%;
  width: 88%;
  height: 88%;
  background: linear-gradient(128deg, rgba(255, 255, 255, 0.26), transparent 50%);
  pointer-events: none;
  transform: rotate(-14deg);
}
#page-hongbao .gift-preview-icon-row {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  min-height: 0;
}
#page-hongbao .gift-hero-tagline {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
#page-hongbao .gift-preview-icon {
  position: relative;
  z-index: 2;
  font-size: 34px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 22px rgba(255, 210, 100, 0.38));
  transform: translateY(0);
}
#page-hongbao .gift-claim-create-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  box-sizing: border-box;
}
#page-hongbao .gift-claim-create-row > .btn-secondary,
#page-hongbao .gift-claim-create-row > .btn-primary.btn-create-gift {
  flex: 1 1 0;
  min-width: 0;
  width: auto !important;
  max-width: none;
  margin-top: 0 !important;
  min-height: 48px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  box-sizing: border-box;
}

.phone {
  width: 390px;
  height: 844px;
  background: var(--bg, #06060f);
  border-radius: 50px;
  border: 2px solid #2a2a3a;
  box-shadow: 0 40px 80px rgba(0,0,0,0.8), 0 0 0 1px #111120;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.status-bar {
  height: 50px;
  background: var(--bg, #06060f);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 0;
  font-size: 12px;
  color: var(--text-dim, #9aa3b8);
  flex-shrink: 0;
  z-index: 10;
}
.status-time { font-weight: 600; color: var(--text, #f1f3f8); font-size: 14px; }

/* flex:1 1 0 + min-height:0：避免子项全为 absolute 时中间区高度塌陷，导致 .phone 缩成一条、底栏被 body 居中到视口中央 */
.pages { flex: 1 1 0; min-height: 0; position: relative; overflow: hidden; }

/* 隐藏 pages 容器内游离元素（不属于任何 .page） */
.pages > :not(.page):not(#tabBar):not(#walletLoadingOverlay):not(#toastMsg) { display: none !important; }
.page {
  position: absolute;
  top: 50px; left: 0; right: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex; flex-direction: column;
  background: var(--bg, #06060f);
  color: var(--text, #f1f3f8);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(14px, 0, 0);
  transition: opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1), transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.34s;
  z-index: 0;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  /* 为 position:fixed 底栏留出空间（见 #tabBar）；无底栏引导页由下方页面 id 规则收回 */
  padding-bottom: var(--ww-tabbar-clearance);
}
#page-welcome.page,
#page-key.page,
#page-key-verify.page,
#page-import.page,
#page-password-restore.page {
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
}
.page::-webkit-scrollbar { width: 5px; }
.page::-webkit-scrollbar-track { background: transparent; }
.page::-webkit-scrollbar-thumb {
  background: rgba(200, 168, 75, 0.28);
  border-radius: 6px;
}
.page.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  z-index: 3;
}
@media (prefers-reduced-motion: reduce) {
  .page { transition-duration: 0.01ms; }
}

/* WW_DESIGN_V1 */
/* ========== WorldToken UI · Design System v1（覆盖层） ========== */
@media (min-width: 769px) {
  .phone {
    background: linear-gradient(165deg, rgba(16, 16, 32, 0.98) 0%, rgba(8, 8, 18, 1) 42%, #06060f 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.45),
      0 40px 100px rgba(0, 0, 0, 0.78),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

.status-bar {
  background: rgba(6, 6, 15, 0.82) !important;
  backdrop-filter: saturate(1.15) blur(16px);
  -webkit-backdrop-filter: saturate(1.15) blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-bar {
  background: rgba(10, 10, 22, 0.9) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.tab-bar {
  background: rgba(10, 10, 22, 0.93) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.tab-item {
  font-size: 11px;
  letter-spacing: 0.03em;
}
.tab-item.active {
  font-weight: 600;
}

#page-welcome {
  background:
    radial-gradient(ellipse 95% 75% at 50% -28%, rgba(228, 197, 108, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 55% 50% at 95% 85%, rgba(100, 80, 200, 0.09) 0%, transparent 52%),
    var(--bg, #06060f) !important;
}
/* 欢迎页须压过其它 .page，避免首帧/stack 异常时底层页挡住点击 */
#page-welcome.page.active {
  z-index: 50 !important;
  position: relative;
  isolation: isolate;
}

.home-header {
  background: linear-gradient(180deg, rgba(14, 14, 28, 0.96) 0%, rgba(8, 8, 18, 0.55) 100%) !important;
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.btn-primary {
  border-radius: var(--radius-md, 16px);
  box-shadow: var(--shadow-gold, 0 4px 28px rgba(228, 197, 108, 0.22));
}
.btn-secondary {
  border-radius: var(--radius-md, 16px);
}

[data-theme="light"] .status-bar {
  background: rgba(255, 255, 255, 0.86) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .nav-bar {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
}
[data-theme="light"] .tab-bar {
  background: rgba(255, 255, 255, 0.95) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.07) !important;
}
[data-theme="light"] #page-welcome {
  background:
    radial-gradient(ellipse 90% 70% at 50% -20%, rgba(184, 146, 42, 0.14) 0%, transparent 55%),
    var(--bg, #06060f) !important;
}
[data-theme="light"] .home-header {
  background: linear-gradient(180deg, #ffffff 0%, rgba(248, 248, 252, 0.95) 100%) !important;
}

/* ── 欢迎页 ── */
#page-welcome {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200,168,75,0.15) 0%, transparent 60%), var(--bg, #06060f);
  align-items: center;
  justify-content: center;
  /* 对称上下内边距 + 额外 20vh（原 30vh；整体上移约 10vh≈一屏 10%） */
  padding-top: calc(max(20px, env(safe-area-inset-top, 0px), min(14vh, 120px)) + 20vh) !important;
  padding-bottom: max(48px, env(safe-area-inset-bottom, 0px), min(11vh, 100px)) !important;
  padding-left: max(20px, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(20px, env(safe-area-inset-right, 0px)) !important;
  text-align: center;
  overflow: hidden;
}
#page-welcome button.btn-primary,
#page-welcome button.btn-secondary,
#page-welcome button[data-ww-welcome-act] {
  touch-action: manipulation;
  position: relative;
  z-index: 6;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: auto !important;
  cursor: pointer;
}
/* 移动 Chrome：点击常落在文字/emoji 子节点上导致 target 无 closest；子元素不接收命中，事件落在 button 上 */
#page-welcome button[data-ww-welcome-act] * {
  pointer-events: none;
}
#welcomeLangGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  max-height: min(52vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px 4px 12px;
  margin-top: 8px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  box-sizing: border-box;
}
#welcomeLangGrid .lang-row:active { transform: scale(0.98); opacity: 0.8; }
.lang-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  min-height: 0;
  padding: 14px 8px 12px;
  gap: 4px;
}
#welcomeLangGrid .lang-row > span:first-of-type {
  font-size: 34px !important;
  line-height: 1;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}
#welcomeLangGrid .lang-row > div {
  flex: none !important;
  text-align: center !important;
  width: 100%;
}
#welcomeLangGrid .lang-row .lang-check {
  position: absolute;
  top: 6px;
  right: 8px;
  margin: 0 !important;
}
.welcome-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #b8982a, #f0d070);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 8px;
  box-shadow: 0 8px 32px rgba(200,168,75,0.3);
}
.welcome-name {
  font-size: 24px; font-weight: 800;
  background: linear-gradient(135deg, #c8a84b, #f0d070);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 3px; margin-bottom: 2px;
}
.welcome-tag { font-size: 12px; color: var(--text-muted, #6b7588); letter-spacing: 2px; margin-bottom: 10px; }

.lang-scroll { width: 100%; margin-bottom: 24px; }
.lang-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.lang-btn {
  background: var(--bg2, #0c0c18);
  border: 1.5px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 12px;
  padding: 10px 4px;
  cursor: pointer; text-align: center; transition: all 0.2s;
}
.lang-btn:hover, .lang-btn.active {
  border-color: var(--gold, #e4c56c);
  background: linear-gradient(135deg, #181808, #1c1c0a);
}
.lang-flag { font-size: 20px; display: block; margin-bottom: 3px; }
.lang-name { font-size: 11px; color: var(--text-muted, #6b7588); line-height: var(--line-tight, 1.35); }
.lang-btn.active .lang-name { color: var(--gold-light, #f2e6b0); }

.btn-primary:active, .btn-secondary:active {
  transform: scale(0.97);
  opacity: 0.85;
}
.btn-primary {
  background: linear-gradient(135deg, #b8982a, #e8c850);
  color: #0a0a05; border: none; border-radius: 16px;
  padding: 14px 16px; font-size: 15px; font-weight: 700;
  min-height: 48px;
  cursor: pointer; width: 100%; transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary {
  background: transparent; color: var(--gold, #e4c56c);
  border: 1.5px solid rgba(200,168,75,0.3);
  border-radius: 16px; padding: 12px 14px;
  font-size: 14px; cursor: pointer; width: 100%;
  min-height: 46px;
  transition: all 0.2s; margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ── 导航栏 ── */
.nav-bar {
  height: 56px; background: var(--bg2, #0c0c18);
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  display: flex; align-items: center;
  padding: 0 max(18px, env(safe-area-inset-left, 0px)) 0 max(18px, env(safe-area-inset-right, 0px));
  gap: 14px; flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.nav-back { font-size: 34px; font-weight: 900; color: var(--gold, #e4c56c); cursor: pointer; width: 44px; line-height: 1; }
.nav-title { font-size: 17px; font-weight: 600; color: var(--text, #f1f3f8); }
/* 返回与标题作为左侧一组，贴合排列；右侧为帮助/操作区 */
.nav-leading {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.nav-leading .nav-back {
  flex-shrink: 0;
}
.nav-leading .nav-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}
.nav-bar > .nav-right {
  flex-shrink: 0;
}
/* 导入页顶栏：右侧有帮助/语言/词数 — 标题区窄，字号随视口收缩、单行 */
#page-import .nav-bar {
  gap: 8px;
}
#page-import .nav-title {
  font-size: clamp(12px, 3.6vw, 16px);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-right { font-size: 13px; color: var(--gold, #e4c56c); cursor: pointer; }

/* ── 密钥页 ── */
.key-content {
  padding: var(--page-pad-y, 16px) max(18px, var(--page-pad-x, 18px));
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* 密钥页助记词：固定 3 列，行数随词数变化（12→4 行 … 24→8 行） */
.key-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(44px, auto);
  gap: 8px;
  margin-bottom: 16px;
  flex: 0 0 auto;
  width: 100%;
  align-content: start;
}
/* 密钥页助记词展示：禁止选中复制（与「禁止复制粘贴」策略一致） */
#keyWordGrid,
#keyWordGrid .key-word,
#keyWordGrid .word-val {
  user-select: none;
  -webkit-user-select: none;
}
.key-word {
  background: var(--bg, #06060f);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 12px;
  padding: 10px 8px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* 单行：序号. 词汇（与验证页「第 n 词」一致，均为 1-based） */
.key-word-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.28em;
  max-width: 100%;
  line-height: 1.38;
  word-break: break-word;
}
.word-idx {
  font-size: 11px;
  color: var(--text-muted, #6b7588);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.word-val { font-size: 13px; color: var(--text, #f1f3f8); font-weight: 500; min-width: 0; }
.key-warning {
  background: rgba(255,180,0,0.08); border: 1px solid rgba(255,180,0,0.2);
  border-radius: 12px; padding: 12px 14px;
  font-size: 12px; color: #ffcc44; line-height: 1.7;
  margin-bottom: 16px; display: flex; gap: 8px;
}

/* ── 首页 ── */
.home-header { background: var(--bg2, #0c0c18); padding: 18px max(18px, env(safe-area-inset-left, 0px)) 22px max(18px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.085)); }
/* 备份提示与铃铛/收款二维码：Grid 第二列固定图标，横幅隐藏时仍靠右 */
.home-header__top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.home-header__top-actions {
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 0;
  box-sizing: border-box;
}
.home-header__icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  box-sizing: border-box;
}
.home-header__icon-btn:active { opacity: 0.92; }
.home-backup-banner {
  grid-column: 1;
  display: none;
  min-width: 0;
  background: rgba(231, 76, 60, 0.14);
  border: 1px solid rgba(231, 76, 60, 0.38);
  color: #ffc8be;
  border-radius: 8px;
  box-sizing: border-box;
  margin: 0;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  line-height: 1.32;
  user-select: none;
}
.home-backup-banner__line1 {
  display: block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}
.home-backup-banner__line2 {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 200, 190, 0.9);
  line-height: 1.35;
}
.home-backup-banner:active { opacity: 0.92; }
.ww-quick-amt {
  flex: 1 1 calc(25% - 8px);
  min-width: 64px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(200, 168, 75, 0.35);
  background: var(--bg3, #141428);
  color: var(--gold, #e4c56c);
  cursor: pointer;
}
.ww-quick-amt:active { transform: scale(0.98); }
.home-greeting { font-size: 12px; color: var(--text-muted, #6b7588); margin-bottom: 4px; }
.home-addr-chip {
  font-size: 12px; color: var(--gold, #e4c56c);
  background: rgba(200,168,75,0.08);
  border: 1px solid rgba(200,168,75,0.2);
  border-radius: 8px; padding: 5px 10px;
  display: inline-block; margin-bottom: 12px;
}

/* 万语地址：单行展示，窄屏用 clamp 缩小字号，不换行 */
#homeAddrChip.wallet-address-chip,
#homeAddrChip.home-addr-chip,
.wallet-address-chip,
.settings-addr-chip,
.vanity-address {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(10px, 2.8vw, 14px);
  max-width: 100%;
  box-sizing: border-box;
}

/* 万语地址：16 位数字 + 中段 + 16 位数字；数字段灰/白，中段金黄 */
.wanyu-address {
  font-family: ui-monospace, monospace, monospace;
  letter-spacing: 0.35px;
}
.wanyu-digits {
  color: var(--text-muted, #999);
}
.wanyu-sep {
  color: var(--text-dim, #666);
  font-weight: 400;
}
.wanyu-chars {
  color: #ffd700;
  font-weight: 700;
}
[data-theme="light"] .wanyu-digits {
  color: #666;
}
[data-theme="light"] .wanyu-sep {
  color: #999;
}
.home-chain-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 14px;
  margin-top: 4px;
  padding: 12px 6px 10px;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid rgba(200, 168, 75, 0.22);
}
[data-theme="light"] .home-chain-strip {
  border-top-color: rgba(168, 137, 53, 0.28);
}
.home-chain-strip.home-chain-strip--dim {
  opacity: 0.68;
  filter: saturate(0.92);
}
.home-chain-strip.home-chain-strip--dim .home-short-addr {
  color: rgba(255,255,255,0.38);
}
.home-mini-chain {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
}
.home-mini-icon { width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.home-mini-icon svg { display: block; width: 30px; height: 30px; }
.home-chain-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  color: rgba(232,200,80,0.95); flex-shrink: 0;
}
.home-short-addr { font-size: 12px; font-family: ui-monospace, monospace; color: rgba(255,255,255,0.62); letter-spacing: 0.35px; }
.tx-empty-friendly {
  text-align: center;
  padding: 32px 20px 28px;
  color: var(--text-muted, #6b7588);
  font-size: 13px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(200,168,75,0.28);
  margin: 6px 0 4px;
}
.tx-empty-friendly .tx-empty-icon { font-size: 58px; margin-bottom: 18px; line-height: 1; opacity: 0.95; }
.tx-empty-friendly .tx-empty-title { font-size: 17px; font-weight: 600; color: var(--text-dim, #9aa3b8); margin-bottom: 10px; }
.tx-empty-friendly .tx-empty-hint { font-size: 12.5px; line-height: 1.8; color: var(--text-muted, #6b7588); max-width: 320px; margin: 0 auto; }
#txHistoryFilter::placeholder { color: var(--text-muted, #6b7588); opacity: 0.85; }
.home-balance { font-size: 32px; font-weight: 800; color: var(--text, #f1f3f8); }
.home-balance.home-balance--loading { animation: homeBalPulse 0.85s ease-in-out infinite; }
@keyframes homeBalPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.42; } }
.home-balance-sub { font-size: 12px; color: var(--text-muted, #6b7588); margin-top: 2px; margin-bottom: 0; }
/* 首页：人民币约价与万语芯片紧邻 */
#page-home .home-addr-stack--tight {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 10px;
  margin-top: 0;
  padding-top: 0;
}
#page-home .home-addr-stack--tight .home-addr-chip {
  margin-top: 0;
  margin-bottom: 8px;
}
/* 首页万语：一屏宽度内单行完整展示（无横向滚动）；按容器宽度缩放整行字号，数字段刻意缩小以省宽 */
#page-home .home-address-container {
  container-type: inline-size;
  container-name: ww-home-addr;
  text-align: center;
  padding: 0 8px;
  box-sizing: border-box;
  width: 100%;
}
#page-home #homeAddrChip.home-addr-chip,
#page-home #homeAddrChip.wallet-address-chip {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  width: auto;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 20px;
  display: inline-block;
  box-sizing: border-box;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  word-break: keep-all;
  text-align: center;
  line-height: 1.35;
  align-self: center;
  font-size: clamp(6px, 1.85vw, 11px);
}
@supports (font-size: 1cqi) {
  #page-home #homeAddrChip.home-addr-chip,
  #page-home #homeAddrChip.wallet-address-chip {
    font-size: min(11px, max(5.5px, calc((100cqi - 56px) / 54)));
  }
}
#page-home #homeAddrChip .wanyu-address {
  letter-spacing: 0.18px;
}
#page-home #homeAddrChip .wanyu-digits {
  font-size: 0.66em;
  letter-spacing: 0.02px;
  font-variant-numeric: tabular-nums;
}
#page-home #homeAddrChip .wanyu-sep {
  font-size: 0.8em;
  font-weight: 600;
}
#page-home #homeAddrChip .wanyu-chars {
  font-size: 1em;
  letter-spacing: 0.22px;
}
@media (max-width: 360px) {
  #page-home #homeAddrChip.home-addr-chip,
  #page-home #homeAddrChip.wallet-address-chip {
    padding: 6px 8px;
  }
}

/* 地址页：万语一行（与芯片同一逻辑） */
#page-addr #addrOneLine {
  display: block;
  text-align: center;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(9px, 2.5vw, 12px);
}

/* 收款区二维码下方万语整行 */
#qrPart1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
  font-size: clamp(8px, 2.4vw, 11px);
}
/* —— balance hide / scroll-top / tab swipe (patch) —— */
.ww-balance-privacy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding-right: 2px; box-sizing: border-box; }
.ww-balance-hide-btn {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.72); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.ww-balance-hide-btn[aria-pressed="true"] { border-color: rgba(200,168,75,0.5); color: var(--gold-light, #f2e6b0); background: rgba(200,168,75,0.1); }
.ww-balance-hidden #totalBalanceDisplay,
.ww-balance-hidden #totalBalanceSub,
.ww-balance-hidden #portfolioPieCanvas,
.ww-balance-hidden #portfolioPieLegend,
.ww-balance-hidden #page-home .asset-amount,
.ww-balance-hidden #page-home .asset-value,
.ww-balance-hidden #page-home .asset-change {
  filter: blur(11px);
  user-select: none;
}
.ww-balance-hidden #homeAddrChip,
.ww-balance-hidden .home-short-addr,
.ww-balance-hidden #settingsAddr,
.ww-balance-hidden #settingsWalletTitle,
.ww-balance-hidden #page-addr .addr-display,
.ww-balance-hidden #page-addr .copy-row,
.ww-balance-hidden #receiveAddrText {
  filter: blur(9px);
  user-select: none;
  pointer-events: none;
}
.ww-balance-hidden .ww-balance-hide-btn {
  pointer-events: auto;
}
.ww-scroll-top-btn {
  position: absolute; bottom: calc(var(--ww-tabbar-clearance) + 20px); right: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(200,168,75,0.42); background: rgba(18,14,28,0.94); color: var(--gold-light, #f2e6b0);
  font-size: 19px; font-weight: 700; line-height: 1; cursor: pointer; z-index: 24;
  display: none; align-items: center; justify-content: center; box-shadow: 0 4px 18px rgba(0,0,0,0.38);
  transition: opacity 0.2s, transform 0.15s;
}
.ww-scroll-top-btn.ww-show { display: flex; }
.ww-scroll-top-btn:active { transform: scale(0.93); }
@media (prefers-reduced-motion: reduce) {
  .ww-scroll-top-btn { transition: none; }
}

.ww-price-ticker-bar { overflow: hidden; width: 100%; background: linear-gradient(90deg, rgba(18,14,28,0.98), rgba(26,22,40,0.95)); border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.085)); padding: 9px 0; margin: 0 0 0 0; }
.ww-price-ticker-marquee { display: flex; width: max-content; animation: wwTickerScroll 32s linear infinite; }
.ww-price-ticker-marquee:hover { animation-play-state: paused; }
@keyframes wwTickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ww-ticker-text { display: inline-block; padding-right: 56px; font-size: 12px; color: rgba(255,255,255,0.82); letter-spacing: 0.25px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ww-ticker-text strong { color: var(--gold-light, #f2e6b0); font-weight: 700; margin-left: 5px; }
.ww-portfolio-pie-card { margin: 0 16px 12px; padding: 14px 16px; background: var(--bg2, #0c0c18); border: 1px solid var(--border, rgba(255, 255, 255, 0.085)); border-radius: 16px; }
.ww-portfolio-pie-title { font-size: 11px; color: var(--text-muted, #6b7588); letter-spacing: 1px; margin-bottom: 10px; }
.ww-portfolio-pie-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ww-portfolio-pie-legend { flex: 1; min-width: 140px; font-size: 12px; line-height: 1.65; color: var(--text, #f1f3f8); }
.ww-portfolio-pie-legend div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ww-pie-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-right: 6px; display: inline-block; }
.ww-speed-btn { flex: 1; min-width: 0; padding: 10px 8px; border-radius: 12px; border: 1px solid var(--border, rgba(255, 255, 255, 0.085)); background: var(--bg3, #141428); color: var(--text-muted, #6b7588); font-size: 12px; cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.ww-speed-btn--active { border-color: rgba(200,168,75,0.65); background: rgba(200,168,75,0.12); color: var(--gold-light, #f2e6b0); font-weight: 600; }
.transfer-contacts-card { background: var(--bg2, #0c0c18); border: 1px solid var(--border, rgba(255, 255, 255, 0.085)); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; }
.transfer-contacts-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.transfer-contacts-title { font-size: 11px; color: var(--text-muted, #6b7588); letter-spacing: 1px; }
.transfer-contact-add { font-size: 12px; color: var(--gold, #e4c56c); cursor: pointer; user-select: none; }
.transfer-contact-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--bg3, #141428); margin-bottom: 6px; border: 1px solid var(--border, rgba(255, 255, 255, 0.085)); cursor: pointer; }
.transfer-contact-row:last-child { margin-bottom: 0; }
.transfer-contact-nick { font-size: 13px; font-weight: 600; color: var(--text, #f1f3f8); flex: 0 1 auto; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-contact-addr { font-size: 10px; color: var(--text-muted, #6b7588); font-family: ui-monospace, monospace; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-contact-del { font-size: 11px; color: var(--text-muted, #6b7588); cursor: pointer; padding: 4px 6px; flex-shrink: 0; user-select: none; }
.transfer-contact-empty { font-size: 12px; color: var(--text-muted, #6b7588); padding: 8px 4px; }

/* 转账页 · 地址簿全屏弹窗 */
#transferAddrBookOverlay.qr-overlay {
  position: absolute;
  inset: 0;
  z-index: 125;
  padding: 16px;
  box-sizing: border-box;
}
.transfer-addr-book-panel {
  position: relative;
  background: var(--bg2, #0c0c18);
  border-radius: 22px;
  max-width: 400px;
  width: 100%;
  /* 空列表时内容区过矮会导致 .transfer-addr-book-add-layer 绝对定位区域不足，表单被裁切 */
  min-height: min(68vh, 520px);
  max-height: min(86vh, 620px);
  display: flex;
  flex-direction: column;
  padding: 16px 16px 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}
.transfer-addr-book-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.transfer-addr-book-add-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 2px 0 6px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(10, 10, 20, 0.96);
  border-radius: 14px;
  border: 1px solid rgba(200, 168, 75, 0.12);
  box-sizing: border-box;
}
.transfer-addr-book-add-layer-card {
  flex: 0 0 auto;
  padding: 0 2px;
}
.transfer-addr-book-add-layer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #f1f3f8);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}
.transfer-addr-book-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted, #6b7588);
  margin-bottom: 4px;
  letter-spacing: 0.35px;
}
.transfer-addr-book-add-layer-card input,
.transfer-addr-book-add-layer-card textarea,
.transfer-addr-book-add-layer-card select {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  background: var(--bg3, #141428);
  color: var(--text, #f1f3f8);
  font-size: 13px;
  font-family: inherit;
}
.transfer-addr-book-add-layer-card select {
  padding: 6px 8px;
  min-height: 34px;
  font-size: 12px;
  line-height: 1.25;
}
.transfer-addr-book-add-layer-card textarea {
  resize: vertical;
  min-height: 48px;
  line-height: 1.4;
}
.transfer-addr-book-net-hint {
  font-size: 10px;
  color: var(--gold, #e4c56c);
  margin: -2px 0 6px;
  line-height: 1.35;
  min-height: 0;
}
.transfer-addr-book-net-hint:empty {
  margin-bottom: 4px;
}
.transfer-addr-book-panel-footer {
  flex-shrink: 0;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.085));
}
.transfer-addr-book-footer-row {
  display: none;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
}
.transfer-addr-book-footer-row.transfer-addr-book-footer-row--visible {
  display: flex;
}
.transfer-addr-book-footer-btn {
  flex: 1;
  min-width: 80px;
  min-height: 40px;
  height: 40px;
  width: auto;
  margin-top: 0;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}
.transfer-addr-book-row-net {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #6b7588);
  margin-left: 6px;
}
.transfer-addr-book-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.transfer-addr-book-head.transfer-addr-book-head--add {
  justify-content: center;
}
.transfer-addr-book-head.transfer-addr-book-head--add .transfer-addr-book-head-actions {
  display: none;
}
.transfer-addr-book-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.transfer-addr-book-head-actions .transfer-addr-book-head-btn {
  flex: 0 0 56px;
  width: 56px;
  min-width: 56px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0 12px;
  margin-top: 0;
  font-size: 13px;
  border-radius: 12px;
  box-sizing: border-box;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.transfer-addr-book-close-head {
  font-weight: 600;
}
.transfer-addr-book-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #f1f3f8);
  letter-spacing: 0.5px;
}
.transfer-addr-book-add-btn {
  font-weight: 600;
  color: var(--gold, #e4c56c);
  background: rgba(200, 168, 75, 0.1);
  border: 1px solid rgba(200, 168, 75, 0.45);
}
.transfer-addr-book-add-form {
  margin-bottom: 12px;
  flex-shrink: 0;
}
.transfer-addr-book-add-form input,
.transfer-addr-book-add-form textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  background: var(--bg3, #141428);
  color: var(--text, #f1f3f8);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 44px;
}
.transfer-addr-book-save-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 2px;
}
.transfer-addr-book-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}
.transfer-addr-book-empty {
  font-size: 13px;
  color: var(--text-muted, #6b7588);
  text-align: center;
  padding: 28px 12px;
  line-height: 1.55;
  cursor: pointer;
  user-select: none;
  border-radius: 14px;
  border: 1px dashed var(--border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.02);
}
.transfer-addr-book-empty:focus-visible {
  outline: 2px solid rgba(200, 168, 75, 0.5);
  outline-offset: 2px;
}
.transfer-addr-book-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 12px;
  background: var(--bg3, #141428);
  margin-bottom: 8px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  cursor: pointer;
  touch-action: manipulation;
}
.transfer-addr-book-row:last-child {
  margin-bottom: 0;
}
.transfer-addr-book-row--pressed {
  opacity: 0.92;
}
.transfer-addr-book-row-main {
  flex: 1;
  min-width: 0;
}
.transfer-addr-book-row-nick {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f1f3f8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transfer-addr-book-row-addr {
  font-size: 10px;
  color: var(--text-muted, #6b7588);
  font-family: ui-monospace, monospace;
  margin-top: 4px;
  word-break: break-all;
  line-height: 1.35;
}
.transfer-addr-book-row-del {
  font-size: 12px;
  color: var(--text-muted, #6b7588);
  cursor: pointer;
  padding: 6px 8px;
  flex-shrink: 0;
  user-select: none;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
}
.transfer-addr-book-row-del:hover,
.transfer-addr-book-row-del:focus-visible {
  color: #e05c5c;
  border-color: rgba(224, 92, 92, 0.35);
  outline: none;
}

.addr-book-list-card {
  background: var(--bg2, #0c0c18);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 16px;
  padding: 14px 16px 12px;
  margin-bottom: 0;
}
.addr-book-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.addr-book-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #f1f3f8);
  letter-spacing: 0.3px;
}
.addr-book-list-add {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold, #e4c56c);
  cursor: pointer;
  user-select: none;
}
.addr-book-list-add:hover,
.addr-book-list-add:focus-visible {
  color: var(--gold-light, #f2e6b0);
  outline: none;
}
.addr-book-list-meta {
  font-size: 11px;
  color: var(--text-muted, #6b7588);
}
.addr-book-list-count {
  font-size: 11px;
  color: var(--text-muted, #6b7588);
  white-space: nowrap;
}
.addr-book-list-search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  background: var(--bg3, #141428);
  color: var(--text, #f1f3f8);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.addr-book-list-search::placeholder {
  color: var(--text-muted, #6b7588);
}
.addr-book-list-search:focus {
  border-color: rgba(200, 168, 75, 0.45);
}
.addr-book-list-scroll {
  max-height: min(52vh, 380px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px 4px;
}
.addr-book-list-scroll .addr-book-settings-row:first-child {
  margin-top: 0;
}
#addrBookSettingsList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.addr-book-settings-empty { font-size: 12px; color: var(--text-muted, #6b7588); padding: 8px 4px; }
.addr-book-settings-empty--center {
  text-align: center;
  padding: 28px 16px 20px;
  line-height: 1.65;
}
.addr-book-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg3, #141428);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
}
.addr-book-settings-main {
  min-width: 0;
  cursor: pointer;
  border-radius: 8px;
  padding: 2px 4px 2px 2px;
  margin: -2px -4px -2px -2px;
  outline: none;
}
.addr-book-settings-main:hover .addr-book-settings-nick { color: var(--gold-light, #f2e6b0); }
.addr-book-settings-main:focus-visible {
  box-shadow: 0 0 0 2px rgba(200, 168, 75, 0.45);
}
.addr-book-settings-nick { font-size: 13px; font-weight: 600; color: var(--text, #f1f3f8); word-break: break-word; }
.addr-book-settings-addr { font-size: 11px; color: var(--text-muted, #6b7588); font-family: ui-monospace, monospace; word-break: break-all; line-height: 1.45; margin-top: 4px; }
.addr-book-settings-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  align-items: stretch;
}
.addr-book-settings-edit,
.addr-book-settings-del {
  font-size: 11px;
  background: transparent;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.addr-book-settings-edit {
  color: var(--gold, #e4c56c);
  border: 1px solid rgba(200, 168, 75, 0.45);
}
.addr-book-settings-del {
  color: var(--text-muted, #6b7588);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
}

/* 地址簿 · 添加/编辑联系人表单 */
.addr-book-add-panel {
  background: var(--bg2, #0c0c18);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 16px;
  padding: 12px 14px 14px;
  margin-top: 12px;
}
.addr-book-add-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #f1f3f8);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.addr-book-add-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted, #6b7588);
  margin-bottom: 4px;
}
.addr-book-add-input,
.addr-book-add-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  background: var(--bg3, #141428);
  color: var(--text, #f1f3f8);
  font-size: 13px;
  font-family: inherit;
}
.addr-book-add-input {
  margin-bottom: 6px;
}
.addr-book-add-textarea {
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
  min-height: 48px;
  margin-bottom: 0;
}
.addr-book-add-input:focus,
.addr-book-add-textarea:focus {
  outline: none;
  border-color: rgba(200, 168, 75, 0.45);
}
.addr-book-add-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
  align-items: stretch;
}
.addr-book-add-actions .btn-secondary,
.addr-book-add-actions .btn-primary {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-top: 0;
  min-height: 42px;
  padding: 9px 12px;
  font-size: 13px;
}

.transfer-addr-dd-item .contact-nick-mark { color: var(--gold, #e4c56c); font-weight: 600; margin-right: 6px; }
.quick-btns { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px var(--home-section-pad-x, 16px); }
#wwCandleChartHost { box-shadow: inset 0 0 0 1px rgba(200,168,75,0.08); }
.quick-btn {
  flex: 1 1 18%; min-width: 56px; background: var(--bg2, #0c0c18);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085)); border-radius: 14px;
  padding: 12px 6px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.quick-btn:hover { border-color: var(--gold, #e4c56c); }
.quick-btn-icon { font-size: 22px; margin-bottom: 4px; line-height: 1; display: flex; align-items: center; justify-content: center; height: 28px; }
.quick-btn-label { font-size: 11px; color: var(--text-dim, #9aa3b8); }
.assets-section {
  padding: 12px var(--home-section-pad-x, 16px) 20px;
  border-top: 1px solid rgba(200,168,75,0.4);
  margin-top: 4px;
}
.assets-title { font-size: 13px; font-weight: 600; color: var(--text, #f1f3f8); margin: 0 0 10px; }

/* 首页 · 区块标题行：标题与「刷新」同一行、垂直居中，左右与搜索框对齐 */
#page-home .home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  min-height: 36px;
}
#page-home .home-section-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}
#page-home .home-refresh-link {
  font-size: 11px;
  color: var(--gold, #e4c56c);
  cursor: pointer;
  line-height: 1.2;
  padding: 6px 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
#page-home .home-tx-section {
  padding: 0 var(--home-section-pad-x, 16px) 16px;
  box-sizing: border-box;
}
#page-home .home-tx-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f1f3f8);
  margin: 0;
  line-height: 1.25;
}
#page-home #txHistoryFilter.home-tx-filter {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin: 0 0 10px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  background: var(--bg3, #141428);
  color: var(--text, #f1f3f8);
  font-size: 13px;
  outline: none;
}
#page-home #txHistoryHomeFooter.home-tx-footer {
  margin-top: 4px;
}
#page-home .home-tx-view-more-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(200, 168, 75, 0.35);
  background: rgba(200, 168, 75, 0.08);
  color: var(--gold, #e4c56c);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
#page-home .home-tx-view-more-btn:active {
  opacity: 0.88;
}
#page-tx-history #txHistoryFilterFull.home-tx-filter {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin: 0 0 10px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  background: var(--bg3, #141428);
  color: var(--text, #f1f3f8);
  font-size: 13px;
  outline: none;
}
.asset-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2, #0c0c18); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085)); cursor: pointer; transition: all 0.2s;
}
.asset-item:hover { border-color: rgba(200,168,75,0.2); }
.asset-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; overflow: hidden; }
.asset-icon .ww-coin-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ww-swap-coin-icon .ww-coin-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.asset-info { flex: 1; }
.asset-name { font-size: 15px; font-weight: 600; color: var(--text, #f1f3f8); }
.asset-chain { font-size: 10px; color: var(--text-muted, #6b7588); }
.asset-right { text-align: right; }
.asset-amount { font-size: 14px; font-weight: 600; color: var(--text, #f1f3f8); }
.asset-value { font-size: 11px; color: var(--text-muted, #6b7588); }
.asset-change { font-size: 10px; }
.asset-change.up { color: var(--green, #4cd964); }
.asset-change.down { color: var(--red, #ff6b6b); }

/* ── 地址页（核心升级）── */
.addr-content { padding: 16px 18px; flex: 1; overflow-y: auto; }

/* 母语地址卡 · 扫码收款区（同色系深灰橄榄底 + 金边） */
.addr-native-card,
#receiveQrSection {
  background: linear-gradient(135deg, #12120a, #1a1a08);
  border: 1.5px solid rgba(200,168,75,0.6);
  border-radius: 22px; padding: 20px;
  margin-bottom: 10px;
  box-shadow: 0 0 20px rgba(200,168,75,0.08);
}
#receiveQrSection { text-align: center; }
.addr-card-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--gold, #e4c56c);
  background: rgba(200,168,75,0.1);
  border: 1px solid rgba(200,168,75,0.2);
  border-radius: 20px; padding: 3px 10px;
  margin-bottom: 14px;
}

/* 地址主体：大字显示 */
.addr-display {
  margin-bottom: 16px;
}
.addr-main {
  font-size: 22px; font-weight: 800;
  color: var(--gold-light, #f2e6b0);
  letter-spacing: 2px;
  line-height: 1.4;
  margin-bottom: 4px;
}
.addr-num {
  font-size: 13px; color: #555;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  padding-left: 2px;
}

.addr-actions { display: flex; gap: 8px; margin-bottom: 0; }
.addr-action-btn {
  flex: 1;
  background: rgba(200,168,75,0.1);
  border: 1px solid rgba(200,168,75,0.25);
  border-radius: 10px; padding: 9px 0;
  font-size: 12px; color: var(--gold, #e4c56c);
  text-align: center; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.addr-action-btn:hover { background: rgba(200,168,75,0.18); }
.addr-action-btn.copied {
  border-color: rgba(46, 160, 67, 0.9) !important;
  color: #0a5d14 !important;
  background: rgba(74, 200, 74, 0.22) !important;
}
[data-theme="light"] .addr-action-btn.copied {
  border-color: rgba(36, 140, 56, 0.95) !important;
  color: #064a12 !important;
  background: rgba(74, 200, 74, 0.18) !important;
}

/* 首页「复制地址」：成功态需盖过内联与浅色主题 */
#homeCopyAddrBtn.ww-copy-btn--success {
  background: rgba(74, 200, 74, 0.38) !important;
  color: #0a3d0a !important;
  border: 1px solid rgba(46, 160, 67, 0.8) !important;
}
[data-theme="light"] #homeCopyAddrBtn.ww-copy-btn--success {
  background: rgba(74, 200, 74, 0.3) !important;
  color: #084208 !important;
  border: 1px solid rgba(36, 130, 50, 0.95) !important;
}

/* 一键复制两个地址 */
.copy-both-btn {
  width: 100%; margin-top: 14px;
  background: var(--bg3, #141428); border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 14px; padding: 12px;
  font-size: 13px; color: var(--text-dim, #9aa3b8);
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.copy-both-btn:hover { border-color: var(--gold, #e4c56c); color: var(--gold-light, #f2e6b0); }

/* QR弹窗 */
.overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 100;
}

@keyframes wtShake {
  0%,100% { transform: translateX(0); }
  15% { transform: translateX(-10px); }
  30% { transform: translateX(10px); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}
.wt-shake-wrong { animation: wtShake 0.5s ease; }
/* PIN 解锁输入错误态（与震动动画配合） */
.ww-pin-unlock-input.ww-pin-input-error {
  border-color: var(--red, #e74c3c) !important;
  box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.35);
}
.wt-transfer-shake { animation: wtShake 0.45s ease; }
.transfer-addr-dd { position:absolute; left:10px; right:10px; top:100%; margin-top:6px; background:var(--bg3, #141428); border:1px solid rgba(200,168,75,0.35); border-radius:12px; max-height:200px; overflow-y:auto; z-index:40; box-shadow:0 10px 28px rgba(0,0,0,0.45); }
.transfer-addr-dd-item { padding:10px 14px; font-size:12px; color:var(--text, #f1f3f8); cursor:pointer; border-bottom:1px solid var(--border, rgba(255, 255, 255, 0.085)); word-break:break-all; line-height:1.45; }
.transfer-addr-dd-item:last-child { border-bottom:none; }
.transfer-addr-dd-item:hover,.transfer-addr-dd-item:active { background:var(--bg2, #0c0c18); }
.transfer-addr-dd-empty { padding:12px 14px; font-size:12px; color:var(--text-muted, #6b7588); }
.transfer-addr-dd-hdr {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted, #6b7588);
  text-transform: uppercase;
}
.transfer-addr-dd-hdr:first-child { padding-top: 4px; }
.transfer-addr-dd-item.recent-item { display: flex; align-items: flex-start; gap: 0; }
.transfer-addr-dd-item.recent-item .recent-ico { flex-shrink: 0; margin-right: 6px; opacity: 0.85; font-size: 13px; }
.overlay.show { display: flex !important; }
.qr-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 100;
}
.qr-overlay.show { display: flex; }
.overlay.show { display: flex !important; }

/* 全屏弹窗：无 .show 时强制隐藏（按 id 兜底，避免层层叠显；hbSuccessOverlay 仍用内联 style 显隐，勿列入） */
#walletLoadingOverlay:not(.show),
#pinUnlockOverlay:not(.show),
#totpUnlockOverlay:not(.show),
#totpSetupOverlay:not(.show),
#pinSetupOverlay:not(.show),
#wanYuCustomizeOverlay:not(.show),
#wwSystemConfirmOverlay:not(.show),
#wwSystemPromptOverlay:not(.show),
#systemNotifOverlay:not(.show),
#qrOverlay:not(.show),
#transferConfirmOverlay:not(.show),
#transferQrScanOverlay:not(.show),
#transferAddrBookOverlay:not(.show) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* 转账页扫码：盖住页内其它层 */
#transferQrScanOverlay.qr-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  padding: 16px;
  box-sizing: border-box;
}

/* 转账助记词签名：全屏盖住底部导航与其它层 */
#transferMnemonicOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
#transferMnemonicOverlay.show {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
}
#transferMnemonicOverlay:not(.show) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
#transferMnemonicOverlay .overlay-sheet {
  background: var(--bg, #06060f);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  max-width: 500px;
}

.overlay-sheet {
  background: var(--bg2, #0c0c18); border-radius: 24px;
  padding: 24px; width: 320px; max-height: 80vh;
  overflow-y: auto;
}

/* PIN/TOTP 弹层：键盘避让由 wallet.ui.js 设置 transform，此处仅平滑过渡 */
#pinUnlockPanel,
#totpUnlockPanel,
.pin-setup-overlay .pin-setup-panel {
  transition: transform 0.2s ease;
}
.qr-card {
  background: #fff; border-radius: 20px;
  padding: 24px; width: 280px; text-align: center;
}
.qr-placeholder {
  width: 180px; height: 180px;
  background: #f0f0f0; margin: 0 auto 16px;
  border-radius: 12px; display: flex;
  align-items: center; justify-content: center;
  font-size: 60px;
}
.qr-addr-main {
  font-size: clamp(8px, 2.4vw, 14px);
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
}
.qr-addr-num { font-size: 12px; color: #999; margin-bottom: 8px; }
.qr-chain { font-size: 10px; color: #bbb; font-family: monospace; word-break: break-all; }
.qr-close {
  margin-top: 16px; background: #1a1a2a; color: #e0e0f0;
  border: none; border-radius: 12px; padding: 12px 32px;
  font-size: 14px; cursor: pointer; width: 100%;
}

/* ── Swap ── */
/* 兑换页：与收款/礼物主 Tab 一致，整页固定不纵向滚动（底栏见 #tabBar） */
#page-swap.page {
  overflow: hidden !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: auto;
}
/* 真机全屏壳层：与 .phone 同宽时铺满视口，杜绝外层橡皮筋滚动（桌面模拟手机框仍用绝对定位由 .pages 裁切） */
@media (max-width: 768px),
       (min-aspect-ratio: 1/1) and (max-height: 520px) and (max-width: 1100px) {
  #page-swap.page {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100dvh !important;
    padding-top: env(safe-area-inset-top, 20px);
  }
}
#page-swap .nav-bar {
  flex-shrink: 0;
}
/* nav 与底栏之间的主列：锁高、禁止滚动（对齐礼物页 .key-content 思路） */
#page-swap .swap-container {
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden !important;
  -webkit-overflow-scrolling: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}
.swap-content { padding: 20px; flex: 1; }
/* 主按钮与上方卡片同宽（列 flex 子项若被居中会按内容收缩） */
#page-swap .swap-content {
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden !important;
  -webkit-overflow-scrolling: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px 2px;
}
#page-swap .swap-content > .btn-primary {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  flex-shrink: 0;
}
.swap-card {
  background: var(--bg2, #0c0c18); border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 18px; padding: 16px; margin-bottom: 10px;
}
/* 兑换页：紧凑布局，一屏内可见主按钮 */
#page-swap .swap-slip-row {
  margin-bottom: 2px;
  flex-shrink: 0;
}
#page-swap .swap-card {
  padding: 5px 8px;
  margin-bottom: 4px;
  border-radius: 12px;
  flex-shrink: 1;
  min-height: 0;
}
#page-swap .swap-in-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 2px;
}
#page-swap .swap-amount-input {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 10px;
}
#page-swap .swap-in-usd {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 56px;
  font-size: 11px;
  color: var(--text-muted, #6b7588);
  white-space: nowrap;
}
#page-swap .swap-quote-hint-row {
  margin-top: 2px;
  min-height: 14px;
  font-size: 11px;
  text-align: right;
}
#page-swap .swap-arrow-wrap {
  text-align: center;
  margin: 2px 0 4px;
  flex-shrink: 0;
}
/* 中间交换方向按钮：正圆（覆盖 .btn-secondary 的 min-height:46px、width:100%、圆角矩形） */
#page-swap .swap-direction-btn,
#page-swap .swap-arrow-btn {
  width: 44px !important;
  height: 44px !important;
  min-height: 0 !important;
  min-width: 0 !important;
  max-width: 44px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  border-radius: 50% !important;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px !important;
  line-height: 1 !important;
}
#page-swap #swapAmountOut {
  font-size: 17px !important;
}
#page-swap .swap-rate-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding: 2px 0 0;
  margin-top: 3px;
  color: var(--text-muted, #6b7588);
  line-height: 1.3;
}
#page-swap .swap-action-btn {
  padding: 8px 0;
  flex-shrink: 0;
}
#page-swap .swap-footnote {
  flex-shrink: 0;
  margin-top: 2px !important;
  font-size: 9px !important;
  line-height: 1.25 !important;
}
#page-swap #swapToOtherBtn {
  padding: 8px 10px !important;
  font-size: 12px !important;
  min-height: 0 !important;
}
#page-swap .swap-min-usd-row {
  margin-top: 4px !important;
}
.swap-label { font-size: 11px; color: var(--text-muted, #6b7588); margin-bottom: 10px; }
.swap-row { display: flex; align-items: center; gap: 10px; }
.swap-coin-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.swap-coin-info { flex: 1; }
.swap-coin-name { font-size: 16px; font-weight: 700; color: var(--text, #f1f3f8); }
.swap-coin-bal { font-size: 11px; color: var(--text-muted, #6b7588); }
.swap-input { background: none; border: none; font-size: 22px; color: var(--text, #f1f3f8); width: 110px; text-align: right; outline: none; }
.swap-arrow { text-align: center; padding: 4px; color: var(--gold, #e4c56c); font-size: 22px; cursor: pointer; }
.swap-info { background: var(--bg2, #0c0c18); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.swap-info-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted, #6b7588); margin-bottom: 6px; }
.swap-info-row:last-child { margin-bottom: 0; }
.swap-info-val { color: var(--text, #f1f3f8); }
.swap-info-val.gold { color: var(--gold, #e4c56c); }

/* ── 底部导航 ── */
/* 桌面：#tabBar 为 body 子节点，用 fixed + 与 .phone 同宽/同底对齐，模拟原先「在 .phone 内 absolute 贴底」；勿在全宽下 fixed 贴视口底（否则会悬在视口中部、下方大片空白）。 */
/* 窄屏 / PWA：#tabBar 用 position:fixed 钉住视口底边（与 .phone 壳层解耦，避免壳层高度偏短时底栏悬空）。 */
#tabBar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: none;
  /* 不使用 transform 避免创建包含块 */
}
@media (min-width: 769px) {
  #tabBar {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: max(0px, calc((100vh - 844px) / 2)) !important;
    width: min(390px, 100vw) !important;
    max-width: 100% !important;
    margin: 0 !important;
    transform: translateX(-50%) !important;
    -webkit-transform: translateX(-50%) !important;
    border-radius: 0 0 40px 40px;
  }
}
/* 窄屏（含 PWA / Telegram WebView）：底栏 fixed 贴布局视口底，避免受 .phone 已用高度偏短影响 */
@media (max-width: 768px),
       (min-aspect-ratio: 1/1) and (max-height: 520px) and (max-width: 1100px) {
  #tabBar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: var(--ww-app-width, 100%) !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    /* 移除 transform 避免创建 stacking context 导致定位异常 */
    -webkit-transform: none !important;
    transform: none !important;
  }
}
/* PWA：首帧在 head 已设 data-ww-boot-page 时隐藏引导页底栏（与 wallet.runtime WW_HIDE_BOTTOM_TABBAR_PAGES 一致），不依赖 REAL_WALLET 注入时机 */
html[data-ww-boot-page="page-welcome"] #tabBar,
html[data-ww-boot-page="page-key"] #tabBar,
html[data-ww-boot-page="page-key-verify"] #tabBar,
html[data-ww-boot-page="page-import"] #tabBar,
html[data-ww-boot-page="page-password-restore"] #tabBar {
  display: none !important;
}
/* 引导页：底栏隐藏（head 首帧 data-ww-boot-page 卸下后仍生效；与 WW_HIDE_BOTTOM_TABBAR_PAGES / wwApplyTabBarVisibilityForPage 一致） */
body:has(#page-welcome.page.active) #tabBar,
body:has(#page-key.page.active) #tabBar,
body:has(#page-key-verify.page.active) #tabBar,
body:has(#page-import.page.active) #tabBar,
body:has(#page-password-restore.page.active) #tabBar {
  display: none !important;
}
.tab-bar {
  /* 勿用固定 height：PWA 下 padding-bottom 含 home indicator 时会把图标+文字区压扁，标签被裁切 */
  min-height: 56px;
  height: auto;
  overflow: visible;
  background: var(--bg2, #0c0c18);
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  /* 底栏外缘贴齐视口底（#tabBar bottom:0）；垂直方向仅留 home indicator 安全区内边距，勿再加 8px 等额外 padding */
  padding: 0;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-shrink: 0;
  width: 100%; position: relative; z-index: 10;
  box-sizing: border-box;
  /* 覆盖 WW_DESIGN_V1 上半段 .tab-bar 的半透明+毛玻璃：避免底栏顶缘发暗/叠影，与各主 Tab 页一致 */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.tab-bar-indicator {
  position: absolute;
  bottom: 10px;
  left: 0;
  height: 40px;
  border-radius: 12px;
  background: rgba(200, 168, 75, 0.12);
  border: 1px solid rgba(200, 168, 75, 0.28);
  pointer-events: none;
  transition: left 0.22s ease, width 0.22s ease, opacity 0.18s ease;
  z-index: 0;
  opacity: 0;
  box-sizing: border-box;
}
.tab-item {
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  gap: 4px;
  font-size: 10px; color: var(--text-muted, #6b7588);
  cursor: pointer; padding: 6px 4px;
  border-radius: 10px; transition: all 0.2s;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(200, 168, 75, 0.15);
}
.tab-item.active { color: var(--gold, #e4c56c); }
.tab-item:active { transform: scale(0.97); }
.ww-swap-flip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(200, 168, 75, 0.45);
  background: rgba(200, 168, 75, 0.1);
  color: var(--gold, #e4c56c);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.ww-swap-flip-btn:active { transform: scale(0.96); background: rgba(200, 168, 75, 0.18); }
.gift-claim-create-row { gap: 10px; }
.gift-claim-create-row .btn-primary,
.gift-claim-create-row .btn-secondary {
  flex: 1;
  min-width: 0;
  padding: 12px 10px;
  font-size: 14px;
  box-sizing: border-box;
}
#hbMessage {
  min-height: 44px;
  line-height: 1.4;
}
.tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0;
  line-height: 0;
}
.tab-icon svg { width: 22px; height: 22px; display: block; flex-shrink: 0; }
.tab-item .tab-icon svg { color: inherit; }
.tab-bar .tab-item > span:not(.tab-icon),
.tab-bar .tab-item .tab-label {
  display: block !important;
  font-size: 10px;
  margin-top: 2px;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-faq .faq-body { padding: 0 16px 32px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
#page-faq .faq-block { background: var(--bg2, #0c0c18); border: 1px solid var(--border, rgba(255, 255, 255, 0.085)); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
#page-faq .faq-block h3 { font-size: 15px; font-weight: 700; color: var(--gold, #e4c56c); margin: 0 0 8px; }
#page-faq .faq-block p { font-size: 13px; color: var(--text-muted, #6b7588); line-height: 1.65; margin: 0; }
.nav-help-btn { flex-shrink: 0; background: rgba(200,168,75,0.12); border: 1px solid rgba(200,168,75,0.35); border-radius: 10px; color: var(--gold, #e4c56c); font-size: 12px; font-weight: 700; padding: 4px 9px; cursor: pointer; line-height: 1.2; }
.nav-help-btn:active { opacity: 0.85; }


@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.fade-up { animation: fadeUp 0.3s ease both; }

/* 设置列表行 */
.settings-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-row:hover { background: rgba(255,255,255,0.03); }
.settings-row--switch { cursor: pointer; user-select: none; }
.settings-row--switch:active { opacity: 0.92; }
.settings-row--switch .settings-label { flex: 1; }
.ww-settings-switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.ww-settings-switch--on {
  background: var(--green, #26a17b);
}
.ww-settings-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
.ww-settings-switch--on .ww-settings-switch__knob {
  transform: translateX(20px);
}
.settings-icon { font-size: 18px; width: 28px; flex-shrink: 0; }
.settings-label { flex: 1; font-size: 14px; color: var(--text, #f1f3f8); margin-left: 4px; }
.settings-value { font-size: 13px; color: var(--text-muted, #6b7588); margin-right: 6px; }
.settings-arrow { font-size: 16px; color: var(--text-muted, #6b7588); }
.settings-divider { height: 1px; background: var(--border, rgba(255, 255, 255, 0.085)); margin: 0 16px; }
/* 设置页：删菜单项后若遗留相邻双分隔线，收起多余一条，避免大块空白感 */
#page-settings .settings-divider + .settings-divider { display: none; }

/* 设置页：与同页底栏（--bg2）统一底色，避免 .u14 弹性留白 + 底部垫层（默认 --bg 更深）与 fixed 底栏形成大块深灰缝/叠影；资产页因列表更长往往不明显 */
#page-settings.page {
  background: var(--bg2, #0c0c18);
  box-shadow: none;
}
#page-settings.page::before,
#page-settings.page::after {
  display: none !important;
  content: none !important;
}
#page-settings .u14 {
  background: transparent;
  box-shadow: none;
  /* 短列表时勿继承 .u14 的 flex:1 占满整页，否则底栏上方出现大块空底色 */
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: visible;
}

/* 语言列表行 */
.lang-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2, #0c0c18); border: 1.5px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 14px; padding: 12px 16px;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.lang-row:hover { border-color: rgba(200,168,75,0.4); background: #161616; }
.lang-row.active {
  border: 2.5px solid var(--gold, #e4c56c);
  background: linear-gradient(135deg,#181808,#1c1c0a);
  box-shadow: 0 0 0 1px rgba(200,168,75,0.55), 0 8px 28px rgba(200,168,75,0.2);
}
/* Welcome: 2-col cards + gold ring + prominent check */
#welcomeLangGrid .lang-row:not(.active) .lang-check {
  font-size: 13px !important;
  min-width: 0;
  opacity: 0 !important;
  filter: none;
}
#welcomeLangGrid .lang-row.active {
  border: 3px solid var(--gold, #e4c56c);
  outline: 2px solid rgba(200, 168, 75, 0.55);
  outline-offset: 0px;
  background: linear-gradient(160deg, rgba(52,44,20,0.99), rgba(24,20,10,0.99));
  box-shadow:
    0 0 0 3px rgba(200, 168, 75, 0.4),
    0 0 0 1px var(--gold-light, #f2e6b0) inset,
    0 0 44px rgba(255, 210, 100, 0.48),
    0 18px 46px rgba(200, 168, 75, 0.36);
}
[data-theme="light"] #welcomeLangGrid .lang-row.active {
  background: linear-gradient(165deg, rgba(255, 248, 228, 0.98), rgba(255, 240, 210, 0.96));
  box-shadow:
    0 0 0 3px rgba(168, 137, 53, 0.22),
    0 0 0 1px rgba(212, 184, 92, 0.65) inset,
    0 10px 32px rgba(168, 137, 53, 0.2);
}
.lang-row.active .lang-check { opacity: 1 !important; }
.lang-check { font-size: 16px; color: var(--gold, #e4c56c); font-weight: 700; }
#welcomeLangGrid .lang-row.active .lang-check {
  font-size: 44px !important;
  line-height: 1;
  font-weight: 900;
  min-width: 58px;
  flex-shrink: 0;
  text-align: center;
  color: #1a1508 !important;
  background: linear-gradient(135deg, #e8c850, #f8e8a8);
  border-radius: 999px;
  width: 58px;
  height: 58px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
  filter: none;
  transform: none;
  box-shadow: 0 8px 26px rgba(200,168,75,0.82);
}

@keyframes successPop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.check-path {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawCheck 0.4s ease 0.3s forwards;
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.wallet-loading-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.72);
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 200;
}
.wallet-loading-overlay.show { display: flex; }
.wallet-loading-spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(200,168,75,0.2);
  border-top-color: var(--gold, #e4c56c);
  border-radius: 50%;
  animation: wallet-spin 0.75s linear infinite;
}
@keyframes wallet-spin { to { transform: rotate(360deg); } }

.wallet-loading-text {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  text-align: center;
  padding: 0 20px;
}

/* 须高于 .wallet-loading-overlay (z-index:200)，否则全页「加载中」未收起时 PIN 弹层/数字键盘被挡住、无法输入或点击 */
#pinUnlockOverlay.show,
#totpUnlockOverlay.show,
#totpSetupOverlay.show,
#pinSetupOverlay.show,
#transferPinOverlay.show {
  z-index: 220;
}







@keyframes wcs-pulse {
  50% { opacity: 0.75; transform: scale(1.05); }
}

/* PIN：隐藏输入 + 虚线方格（系统数字键盘） */
.ww-pin-field {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto 12px;
  min-height: 52px;
  cursor: text;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.ww-pin-field--setup {
  max-width: 100%;
  margin-bottom: 22px;
}
.pin-hidden-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 3;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 16px;
  caret-color: transparent;
  background: transparent;
  cursor: text;
}
.ww-pin-field--focused .pin-boxes {
  border-color: rgba(212, 175, 55, 0.9);
}
.ww-pin-field--focused .pin-box:not(:last-child) {
  border-right-color: rgba(212, 175, 55, 0.9);
}
.pin-setup-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88);
  display: none; flex-direction: column;
  align-items: center; justify-content: flex-end;
  z-index: 120;
  padding-bottom: 24px;
}
.pin-setup-overlay.show { display: flex; }
.pin-setup-panel {
  width: 100%; max-width: 360px;
  background: var(--bg2, #0c0c18);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 24px 24px 0 0;
  padding: 20px 18px 28px;
}
.pin-setup-title { font-size: 16px; font-weight: 700; color: var(--text, #f1f3f8); text-align: center; margin-bottom: 6px; }
.pin-setup-hint { font-size: 12px; color: var(--text-muted, #6b7588); text-align: center; margin-bottom: 18px; }
.pin-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  pointer-events: none;
  flex-wrap: nowrap;
}
.pin-boxes {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  flex-wrap: nowrap;
  border: 2px dashed var(--gold, #d4af37);
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.pin-box {
  position: relative;
  width: 42px;
  height: 52px;
  border: none;
  border-right: 2px dashed var(--gold, #d4af37);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  background: transparent;
  transition: border-color 0.15s, color 0.15s;
}
.pin-box:last-child {
  border-right: none;
}
.pin-box.filled::after {
  content: '●';
  font-size: 18px;
  line-height: 1;
  color: var(--gold, #d4af37);
}
.pin-dots.ww-pin-dots--error { animation: wtShake 0.5s ease; }
.pin-dots.ww-pin-dots--error .pin-boxes {
  border-color: var(--red, #e85555) !important;
  border-style: dashed;
}
.pin-dots.ww-pin-dots--error .pin-box:not(:last-child) {
  border-right-color: var(--red, #e85555) !important;
  border-right-style: dashed;
}
.pin-dots.ww-pin-dots--error .pin-box.filled::after {
  color: var(--red, #e85555) !important;
}
.pin-setup-cancel {
  margin-top: 14px; text-align: center;
  font-size: 14px; color: var(--gold, #e4c56c); cursor: pointer;
}

.offline-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #1a1408;
  background: linear-gradient(135deg, #e8a010, #f0c040);
  flex-shrink: 0;
  z-index: 50;
}
.offline-banner.show { display: flex; }


/* 提取的通用样式类 */
.u1 { font-size:24px }
.u2 { flex:1;text-align:left }
.u3 { opacity:0 }
.u4 { flex:1 }
.u5 { display:none }
.u6 { text-align:right }
.u7 { display:flex;align-items:center;gap:12px }
.u8 { font-size:22px;line-height:1 }
.u9 { display:flex;justify-content:space-between }
.u10 { font-size:28px;margin-bottom:10px }
.u11 { display:flex;align-items:center;gap:6px }
.u12 { display:flex;flex-direction:column;gap:8px }
.u13 { width:100%;padding:12px }
.u14 { padding:16px 18px;flex:1;overflow-y:auto }
.u15 { font-size:20px;margin-bottom:4px }

.news-item{padding:14px 16px;border-bottom:1px solid var(--border, rgba(255, 255, 255, 0.085));cursor:pointer;transition:background 0.2s}
.news-item:active{background:var(--bg2, #0c0c18)}
.news-title{font-size:14px;font-weight:600;color:var(--text, #f1f3f8);margin-bottom:4px;line-height:1.4}
.news-time{font-size:11px;color:var(--text-muted, #6b7588)}

.settings-section-title {
  font-size: 11px;
  color: var(--text-muted, #6b7588);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px 16px 6px;
  font-weight: 600;
}

.ww-tx-history-row { transition: opacity 0.2s; }
.ww-tx-history-row:hover { opacity: 0.8; }

/* 助记词随机填空验证（wwBuildRandomVerifyInputs） */
.ww-verify-input-row {
  background: var(--bg2, #0c0c18);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ww-verify-input-idx {
  font-size: 12px;
  color: var(--text-muted, #6b7588);
  width: 28px;
  flex-shrink: 0;
}
.ww-verify-input-field {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text, #f1f3f8);
  font-family: inherit;
}

/* 创建钱包：助记词网格（Level 1） */
.mnemonic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.mnemonic-word {
  background: var(--bg, #06060f);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.085));
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #f1f3f8);
  text-align: left;
  word-break: break-word;
}
.mnemonic-word-number {
  display: inline-block;
  width: 24px;
  color: var(--text-dim, #9aa3b8);
  font-weight: 400;
  font-size: 14px;
}

/* 导入助记词：词不在当前词表时标红（与 wwUpdateImportWordValidityVisual 一致） */
#page-import #importGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
#page-import #importGrid > .ww-import-cell {
  min-width: 0;
}
#page-import #importGrid .ww-import-cell--invalid {
  border-color: #e04545 !important;
  box-shadow: 0 0 0 1px rgba(224, 69, 69, 0.45);
}
#page-import #importGrid input.import-word.invalid-word {
  color: #e04545 !important;
  box-shadow: 0 0 0 1px #e04545;
}
#page-import #importGrid input.import-word.invalid-word:focus {
  color: #e04545 !important;
  box-shadow: 0 0 0 1px #e04545;
}
#page-import #importGrid .ww-import-cell-hint:not(:empty) {
  display: block !important;
}

/* ========== PWA / 手机横竖屏：方向变化时布局与间距（依赖 head 中 --ww-app-height / --ww-app-width 与 html.ww-landscape） ========== */

/* 欢迎页：竖屏用 vh 下移；横屏视口高度小，避免过量 padding-top 把按钮顶出可视区 */
@media (orientation: landscape) and (max-height: 520px) {
  #page-welcome {
    padding-top: calc(max(12px, env(safe-area-inset-top, 0px)) + min(10vh, 56px)) !important;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px), min(6vh, 72px)) !important;
  }
  #welcomeLangGrid {
    max-height: min(62vh, 360px);
    max-width: min(560px, 92vw);
  }
  .welcome-name { font-size: clamp(18px, 4.2vw, 22px); }
  .welcome-tag { font-size: 11px; margin-bottom: 6px; }
}

/* 首页：横屏双列（左：头部与资源；右：资产与交易），充分利用宽度 */
@media (max-width: 768px),
       (min-aspect-ratio: 1/1) and (max-height: 520px) and (max-width: 1100px) {
  html.ww-landscape #page-home.page {
    display: grid !important;
    grid-template-columns: minmax(200px, 36vw) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "ww-h-head ww-h-assets"
      "ww-h-trx   ww-h-tx";
    column-gap: 12px;
    row-gap: 8px;
    align-items: start;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }
  html.ww-landscape #page-home .home-header {
    grid-area: ww-h-head;
    padding: 10px max(12px, env(safe-area-inset-left, 0px)) 12px max(12px, env(safe-area-inset-right, 0px));
    margin: 0;
  }
  html.ww-landscape #page-home .home-balance {
    font-size: clamp(22px, 4.5vw, 28px);
  }
  html.ww-landscape #page-home .home-greeting {
    font-size: 11px;
  }
  html.ww-landscape #page-home #trxResourceCard {
    grid-area: ww-h-trx;
    margin: 0 !important;
    align-self: start;
    max-width: none;
  }
  html.ww-landscape #page-home .assets-section {
    grid-area: ww-h-assets;
    border-top: none;
    margin-top: 0;
    padding: 8px var(--home-section-pad-x, 16px) 10px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  html.ww-landscape #page-home .home-tx-section {
    grid-area: ww-h-tx;
    padding: 8px var(--home-section-pad-x, 16px) 10px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(200, 168, 75, 0.28);
    box-sizing: border-box;
  }
  html.ww-landscape #page-home #txHistoryFilter.home-tx-filter {
    margin-bottom: 8px;
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* 密钥 / 验证页：横屏可多列铺词格 */
@media (max-width: 768px),
       (min-aspect-ratio: 1/1) and (max-height: 520px) and (max-width: 1100px) {
  html.ww-landscape .key-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    grid-auto-rows: minmax(40px, auto);
  }
  html.ww-landscape .key-word {
    padding: 8px 6px;
  }
  html.ww-landscape .word-val {
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  html.ww-landscape .key-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 横屏时全局略收紧字号与导航（与 ww-landscape 同条件，避免桌面大屏误伤） */
@media (max-width: 768px),
       (min-aspect-ratio: 1/1) and (max-height: 520px) and (max-width: 1100px) {
  html.ww-landscape {
    --page-pad-y: 12px;
    --page-pad-x: 14px;
  }
  html.ww-landscape .nav-bar {
    min-height: 48px;
    padding-top: 2px;
    padding-bottom: 2px;
  }
  html.ww-landscape .nav-title {
    font-size: 16px;
  }
  html.ww-landscape .tab-item {
    font-size: 10px;
  }
}
