:root {
  --primary: #fcd535;
  --primary-active: #f0b90b;
  --ink: #181a20;
  --body: #eaecef;
  --muted: #707a8a;
  --muted-strong: #929aa5;
  --canvas: #0b0e11;
  --card: #1e2329;
  --elevated: #2b3139;
  --hairline: #2b3139;
  --on-primary: #181a20;
  --on-dark: #ffffff;
  --up: #0ecb81;
  --down: #f6465d;
  --info: #3b82f6;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--body);
}
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
body.is-app { padding: 0 0 84px; }

.phone {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 24px 16px 32px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  position: relative;
  display: inline-block;
}
.logo.big { width: 56px; height: 56px; border-radius: 12px; }
.logo.big::after { inset: 16px 12px 17px; }
.logo::after {
  content: "";
  position: absolute;
  inset: 10px 8px 11px;
  border: 2.5px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
.brand h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--on-dark);
  line-height: 1.2;
}
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.user-chip {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}
.ghost-link {
  color: var(--on-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--card);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 0;
  cursor: pointer;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 4px 4px 4px 16px;
  height: 48px;
}
.search-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--on-dark);
  font: 400 14px/1.5 Inter, sans-serif;
  outline: none;
  min-width: 0;
}
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap button {
  border: 0;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-md);
  height: 40px;
  padding: 0 18px;
  font: 600 14px/1 Inter, sans-serif;
  cursor: pointer;
}
.search-wrap button:active { background: var(--primary-active); }
.hint {
  margin: 8px 4px 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

.block { margin-top: 24px; }
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.block-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--on-dark);
}
.count, .text-btn {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-family: "IBM Plex Sans", Inter, sans-serif;
}
.text-btn { background: none; border: 0; cursor: pointer; }

.row-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 6px 2px 4px;
  scrollbar-width: none;
}
.row-scroll::-webkit-scrollbar { display: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
}

.app-item, .recent-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 64px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.icon-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}
.app-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  background: var(--elevated);
  object-fit: cover;
  display: block;
}
.app-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--body);
}
.hot {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--down);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.3;
  z-index: 2;
}
.star {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--primary);
  font-size: 12px;
  line-height: 20px;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 0 0 1px var(--hairline);
}
.star.is-off { color: var(--muted-strong); }

.banner-wrap { margin-top: 24px; }
.banner-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-xl);
  background: var(--card);
}
.banner-track {
  display: flex;
  width: 100%;
  transition: transform 0.4s ease;
}
.banner {
  flex: 0 0 100%;
  width: 100%;
  min-height: 132px;
  padding: 24px 20px;
  text-decoration: none;
  color: var(--on-dark);
  display: block;
}
.banner h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.2px;
}
.banner p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.5;
}
.theme-blue { background: var(--card); }
.theme-blue h3 { color: var(--primary); }
.theme-violet { background: var(--elevated); }
.theme-green { background: var(--card); box-shadow: inset 4px 0 0 var(--up); }
.theme-green h3 { color: var(--up); }
.theme-orange { background: var(--primary); color: var(--ink); }
.theme-orange h3,
.theme-orange p { color: var(--ink); }
.banner.has-image {
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 2000px rgba(11, 14, 17, 0.45);
}
.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.dots button {
  width: 6px;
  height: 6px;
  border: 0;
  padding: 0;
  border-radius: 99px;
  background: var(--elevated);
  cursor: pointer;
}
.dots button.on {
  width: 16px;
  background: var(--primary);
}

.filters { margin-top: 16px; }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--hairline);
  background: var(--card);
  color: var(--muted-strong);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.chip.on {
  color: var(--ink);
  background: var(--primary);
  border-color: var(--primary);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 0;
  font-size: 14px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.tab.active {
  color: var(--primary);
  font-weight: 700;
}

.dapp-list {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.dapp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  color: inherit;
  text-align: left;
  padding: 12px 16px;
  cursor: pointer;
}
.dapp-row:last-child { border-bottom: 0; }
.dapp-row:active { background: var(--elevated); }
.dapp-row .icon-wrap,
.dapp-row .app-icon {
  width: 48px;
  height: 48px;
}
.dapp-row .icon-wrap { flex: 0 0 48px; }
.dapp-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dapp-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--on-dark);
  line-height: 1.3;
}
.dapp-summary {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dapp-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.dapp-tag {
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: var(--primary);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.3;
}
.dapp-tag.faint {
  background: var(--elevated);
  color: var(--muted-strong);
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.login-card {
  width: min(400px, 100%);
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 32px 24px 24px;
  text-align: center;
}
.login-card h1 {
  margin: 16px 0 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--on-dark);
  letter-spacing: -0.4px;
}
.login-lead {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
}
.login-switch {
  display: flex;
  gap: 8px;
  background: var(--canvas);
  padding: 4px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.login-switch button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  height: 36px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}
.login-switch button.on {
  background: var(--primary);
  color: var(--ink);
}
#auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
#auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
#auth-form input {
  height: 44px;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--on-dark);
  border-radius: var(--radius-lg);
  padding: 0 14px;
  font-size: 15px;
}
#auth-form input:focus {
  outline: 0;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45);
}
#auth-submit {
  margin-top: 8px;
  height: 44px;
  border: 0;
  background: var(--primary);
  color: var(--ink);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
#auth-submit:active { background: var(--primary-active); }
.error { color: var(--down); font-size: 13px; min-height: 18px; margin: 0; }
.login-hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.login-hint b { color: var(--primary); font-weight: 600; }

@media (min-width: 720px) {
  .phone { width: 720px; padding-top: 32px; }
  .grid { grid-template-columns: repeat(6, 1fr); }
}
