:root {
  color-scheme: light;
  --page: #f6f6f6;
  --card: #fff;
  --ink: #30343b;
  --muted: #8f96a3;
  --line: #eceff3;
  --red: #ef3f46;
  --green: #18a85e;
  --gold-bg: #fff6eb;
  --gold-line: #f6dcc6;
  --brown: #6b3510;
  --blue: #1e76f2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
}

button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.app-shell {
  width: 100vw;
  max-width: 100vw;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--page);
}

.status-row,
.fund-kicker,
.fund-tags,
.quote-main,
.quote-grid,
.product-tabs,
.section-title,
.manager-metrics,
.holding-head,
.holding-row,
.chart-legend,
.range-tabs {
  display: flex;
  align-items: center;
}

.status-row {
  justify-content: space-between;
  height: 26px;
  color: #111;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-row {
  justify-content: space-between;
  min-height: 54px;
}

.fund-hero {
  padding: calc(20px + env(safe-area-inset-top)) 20px 24px;
  background: #fff;
}

.fund-kicker {
  gap: 8px;
  color: #6f7784;
  font-size: 14px;
}

.fund-kicker i {
  width: 1px;
  height: 12px;
  background: #cdd2d9;
}

.fund-hero h1 {
  margin: 12px 0 0;
  color: #1f2937;
  max-width: 100%;
  word-break: break-all;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.16;
  letter-spacing: 0;
}

.fund-tags {
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.fund-tags::-webkit-scrollbar {
  display: none;
}

.fund-tags span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 7px;
  color: #9a4c16;
  background: #fff1e3;
  font-size: 13px;
  font-weight: 700;
}

.quote-card {
  margin: 12px 18px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 255, 255, 0.85) 0 22%, transparent 23%),
    linear-gradient(135deg, #fffaf4 0%, #fff1e5 100%);
}

.quote-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.68fr);
  gap: 8px;
  padding: 20px 14px 17px;
  border-bottom: 1px solid #f3dfce;
}

.quote-main div {
  min-width: 0;
  overflow: hidden;
}

.quote-main span,
.quote-grid span,
.section-title span,
.manager-metrics span,
.holding-head,
.table-note,
.paragraph,
.info-table dt,
.risk-footer {
  color: var(--muted);
}

.quote-main span,
.quote-grid span {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 700;
}

.quote-main strong {
  display: block;
  min-width: 0;
  word-break: break-all;
  overflow-wrap: anywhere;
  font-size: clamp(27px, 7.6vw, 34px);
  line-height: 1;
  letter-spacing: 0;
}

.quote-main div:nth-child(2) strong {
  font-size: clamp(21px, 5.6vw, 25px);
}

.quote-main em {
  display: none;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quote-grid div:nth-child(3) {
  grid-column: 1 / -1;
}

.quote-grid div {
  min-width: 0;
  overflow: hidden;
  padding: 16px 8px 18px 12px;
  border-right: 1px dashed #edd8c7;
}

.quote-grid div:last-child {
  border-right: 0;
}

.quote-grid strong {
  display: block;
  color: var(--brown);
  min-width: 0;
  word-break: break-all;
  overflow-wrap: anywhere;
  font-size: clamp(18px, 4.9vw, 23px);
  line-height: 1.12;
}

.rise {
  color: var(--red) !important;
}

.fall {
  color: var(--green) !important;
}

.product-tabs {
  position: sticky;
  top: 0;
  z-index: 9;
  gap: 20px;
  overflow-x: auto;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  scrollbar-width: none;
}

.product-tabs::-webkit-scrollbar {
  display: none;
}

.product-tabs button {
  position: relative;
  flex: 0 0 auto;
  height: 54px;
  color: #7f8792;
  font-size: 17px;
  font-weight: 700;
}

.product-tabs button.active {
  color: #242933;
}

.product-tabs button.active::after {
  position: absolute;
  right: 2px;
  bottom: 0;
  left: 2px;
  height: 3px;
  border-radius: 999px;
  background: var(--red);
  content: "";
}

.panel {
  display: none;
  padding: 12px 18px 0;
}

.panel.active {
  display: block;
}

.section-card {
  margin-bottom: 12px;
  padding: 18px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.section-title span {
  flex: 0 0 auto;
  font-size: 14px;
}

.manager-layout {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 15px;
  align-items: center;
}

.manager-layout img {
  width: 116px;
  height: 148px;
  object-fit: cover;
  object-position: center top;
  border-radius: 13px;
  background: #edf4ff;
}

.manager-copy h3 {
  margin: 0 0 8px;
  font-size: 25px;
}

.manager-copy {
  min-width: 0;
}

.manager-copy p,
.paragraph {
  margin: 0;
  word-break: break-all;
  font-size: 15px;
  line-height: 1.65;
  text-align: justify;
}

.manager-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.manager-metrics div {
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: #f8f9fb;
}

.manager-metrics span {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.manager-metrics strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.info-table {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.info-table div {
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.info-table dt,
.info-table dd {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 14px;
}

.info-table dd {
  min-width: 0;
  color: #343a43;
  font-weight: 700;
}

.sector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.sector-list span {
  padding: 7px 11px;
  border-radius: 999px;
  color: #b4232d;
  background: #fff0f1;
  font-size: 13px;
  font-weight: 700;
}

.asset-bars {
  display: grid;
  gap: 10px;
}

.allocation-layout {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 15px;
  align-items: center;
  margin-bottom: 14px;
}

.allocation-pie {
  position: relative;
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef1f5;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.06);
}

.allocation-pie::after {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.allocation-pie div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.allocation-pie strong,
.allocation-pie span {
  display: block;
}

.allocation-pie strong {
  color: #111827;
  font-size: 18px;
  line-height: 1.1;
}

.allocation-pie span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.allocation-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.allocation-item {
  display: grid;
  grid-template-columns: 10px minmax(74px, 1fr) auto;
  column-gap: 7px;
  row-gap: 2px;
  align-items: center;
  min-width: 0;
}

.allocation-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.allocation-item span {
  overflow: hidden;
  color: #303642;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.allocation-item strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.allocation-item em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.compact-assets {
  grid-template-columns: 1fr 1fr;
}

.asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 12px 10px;
  border-radius: 12px;
  background: #f8f9fb;
}

.asset-row strong,
.asset-row span,
.asset-row em {
  display: block;
}

.asset-row strong {
  margin-bottom: 4px;
  color: #252a32;
  font-size: 15px;
}

.asset-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.asset-row em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 16px;
  font-weight: 800;
}

.stock-asset em {
  color: var(--red);
}

.cash-asset em {
  color: #2563eb;
}

.daily-stock-list {
  display: grid;
  gap: 0;
}

.daily-stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.daily-stock-row:last-child {
  border-bottom: 0;
}

.daily-stock-name,
.daily-stock-return {
  min-width: 0;
}

.daily-stock-name strong,
.daily-stock-name em,
.daily-stock-name span,
.daily-stock-return strong,
.daily-stock-return span {
  display: block;
}

.daily-stock-name strong {
  display: inline;
  margin-right: 5px;
  font-size: 17px;
  line-height: 1.35;
}

.daily-stock-name em {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid #ffb4bd;
  border-radius: 4px;
  color: #ff7a87;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.daily-stock-name span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.daily-stock-return {
  text-align: right;
}

.daily-stock-return strong {
  font-size: 18px;
  line-height: 1.2;
}

.daily-stock-return span {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
}

.holding-head,
.holding-row {
  display: grid;
  grid-template-columns: minmax(104px, 1.05fr) minmax(74px, 0.74fr) minmax(74px, 0.74fr) minmax(62px, 0.56fr);
  gap: 8px;
}

.holding-head {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.holding-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.holding-row:last-child {
  border-bottom: 0;
}

.stock-name strong {
  display: inline-block;
  margin-right: 4px;
  font-size: 18px;
  line-height: 1.25;
}

.stock-name em {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 4px;
  border: 1px solid #ff9ca3;
  border-radius: 5px;
  color: #ff6570;
  font-style: normal;
  font-size: 12px;
}

.stock-name span,
.stock-pnl span {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.stock-pnl strong,
.stock-weight strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.stock-weight {
  display: flex;
  align-items: center;
}

.table-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.chart-legend {
  justify-content: space-between;
  margin-bottom: 8px;
  color: #475569;
  font-size: 14px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: var(--red);
}

.chart-legend span:nth-child(2) i {
  background: #8fb4ea;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fff;
}

.range-tabs {
  justify-content: space-around;
  margin-top: 8px;
  color: #8b929d;
  font-weight: 700;
}

.range-tabs span {
  padding: 8px 12px;
  border-radius: 999px;
}

.range-tabs .active {
  color: var(--red);
  background: #fff0f1;
}

.month-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.month-summary div {
  padding: 12px;
  border-radius: 12px;
  background: #fff6f0;
}

.month-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.month-summary strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.investor-list {
  display: grid;
  gap: 12px;
}

.investor-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 13px;
  align-items: center;
  padding: 13px;
  border-radius: 14px;
  background: #fff7f0;
}

.investor-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 50%;
  background: #f3f4f6;
}

.investor-main {
  min-width: 0;
}

.investor-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.investor-title h3 {
  margin: 0;
  color: #242933;
  font-size: 19px;
}

.investor-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.investor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.investor-grid div {
  min-width: 0;
}

.investor-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.investor-grid strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--brown);
  font-size: 14px;
  line-height: 1.25;
}

.investor-grid em {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.15;
}

.legal-notice {
  padding: 12px;
  border-radius: 12px;
  background: #fff6f0;
}

.legal-notice strong {
  display: block;
  margin-bottom: 4px;
  color: #8b3d12;
  font-size: 15px;
}

.legal-notice p {
  margin: 0;
  color: #7c6f66;
  font-size: 13px;
  line-height: 1.55;
}

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 390px;
  margin-top: 14px;
  overflow-y: auto;
  padding: 4px 2px;
}

.chat-message {
  max-width: 86%;
  padding: 11px 12px;
  border-radius: 13px;
  font-size: 15px;
  line-height: 1.55;
}

.chat-message p {
  margin: 0;
}

.chat-message.assistant {
  align-self: flex-start;
  color: #30343b;
  background: #f4f6f8;
}

.chat-message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--red);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 9px;
  margin-top: 14px;
}

.chat-form textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px;
  outline: 0;
  color: var(--ink);
  background: #fbfcfd;
  font: inherit;
  line-height: 1.45;
}

.chat-form button {
  align-self: stretch;
  border-radius: 13px;
  color: #fff;
  background: var(--red);
  font-weight: 700;
}

.risk-footer {
  padding: 6px 18px calc(24px + env(safe-area-inset-bottom));
}

.risk-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 370px) {
  .quote-grid {
    grid-template-columns: 1fr;
  }

  .month-summary {
    grid-template-columns: 1fr;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-form button {
    min-height: 44px;
  }

  .quote-grid div {
    border-right: 0;
    border-bottom: 1px dashed #edd8c7;
  }

  .quote-grid div:last-child {
    border-bottom: 0;
  }

  .manager-layout {
    grid-template-columns: 92px 1fr;
  }

  .manager-layout img {
    width: 92px;
    height: 124px;
  }

  .allocation-layout {
    grid-template-columns: 118px 1fr;
    gap: 12px;
  }

  .allocation-pie {
    width: 118px;
  }

  .allocation-pie::after {
    inset: 25px;
  }

  .allocation-pie strong {
    font-size: 16px;
  }

  .asset-row {
    padding: 10px 8px;
  }

  .asset-row em {
    font-size: 15px;
  }

  .holding-head,
  .holding-row {
    grid-template-columns: minmax(96px, 1.02fr) minmax(68px, 0.72fr) minmax(68px, 0.72fr) minmax(54px, 0.54fr);
    gap: 6px;
  }

  .stock-name strong,
  .stock-pnl strong,
  .stock-weight strong {
    font-size: 16px;
  }

  .holding-head,
  .stock-name span,
  .stock-pnl span {
    font-size: 12px;
  }
}
