/* investPartner web client — aligned with iOS demo scope */
:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --text: #1a1d26;
  --muted: #5c6478;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --border: #e2e6ef;
  --user-bubble: #dbeafe;
  --bot-bubble: #ffffff;
  --success: #059669;
  --danger: #dc2626;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

#app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: 64px;
}

header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  /* 高于底栏(500)，低于登录蒙层(1000)，避免顶栏按钮被下层盖住 */
  z-index: 900;
}

header.app-header .hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ----- 全屏认证页 ----- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-gate {
  --auth-bg-deep: #0b1220;
  --auth-bg-mid: #111827;
  --auth-accent: #38bdf8;
  --auth-accent-deep: #2563eb;
  --auth-card: rgba(255, 255, 255, 0.97);
  --auth-card-border: rgba(255, 255, 255, 0.18);
  --auth-input-bg: #f8fafc;
  --auth-input-border: #e2e8f0;
  --auth-input-focus: #93c5fd;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a5f 0%, var(--auth-bg-deep) 45%, #070b14 100%);
}

.auth-gate[hidden] {
  display: none !important;
}

.auth-gate-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-gate-bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.auth-gate-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: auth-glow-drift 18s ease-in-out infinite alternate;
}

.auth-gate-bg-glow--a {
  width: 420px;
  height: 420px;
  top: -8%;
  left: -6%;
  background: rgba(37, 99, 235, 0.35);
}

.auth-gate-bg-glow--b {
  width: 360px;
  height: 360px;
  bottom: -10%;
  right: -4%;
  background: rgba(56, 189, 248, 0.22);
  animation-delay: -9s;
}

@keyframes auth-glow-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(24px, 16px) scale(1.08); }
}

.auth-gate-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: min(920px, 100%);
  animation: auth-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes auth-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-gate-brand {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
  color: #e2e8f0;
}

@media (min-width: 768px) {
  .auth-gate-brand {
    display: flex;
  }

  .auth-gate-inner {
    flex: 0 0 min(440px, 100%);
    border-radius: 0 var(--radius) var(--radius) 0 !important;
    border-left: none !important;
  }

  .auth-gate-shell {
    box-shadow:
      0 24px 64px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .auth-gate-brand {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 58, 95, 0.55) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
  }
}

.auth-gate-brand-mark {
  margin-bottom: 20px;
  filter: drop-shadow(0 8px 24px rgba(37, 99, 235, 0.35));
}

.auth-gate-brand-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.auth-gate-brand-tagline {
  margin: 0 0 32px;
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.5;
}

.auth-gate-brand-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-gate-brand-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.auth-gate-brand-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-deep));
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.auth-gate-inner {
  width: min(440px, 100%);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--auth-card);
  border: 1px solid var(--auth-card-border);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  backdrop-filter: blur(12px);
  margin: 0;
}

@media (max-width: 767px) {
  .auth-gate-inner {
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.4),
      0 1px 0 rgba(255, 255, 255, 0.8) inset;
  }
}

.auth-gate-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-gate-logo-sm {
  display: inline-flex;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.25));
}

@media (min-width: 768px) {
  .auth-gate-logo-sm {
    display: none;
  }
}

.auth-gate-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-gate-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  padding: 4px;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}

.auth-tab.active {
  background: #fff;
  color: var(--auth-accent-deep);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.auth-panel {
  animation: auth-panel-in 0.3s ease both;
}

@keyframes auth-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-panel-lead {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.2s;
}

.auth-panel input[type="text"],
.auth-panel input[type="password"],
.auth-panel input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 11px 12px 11px 40px;
  border: 1px solid var(--auth-input-border);
  border-radius: 10px;
  background: var(--auth-input-bg);
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-panel input::placeholder {
  color: #94a3b8;
}

.auth-panel input:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.auth-panel input:focus {
  outline: none;
  border-color: var(--auth-accent-deep);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-input-wrap:focus-within .auth-input-icon {
  color: var(--auth-accent-deep);
}

.auth-captcha-box {
  margin: 16px 0 4px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
}

.auth-captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.auth-captcha-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.auth-captcha-q {
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", monospace;
  font-size: 1.05rem;
  color: var(--auth-accent-deep);
  padding: 4px 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px dashed #93c5fd;
  letter-spacing: 0.04em;
}

.auth-captcha-refresh {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--auth-accent-deep);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-captcha-refresh:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.auth-captcha-box input[type="text"] {
  padding-left: 12px;
}

.auth-email-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 12px 0 4px;
}

.auth-send-code-btn {
  flex-shrink: 0;
}

.auth-send-code-hint {
  font-size: 0.85rem;
}

.auth-register-note {
  margin-top: 10px;
  font-size: 0.82rem;
}

.auth-register-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-register-step {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.auth-register-step.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.auth-register-step.done {
  background: #dcfce7;
  color: #15803d;
}

.auth-register-step-panel[hidden] {
  display: none !important;
}

.auth-register-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.auth-register-actions .auth-submit {
  flex: 1;
  margin-top: 0;
}

.auth-register-actions .secondary {
  flex-shrink: 0;
}

.auth-required {
  color: #dc2626;
  font-size: 0.78rem;
  font-weight: 600;
}

.auth-panel .btn-primary.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-panel .btn-primary.auth-submit {
  width: 100%;
  margin-top: 20px;
  padding: 13px 16px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.auth-panel .btn-primary.auth-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.42);
  transform: translateY(-1px);
}

.auth-panel .btn-primary.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.auth-error {
  color: var(--danger, #dc2626) !important;
  min-height: 1.2em;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 0.82rem;
}

.auth-error:empty {
  display: none;
  padding: 0;
  border: none;
  background: none;
  min-height: 0;
  margin-top: 0;
}

.auth-message:not(:empty) {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--success) !important;
  font-size: 0.82rem;
}

.auth-demo-hint {
  margin-top: 14px;
  font-size: 0.82rem;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.auth-demo-hint summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  user-select: none;
}

.auth-demo-hint summary:hover {
  color: var(--text);
}

.auth-demo-hint p {
  margin: 8px 0 0;
}

.auth-demo-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #e2e8f0;
  font-size: 0.85em;
}

/* ----- Legacy login dialog styles (removed; kept minimal for compat) ----- */
.ip-dlg-login {
  display: none;
}

.reader-item-dialog {
  padding: 0;
  border: none;
  border-radius: var(--radius);
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  background: transparent;
}

.reader-item-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.reader-item-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.reader-item-dialog-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding-bottom: 10px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.reader-item-dialog-h {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.reader-item-dialog-body {
  overflow: auto;
  max-height: min(72vh, 680px);
  padding-top: 12px;
}

.reader-item-dialog-body .reader-item-dialog-article-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
}

.reader-item-dialog-body section h4 {
  margin: 14px 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.reader-item-dialog-body .reader-item-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  .reader-item-dialog-body .reader-item-pre {
    background: rgba(255, 255, 255, 0.06);
  }
}

.ip-dlg-settings {
  padding: 0;
  margin: 0;
  border: none;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  background: transparent;
}

.ip-dlg-settings::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.ip-dlg-settings-inner {
  position: relative;
  width: 100vw;
  height: 100%;
  min-height: 100dvh;
}

.ip-dlg-settings-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ip-dlg-settings .settings-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: min(100%, 400px);
  background: var(--card);
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.settings-panel .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.settings-panel label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin: 12px 16px 6px;
}

.settings-panel input[type="text"],
.settings-panel select,
.settings-panel textarea.settings-textarea {
  width: calc(100% - 32px);
  margin: 0 16px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.settings-panel textarea.settings-textarea {
  min-height: 76px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
}

.settings-panel .row {
  margin: 0 16px 12px;
}

.settings-panel button.secondary {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
}

.settings-panel button.danger {
  color: var(--danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.login-card {
  width: min(400px, 100%);
  padding: 18px 20px;
  margin: 0;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.login-title {
  margin-top: 0;
}

.header-logout {
  padding: 8px 12px;
  font-size: 0.82rem;
}

header.app-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

header.app-header .gear {
  background: var(--primary-soft);
  border: none;
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
}

.tab-bar {
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* 底栏固定在视口底部 */
  z-index: 500;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  pointer-events: auto;
}

.tab-bar button {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tab-bar button.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-bar button .ico {
  font-size: 1.15rem;
}

.panel {
  display: none;
  padding: 12px 16px 24px;
  flex: 1;
}

.panel.active {
  display: block;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.msg-row {
  display: flex;
  margin-bottom: 10px;
}

.msg-row.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-row.user .bubble {
  background: var(--user-bubble);
  border-bottom-right-radius: 4px;
}

.msg-row.assistant .bubble {
  background: var(--bot-bubble);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.stream-preview {
  border: 1px dashed var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.stream-phase-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  padding: 8px 10px;
  margin: -4px -4px 12px -4px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
}

.stream-phase-strip .phase-arrow {
  color: var(--muted);
  font-weight: 400;
}

.stream-phase-strip .phase-step {
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .stream-phase-strip {
    background: rgba(255, 255, 255, 0.06);
  }
}

.stream-elapsed {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
  margin: -6px -4px 10px -4px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
  background: rgba(0, 0, 0, 0.05);
  line-height: 1.35;
}

@media (prefers-color-scheme: dark) {
  .stream-elapsed {
    background: rgba(255, 255, 255, 0.06);
  }
}

.stream-preview .lbl {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.stream-preview .thinking {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.stream-preview .out {
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, var(--bg) 12px);
  padding-bottom: 8px;
}

.chat-input-row textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.chat-input-row button {
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chat-input-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  z-index: 6000;
  display: none;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  display: block;
}

.news-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.news-item .news-push-subtitle {
  font-size: 0.78rem;
  line-height: 1.35;
  color: color-mix(in srgb, var(--muted) 86%, var(--fg, currentColor));
  margin-top: 6px;
  letter-spacing: 0.01em;
}


.news-item .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}



.news-item.news-tier-research {
  background: color-mix(in srgb, #b45309 8%, var(--card-bg, var(--bg)));
  border-left: 3px solid color-mix(in srgb, #b45309 65%, transparent);
  padding-left: 12px;
  margin-left: -4px;
}

.news-research-scroll-panel {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #b45309 35%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, #b45309 6%, var(--card-bg, var(--bg)));
}

.news-research-scroll-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.news-research-scroll-body {
  max-height: min(42vh, 280px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-research-scroll-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card-bg, var(--bg));
  border: 1px solid color-mix(in srgb, #b45309 22%, var(--border));
}

.news-research-scroll-item .news-research-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}

.news-research-scroll-item .news-research-meta {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.llm-progress-steps {
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  background: color-mix(in srgb, var(--primary) 5%, var(--card-bg, var(--bg)));
  font-size: 0.86rem;
  line-height: 1.55;
}

.llm-progress-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 0;
  color: var(--muted);
}

.llm-progress-step.is-active {
  color: var(--text, inherit);
  font-weight: 600;
}

.llm-progress-step.is-done {
  color: color-mix(in srgb, var(--primary) 70%, var(--muted));
}

.llm-progress-step-dot {
  flex: 0 0 auto;
  width: 1.1em;
  text-align: center;
}

.wind-vane-desc {
  margin: 0 0 12px;
  line-height: 1.55;
  font-size: 0.82rem;
  color: var(--muted);
}

.news-item.news-tier-stock {
  background: color-mix(in srgb, var(--primary) 6%, var(--card-bg, var(--bg)));
  border-left: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
  padding-left: 12px;
  margin-left: -4px;
}

.news-item.news-tier-similar-tags {
  background: color-mix(in srgb, var(--muted) 8%, var(--card-bg, var(--bg)));
  border-left: 3px solid color-mix(in srgb, var(--muted) 70%, transparent);
  padding-left: 12px;
  margin-left: -4px;
}

.news-item.news-tier-explore {
  background: color-mix(in srgb, var(--border) 12%, var(--card-bg, var(--bg)));
  border-left: 3px solid var(--border);
  padding-left: 12px;
  margin-left: -4px;
}

.news-tier-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  vertical-align: middle;
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  font-size: 0.85rem;
}

.emotion-grid span {
  color: var(--muted);
}

.advice-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
}

.advice-card .advice-risk-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  border: 1px solid var(--border);
}

.advice-card .advice-reasoning {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-toolbar-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 6px;
  font-size: 0.85rem;
}

.chat-enable-search-label {
  cursor: pointer;
  user-select: none;
}

.chat-search-badge {
  font-size: 0.78rem;
  color: var(--muted);
}

.chat-stock-badge {
  font-size: 0.78rem;
  color: var(--muted);
}

.chat-search-details {
  margin: 0 0 10px;
  font-size: 0.78rem;
}

.chat-search-details pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

button.secondary {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.history-list {
  font-size: 0.88rem;
  color: var(--muted);
}

.history-list .h-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 0.9rem;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  margin-top: 8px;
}

.spark .bar {
  flex: 1;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  min-width: 4px;
  opacity: 0.7;
}

.row-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.row-controls label {
  font-size: 0.85rem;
  color: var(--text);
}

.news-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.tag-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.2;
  max-width: 100%;
}

.tag-pill-pending {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #9a3412;
  border-color: #fb923c;
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.25);
}

.tag-pill-macro {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #3b82f6;
}

.tag-pill-sector {
  background: #ecfdf5;
  color: #047857;
  border-color: #10b981;
}

.tag-pill-company {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #8b5cf6;
}

.tag-pill-flow {
  background: #fefce8;
  color: #a16207;
  border-color: #eab308;
}

.tag-pill-alt-0 {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #0ea5e9;
}
.tag-pill-alt-1 {
  background: #fce7f3;
  color: #be185d;
  border-color: #ec4899;
}
.tag-pill-alt-2 {
  background: #f1f5f9;
  color: #475569;
  border-color: #94a3b8;
}
.tag-pill-alt-3 {
  background: #ecfccb;
  color: #3f6212;
  border-color: #84cc16;
}

.news-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.news-head .news-title-link {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.news-head .news-title-link:hover {
  text-decoration: underline;
}

.news-head button.news-title-link {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.news-head button.news-title-link:hover {
  text-decoration: underline;
}

.news-head .news-title-nolink {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--text);
}

.score-pill {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 999px;
}

.push-reason {
  margin-top: 6px;
  font-size: 0.78rem;
}

.btn-news-explain {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.news-explain-wrap {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fafbfc;
}

.news-explain-wrap .explain-block {
  margin-bottom: 12px;
}

.news-explain-wrap .explain-block:last-child {
  margin-bottom: 0;
}

.news-explain-wrap .explain-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* 流式正文开始后 / 完成后收起思考区，避免长期占屏 */
.news-explain-wrap .explain-thinking-wrap.is-folded {
  display: none;
}

.news-explain-wrap .explain-thinking {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: #64748b;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  min-height: 0;
  max-height: min(28vh, 240px);
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
}

.news-explain-wrap .explain-body {
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip {
  font-size: 0.72rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
}

.profile-summary-card .kv {
  margin-top: 10px;
  font-size: 0.88rem;
}

.profile-summary-card .kv div {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.profile-domain-card {
  margin-bottom: 12px;
}

.profile-domain-card .domain-q {
  font-weight: 600;
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.profile-domain-card .domain-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.profile-domain-card .domain-grid label.domain-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.profile-domain-card .domain-grid label.domain-opt.domain-on {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.profile-domain-card .domain-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ob-q {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.45;
}

.ob-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  margin-bottom: 10px;
  font-family: inherit;
  background: var(--bg);
}

.ob-open-hint {
  margin: 8px 0 0;
  font-size: 0.76rem;
}

.option-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-grid .option-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.9rem;
}

.option-grid .option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.option-grid .option-btn:disabled {
  opacity: 0.6;
}

/* 心境 · 自我觉察输入与结果 */
.mindset-compliance {
  line-height: 1.5;
}

.mindset-section-title {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 8px;
}

.mindset-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
}

.mindset-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.mindset-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.mindset-loading {
  margin-top: 10px;
  animation: mindset-pulse 1.2s ease-in-out infinite;
}

@keyframes mindset-pulse {
  50% {
    opacity: 0.65;
  }
}

.mindset-result {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel, var(--bg));
}

.mindset-result-section {
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}

.mindset-result-section:last-child {
  margin-bottom: 0;
}

.mindset-zone-badge {
  display: inline-block;
  margin: 6px 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.mindset-zone-red {
  background: rgba(220, 53, 69, 0.15);
  color: #c82333;
}

.mindset-zone-yellow {
  background: rgba(255, 193, 7, 0.2);
  color: #b38600;
}

.mindset-zone-green {
  background: rgba(40, 167, 69, 0.15);
  color: #1e7e34;
}

.mindset-save-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.mindset-history-root {
  margin-top: 8px;
}

.mindset-history-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.mindset-history-item:last-child {
  border-bottom: none;
}

.mindset-history-item time {
  display: block;
  font-size: 0.76rem;
  color: var(--muted, #888);
  margin-bottom: 6px;
}

.mindset-history-head {
  justify-content: space-between;
  align-items: center;
}

.mindset-subhint {
  width: 100%;
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.mindset-history-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.mindset-item-clickable {
  cursor: pointer;
  border-radius: 10px;
  margin: 0 -8px;
  padding: 12px 8px;
  border-bottom: none;
  transition: background 0.15s ease;
}

.mindset-item-clickable:hover {
  background: var(--primary-soft, rgba(0, 0, 0, 0.04));
}

.mindset-item-clickable .mind-open-hint {
  font-size: 0.72rem;
  color: var(--muted, #888);
  margin-top: 6px;
}

.mindset-record-dialog {
  max-width: min(96vw, 520px);
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.mindset-record-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.mindset-dialog-inner {
  padding: 16px 18px 20px;
  max-height: min(85vh, 720px);
  overflow-y: auto;
}

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

.mindset-dialog-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.mindset-dialog-close {
  flex-shrink: 0;
}

.mindset-dialog-section {
  margin-top: 14px;
}

.mindset-dialog-input {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--panel, #f5f5f5);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.5;
  max-height: 180px;
  overflow-y: auto;
}

.mindset-dialog-body {
  margin-top: 8px;
}

.mindset-dialog-body .mindset-zone-badge {
  margin-top: 0;
}

.mindset-growth-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.mindset-dashboard-details {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 心境页：成就、情绪条 */
.sentiment-profile-card .sentiment-profile-line {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.sentiment-profile-card .sentiment-pattern {
  margin: 8px 0 0;
}

.achievement-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.achievement-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.achievement-row:last-child {
  border-bottom: none;
}

.achievement-row .ach-icon {
  font-size: 1.35rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.achievement-row .ach-body {
  flex: 1;
  min-width: 0;
}

.achievement-row .ach-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.achievement-row .ach-desc {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.achievement-row .ach-when {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

.sentiment-spark-card .spark-legend {
  margin: 6px 0 10px;
}

.sentiment-spark-card .spark-footer {
  margin-top: 10px;
}

/* News demo blocks（每日大盘 / 必读 / 偏好） */
.news-inline-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin: 10px 0 6px;
}

.news-prefs-save-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 10px 0 4px;
}

.news-prefs-save-hint {
  font-size: 0.82rem;
  line-height: 1.4;
}

.news-demo-card input[type="text"],
.news-demo-card textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
}

.news-demo-card textarea {
  min-height: 96px;
  resize: vertical;
}

.news-prefs-focus-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 8px 0 10px;
}

.news-prefs-focus-label {
  margin: 0;
}

label.news-prefs-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

#news-prefs-sectors:disabled,
#news-prefs-symbols:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.news-prefs-field-inactive {
  opacity: 0.72;
}

.news-prefs-field-inactive:focus {
  opacity: 1;
}

.news-effective-tags {
  margin: 10px 0 12px;
  padding: 10px 12px;
}

.news-effective-tags-head {
  margin-bottom: 6px;
  line-height: 1.45;
}

.news-effective-tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 8px;
}

.tag-pill-symbol-needle {
  background: rgba(80, 120, 200, 0.18);
}

.news-summary-body {
  margin: 8px 0 4px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.news-summary-body.keyword-summary-body {
  max-height: min(48vh, 440px);
  overflow: auto;
}

.keyword-symbol-context {
  margin: 10px 0 12px;
  padding: 10px 12px;
}

.keyword-symbol-quote-below-tags {
  margin: 10px 0 12px;
  padding: 12px 14px;
}
.keyword-symbol-quote-inner {
  margin-top: 0;
}
.keyword-symbol-kline-wrap {
  margin-top: 12px;
}
.keyword-symbol-kline-caption {
  margin: 0 0 8px;
}
.keyword-symbol-kline-wrap canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 6px;
  background: color-mix(in srgb, var(--card-bg, var(--card)) 97%, var(--border));
}
.keyword-symbol-code-line {
  margin: 6px 0 4px;
}
.keyword-symbol-quote {
  margin: 8px 0 6px;
  padding: 8px 10px;
  background: rgba(127, 127, 127, 0.08);
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.48;
}
.keyword-symbol-quote-head {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.keyword-symbol-quote-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.82rem;
}
.keyword-symbol-quote-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px 4px 0;
  vertical-align: top;
  white-space: nowrap;
  width: 7.5rem;
}
.keyword-symbol-quote-table td {
  padding: 4px 0;
  word-break: break-word;
}
.keyword-symbol-quote-summary {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text);
}
.keyword-symbol-tags {
  margin: 8px 0 4px;
}
.keyword-symbol-tag-row {
  margin: 6px 0;
  line-height: 1.55;
}
.keyword-symbol-tag-type {
  font-weight: 600;
  font-size: 0.82rem;
  margin-right: 4px;
  color: var(--text);
}
.keyword-symbol-news-list {
  margin: 4px 0 0;
  padding-left: 1.1rem;
  list-style: disc;
}
.keyword-symbol-news-list li {
  margin: 8px 0;
  line-height: 1.4;
}
.keyword-symbol-news-snippet {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.keyword-symbol-news-list button.keyword-symbol-news-open {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
}

.keyword-symbol-news-list button.keyword-symbol-news-open:hover {
  opacity: 0.88;
}

.news-tags-tier-hint {
  display: inline-block;
  line-height: 1.45;
  margin-bottom: 2px;
}

.must-read-list {
  margin-top: 12px;
  font-size: 0.88rem;
}

.must-read-panel {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, rgba(0, 0, 0, 0.15));
}

.must-read-note {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.must-read-note time {
  font-size: 0.72rem;
  color: var(--muted);
}

.news-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.news-struct-out {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* ——— 投资纪律守护工作台 V2 ——— */
.disc-workbench {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 24px;
}

.disc-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.disc-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.disc-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.disc-history-wrap {
  position: relative;
}

.disc-history-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 260px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

.disc-history-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.disc-history-menu button:hover {
  background: var(--primary-soft);
}

.disc-risk {
  margin-bottom: 14px;
}

.disc-risk-body {
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

.disc-input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (min-width: 900px) {
  .disc-input-grid {
    grid-template-columns: 3fr 2fr;
    align-items: stretch;
  }

  .disc-text-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .disc-textarea-tall {
    flex: 1;
    min-height: 180px;
  }
}

.disc-table-scroll {
  overflow-x: auto;
  margin-top: 8px;
}

.disc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.disc-table th,
.disc-table td {
  border: 1px solid var(--border);
  padding: 6px 4px;
  vertical-align: middle;
}

.disc-table th {
  background: var(--bg-alt);
  font-weight: 600;
}

/* 大盘总结：涨跌色（涨红、跌绿）、AI 富文本 */
.mo-quote-up,
.disc-table td.mo-pct-up,
.disc-table th.mo-pct-up {
  color: #c62828;
  font-weight: 700;
}

.mo-quote-down,
.disc-table td.mo-pct-down,
.disc-table th.mo-pct-down {
  color: #1b5e20;
  font-weight: 700;
}

.mo-num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mo-ai-body {
  margin: 8px 0 4px;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-height: 2.6em;
}

.mo-money-holder {
  margin: 8px 0;
}

.mo-money-wrap {
  margin-top: 4px;
}

.mo-mkt-trade-bar {
  font-size: 0.82rem;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.mo-mkt-index-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.mo-mkt-idx-col {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}

.mo-mkt-idx-col-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}

.mo-mkt-idx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 8px 0 0;
  font-size: 0.86rem;
}

.mo-mkt-idx-row:first-of-type {
  margin-top: 0;
}

.mo-mkt-idx-row strong.mo-pct-up {
  color: #c62828;
  font-weight: 700;
}

.mo-mkt-idx-row strong.mo-pct-down {
  color: #1b5e20;
  font-weight: 700;
}

.mo-mkt-flow-hint {
  font-size: 0.72rem;
  opacity: 0.78;
  margin: 0 0 8px;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .mo-mkt-index-pair {
    grid-template-columns: 1fr;
  }
}

/* 全市场资金流：每项 dt+dd 必须成组，勿对 dl 整体做 multi-col grid（会打乱顺序） */
.mo-mkt-flow-dl {
  margin: 0;
  padding: 4px 14px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.mo-mkt-kv {
  display: grid;
  grid-template-columns: minmax(120px, min(42%, 220px)) 1fr;
  gap: 8px 16px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.mo-mkt-kv:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.mo-mkt-kv dt {
  font-size: 0.74rem;
  opacity: 0.85;
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

.mo-mkt-kv dd {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: right;
  word-break: break-all;
}

.mo-mkt-kv dd strong.mo-pct-up {
  color: #c62828;
}

.mo-mkt-kv dd strong.mo-pct-down {
  color: #1b5e20;
}

@media (max-width: 400px) {
  .mo-mkt-kv {
    grid-template-columns: 1fr;
  }

  .mo-mkt-kv dd {
    text-align: left;
  }
}

.mo-money-ind-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.025);
}

.mo-money-ind-table tbody tr:hover {
  background: rgba(198, 40, 40, 0.06);
}

.disc-inp {
  width: 100%;
  min-width: 56px;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  background: var(--surface);
}

.disc-field-err {
  border-color: var(--danger) !important;
  outline: 1px solid var(--danger);
}

.disc-cash-row td:nth-child(2) {
  font-weight: 600;
}

.disc-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 8px 0 4px;
}

.disc-req {
  color: var(--danger);
}

.disc-textarea {
  width: 100%;
  min-height: 100px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  resize: vertical;
  font-family: inherit;
}

.disc-generate-row {
  margin: 16px 0;
}

.disc-btn-generate {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 600;
}

.disc-btn-generate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.disc-output {
  margin-top: 16px;
}

.disc-output-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.disc-md-render {
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  background: var(--bg-alt);
  border-radius: 10px;
  max-height: 70vh;
  overflow-y: auto;
}

.disc-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.disc-footer-disclaimer {
  margin-top: 20px;
  padding: 12px 14px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

/* 风向标 */
.wind-vane-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.wind-vane-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text);
}

.wind-vane-card {
  margin-bottom: 12px;
}

.wind-vane-section-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--primary, #0f3460);
}

.wind-vane-title-lg {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.wind-vane-hot-leader-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 12px;
}

.wind-vane-hot-leader-inline .wind-vane-title-lg {
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.wind-vane-hot-leader-box {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: min(100%, 280px);
  min-height: 2.4em;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(15, 52, 96, 0.22);
  border-radius: 8px;
  background: rgba(15, 52, 96, 0.04);
  font-weight: 600;
  color: var(--primary, #0f3460);
}

.wind-vane-recent-mainline-body {
  margin-top: 4px;
}

.wind-vane-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.wind-vane-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.wind-vane-kc50-value {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.wind-vane-level-excellent {
  background: #15803d;
}

.wind-vane-level-good {
  background: #2563eb;
}

.wind-vane-level-fair {
  background: #d97706;
}

.wind-vane-level-poor {
  background: #b91c1c;
}

.wind-vane-rotation-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.wind-vane-rotation-empty {
  color: var(--muted);
  font-style: italic;
}

.mo-kline-dialog {
  width: min(96vw, 720px);
  max-height: 85vh;
  border: none;
  border-radius: 14px;
  padding: 0;
}

.mo-kline-dialog-inner {
  padding: 16px;
  max-height: 85vh;
  overflow-y: auto;
}

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

.mo-kline-dialog-head h3 {
  margin: 0;
  font-size: 1rem;
}

.mo-kline-canvas-wrap {
  margin: 8px 0;
}

.mo-kline-canvas-wrap canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fafafa;
}

.mo-kline-error {
  color: var(--danger, #b91c1c);
}

button.mo-kline-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--link, #2563eb);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.mo-kline-link:hover {
  color: var(--link-hover, #1d4ed8);
}

.mo-watch-inputs {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.mo-watch-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font: inherit;
}

.mo-watch-analyze-out {
  margin-top: 10px;
}
