:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --ink: #13202f;
  --muted: #637083;
  --line: #d9e1ec;
  --accent: #146c94;
  --accent-2: #d9862b;
  --positive: #16835a;
  --negative: #c84d4d;
  --shadow: 0 18px 42px rgba(31, 45, 72, 0.1);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 108, 148, 0.12), transparent 36rem),
    radial-gradient(circle at 88% 6%, rgba(217, 134, 43, 0.12), transparent 28rem),
    var(--bg);
  color: var(--ink);
}

button,
select {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 28px 2px 20px;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

h2 {
  font-size: 18px;
}

.summary {
  max-width: 820px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.status-pill {
  min-width: 128px;
  border: 1px solid rgba(20, 108, 148, 0.18);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
}

.status-pill.error {
  border-color: rgba(200, 77, 77, 0.24);
  color: var(--negative);
}

.panel,
.metric-card,
.result-card {
  border: 1px solid rgba(19, 32, 47, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.toolbar {
  display: grid;
  grid-template-columns: 160px 160px 160px auto 1fr;
  gap: 12px;
  align-items: end;
  padding: 18px;
  margin-bottom: 16px;
}

.custom-input-panel {
  padding: 18px;
  margin-bottom: 16px;
}

.symbol-input-label {
  display: grid;
  gap: 8px;
}

textarea {
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 108, 148, 0.14);
}

label {
  display: grid;
  gap: 7px;
}

label span,
.refresh-copy,
.metric-card span,
.metric-card small,
.panel-title p,
th,
.card-subtitle,
.trade-row {
  color: var(--muted);
  font-size: 13px;
}

select,
button {
  min-height: 44px;
  border-radius: 6px;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

button {
  border: 0;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.refresh-copy {
  align-self: center;
  justify-self: end;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 20px;
}

.metric-card strong {
  align-self: end;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.table-panel {
  overflow: hidden;
  padding: 18px;
  margin-bottom: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title p {
  margin-top: 6px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: right;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: #f7fafc;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.result-card {
  padding: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.card-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.card-title h2 {
  font-size: 20px;
}

.rank-badge {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(20, 108, 148, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.card-return {
  text-align: right;
}

.card-return strong {
  display: block;
  font-size: 26px;
}

.trade-detail {
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.trade-detail table {
  min-width: 760px;
  box-shadow: none;
}

.trade-detail th,
.trade-detail td {
  padding: 9px 10px;
  font-size: 12px;
}

.trade-detail th:first-child,
.trade-detail td:first-child {
  text-align: left;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

@media (max-width: 900px) {
  .hero,
  .panel-title,
  .card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar,
  .metrics,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .refresh-copy {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 760px);
    padding-top: 18px;
  }

  h1 {
    font-size: 36px;
  }

  .summary {
    display: none;
  }

  .toolbar,
  .custom-input-panel,
  .table-panel,
  .result-card {
    padding: 14px;
  }

  .metrics {
    gap: 10px;
  }

  .metric-card {
    min-height: 104px;
    padding: 14px;
  }

  .metric-card strong {
    font-size: 22px;
  }

  table {
    min-width: 760px;
  }
}
