:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #12151a;
  --panel-2: #181c22;
  --line: #292e37;
  --text: #f4f5f7;
  --muted: #8d96a4;
  --lime: #c8f542;
  --green: #35d392;
  --red: #ff657d;
  --amber: #f2bd4b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 80% 2%, rgba(200, 245, 66, 0.07), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

button { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--lime);
  color: #0d1008;
  font-size: 12px;
  font-weight: 950;
}

.brand strong,
.brand small { display: block; }
.brand small { color: var(--muted); font-size: 10px; }

.top-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.top-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(53, 211, 146, 0.1);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: 86px 0 72px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.hero-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-row > div > p:last-child {
  max-width: 640px;
  margin-bottom: 0;
  color: #aeb5c0;
  font-size: 16px;
  line-height: 1.8;
}

#runButton {
  display: flex;
  min-width: 192px;
  height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--lime);
  color: #0c1006;
  font-weight: 900;
  cursor: pointer;
}

#runButton:hover { filter: brightness(1.06); }
#runButton:disabled {
  cursor: progress;
  background: linear-gradient(90deg, var(--lime), #e7ff9f, var(--lime));
  background-size: 220% 100%;
  animation: buttonScan 900ms linear infinite;
}
#runButton b { font-size: 22px; }

.market-section,
.decision-section,
.agents-section,
.history-section { padding: 54px 0; border-bottom: 1px solid var(--line); }

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-title h2 { margin-bottom: 0; font-size: 27px; letter-spacing: -0.025em; }
.section-title > span { color: var(--muted); font-size: 11px; }

.section-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-tools > span {
  color: var(--muted);
  font-size: 11px;
}

#exportButton,
.text-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

#exportButton:hover,
.text-button:hover {
  border-color: rgba(200, 245, 66, 0.58);
}

#exportButton:disabled {
  color: #555d69;
  cursor: not-allowed;
}

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

.asset-card {
  position: relative;
  min-height: 150px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.asset-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -70px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(200, 245, 66, 0.05);
}

.asset-card:hover,
.asset-card.is-selected { border-color: rgba(200, 245, 66, 0.65); }
.asset-card.is-selected { background: linear-gradient(135deg, rgba(200, 245, 66, 0.08), transparent), var(--panel); }

.asset-card-head,
.asset-card-meta { display: flex; justify-content: space-between; gap: 12px; }
.asset-card-head span { color: var(--muted); font-size: 11px; }
.asset-card-price { display: block; margin-top: 24px; font-size: 28px; letter-spacing: -0.025em; }
.asset-card-meta { margin-top: 8px; color: var(--muted); font-size: 11px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.decision-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: 176px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(200, 245, 66, 0.045), transparent 45%), var(--panel);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.decision-card.is-running {
  border-color: rgba(200, 245, 66, 0.6);
  box-shadow: 0 0 0 4px rgba(200, 245, 66, 0.045);
}

.action-block { padding-right: 22px; border-right: 1px solid var(--line); }
.action-block span,
.action-block em { display: block; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 850; }
.action-block strong { display: block; margin: 7px 0 5px; color: var(--amber); font-size: 38px; letter-spacing: 0.04em; }
.action-block.is-buy strong { color: var(--green); }
.action-block.is-sell strong { color: var(--red); }

.decision-copy > strong { font-size: 17px; line-height: 1.6; }
.metrics { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.metrics span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 10px; }
.metrics b { margin-left: 5px; color: var(--text); }

.consensus {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(242, 189, 75, 0.11);
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.flow { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 800; }
.flow span { padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; }
.flow b { color: #4f5662; }

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

.agent-empty {
  display: grid;
  min-height: 180px;
  grid-column: 1 / -1;
  place-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed #343a45;
  border-radius: 12px;
  background: rgba(18, 21, 26, 0.55);
  text-align: center;
}

.agent-empty span {
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.agent-empty strong {
  color: var(--muted);
  font-size: 12px;
}

.agent-card {
  min-height: 220px;
  padding: 17px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--amber);
  border-radius: 12px;
  background: var(--panel);
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 320ms ease forwards;
}

.agent-card.is-positive { border-top-color: var(--green); }
.agent-card.is-negative { border-top-color: var(--red); }

.agent-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.agent-number { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 10px; font-weight: 900; }
.agent-head strong,
.agent-head span { display: block; }
.agent-head strong { font-size: 13px; }
.agent-head div > span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.agent-head em { padding: 4px 7px; border-radius: 999px; background: var(--panel-2); color: var(--amber); font-size: 10px; font-style: normal; font-weight: 900; }
.agent-card.is-positive .agent-head em { color: var(--green); }
.agent-card.is-negative .agent-head em { color: var(--red); }

.agent-card p { min-height: 72px; margin: 24px 0 17px; color: #b1b8c3; font-size: 12px; line-height: 1.7; }
.score-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; }
.score-track { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: var(--panel-2); }
.score-track i { display: block; height: 100%; border-radius: inherit; background: var(--amber); }
.agent-card.is-positive .score-track i { background: var(--green); }
.agent-card.is-negative .score-track i { background: var(--red); }

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) 76px repeat(3, minmax(90px, 0.7fr));
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.history-row div strong,
.history-row div span {
  display: block;
}

.history-row div span,
.history-row > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.history-row b {
  margin-left: 4px;
  color: var(--text);
}

.history-row em {
  justify-self: start;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(242, 189, 75, 0.11);
  color: var(--amber);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.history-row em.is-buy { color: var(--green); background: rgba(53, 211, 146, 0.1); }
.history-row em.is-sell { color: var(--red); background: rgba(255, 101, 125, 0.1); }

.history-empty {
  padding: 22px;
  border: 1px dashed #343a45;
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 48px; color: var(--muted); font-size: 10px; }

@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes buttonScan { to { background-position: -220% 0; } }

@media (max-width: 840px) {
  .hero-row { align-items: stretch; flex-direction: column; }
  #runButton { width: 100%; }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-card { grid-template-columns: 150px minmax(0, 1fr); }
  .consensus { grid-column: 1 / -1; justify-self: start; }
  .history-row { grid-template-columns: minmax(140px, 1fr) 72px repeat(3, minmax(70px, 0.6fr)); }
}

@media (max-width: 620px) {
  .topbar,
  main { width: min(1180px, calc(100% - 28px)); }
  .top-status { font-size: 0; }
  .top-status::after { content: "独立演示"; font-size: 10px; }
  .hero { padding: 58px 0 50px; }
  h1 { font-size: 47px; }
  .asset-grid,
  .agent-grid { grid-template-columns: 1fr; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .section-tools { width: 100%; justify-content: space-between; }
  .flow { width: 100%; overflow-x: auto; }
  .flow span { flex: 0 0 auto; }
  .decision-card { grid-template-columns: 1fr; }
  .action-block { padding: 0 0 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .history-row { grid-template-columns: 1fr auto; }
  .history-row > span { grid-column: 1 / -1; margin-top: 0; }
  footer { flex-direction: column; }
}
