:root {
  --bg: #f7f4ef;
  --card: #fffef9;
  --ink: #1f2937;
  --muted: #6b7280;
  --up: #047857;
  --down: #b91c1c;
  --accent: #0ea5e9;
  --border: #e5ddd0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 0%, #fff8e8 0, transparent 35%),
    radial-gradient(circle at 100% 100%, #d9f1ff 0, transparent 35%),
    var(--bg);
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.28;
  z-index: 0;
}
.bg1 { width: 220px; height: 220px; background: #14b8a6; top: -40px; right: -20px; }
.bg2 { width: 260px; height: 260px; background: #f59e0b; bottom: -60px; left: -40px; }

.container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.hero h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0.02em;
}
.hero p { color: var(--muted); margin: 8px 0 14px; }
button {
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

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

.card, .panel {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.panel { margin-top: 14px; }
.panel h2 { margin: 0 0 10px; font-size: 18px; }

.k { font-size: 13px; color: var(--muted); }
.v { font-size: 22px; font-weight: 700; margin-top: 6px; }

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #e8e1d4;
}
.row:last-child { border-bottom: 0; }
.up { color: var(--up); }
.down { color: var(--down); }

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #eef7ff;
  color: #0369a1;
}

footer { margin-top: 16px; color: var(--muted); }

@media (max-width: 720px) {
  .hero h1 { font-size: 28px; }
  .grid.stats { grid-template-columns: 1fr; }
}


.predict-form {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.predict-form input {
  flex: 1 1 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
}

.secondary-btn {
  background: #e5edf6;
  color: #1f2937;
  border: 1px solid #c7d4e3;
}

.live-price {
  font-size: 14px;
  color: #0f766e;
  margin-bottom: 10px;
  font-weight: 600;
}

.predict-result {
  border: 1px dashed #d9cfbf;
  border-radius: 10px;
  padding: 10px;
  background: #fffcf7;
}

.tb-explain {
  border: 1px solid #e8dfcf;
  border-radius: 10px;
  background: #fffaf2;
  padding: 10px;
  margin-bottom: 10px;
}

.collector-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  margin-bottom: 10px;
}

.collector-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.collector-select {
  flex: 1 1 320px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
}

.mode-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.mode-btn {
  background: #eef2f7;
  color: #1f2937;
  border: 1px solid #d5dbe5;
}

.mode-btn.active {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
}

.progress-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  margin-bottom: 10px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e8edf4;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0ea5e9, #14b8a6);
  transition: width 0.25s ease;
}

.chart-wrap {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.line-chart {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f8ff 100%);
  overflow: hidden;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.io-panel {
  margin-top: 12px;
}

.io-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.io-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.ratio-track {
  margin-top: 8px;
  height: 8px;
  background: #eceff5;
  border-radius: 999px;
  overflow: hidden;
}

.ratio-bar {
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
}

.io-chart-wrap {
  margin-bottom: 12px;
}

.oi-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.oi-table {
  width: 100%;
  border-collapse: collapse;
}

.oi-table th,
.oi-table td {
  padding: 10px 8px;
  border-bottom: 1px dashed #e8e1d4;
  text-align: right;
  font-size: 13px;
}

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

.oi-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .io-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .oi-table {
    font-size: 12px;
  }
  .oi-table th,
  .oi-table td {
    padding: 8px 6px;
  }
}
