/*
 * Android 5–8 的 WebView 兼容样式。
 * 这里故意只使用物理方向属性、普通 transform 和 100vh，避免 Tailwind 4
 * 的 @layer、逻辑属性及新颜色语法让旧浏览器跳过整份样式表。
 */
html.legacy-css,
html.legacy-css body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: #121212;
  color: #f2e4c4;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

html.legacy-css *,
html.legacy-css *:before,
html.legacy-css *:after {
  box-sizing: border-box;
}

html.legacy-css button,
html.legacy-css input {
  font: inherit;
}

html.legacy-css button {
  cursor: pointer;
}

html.legacy-css button:disabled {
  cursor: not-allowed;
}

html.legacy-css img {
  display: block;
  max-width: 100%;
}

html.legacy-css .app-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

html.legacy-css .app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  padding: 12px 16px;
  background: #121212;
}

html.legacy-css .app-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

html.legacy-css .app-header-actions {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  height: 64px;
  padding: 12px 16px;
  pointer-events: none;
}

html.legacy-css .app-header-actions > div {
  display: flex;
  align-items: center;
  float: right;
  pointer-events: auto;
}

html.legacy-css .app-header-actions button {
  min-width: 40px;
  min-height: 40px;
  margin-left: 12px;
  border: 0;
  background: transparent;
  color: #fff;
}

html.legacy-css .app-header-actions button:last-child {
  min-width: 92px;
  min-height: 32px;
  border-radius: 6px;
  padding: 6px 12px;
  background: #e4c78a;
  color: #1a150c;
  font-size: 14px;
  font-weight: bold;
}

html.legacy-css .sidebar-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  border: 0;
  background: transparent;
}

html.legacy-css .app-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: 60%;
  min-width: 220px;
  overflow: hidden;
  background: #121212;
}

html.legacy-css .app-sidebar nav {
  height: 100%;
  padding: 12px 20px;
}

html.legacy-css .app-sidebar nav > div {
  margin-top: 40px;
}

html.legacy-css .app-sidebar a {
  display: block;
  margin-bottom: 16px;
  border: 1px solid #e4c78a;
  border-radius: 12px;
  padding: 12px 8px;
  color: #f2e4c4;
  text-align: center;
  text-decoration: none;
}

html.legacy-css .app-sidebar a[aria-current="page"] {
  background: #e4c78a;
  color: #1a150c;
}

html.legacy-css .language-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  padding: 24px 32px;
  background: rgba(0, 0, 0, 0.55);
}

html.legacy-css .language-overlay > button:first-child {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 0;
  background: transparent;
}

html.legacy-css .language-overlay > div[role="dialog"] {
  position: relative;
  width: 100%;
  max-width: 296px;
  margin: 12vh auto 0;
  border: 1px solid #e4c78a;
  border-radius: 28px;
  padding: 12px 20px 24px;
  background: #161616;
}

html.legacy-css .language-overlay [role="dialog"] button {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 1px solid #e4c78a;
  border-radius: 16px;
  padding: 12px 20px;
  background: transparent;
  color: #fff;
  text-align: left;
}

html.legacy-css .language-overlay [role="dialog"] button[aria-pressed="true"] {
  background: #e4c78a;
  color: #1a150c;
}

html.legacy-css .mining-screen,
html.legacy-css .team-screen,
html.legacy-css .community-screen,
html.legacy-css .wealth-screen {
  width: 100%;
  padding-right: 16px;
  padding-bottom: 40px;
  padding-left: 16px;
}

html.legacy-css .mining-hero {
  position: relative;
  min-height: 176px;
  overflow: hidden;
  margin-right: -16px;
  margin-left: -16px;
  padding: 24px 20px 32px;
}

html.legacy-css .mining-hero img {
  position: absolute;
  top: 0;
  right: 0;
  width: 58%;
  height: 100%;
  object-fit: cover;
}

html.legacy-css .mining-hero > div:last-child {
  position: relative;
  width: 65%;
  max-width: 256px;
}

html.legacy-css .mining-hero h1,
html.legacy-css .community-hero h1,
html.legacy-css .wealth-heading h1 {
  margin: 0;
  color: #e8d5a3;
  font-size: 28px;
  line-height: 1.25;
}

html.legacy-css .mining-hero p,
html.legacy-css .wealth-heading p {
  margin-top: 12px;
  color: rgba(242, 228, 196, 0.85);
  font-size: 15px;
  line-height: 1.6;
}

html.legacy-css .mining-content {
  display: block;
  padding: 0;
}

html.legacy-css .mining-content > section,
html.legacy-css .team-screen > section,
html.legacy-css .community-screen > section,
html.legacy-css .wealth-screen > section {
  margin-top: 24px;
}

html.legacy-css .mining-form,
html.legacy-css .earnings-card,
html.legacy-css .team-performance-card,
html.legacy-css .wealth-holdings-card,
html.legacy-css .community-screen article,
html.legacy-css .team-screen article {
  border: 1px solid rgba(228, 199, 138, 0.35);
  border-radius: 16px;
  background: #1c1810;
}

html.legacy-css .mining-form,
html.legacy-css .earnings-card,
html.legacy-css .wealth-holdings-card {
  padding: 16px;
}

html.legacy-css .mining-form input,
html.legacy-css .team-invite input,
html.legacy-css .wealth-holdings-card input {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(228, 199, 138, 0.45);
  border-radius: 12px;
  padding: 10px 16px;
  outline: 0;
  background: transparent;
  color: #f2e4c4;
}

html.legacy-css .mining-form button,
html.legacy-css .mining-claim-section button,
html.legacy-css .wealth-holdings-card > button,
html.legacy-css .community-screen > button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 10px 20px;
  background: #e4c78a;
  color: #1a150c;
  font-weight: bold;
}

html.legacy-css .mining-form button {
  width: 100%;
  margin-top: 12px;
}

html.legacy-css .mining-claim-section > div {
  display: flex;
  align-items: center;
}

html.legacy-css .mining-claim-section > div > div {
  flex: 1;
  min-height: 44px;
  border: 1px solid rgba(228, 199, 138, 0.45);
  border-radius: 12px;
  padding: 10px 16px;
}

html.legacy-css .mining-claim-section > div > button {
  margin-left: 12px;
  white-space: nowrap;
}

html.legacy-css .mining-earnings-section .earnings-card {
  position: relative;
  overflow: hidden;
}

html.legacy-css .earnings-card > img {
  position: absolute;
  top: 7%;
  right: 8px;
  width: 46%;
  height: 86%;
  object-fit: contain;
}

html.legacy-css .earnings-card > div {
  position: relative;
}

html.legacy-css .tier-grid,
html.legacy-css .team-stats-grid,
html.legacy-css .community-earnings-grid,
html.legacy-css .community-performance-grid {
  display: flex;
  margin-right: -4px;
  margin-left: -4px;
}

html.legacy-css .tier-grid > *,
html.legacy-css .team-stats-grid > *,
html.legacy-css .community-performance-grid > * {
  width: 33.333%;
  margin: 0 4px;
}

html.legacy-css .community-earnings-grid > * {
  width: 50%;
  margin: 0 4px;
}

html.legacy-css .tier-grid article,
html.legacy-css .team-stats-grid article,
html.legacy-css .community-screen article {
  min-height: 124px;
  padding: 16px 8px;
  text-align: center;
}

html.legacy-css .tier-grid img,
html.legacy-css .team-stats-grid img,
html.legacy-css .community-screen article img {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  object-fit: contain;
}

html.legacy-css .team-performance-card {
  position: relative;
  overflow: hidden;
  padding: 24px 20px;
}

html.legacy-css .team-performance-card > img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html.legacy-css .team-performance-card > div {
  position: relative;
}

html.legacy-css .team-invite > div {
  display: flex;
  align-items: center;
  border-radius: 12px;
  padding: 4px 6px 4px 16px;
  background: #e8d5a3;
}

html.legacy-css .team-invite input {
  min-width: 0;
  border: 0;
  color: #3a2a10;
}

html.legacy-css .team-invite button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
}

html.legacy-css .community-hero {
  padding-top: 16px;
  text-align: center;
}

html.legacy-css .community-hero > img {
  width: 176px;
  height: 160px;
  margin: 0 auto;
  object-fit: contain;
}

html.legacy-css .wealth-heading h1 {
  display: inline;
  color: #f2e4c4;
}

html.legacy-css .wealth-holdings-card > div {
  display: flex;
  align-items: flex-start;
}

html.legacy-css .wealth-holdings-card > div > img {
  width: 104px;
  height: 84px;
  margin-left: 12px;
  object-fit: contain;
}

html.legacy-css .legacy-data-table {
  width: 100%;
  border-spacing: 0 6px;
  table-layout: fixed;
  color: rgba(242, 228, 196, 0.85);
  font-size: 11px;
  text-align: center;
}

html.legacy-css .legacy-data-table th,
html.legacy-css .legacy-data-table td {
  overflow: hidden;
  padding: 8px 4px;
  word-wrap: break-word;
}

html.legacy-css .gold-rule {
  margin-top: 24px;
  margin-bottom: 24px;
  text-align: center;
}

html.legacy-css .gold-rule span {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: rgba(228, 199, 138, 0.5);
}

html.legacy-css .legacy-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  width: calc(100% - 32px);
  max-width: 384px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(228, 199, 138, 0.45);
  border-radius: 16px;
  padding: 24px;
  background: #1c1810;
  color: #f2e4c4;
}

html.legacy-css .legacy-dialog.wallet-dialog {
  border: 0;
  border-radius: 24px;
  background: #ffffff;
  color: #1a1a2e;
}

html.legacy-css .legacy-dialog > button {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: #e4c78a;
  color: #1a150c;
  font-weight: bold;
}

html.legacy-css .legacy-dialog > button:last-child {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}

html.legacy-css .legacy-dialog-actions button {
  width: 48%;
  min-height: 44px;
  margin-top: 12px;
  margin-right: 4%;
  border-radius: 12px;
  padding: 10px 16px;
}

html.legacy-css .legacy-dialog-actions button:first-child {
  border: 1px solid rgba(228, 199, 138, 0.45);
  background: transparent;
  color: #f2e4c4;
}

html.legacy-css .legacy-dialog-actions button:last-child {
  margin-right: 0;
  border: 0;
  background: #e4c78a;
  color: #1a150c;
  font-weight: bold;
}

html.legacy-css .wallet-dialog button {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid #d8e8f5;
  border-radius: 12px;
  padding: 10px 16px;
  background: #ffffff;
  color: #1a1a2e;
}

html.legacy-css .wallet-dialog > button:last-child {
  width: 24px;
  min-height: 24px;
  margin: 0;
  border: 0;
  background: transparent;
}

html.legacy-css [data-radix-dialog-overlay] {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 49;
  background: rgba(0, 0, 0, 0.65);
}

html.legacy-css [data-radix-dialog-content] input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(228, 199, 138, 0.45);
  border-radius: 12px;
  padding: 10px 16px;
  background: transparent;
  color: inherit;
}

html.legacy-css .app-toast {
  position: fixed;
  top: 72px;
  right: 16px;
  left: 16px;
  z-index: 100;
}

html.legacy-css .app-toast > div {
  margin-bottom: 12px;
  border: 1px solid #bccac0;
  border-radius: 10px;
  padding: 16px;
  background: #ffffff;
  color: #0d1c2e;
}

@media (min-width: 480px) {
  html.legacy-css .mining-screen,
  html.legacy-css .team-screen,
  html.legacy-css .community-screen,
  html.legacy-css .wealth-screen {
    max-width: 560px;
    margin-right: auto;
    margin-left: auto;
  }
}
