/* TH layout proposal. Existing colors, branding, wording and app logic retained. */
:root {
  --nav-h: 86px;
  --bg: #050505;
  --surface: #10100f;
  --surface-2: #181816;
  --line: #2b2a26;
  --cream: #f4e6cf;
  --sub: #b9b4aa;
  --muted: #8d8981;
  --text: #f7f4ee;
}
:root, :root:lang(zh-Hant), :root:lang(ja) {
  font-family: 'Noto Sans SC', 'Microsoft YaHei', 'DengXian', Arial, sans-serif;
}
body { background: #0c0c0b; }
button, input { -webkit-font-smoothing: antialiased; }
button:focus-visible, input:focus-visible { outline: 2px solid #d6c39e; outline-offset: 4px; }
.app-shell {
  max-width: 460px;
  border-color: #24231f;
  background: radial-gradient(ellipse at 90% -8%, #f4e6cf0c, transparent 40%), #050505;
}
.app-scroll { padding: 25px 22px 112px; }
.topbar { min-height: 46px; gap: 12px; margin: 0 0 30px; }
.topbar-logo-button, .brand-avatar { width: 44px; height: 44px; flex-basis: 44px; }
.brand-avatar { box-shadow: 0 0 0 1px #ffffff35; }
.title-block { text-align: left; }
.title-block::before {
  content: 'TH DAPP'; display: block; margin-bottom: 5px; color: #a9a295;
  font: 600 9px/1.2 Arial, sans-serif; letter-spacing: 2.7px;
}
.screen-title { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.topbar-actions { flex-basis: 40px; }
.icon-button { width: 40px; height: 40px; border: 1px solid #333129; background: #ffffff05; box-shadow: none; }
.hero { margin: 0 0 22px; }
.kicker { color: var(--sub); font-size: 13px; line-height: 1.5; }
.headline { margin-top: 8px; font-size: 46px; font-weight: 650; letter-spacing: -1.6px; font-variant-numeric: tabular-nums; }
.home-overview-title { margin: 0; color: var(--text); font-size: 25px; font-weight: 600; letter-spacing: 1px; }
[data-screen='home'] .hero::after {
  content: '本金、收益與常用操作，清晰掌握。'; display: block;
  margin-top: 8px; color: var(--muted); font-size: 11px; letter-spacing: .4px;
}
.metal-card, .dark-card, .metric-card, .action-card, .level-card, .profile-card, .list-card, .direct-list-card {
  border-radius: 20px; box-shadow: none; border-color: #292823;
}
.metal-card {
  position: relative; isolation: isolate; overflow: hidden; min-height: 202px;
  padding: 22px; margin-bottom: 14px; display: flex; flex-direction: column;
  background: linear-gradient(117deg, #faf0de 0%, #e7d8bd 52%, #d7d7d1 100%);
  border: 1px solid #fff4dcad;
}
.metal-card::before, .metal-card::after {
  content: ''; position: absolute; z-index: -1; width: 230px; height: 230px;
  border: 1px solid #29201217; border-radius: 50%; right: -98px; top: -70px;
}
.metal-card::after { width: 295px; height: 295px; right: -122px; top: -98px; }
.metal-card .card-label { order: -2; font-size: 12px; color: #534d40; font-weight: 500; letter-spacing: .8px; }
.metal-card .card-main {
  order: -1; margin: 12px 0 22px; font-size: 48px; font-weight: 600; letter-spacing: -2px; line-height: 1;
}
.metal-card .card-main::after { content: 'USDT'; font: 600 10px Arial, sans-serif; letter-spacing: .8px; margin-left: 10px; color: #5f594b; }
.card-head { margin: auto 0 0; padding-top: 15px; border-top: 1px solid #14110b25; font-size: 10px; color: #625b4e; font-weight: 500; }
.card-head > span:last-child { display: flex; align-items: center; gap: 6px; }
.card-head > span:last-child::before { content: ''; width: 5px; height: 5px; background: #80776b; border-radius: 50%; }
.card-wallet-address { font-size: 11px; }
.card-bottom { position: absolute; right: 22px; top: 44px; margin: 0; }
.metal-card .card-bottom .brand-mark { color: #19150d21; font: 700 64px/1 Arial, sans-serif; letter-spacing: -6px; }
.grid-2 { gap: 12px; }
.metric-card { position: relative; background: #10100f; padding: 17px 18px; }
.metric-label { font-size: 11px; color: #b6b0a5; letter-spacing: .5px; }
.metric-value { margin-top: 10px; font-size: 28px; font-weight: 550; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.metric-note { font-size: 10px; margin-top: 8px; color: #b4bf92; }
.action-card {
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px;
  padding: 0; margin: 22px 0; border: 0; background: none;
}
.action-card::before { content: '常用操作'; grid-column: 1/-1; color: #c9c2b5; font-size: 12px; letter-spacing: .6px; margin-bottom: 2px; }
.action-button { gap: 9px; min-height: 82px; border: 1px solid #2e2b24; border-radius: 16px; color: var(--cream); background: #12110f; font-size: 11px; font-weight: 500; }
.action-button strong { font-weight: 500; letter-spacing: .5px; }
.action-button span { width: 30px; height: 30px; background: transparent; }
.action-button:first-child { display: flex; grid-column: 1/-1; min-height: 52px; justify-content: center; gap: 7px; padding: 10px; color: #191610; background: var(--cream); border-color: var(--cream); font-size: 14px; }
.action-button:first-child span { width: 24px; height: 24px; order: 1; }
.action-button:first-child strong { font-weight: 650; letter-spacing: 1px; }
.dark-card { padding: 20px; background: #10100f; }
.cream-card { color: #1a1711; background: linear-gradient(120deg, #f3e6ce, #eee8dd); border-color: #f4e6cf80; }
.dark-card h3, .level-card h3 { font-size: 13px; font-weight: 600; letter-spacing: .5px; margin-bottom: 15px; }
[data-screen='home'] .page > .cream-card { padding: 18px 20px; color: var(--text); background: #10100f; border-color: #292823; }
[data-screen='home'] .page > .cream-card h3 { color: #dcd3c3; margin-bottom: 15px; }
[data-screen='home'] .stat-line { padding-top: 13px; border-color: #2b2923; color: #938c7d; font-size: 11px; }
[data-screen='home'] .stat-line strong { color: #ddd4c4; }
.bottom-nav {
  width: min(calc(100% - 28px), 430px); bottom: 14px; min-height: 72px;
  padding: 7px; gap: 4px; border: 1px solid #373329; border-radius: 22px;
  background: #161511f5; box-shadow: 0 8px 25px #0008;
}
.nav-button { position: relative; gap: 5px; border-radius: 15px; padding: 9px 4px; font-size: 10px; font-weight: 500; color: #8c877e; letter-spacing: .5px; }
.nav-button svg { width: 19px; height: 19px; stroke-width: 1.6; }
.nav-button.active { color: #f6e9d3; background: #f4e6cf10; }
.nav-button.active::before { content: ''; position: absolute; width: 13px; height: 2px; background: #cdbb95; border-radius: 3px; top: 0; }
.primary-button { min-height: 52px; border-radius: 14px; font-size: 14px; font-weight: 600; letter-spacing: .7px; }
.secondary-button { min-height: 44px; font-weight: 500; }
.section { margin-top: 18px; }
.tab-row { width: 100%; display: flex; gap: 5px; margin: 0 0 18px; padding: 5px; border-radius: 16px; border: 1px solid #2a2721; background: #141310; }
.chip-button { flex: 1; min-height: 40px; padding: 8px 10px; font-size: 12px; font-weight: 500; border-radius: 11px; background: transparent; color: #aaa397; }
.chip-button.active { color: #211c13; background: var(--cream); }
[data-screen='rewards'] .hero { position: relative; padding: 22px; min-height: 145px; margin-bottom: 18px; overflow: hidden; border-radius: 20px; background: linear-gradient(118deg, #f5ead7, #d9d6cd); color: #18150f; }
[data-screen='rewards'] .hero::after { content: 'TH'; position: absolute; right: 22px; bottom: 12px; color: #18140a12; font: 650 75px Arial, sans-serif; letter-spacing: -5px; }
[data-screen='rewards'] .hero .kicker { color: #625a4b; font-size: 12px; }
[data-screen='rewards'] .hero .headline { margin-top: 12px; font-size: 45px; }
[data-screen='rewards'] .hero .headline::after { content: 'USDT'; margin-left: 10px; font: 500 10px Arial, sans-serif; letter-spacing: .8px; color: #6e6658; }
[data-screen='rewards'] .grid-2 > .dark-card { padding: 17px 18px; color: var(--text); background: #10100f; border-color: #292823; }
[data-screen='rewards'] .grid-2 h3 { color: #b6b0a5; font-size: 11px; font-weight: 500; margin: 0 0 11px; }
.reward-number { font-size: 29px; font-weight: 550; line-height: 1.15; letter-spacing: -.8px; }
.withdraw-form-card { gap: 14px; margin-top: 0; }
.withdraw-input { margin: 0; padding: 15px 16px; background: #1a1916; border: 1px solid #353126; border-radius: 14px; }
.amount-input-label { font-size: 11px; font-weight: 500; margin-bottom: 7px; color: #c0b8a8; }
.withdraw-input input { font-size: 23px; font-weight: 500; }
.withdraw-input input::placeholder { font-size: 19px; color: #6d685e; }
.amount-input strong { font-size: 11px; font-weight: 500; color: #cec4ae; }
.withdraw-available-line { font-size: 11px; font-weight: 500; color: #948d80; }
.withdraw-available-line strong { color: #dcd2be; font-weight: 500; }
.withdraw-orders { padding-top: 19px; margin-top: 6px; border-top: 1px solid #2b2821; gap: 13px; }
.reward-record-head { font-size: 12px; color: #d5cdbd; font-weight: 500; }
.reward-record-head > strong { font-weight: 500; }
.reward-record-head > span { color: #c5b89d; background: #28251e; min-width: 21px; height: 21px; font-size: 10px; font-weight: 500; }
.reward-record-empty, .empty-history { display: grid; align-content: center; min-height: 70px; border: 1px dashed #343025; border-radius: 13px; font-size: 11px; color: #8f887b; background: transparent; }
[data-screen='participate'] .hero { padding: 22px; margin-bottom: 18px; border: 1px solid #333027; border-radius: 20px; background: #11110f; }
[data-screen='participate'] .hero .headline { font-size: 35px; font-weight: 550; letter-spacing: -.7px; }
[data-screen='participate'] .asset-pill { padding: 5px 8px; margin-left: 4px; font-size: 10px; font-weight: 500; background: #26231c; color: #d7c7a7; }
.deposit-entry-card { padding: 22px; }
.deposit-entry-head { margin-bottom: 25px; }
.deposit-entry-head h3 { font-size: 14px; font-weight: 550; }
.deposit-entry-head > span { font-size: 10px; font-weight: 500; }
.deposit-amount-input { margin: 0 0 24px; padding: 22px 10px; background: #191815; border: 1px solid #373124; }
.deposit-amount-field input { font-size: 35px; font-weight: 500; text-align: center; }
.deposit-amount-field { gap: 4px; }
.amount-step-button { width: 39px; height: 39px; color: #e2d3b8; background: #f4e6cf07; border-color: #b2a28545; font-size: 23px; font-weight: 400; }
.deposit-submit { min-height: 54px; }
.deposit-history-card { padding: 20px; margin-top: 22px; }
.compact-head h3 { font-size: 13px; }
.compact-head p { color: #8f887b; font-size: 11px; }
[data-screen='participate'] .empty-history { margin-top: 20px; min-height: 114px; text-align: center; }
[data-screen='profile'] .hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  min-height: 103px; margin-bottom: 16px; padding: 20px 22px; border: 1px solid #353027; border-radius: 20px; background: #11110f;
}
[data-screen='profile'] .hero .kicker { margin: 0; font-size: 12px; color: #bbb2a2; }
[data-screen='profile'] .hero .headline { font-size: 38px; margin: 0; color: #ecdabc; letter-spacing: -.7px; font-weight: 500; }
[data-screen='profile'] .cream-card { padding: 22px; }
[data-screen='profile'] .cream-card h3 { font-size: 14px; font-weight: 600; }
.invite-qr { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 20px; align-items: center; }
.qr-code { width: 86px; height: 86px; padding: 9px; border-radius: 10px; box-shadow: 0 0 0 1px #15120c14; background: #f8f5ee; }
.qr-meta strong { font-size: 12px; font-weight: 600; color: #272116; }
.qr-meta span { color: #70634e; font-size: 10px; }
.qr-meta small { margin-top: 7px; color: #756850; font-size: 10px; }
[data-screen='profile'] .grid-2 { gap: 0; border: 1px solid #292823; border-radius: 20px; overflow: hidden; background: #10100f; }
[data-screen='profile'] .metric-card { padding: 18px 20px; border: 0; border-radius: 0; background: transparent; }
[data-screen='profile'] .metric-card:nth-child(odd) { border-right: 1px solid #292823; }
[data-screen='profile'] .metric-card:nth-child(-n+2) { border-bottom: 1px solid #292823; }
[data-screen='profile'] .metric-value { font-size: 26px; }
.direct-list-card { padding: 20px; background: #10100f; border: 1px solid #292823; }
.direct-list-card h3 { margin: 0 0 15px; color: #ddd4c4; font-size: 12px; font-weight: 500; }
.direct-list-card .empty-history { text-align: center; min-height: 66px; }
.modal-backdrop { background: #000a; }
.language-modal, .status-modal, .invite-modal { border-radius: 22px; background: #171610; }
:root:lang(en) [data-screen='home'] .hero::after { content: 'Your principal, rewards and everyday actions.'; }
:root:lang(en) .action-card::before { content: 'Quick actions'; }
:root:lang(ja) [data-screen='home'] .hero::after { content: '元本・報酬・よく使う操作をひと目で。'; }
:root:lang(ja) .action-card::before { content: 'よく使う操作'; }
@media (max-width: 380px) {
  .app-scroll { padding-right: 17px; padding-left: 17px; padding-top: 20px; }
  .topbar { margin-bottom: 24px; }
  .metal-card { padding: 20px; }
  .metal-card .card-main { font-size: 43px; }
  .metric-card { padding: 15px; }
  .action-card { gap: 9px; }
  .action-button { font-size: 10px; }
  .dark-card { padding: 17px; }
  .invite-qr { gap: 13px; }
}
