:root {
  --bg-0: #160b07;
  --bg-1: #2d170d;
  --bg-2: #5a3218;
  --app-width: 430px;
  --panel: rgba(39, 20, 13, 0.94);
  --panel-bright: rgba(96, 54, 25, 0.8);
  --line: #b77a32;
  --line-soft: rgba(255, 203, 99, 0.5);
  --gold-1: #fff5a6;
  --gold-2: #ffd36a;
  --gold-3: #b7732a;
  --red: #ff4053;
  --green: #23d768;
  --white: #f7fbff;
  --muted: #b8d4f5;
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(170, 103, 34, 0.32), transparent 26rem),
    linear-gradient(180deg, #1b100b 0%, #060403 100%);
  color: var(--white);
  font-family: "Microsoft YaHei", "PingFang SC", "Arial", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

#app {
  width: min(100%, var(--app-width));
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(159, 91, 29, 0.33), transparent 12rem),
    linear-gradient(180deg, rgba(34, 18, 11, 0.98) 0%, rgba(9, 6, 5, 0.98) 100%);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.62);
}

#app::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.027) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: 0.35;
  pointer-events: none;
}

.screen {
  position: relative;
  z-index: 1;
  height: calc(100dvh - 74px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(243, 183, 78, 0.14), transparent 14rem),
    linear-gradient(180deg, rgba(48, 25, 13, 0.54), rgba(8, 5, 4, 0.1));
}

.screen.no-nav {
  height: 100dvh;
  padding-bottom: 28px;
}

.home-screen {
  padding-top: 14px;
  overflow: hidden;
}

.market-table-screen {
  --muted: #d6b485;
  color: #fff3c6;
  background:
    radial-gradient(circle at 50% 0%, rgba(243, 183, 78, 0.22), transparent 12rem),
    linear-gradient(180deg, rgba(65, 35, 18, 0.98), rgba(19, 11, 8, 0.98) 55%, rgba(7, 6, 8, 0.98)),
    #21110b;
  padding: 14px 12px 24px;
}

.market-table-screen .topbar {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 2px solid rgba(255, 207, 112, 0.62);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(103, 58, 29, 0.92), rgba(42, 22, 13, 0.96)),
    #3a2115;
  box-shadow:
    inset 0 2px 0 rgba(255, 233, 171, 0.26),
    inset 0 -3px 0 rgba(0, 0, 0, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.34);
}

.market-table-screen .brand h1 {
  color: var(--gold-1);
  text-shadow:
    0 2px 0 #5a260c,
    0 0 10px rgba(255, 214, 113, 0.32);
}

.market-table-screen .brand h2 {
  color: #f0d19b;
}

.market-table-screen .balance-pill {
  border-color: rgba(255, 221, 124, 0.74);
  background:
    linear-gradient(180deg, rgba(106, 60, 25, 0.96), rgba(38, 22, 14, 0.98));
  box-shadow:
    inset 0 2px 0 rgba(255, 235, 184, 0.22),
    0 5px 12px rgba(0, 0, 0, 0.36);
}

.market-table-screen .balance-pill span {
  color: #e6c48d;
}

.market-table-screen .balance-pill strong {
  color: var(--gold-1);
  text-shadow: 0 2px 0 #5b2913;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 2px solid rgba(255, 207, 112, 0.52);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(98, 55, 28, 0.88), rgba(35, 20, 13, 0.94));
  box-shadow:
    inset 0 2px 0 rgba(255, 233, 171, 0.18),
    inset 0 -3px 0 rgba(0, 0, 0, 0.24),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.brand {
  min-width: 0;
}

.brand h1,
.brand h2 {
  margin: 0;
}

.brand h1 {
  font-size: 27px;
  line-height: 1.05;
}

.brand h2 {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.balance-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(255, 216, 102, 0.62);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 208, 82, 0.18), rgba(19, 76, 143, 0.65));
  box-shadow: inset 0 0 14px rgba(255, 239, 164, 0.18), 0 5px 16px var(--shadow);
  text-align: right;
}

.balance-pill span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.balance-pill strong {
  display: block;
  color: var(--gold-1);
  font-size: 16px;
  text-shadow: 0 2px 0 #522b11;
}

.gold-text,
.section-title,
.value-gold,
.hero-title {
  color: var(--gold-1);
  text-shadow:
    0 2px 0 #5b2913,
    0 0 10px rgba(255, 211, 106, 0.28);
}

.hero-title {
  font-size: 34px;
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: 0;
}

.subtle {
  color: var(--muted);
}

.panel,
.market-row,
.holding-card,
.trade-card,
.announcement,
.rank-row {
  border: 2px solid var(--line-soft);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(82, 45, 23, 0.9), rgba(24, 13, 9, 0.96)),
    var(--panel);
  box-shadow:
    inset 0 0 0 2px rgba(95, 41, 18, 0.42),
    inset 0 12px 20px rgba(255, 218, 137, 0.07),
    0 10px 24px rgba(0, 0, 0, 0.36);
}

.panel {
  padding: 14px;
  margin: 10px 0;
}

.notice-panel {
  padding: 14px 16px;
}

.market-header {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  grid-template-areas:
    "back title balance"
    "back date balance";
  align-items: center;
  gap: 4px 10px;
  margin: 2px 0 12px;
}

.back-chip {
  grid-area: back;
  align-self: start;
  min-height: 34px;
}

.home-title {
  grid-area: title;
  font-size: 36px;
  line-height: 1;
  font-weight: 1000;
}

.home-date {
  grid-area: date;
  color: #fff5bd;
  font-size: 16px;
  font-weight: 1000;
  text-shadow: 0 2px 0 #5b2913;
}

.home-balance {
  grid-area: balance;
  text-align: right;
  color: var(--gold-1);
  text-shadow: 0 2px 0 #5b2913;
}

.home-balance span,
.home-balance strong {
  display: block;
  font-weight: 1000;
}

.home-balance span {
  font-size: 27px;
  line-height: 1;
}

.home-balance strong {
  font-size: 18px;
}

.market-board {
  margin-top: 8px;
  padding: 12px;
  border-radius: 24px;
  border-color: rgba(255, 203, 99, 0.64);
  background:
    linear-gradient(180deg, rgba(75, 40, 20, 0.96), rgba(20, 12, 9, 0.98));
}

.index-card {
  min-height: 164px;
  display: grid;
  place-items: center;
  align-content: center;
  margin-bottom: 12px;
  border: 2px solid rgba(255, 204, 95, 0.56);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 204, 93, 0.18), transparent 8rem),
    linear-gradient(180deg, rgba(36, 84, 134, 0.72), rgba(13, 48, 88, 0.84));
  box-shadow:
    inset 0 0 24px rgba(255, 212, 111, 0.18),
    inset 0 -5px 0 rgba(0, 0, 0, 0.16);
}

.index-label {
  font-size: 24px;
  font-weight: 1000;
}

.index-value {
  color: var(--gold-2);
  font-size: clamp(54px, 18vw, 78px);
  line-height: 0.98;
  font-weight: 1000;
  text-shadow:
    0 4px 0 #6b3212,
    0 0 16px rgba(255, 214, 106, 0.35);
}

.index-change {
  margin-top: 2px;
  font-size: 27px;
  font-weight: 1000;
}

.home-rank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-rank-panel {
  min-width: 0;
  padding: 0 0 8px;
  overflow: hidden;
  border: 2px solid rgba(255, 203, 99, 0.42);
  border-radius: 16px;
  background: rgba(31, 16, 10, 0.72);
  box-shadow: inset 0 0 18px rgba(255, 179, 67, 0.12);
}

.home-rank-title {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  background:
    linear-gradient(180deg, rgba(81, 45, 23, 0.95), rgba(25, 14, 10, 0.95));
  color: var(--gold-1);
  text-shadow: 0 2px 0 #5b2913;
}

.home-rank-title span {
  font-size: 21px;
  font-weight: 1000;
}

.home-rank-title b {
  font-size: 15px;
}

.home-rank-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 24px 1fr;
  grid-template-areas:
    "idx name"
    "idx data";
  gap: 0 4px;
  align-items: center;
  padding: 6px 8px;
  border-top: 1px solid rgba(109, 181, 241, 0.16);
  background: transparent;
  text-align: left;
}

.home-rank-index {
  grid-area: idx;
  align-self: start;
  padding-top: 4px;
  font-size: 21px;
  font-weight: 1000;
}

.home-rank-name {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  color: var(--white);
  font-size: 16px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-rank-price,
.home-rank-change {
  grid-area: data;
  font-size: 13px;
  font-weight: 1000;
}

.home-rank-price {
  color: #fff5bd;
}

.home-rank-change {
  justify-self: end;
}

.home-rank-panel.up .home-rank-index,
.home-rank-panel.up .home-rank-change {
  color: var(--red);
}

.home-rank-panel.down .home-rank-index,
.home-rank-panel.down .home-rank-change {
  color: var(--green);
}

.home-disclaimer {
  margin-top: 9px;
  color: rgba(216, 235, 255, 0.76);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.site-filing {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin: 10px 0 4px;
  color: rgba(255, 239, 188, 0.76);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 2px 0 rgba(24, 8, 4, 0.7);
}

.site-filing a {
  color: rgba(255, 245, 166, 0.88);
  text-decoration: none;
}

.site-filing a:active,
.site-filing a:hover {
  color: var(--gold-1);
}

.notice-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 5px 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.notice-line b {
  color: var(--gold-1);
  flex: 0 0 auto;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 8px;
}

.section-title {
  font-size: 22px;
  font-weight: 1000;
}

.mini-btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 12px;
  color: var(--white);
  background: linear-gradient(180deg, #4d87bd, #163e6a);
  border: 1px solid rgba(255, 224, 145, 0.6);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 900;
}

.image-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent;
  text-shadow: none;
  -webkit-text-stroke: 0;
  line-height: 0;
}

.image-button:active {
  transform: translateY(1px);
}

.image-button-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.refresh-image-button {
  width: 78px;
  min-height: 32px;
}

.market-sync-button {
  flex: 0 0 auto;
  width: 126px;
  min-height: 42px;
}

.holding-image-button {
  width: 100%;
  min-height: 42px;
}

.holding-image-button .image-button-img,
.market-sync-button .image-button-img {
  max-height: 42px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-box {
  min-height: 112px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-box,
.summary-pill,
.trade-meta div {
  background:
    linear-gradient(180deg, rgba(58, 31, 17, 0.92), rgba(17, 10, 8, 0.94));
  border: 1px solid rgba(255, 203, 99, 0.34);
}

.stat-label {
  color: var(--gold-1);
  font-size: 18px;
  font-weight: 1000;
}

.stat-main {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1.1;
}

.stat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profit {
  color: var(--red);
}

.loss {
  color: var(--green);
}

.streamer-wall {
  display: grid;
  grid-template-columns: 95px 1fr;
  gap: 12px;
  align-items: center;
}

.home-streamer {
  padding: 10px;
}

.speech {
  position: relative;
  padding: 12px;
  border-radius: 18px;
  background: #fff0c8;
  color: #682111;
  font-size: 14px;
  font-weight: 900;
}

.speech::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 34px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 12px solid #fff8ee;
}

.avatar {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  border: 3px solid var(--gold-2);
  object-fit: cover;
  box-shadow: 0 0 0 3px #5c2e13, 0 8px 18px rgba(0, 0, 0, 0.42);
  background: #2a160e;
}

.avatar.portrait-avatar {
  border-color: #ffe581;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 226, 122, 0.28), transparent 56%),
    linear-gradient(180deg, #7b431f, #1c0d08);
  box-shadow:
    0 0 0 2px #fff0a8,
    0 0 0 5px #65300f,
    inset 0 0 18px rgba(255, 236, 164, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.46);
}

.avatar.large {
  width: 108px;
  height: 108px;
  border-radius: 22px;
}

.home-streamer .avatar.large {
  width: 84px;
  height: 84px;
  border-radius: 18px;
}

.market-list {
  display: grid;
  gap: 10px;
}

.stock-table-wrap {
  overflow: auto;
  border: 2px solid rgba(255, 203, 99, 0.7);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(69, 39, 23, 0.98), rgba(23, 13, 10, 0.98)),
    #24140e;
  box-shadow:
    inset 0 0 0 2px rgba(111, 52, 22, 0.62),
    inset 0 10px 18px rgba(255, 214, 123, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.42);
}

.group-board {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}

.group-card {
  padding: 8px;
  border: 1px solid rgba(255, 221, 132, 0.58);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(71, 39, 21, 0.96), rgba(26, 15, 10, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 5px 13px rgba(0, 0, 0, 0.28);
}

.group-main {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 52px 58px 58px;
  gap: 6px;
  align-items: center;
  padding: 0;
  background: transparent;
  color: #fff0ba;
  text-align: left;
}

.group-main span,
.group-main strong,
.group-main em,
.group-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-main span {
  font-size: 15px;
  font-weight: 1000;
}

.group-main strong {
  color: var(--gold-1);
  font-size: 15px;
  font-weight: 1000;
  text-align: right;
}

.group-main em {
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
  text-align: right;
}

.group-main small {
  color: #f0cd91;
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.group-members,
.detail-group-members {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.group-member-chip {
  max-width: 92px;
  min-height: 23px;
  padding: 4px 7px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255, 238, 176, 0.12);
  color: #ffe8ad;
  font-size: 10px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-blue {
  border-color: rgba(111, 182, 255, 0.72);
}

.group-yellow {
  border-color: rgba(255, 225, 83, 0.78);
}

.group-green {
  border-color: rgba(96, 225, 133, 0.78);
}

.stock-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
  line-height: 1.15;
}

.stock-table th:nth-child(1),
.stock-table td:nth-child(1) {
  width: 28px;
}

.stock-table th:nth-child(3),
.stock-table td:nth-child(3) {
  width: 47px;
}

.stock-table th:nth-child(4),
.stock-table td:nth-child(4) {
  width: 50px;
}

.stock-table th:nth-child(5),
.stock-table td:nth-child(5) {
  width: 48px;
}

.stock-table th:nth-child(6),
.stock-table td:nth-child(6) {
  width: 34px;
}

.stock-table th:nth-child(7),
.stock-table td:nth-child(7) {
  width: 56px;
}

.stock-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 4px;
  background:
    linear-gradient(180deg, #8f5524, #56301a 55%, #321b10);
  color: #ffedb2;
  font-size: 11px;
  font-weight: 1000;
  text-align: right;
  white-space: nowrap;
}

.stock-table th:nth-child(2),
.stock-table td:nth-child(2) {
  text-align: left;
}

.stock-table td {
  height: 38px;
  padding: 5px 4px;
  border-bottom: 1px solid rgba(223, 163, 78, 0.28);
  color: #ffe9b1;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.stock-table tbody tr:nth-child(even) td {
  background: rgba(48, 28, 18, 0.93);
}

.stock-table tbody tr:nth-child(odd) td {
  background: rgba(34, 20, 15, 0.96);
}

.stock-table tbody tr:hover td {
  background: rgba(82, 47, 24, 0.96);
}

.stock-table tbody tr.group-index-row td {
  background: rgba(88, 52, 23, 0.98);
}

.stock-table tbody tr.group-member-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(255, 226, 106, 0.92);
}

.stock-table tbody tr.group-blue td:first-child {
  box-shadow: inset 3px 0 0 #8ac8ff;
}

.stock-table tbody tr.group-yellow td:first-child {
  box-shadow: inset 3px 0 0 #ffe26a;
}

.stock-table tbody tr.group-green td:first-child {
  box-shadow: inset 3px 0 0 #86e88d;
}

.col-rank {
  width: 38px;
  color: #f1c670;
  text-align: center !important;
}

.col-name {
  min-width: 156px;
}

.stock-name-btn {
  display: grid;
  align-content: center;
  gap: 0;
  min-height: 30px;
  width: 100%;
  padding: 0;
  background: transparent;
  color: #fff0ba;
  text-align: left;
}

.stock-name-btn strong {
  display: flex;
  gap: 5px;
  align-items: center;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-badge {
  flex: 0 0 auto;
  max-width: 48px;
  padding: 1px 4px;
  border-radius: 6px;
  overflow: hidden;
  color: #271406;
  font-size: 8px;
  font-weight: 1000;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-badge.blue {
  background: #8ac8ff;
}

.group-badge.yellow {
  background: #ffe26a;
}

.group-badge.green {
  background: #86e88d;
}

.stock-name-btn span {
  overflow: hidden;
  color: #c99859;
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-name-btn .stock-title-text {
  color: #fff0ba;
  font-size: 12px;
}

.stock-name-btn .group-badge {
  color: #271406;
  font-size: 8px;
}

.col-price {
  color: #ffeaa6 !important;
  font-size: 13px;
  font-weight: 1000 !important;
}

.col-change.up {
  color: #ff4e54;
}

.col-change.down {
  color: #3fe07b;
}

.col-volume,
.col-heat {
  color: #e6c895 !important;
}

.col-actions {
  width: 56px;
  text-align: center !important;
}

.table-action {
  min-height: 24px;
  width: 34px;
  padding: 3px 2px;
  border: 1px solid rgba(255, 225, 145, 0.78);
  border-radius: 7px;
  background:
    linear-gradient(180deg, #4a83bc, #16416f);
  color: #ffffff;
  font-size: 10px;
  font-weight: 1000;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -2px 0 rgba(0, 0, 0, 0.28);
}

.image-table-action {
  width: 52px;
  min-height: 39px;
}

.image-table-action .image-button-img {
  max-height: 39px;
}

.table-action.primary {
  border-color: #ffe49b;
  background: linear-gradient(180deg, #ffe06a, #c77a1d);
  color: #4c2408;
}

.table-note {
  margin-top: 2px;
  color: #f0cd91;
  font-size: 11px;
  font-weight: 900;
}

.market-sync-note {
  max-width: 252px;
  margin-top: 3px;
  color: #ffe8a3;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  text-shadow: var(--text-outline-soft);
}

.market-sync-note.warn {
  color: #ffddbf;
}

.market-table-screen .section-title {
  color: var(--gold-1);
  text-shadow: 0 2px 0 #5b2913;
}

.market-table-screen .mini-btn {
  border-color: rgba(255, 224, 145, 0.72);
  background: linear-gradient(180deg, #4d87bd, #163e6a);
  color: #ffffff;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

.market-row {
  min-height: 92px;
  padding: 10px;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 10px;
  align-items: center;
}

.market-row .avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
}

.market-name {
  font-size: 18px;
  font-weight: 1000;
  line-height: 1.1;
}

.market-code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-stack {
  min-width: 82px;
  text-align: right;
}

.price {
  color: var(--gold-1);
  font-size: 22px;
  font-weight: 1000;
  text-shadow: 0 2px 0 #5b2913;
}

.change {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 1000;
}

.change.up {
  color: var(--red);
}

.change.down {
  color: var(--green);
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn {
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 16px;
  color: var(--white);
  font-size: 18px;
  font-weight: 1000;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.24),
    inset 0 -4px 0 rgba(0, 0, 0, 0.16),
    0 8px 16px rgba(0, 0, 0, 0.34);
}

.btn:active {
  transform: translateY(1px);
}

.btn-blue {
  background: linear-gradient(180deg, #2f9de5, #11518f);
  border: 2px solid rgba(255, 224, 145, 0.66);
}

.btn-gold {
  background: linear-gradient(180deg, #ffe16a, #eda72b);
  border: 2px solid #ffeaa3;
  color: #7c2b0c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.btn-red {
  background: linear-gradient(180deg, #ff5b61, #a91b20);
  border: 2px solid #ffb1a1;
}

.btn-wide {
  width: 100%;
}

.back-btn {
  min-width: 96px;
}

.detail-head {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}

.detail-name {
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
}

.detail-code {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.detail-price {
  margin-top: 10px;
  color: var(--gold-1);
  font-size: 38px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 3px 0 #5b2913;
}

.chart-card {
  padding: 12px 10px 10px;
}

.chart-wrap {
  width: 100%;
  min-height: 176px;
}

.chart-wrap svg {
  width: 100%;
  height: 176px;
  display: block;
}

.detail-copy {
  margin: 8px 0 0;
  color: #fff6bb;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.detail-group-card {
  padding: 11px;
}

.detail-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--gold-1);
  font-size: 15px;
  font-weight: 1000;
}

.detail-group-title strong {
  flex: 0 0 auto;
  color: #f0cd91;
  font-size: 12px;
}

.holding-summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.summary-pill {
  padding: 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
}

.summary-pill strong {
  display: block;
  margin-top: 5px;
  color: var(--gold-1);
  font-size: 20px;
}

.trade-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.trade-target {
  display: grid;
  grid-template-columns: 102px 1fr;
  gap: 12px;
  align-items: center;
}

.trade-card {
  padding: 14px;
}

.trade-title {
  color: var(--gold-1);
  font-size: 22px;
  font-weight: 1000;
  text-align: center;
  text-shadow: 0 2px 0 #5b2913;
}

.qty-row {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.qty-row input {
  min-width: 0;
  height: 46px;
  border: 2px solid rgba(255, 211, 106, 0.75);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #07152d;
  text-align: center;
  font-size: 20px;
  font-weight: 1000;
}

.qty-step {
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2c88d4, #0b4384);
  color: var(--white);
  font-size: 20px;
  font-weight: 1000;
  border: 1px solid rgba(255, 217, 129, 0.6);
}

.trade-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.trade-meta div {
  padding: 8px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.trade-meta strong {
  display: block;
  margin-top: 2px;
  color: var(--gold-1);
  font-size: 17px;
}

.holding-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
}

.holding-card .avatar {
  width: 60px;
  height: 60px;
  border-radius: 14px;
}

.holding-card h3 {
  margin: 0;
  font-size: 18px;
}

.holding-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.holding-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.rank-row {
  min-height: 70px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
}

.ranking-section {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.ranking-section-title {
  margin: 0 2px;
  color: var(--cream-bright);
  font-size: 14px;
  font-weight: 1000;
  text-shadow: var(--text-outline);
}

.rank-top-list,
.rank-nearby-list {
  display: grid;
  gap: 8px;
}

.rank-row.top-three {
  border-color: rgba(255, 226, 106, 0.86);
  background:
    linear-gradient(180deg, rgba(141, 79, 35, 0.96), rgba(62, 31, 18, 0.98) 28%, rgba(29, 13, 9, 0.99)),
    var(--wood-dark);
}

.rank-row.self {
  border-color: rgba(255, 246, 177, 0.96);
  box-shadow:
    inset 0 2px 0 rgba(255, 248, 198, 0.42),
    inset 0 -4px 0 rgba(39, 15, 8, 0.68),
    inset 0 0 0 2px rgba(255, 214, 95, 0.36),
    0 10px 23px rgba(0, 0, 0, 0.38);
}

.rank-row.self .market-code {
  color: #ffe26a;
}

.rank-medal {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-1);
  background: rgba(45, 24, 14, 0.9);
  border: 2px solid rgba(255, 222, 130, 0.42);
  font-weight: 1000;
}

.rank-score {
  color: var(--gold-1);
  min-width: 58px;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1.05;
  text-align: right;
}

.announcement {
  padding: 12px;
  margin-bottom: 10px;
}

.announcement h3 {
  margin: 0 0 7px;
  color: var(--gold-1);
  font-size: 18px;
}

.announcement p {
  margin: 0;
  color: #ffe8b3;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
  font-weight: 900;
}

.nav {
  position: fixed;
  left: max(4px, calc((100vw - var(--app-width)) / 2 + 4px));
  right: max(4px, calc((100vw - var(--app-width)) / 2 + 4px));
  bottom: max(6px, env(safe-area-inset-bottom));
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  height: 58px;
  padding: 3px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(50, 28, 17, 0.72), rgba(14, 8, 6, 0.82));
  border: 1px solid rgba(255, 205, 101, 0.28);
  box-shadow: 0 -5px 18px rgba(0, 0, 0, 0.36);
}

.nav button {
  width: 100%;
  min-width: 0;
  height: 52px;
  min-height: 0;
  padding: 0;
  border-radius: 7px;
  overflow: hidden;
  background: transparent;
  color: transparent;
  border: 0;
  filter: saturate(0.92) brightness(0.88);
}

.nav button.active {
  filter: saturate(1.16) brightness(1.1) drop-shadow(0 0 7px rgba(255, 234, 163, 0.78));
  transform: translateY(-3px) scale(1.04);
}

.nav-image-button {
  display: grid;
  place-items: center;
}

.nav-button-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  pointer-events: none;
}

.toast {
  position: fixed;
  left: max(16px, calc((100vw - var(--app-width)) / 2 + 16px));
  right: max(16px, calc((100vw - var(--app-width)) / 2 + 16px));
  bottom: 86px;
  z-index: 5;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 241, 167, 0.96);
  color: #61290d;
  font-weight: 1000;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  display: none;
}

.toast.show {
  display: block;
}

/* Nav-art aligned fantasy board styling */
:root {
  --cream: #fff4bf;
  --cream-bright: #fff9d8;
  --ink-outline: #3b1d08;
  --wood-dark: #2a140f;
  --wood-mid: #5c3020;
  --wood-light: #7d4726;
  --gold-frame: #f8c45b;
  --gold-frame-dark: #8d531b;
  --gem-blue: #16147d;
  --gem-red: #c9271e;
  --gem-green: #075b09;
  --gem-purple: #4b0878;
  --gem-orange: #c97a00;
  --text-outline:
    -1px -1px 0 var(--ink-outline),
    1px -1px 0 var(--ink-outline),
    -1px 1px 0 var(--ink-outline),
    1px 1px 0 var(--ink-outline),
    0 3px 0 var(--ink-outline),
    0 0 9px rgba(255, 232, 153, 0.18);
  --text-outline-soft:
    -1px 0 0 var(--ink-outline),
    1px 0 0 var(--ink-outline),
    0 1px 0 var(--ink-outline),
    0 2px 0 var(--ink-outline);
}

body {
  color: var(--cream);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Arial", sans-serif;
  font-weight: 900;
}

#app {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 190, 71, 0.22), transparent 14rem),
    linear-gradient(180deg, #3a1e14 0%, #170b08 54%, #080403 100%);
}

#app::before {
  opacity: 0.18;
}

.screen,
.market-table-screen {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 197, 80, 0.16), transparent 12rem),
    linear-gradient(180deg, rgba(76, 41, 22, 0.8), rgba(14, 7, 5, 0.4));
}

.gold-text,
.section-title,
.hero-title,
.home-title,
.index-label,
.trade-title,
.detail-name,
.market-name,
.stat-label,
.announcement h3,
.home-rank-title,
.detail-group-title,
.group-main span {
  color: var(--cream-bright);
  -webkit-text-stroke: 0.4px var(--ink-outline);
  text-shadow: var(--text-outline);
}

.hero-title,
.home-title {
  letter-spacing: 0;
}

.brand h2,
.table-note,
.home-date,
.detail-code,
.market-code,
.stat-note,
.holding-card p,
.announcement p,
.notice-line,
.detail-copy {
  color: #f2d89c;
  text-shadow: var(--text-outline-soft);
}

.topbar,
.market-table-screen .topbar,
.panel,
.market-row,
.holding-card,
.trade-card,
.announcement,
.rank-row,
.market-board,
.stock-table-wrap,
.group-card,
.home-rank-panel,
.detail-group-card {
  border-color: rgba(255, 210, 91, 0.78);
  background:
    linear-gradient(180deg, rgba(126, 70, 35, 0.96), rgba(56, 28, 18, 0.98) 18%, rgba(25, 12, 9, 0.99)),
    var(--wood-dark);
  box-shadow:
    inset 0 2px 0 rgba(255, 236, 164, 0.35),
    inset 0 -4px 0 rgba(39, 15, 8, 0.68),
    inset 0 0 0 2px rgba(96, 43, 17, 0.62),
    0 10px 23px rgba(0, 0, 0, 0.38);
}

.market-board,
.index-card,
.home-rank-panel,
.stock-table-wrap,
.group-card {
  border-radius: 12px;
}

.balance-pill,
.stat-box,
.summary-pill,
.trade-meta div {
  border: 2px solid rgba(255, 210, 91, 0.66);
  background:
    linear-gradient(180deg, rgba(79, 35, 82, 0.9), rgba(35, 16, 36, 0.95));
  box-shadow:
    inset 0 2px 0 rgba(255, 236, 164, 0.22),
    inset 0 -3px 0 rgba(0, 0, 0, 0.35);
}

.balance-pill strong,
.home-balance,
.index-value,
.detail-price,
.price,
.stat-main,
.summary-pill strong,
.trade-meta strong,
.rank-score,
.col-price {
  color: var(--cream-bright) !important;
  -webkit-text-stroke: 0.45px var(--ink-outline);
  text-shadow: var(--text-outline);
}

.index-card {
  border: 3px solid rgba(255, 215, 103, 0.7);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 243, 174, 0.14), transparent 8rem),
    linear-gradient(180deg, rgba(37, 45, 91, 0.96), rgba(17, 31, 74, 0.98));
}

.home-rank-title,
.stock-table th {
  background:
    linear-gradient(180deg, #8a4a24, #5a2c18 52%, #2a130d);
}

.home-rank-name,
.stock-name-btn .stock-title-text,
.stock-table td,
.group-member-chip {
  color: var(--cream);
  text-shadow: var(--text-outline-soft);
}

.home-rank-index,
.home-rank-change,
.col-change,
.change,
.profit,
.loss {
  -webkit-text-stroke: 0.3px #241005;
  text-shadow: 0 2px 0 #241005;
}

.mini-btn,
.btn,
.table-action,
.qty-step {
  border: 2px solid rgba(255, 231, 142, 0.82);
  border-radius: 10px;
  color: var(--cream-bright);
  -webkit-text-stroke: 0.35px var(--ink-outline);
  text-shadow: var(--text-outline-soft);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.22),
    inset 0 -4px 0 rgba(0, 0, 0, 0.26),
    0 5px 13px rgba(0, 0, 0, 0.34);
}

.mini-btn,
.btn-blue,
.qty-step {
  background: linear-gradient(180deg, #2421a0, #111064);
}

.btn-gold,
.table-action.primary {
  background: linear-gradient(180deg, #f5b332, #b65b13);
  color: var(--cream-bright);
}

.btn-red {
  background: linear-gradient(180deg, #df3227, #8e1712);
}

.group-card.group-blue,
.stock-table tbody tr.group-blue td:first-child {
  border-color: rgba(97, 153, 255, 0.78);
}

.group-card.group-yellow,
.stock-table tbody tr.group-yellow td:first-child {
  border-color: rgba(255, 226, 106, 0.85);
}

.group-card.group-green,
.stock-table tbody tr.group-green td:first-child {
  border-color: rgba(104, 225, 103, 0.82);
}

.group-badge {
  border: 1px solid rgba(59, 29, 8, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.stock-table td {
  border-bottom-color: rgba(255, 199, 92, 0.26);
}

.stock-table tbody tr:nth-child(even) td {
  background: rgba(52, 25, 17, 0.96);
}

.stock-table tbody tr:nth-child(odd) td {
  background: rgba(36, 18, 13, 0.98);
}

.stock-table tbody tr.group-index-row td {
  background: rgba(80, 42, 22, 0.99);
}

.qty-row input {
  border: 3px solid rgba(255, 217, 106, 0.86);
  background: #fff3c2;
  color: #3c1b07;
  text-shadow: none;
}

.toast {
  border: 2px solid rgba(255, 218, 101, 0.86);
  background: #fff2b6;
  color: #4d2109;
}

@media (max-width: 370px) {
  .screen {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero-title {
    font-size: 30px;
  }

  .detail-name {
    font-size: 25px;
  }

  .detail-price {
    font-size: 32px;
  }

  .market-row {
    grid-template-columns: 56px 1fr;
  }

  .market-row .price-stack {
    grid-column: 2;
    text-align: left;
  }

  .stock-table {
    font-size: 11px;
  }

  .stock-table th {
    font-size: 10px;
  }

  .table-action {
    padding: 3px 2px;
  }
}
