* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f6f8fa;
  color: #1f2328;
  font-size: 14px;
}
header {
  background: linear-gradient(135deg, #1d3557 0%, #2a9d8f 100%);
  color: #fff;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
header h1 { font-size: 22px; font-weight: 600; }
.header-info { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.badge {
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 20px;
}
.badge.bull { background: #e63946; }
.badge.bear { background: #6c757d; }

nav.tabs {
  background: #fff;
  padding: 0 30px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e1e4e8;
  overflow-x: auto;
}
.tab {
  background: none;
  border: none;
  padding: 14px 18px;
  font-size: 15px;
  cursor: pointer;
  color: #57606a;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.tab:hover { color: #1d3557; }
.tab.active { color: #2a9d8f; border-bottom-color: #2a9d8f; font-weight: 600; }

main { padding: 24px 30px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.card {
  background: #fff;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid #e1e4e8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card .label { color: #6e7781; font-size: 12px; margin-bottom: 6px; }
.card .value { font-size: 22px; font-weight: 600; color: #1f2328; }
.card .value.positive { color: #e63946; }
.card .value.negative { color: #2a9d8f; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar button, button.action {
  background: #fff;
  border: 1px solid #d0d7de;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.toolbar button:hover, button.action:hover {
  background: #f3f4f6;
  border-color: #999;
}
button.primary { background: #2a9d8f; color: #fff; border-color: #2a9d8f; }
button.primary:hover { background: #248579; }
button.danger { background: #e63946; color: #fff; border-color: #e63946; }
button.danger:hover { background: #c92e3a; }

table {
  width: 100%;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eef0f3;
  font-size: 13px;
}
th {
  background: #f6f8fa;
  font-weight: 600;
  color: #57606a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
tr:last-child td { border-bottom: none; }
tr:hover { background: #f9fafb; }
td.positive { color: #e63946; font-weight: 600; }
td.negative { color: #2a9d8f; font-weight: 600; }
td.right { text-align: right; }
td .ticker { font-weight: 600; color: #1d3557; }

.signal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 14px;
  color: #57606a;
}
h3 { margin: 20px 0 12px; font-size: 16px; color: #1d3557; }

.signal-card {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-left: 4px solid #2a9d8f;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.signal-card.sell { border-left-color: #e63946; }
.signal-card.rebalance { border-left-color: #f4a261; }
.signal-card .info { flex: 1; min-width: 200px; }
.signal-card .ticker-line { font-weight: 600; color: #1d3557; font-size: 15px; }
.signal-card .meta-line { color: #6e7781; font-size: 12px; margin-top: 3px; }
.signal-card .action-line { display: flex; gap: 8px; align-items: center; }

.hint { color: #6e7781; margin: 12px 0; }
ul { padding-left: 24px; color: #1f2328; }
ul li { margin: 4px 0; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2328;
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}
.toast.show { opacity: 1; }

.empty {
  background: #f6f8fa;
  border: 1px dashed #d0d7de;
  padding: 30px;
  text-align: center;
  color: #6e7781;
  border-radius: 8px;
}
