/* NovaX H5 — 自适应布局 */
:root {
  --primary: #0d5f6a;
  --primary-dark: #063d45;
  --primary-soft: #e5f3f5;
  --accent-gold: #c5a059;
  --accent-gold-bright: #d4b16e;
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --text: #333333;
  --text-secondary: #999999;
  --border: #ebebeb;
  --green: #3eb37c;
  --red: #e87062;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 56px;
  font-size: clamp(14px, 3.8vw, 16px);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}


body.pad-tabbar {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

a {
  color: var(--primary);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* ---------- Shell ---------- */
.app-viewport {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-page);
  position: relative;
}

/* ---------- Login · NovaX 主题 ---------- */
.page-login {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  padding: 12vw 1.25rem calc(2rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #041f24;
  background-image:
    radial-gradient(
      ellipse 120% 80% at 50% 8%,
      rgba(197, 160, 89, 0.22) 0%,
      transparent 45%
    ),
    radial-gradient(
      ellipse 100% 70% at 50% 112%,
      rgba(8, 50, 58, 0.95) 0%,
      transparent 55%
    ),
    linear-gradient(
      165deg,
      #156b77 0%,
      #0d5f6a 42%,
      #063942 78%,
      #031a1f 100%
    );
}

.page-login::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: repeating-conic-gradient(
    from 2deg at 50% 24%,
    transparent 0deg 6.5deg,
    rgba(255, 255, 255, 0.028) 6.5deg 7deg
  );
  opacity: 0.95;
  pointer-events: none;
}

.page-login::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 85% 65% at 50% 28%,
    transparent 22%,
    rgba(4, 20, 24, 0.55) 100%
  );
  pointer-events: none;
}

.page-login > * {
  position: relative;
  z-index: 1;
}

.page-login .brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo {
  display: block;
  width: min(140px, 42vw);
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 22px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(197, 160, 89, 0.35);
}

.page-login .brand h1 {
  margin: 0;
  font-size: clamp(1.45rem, 5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow:
    0 0 36px rgba(197, 160, 89, 0.35),
    0 2px 22px rgba(4, 30, 35, 0.75);
}

.page-login .brand p {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.875rem;
}

.page-login .login-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 24px 56px rgba(0, 12, 16, 0.5),
    0 0 60px rgba(13, 95, 106, 0.2);
}

.page-login .tabs-auth {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.page-login .tabs-auth button {
  color: rgba(255, 255, 255, 0.52);
}

.page-login .tabs-auth button.active {
  color: #fff;
  font-weight: 700;
  border-bottom-color: var(--accent-gold-bright);
  text-shadow: 0 0 18px rgba(197, 160, 89, 0.45);
}

.page-login .field label {
  color: rgba(255, 255, 255, 0.68);
}

.page-login .field input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}

.page-login .field input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.page-login .field input:focus {
  border-color: rgba(212, 177, 110, 0.85);
  box-shadow: 0 0 0 3px rgba(13, 95, 106, 0.28);
}

.page-login .field input:-webkit-autofill,
.page-login .field input:-webkit-autofill:hover,
.page-login .field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(13, 70, 78, 0.55) inset;
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  transition: background-color 99999s ease-out;
}

.page-login .btn-primary {
  margin-top: 0.5rem;
  background: linear-gradient(
    180deg,
    var(--accent-gold-bright) 0%,
    var(--accent-gold) 45%,
    #a98647 100%
  );
  color: #102022;
  font-weight: 700;
  box-shadow:
    0 8px 28px rgba(0, 15, 18, 0.45),
    0 0 24px rgba(197, 160, 89, 0.35);
}

.page-login .btn-primary:active {
  opacity: 0.94;
  transform: scale(0.992);
}

.page-login .login-tip {
  color: rgba(255, 255, 255, 0.52);
}

.page-login .login-tip a {
  color: var(--accent-gold-bright);
}

.app-viewport:has(.page-login:not(.hidden)) {
  background: #063039;
}

/* 登录表单结构 / 主按钮基样式（「我的」等页复用 .btn-primary） */
.login-card {
  border-radius: 14px;
  padding: 1.25rem 1rem;
}

.tabs-auth {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.tabs-auth button {
  flex: 1;
  padding: 0.65rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
}

.field input:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #137584 0%, var(--primary) 55%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  box-shadow: 0 4px 16px rgba(6, 50, 57, 0.22);
}

.btn-primary:active {
  opacity: 0.92;
}

.login-tip {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.login-tip a {
  color: var(--primary);
}

/* ---------- Page headers ---------- */
.page-head {
  padding: 0.65rem 0.9rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.page-head-row .title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg-page);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ---------- Market ---------- */
.market-scroll {
  padding: 0.65rem 0.75rem 0.25rem;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ececef;
  border-radius: 22px;
  padding: 0.55rem 0.85rem;
}

.search-bar svg {
  flex-shrink: 0;
  opacity: 0.45;
}

.search-bar input[type="search"]::-webkit-search-cancel-button,
.search-bar input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  outline: none;
  min-width: 0;
}

.search-clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.5);
  font-size: 0.68rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.search-clear:active {
  background: rgba(0, 0, 0, 0.16);
}

.market-empty-search {
  text-align: center;
  padding: 2rem 1.25rem 1rem;
  font-size: 0.875rem;
  color: rgba(55, 65, 81, 0.75);
}

.market-hint {
  text-align: center;
  padding: 1.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.market-hint-error {
  color: var(--text-secondary);
}

.btn-retry-market {
  display: inline-block;
  margin-top: 0.65rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary-soft);
  color: var(--primary);
  -webkit-tap-highlight-color: transparent;
}

.btn-retry-market:active {
  opacity: 0.85;
}

.promo-banner {
  display: block;
  margin: 0.75rem 0.65rem 0;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 18px rgba(0, 25, 55, 0.14);
}

.promo-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.promo-banner:active {
  opacity: 0.94;
}

.list-head {
  display: grid;
  grid-template-columns: 1fr minmax(5rem, auto) minmax(4rem, auto);
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.65rem;
  color: var(--text-secondary);
  align-items: center;
}

.list-head .sortable {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.list-sort-btn {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.list-sort-btn-price {
  justify-content: flex-end;
  text-align: right;
  width: 100%;
}

.list-sort-btn:active {
  opacity: 0.85;
}

.list-sort-btn-active {
  color: var(--primary);
  font-weight: 600;
}

.list-sort-indicator {
  font-size: 0.6rem;
  opacity: 0.85;
  flex-shrink: 0;
}

.list-head-mute {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.market-rows {
  background: var(--bg-card);
  margin: 0 0.5rem;
  border-radius: 10px;
  overflow: hidden;
}

.market-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.65rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.market-row:last-child {
  border-bottom: none;
}

.coin-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.coin-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ddd, #bbb);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #555;
}

.coin-meta {
  min-width: 0;
}

.coin-meta .vol {
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coin-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.price-col {
  text-align: right;
}

.price-usd {
  font-weight: 600;
  font-size: 0.85rem;
}

.price-cny {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.change-pill {
  min-width: 3.4rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.change-pill.up {
  background: var(--green);
}

.change-pill.down {
  background: var(--red);
}

/* ---------- Trade ---------- */
.trade-body {
  padding: 0.65rem 0.75rem 1rem;
}

.transit-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 0.85rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.transit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.transit-head em {
  font-style: italic;
  font-weight: 800;
  font-size: 1.1rem;
}

.transit-actions {
  display: flex;
  gap: 0.35rem;
}

.swap-section-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.swap-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
}

.wallet-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.swap-box {
  background: #f0f0f3;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.token-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.35rem 0.55rem;
  background: #fff;
  border-radius: 999px;
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.swap-input {
  flex: 1;
  border: none;
  background: transparent;
  text-align: right;
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  min-width: 0;
}

.swap-input.placeholder-muted {
  color: var(--text-secondary);
  font-weight: 500;
}

.swap-divider-wrap {
  display: flex;
  justify-content: center;
  margin: -6px 0;
  position: relative;
  z-index: 1;
}

.swap-divider-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 3px solid var(--bg-card);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-swap-main {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #157c89 0%, var(--primary) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 50, 57, 0.18);
}

.detail-rows {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.detail-rows div {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-top: 1px solid var(--border);
}

.records-section {
  margin-top: 1.25rem;
}

.records-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem 0.5rem;
  font-size: 0.85rem;
}

.records-head .more {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.empty-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.empty-card .doc-icon {
  font-size: 2rem;
  opacity: 0.35;
  margin-bottom: 0.5rem;
}

/* ---------- Mine ---------- */
.mine-account-line {
  margin: 0;
  padding: 0.35rem 0.9rem 0.15rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-page);
}

.mine-body {
  padding: 0.5rem 0.75rem 1rem;
}

.settings-group {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.settings-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.9rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.settings-group .settings-cell:last-child {
  border-bottom: none;
}

.settings-cell .left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-cell .left.stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.settings-cell .right {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.settings-cell .sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chevron {
  opacity: 0.35;
  font-size: 0.75rem;
}

/* ---------- 发现 ---------- */
.discover-body {
  padding: 0.65rem 0.75rem 1rem;
}

.discover-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.65rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.discover-hero-text h3 {
  margin: 0;
  font-size: 1rem;
}

.discover-hero-text p {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.discover-hero-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.discover-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.discover-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.85rem;
  background: var(--bg-card);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

.discover-card strong {
  font-size: 0.88rem;
}

.dc-tag {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #eef0f3;
  color: var(--text-secondary);
}

.dc-tag.hot {
  background: #ffe8e6;
  color: var(--red);
}

.dc-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.discover-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.15rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.discover-more {
  border: none;
  background: none;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.discover-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.discover-feed li {
  border-bottom: 1px solid var(--border);
}

.discover-feed li:last-child {
  border-bottom: none;
}

.discover-feed-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  text-decoration: none;
  color: inherit;
}

.df-title {
  font-size: 0.85rem;
  line-height: 1.35;
}

.df-time {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* ---------- USDG 申购 ---------- */
[data-view="usdg-subscribe"] {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-card);
}

.usdg-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.85rem 5.5rem;
  -webkit-overflow-scrolling: touch;
}

.usdg-title {
  margin: 1rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.usdg-deadline {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.usdg-product-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1.1rem 0 0;
}

.usdg-product-tab {
  display: block;
  padding: 0.75rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s;
}

.usdg-product-tab.active {
  border-color: #222;
  color: var(--text);
}

.usdg-product-tab .upt {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
}

.usdg-product-tab .rate {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
}

.usdg-product-tab .ptype {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  opacity: 0.85;
}

.usdg-field-label {
  display: block;
  margin: 1.15rem 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.usdg-amount-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
}

.usdg-amount-box:focus-within {
  border-color: #ccc;
  background: #fff;
}

.usdg-amount-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  min-width: 0;
}

.usdg-amount-input::placeholder {
  color: #bbb;
  font-weight: 500;
}

.usdg-amount-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.usdg-max-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: none;
  background: #ececef;
  font-size: 0.72rem;
  color: var(--text);
  cursor: pointer;
}

.usdg-balance-line {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.usdg-readonly-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
}

.usdg-rules {
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: var(--bg-page);
}

.usdg-rules-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.usdg-rules-head .info-i {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 1px solid var(--text-secondary);
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.usdg-rules-list {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
}

.usdg-rules-list li {
  margin-bottom: 0.5rem;
}

.usdg-reward-tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: linear-gradient(135deg, #e8f8a8 0%, #c8f5a0 100%);
  font-size: 0.68rem;
  font-weight: 700;
  color: #2d6a3e;
  vertical-align: middle;
}

.usdg-rules-note {
  margin: 0.65rem 0 0;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.usdg-flow-title {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.usdg-steps {
  position: relative;
  padding-left: 0.15rem;
}

.usdg-step {
  display: flex;
  gap: 0.65rem;
  padding-bottom: 1rem;
  position: relative;
}

.usdg-step:last-child {
  padding-bottom: 0;
}

.usdg-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.62rem;
  top: 1.55rem;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.usdg-step-num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-card);
  position: relative;
  z-index: 1;
}

.usdg-step-body {
  flex: 1;
  padding-top: 0.05rem;
}

.usdg-step-body strong {
  display: block;
  font-size: 0.82rem;
}

.usdg-step-body span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.usdg-footer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  padding: 0.65rem 0.85rem calc(0.65rem + var(--safe-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 90;
}

.usdg-submit-btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #157c89 0%, var(--primary) 55%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 50, 57, 0.2);
}

.usdg-submit-btn:disabled {
  background: #d8d8dc;
  color: #fff;
  cursor: not-allowed;
}

@media (min-width: 480px) {
  .usdg-footer {
    border-radius: 0 0 16px 16px;
  }
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 6px;
  z-index: 100;
}

.bottom-nav button {
  flex: 1;
  border: none;
  background: none;
  padding: 4px 1px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.58rem;
  color: var(--text-secondary);
  min-width: 0;
}

.bottom-nav button.active {
  color: var(--primary);
}

.bottom-nav .nav-icon {
  width: 22px;
  height: 22px;
  position: relative;
}

.bottom-nav .dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
}

/* ---------- 币种详情（行情点击进入） ---------- */
[data-view="market-detail"] {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  position: relative;
}

.coin-detail-topbar {
  flex-shrink: 0;
  align-items: flex-start;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.coin-detail-head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coin-logo-sm {
  width: 40px;
  height: 40px;
  font-size: 0.7rem;
}

.coin-detail-head-text {
  min-width: 0;
}

.coin-detail-name-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.coin-detail-symbol {
  font-weight: 700;
  font-size: 1.05rem;
}

.coin-detail-badge {
  font-size: 0.62rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.coin-detail-addr-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.coin-detail-copy {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--primary);
  line-height: 1;
}

.coin-detail-head-spacer {
  width: 36px;
  flex-shrink: 0;
}

.coin-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.65rem;
  padding-bottom: calc(4.5rem + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.coin-detail-h2 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin: 0.15rem 0 0.5rem;
}

.coin-detail-hero {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 0.75rem 0.75rem 0.5rem;
  margin-bottom: 0.65rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.coin-detail-hero-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.coin-detail-usd-big {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.coin-detail-usd-big.up,
.coin-detail-pct-big.up,
.pct.up {
  color: var(--green);
}

.coin-detail-usd-big.down,
.coin-detail-pct-big.down,
.pct.down {
  color: var(--red);
}

.coin-detail-sub-row {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.coin-detail-pct-big {
  font-weight: 600;
}

.coin-detail-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  margin-top: 0.65rem;
}

.coin-detail-metric-k {
  display: block;
  font-size: 0.62rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.coin-detail-metric-v {
  font-size: 0.78rem;
  font-weight: 600;
}

.coin-detail-metric-v.dim {
  color: var(--text-secondary);
  font-weight: 500;
}

.coin-detail-chart-bar {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 0.5rem 0.5rem 0.4rem;
  margin-bottom: 0.65rem;
}

.coin-intv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

.coin-intv {
  border: none;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  background: #f0f0f3;
  color: var(--text-secondary);
  cursor: pointer;
}

.coin-intv.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.coin-chart-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.coin-chart-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.coin-chart-gear {
  width: 32px;
  height: 32px;
}

.coin-ma-row {
  font-size: 0.58rem;
  color: #b8860b;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coin-chart-svg-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

.coin-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.coin-chart-loading,
.coin-chart-err {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(250, 250, 250, 0.9);
}

.coin-ind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-top: 0.35rem;
}

.coin-ind {
  border: none;
  padding: 0.15rem 0.35rem;
  font-size: 0.58rem;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.coin-ind.active {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-soft);
}

.coin-txn-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 0.5rem 0.6rem 0.65rem;
  margin-bottom: 0.5rem;
}

.coin-txn-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.coin-txn-tabs {
  display: flex;
  gap: 0.5rem;
}

.coin-txn-tab {
  border: none;
  background: none;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.15rem 0;
  cursor: pointer;
}

.coin-txn-tab.active {
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--text);
}

.coin-txn-currency {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.coin-txn-list-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.25rem;
  font-size: 0.58rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.coin-txn-list-head span:nth-child(2),
.coin-txn-list-head span:nth-child(3) {
  text-align: right;
}

.coin-txn-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.coin-txn-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.25rem 0.35rem;
  align-items: start;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
}

.coin-txn-item:last-child {
  border-bottom: none;
}

.coin-txn-side {
  font-weight: 700;
  font-size: 0.68rem;
}

.coin-txn-side.buy {
  color: var(--green);
}

.coin-txn-side.sell {
  color: var(--red);
}

.coin-txn-qty {
  font-weight: 600;
}

.coin-txn-time {
  display: block;
  font-size: 0.58rem;
  color: var(--text-secondary);
}

.coin-txn-val {
  text-align: right;
}

.coin-txn-addr {
  text-align: right;
  font-size: 0.62rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.coin-txn-note {
  font-size: 0.58rem;
  color: var(--text-secondary);
  margin: 0.35rem 0 0;
  line-height: 1.4;
}

.coin-detail-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem calc(0.5rem + var(--safe-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  z-index: 20;
}

.btn-coin-buy,
.btn-coin-sell {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.btn-coin-buy {
  background: var(--green);
}

.btn-coin-sell {
  background: var(--red);
}

a.market-row-link {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a.market-row-link:active {
  background: rgba(0, 0, 0, 0.035);
}

.market-rows a.market-row:last-child {
  border-bottom: none;
}

a.market-row-link .change-pill {
  pointer-events: none;
}
@media (min-width: 480px) {
  .app-viewport {
    box-shadow: 0 0 0 1px var(--border), 0 12px 48px rgba(0, 0, 0, 0.08);
    min-height: calc(100vh - 24px);
    margin: 12px auto;
    border-radius: 16px;
    overflow: hidden;
  }

  .bottom-nav {
    border-radius: 0 0 16px 16px;
  }
}
