* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f5f9;
  color: #1c2530;
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: #7a8699; }
.error { color: #c62828; margin-top: 8px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #1f3a5f;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 600; }
.userbox { font-size: 13px; }
.userbox button {
  margin-left: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.6);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

.view { max-width: 720px; margin: 0 auto; padding: 16px; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(16,24,40,.08);
}
.login-card { max-width: 360px; margin: 10vh auto 0; }
.login-card h2 { margin-bottom: 4px; }
.hint { color: #7a8699; font-size: 13px; margin-bottom: 16px; }

label { display: block; font-size: 14px; margin-bottom: 12px; }
input, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid #3b82f6; border-color: transparent; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
}
.btn.primary { background: #1f3a5f; color: #fff; width: 100%; }
.btn.small { width: auto; padding: 8px 14px; }
.btn.ghost { background: transparent; border: 1px solid #cfd8e3; color: #1c2530; }
.btn.ghost.small { float: right; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #e6ebf2;
  color: #1c2530;
  font-size: 15px;
  cursor: pointer;
}
.tab.active { background: #1f3a5f; color: #fff; }

.pane { display: none; }
.pane.active { display: block; }

.inline-form { display: flex; gap: 8px; margin-bottom: 14px; }
.inline-form input { flex: 2; margin-top: 0; }
.inline-form select { flex: 1; margin-top: 0; }
.inline-form button { flex: 1; }

.card + .card { margin-top: 12px; }
.card h3 { font-size: 16px; margin-bottom: 10px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.grid .kv { background: #f6f8fb; border-radius: 8px; padding: 10px 12px; }
.kv .k { font-size: 12px; color: #7a8699; }
.kv .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
  background: #eef2f7;
  color: #334155;
}
.badge.buy { background: #dcfce7; color: #166534; }
.badge.avoid { background: #fee2e2; color: #991b1b; }
.badge.neutral { background: #fef3c7; color: #92400e; }

ul { list-style: none; }
ul li { padding: 6px 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; }
ul li:last-child { border-bottom: none; }

.quality { font-size: 12px; color: #7a8699; margin-top: 10px; }

/* 对话 */
.chat-box {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 62vh; overflow-y: auto; padding: 4px 0;
}
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot { justify-content: flex-start; }
.bubble {
  max-width: 85%; padding: 10px 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.55; word-break: break-word;
}
.chat-msg.user .bubble { background: #1f3a5f; color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.bot .bubble { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.chat-text { white-space: normal; }
.chat-tools { margin-top: 6px; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input { flex: 1; margin-top: 0; }
.chat-input button { flex: 0 0 auto; }

/* 板块 */
.sector-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 2px; border-bottom: 1px dashed #e2e8f0; cursor: pointer;
}
.sector-row:hover { background: #f6f8fb; }
.sector-name { font-size: 14px; }
.footer { text-align: center; color: #9aa7b8; font-size: 12px; padding: 24px 16px; }

@media (min-width: 480px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
