:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #18201d;
  --muted: #64706b;
  --line: #d8ded7;
  --green: #167a5b;
  --blue: #1e5b9a;
  --red: #a53e34;
  --amber: #9a6b17;
  --teal-soft: #dcefe8;
  --blue-soft: #e2ecf7;
  --amber-soft: #f5ecd9;
  --red-soft: #f3e2df;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  background: #101815;
  color: #f4f7f0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid #6b8176;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #bfe6d6;
}

.brand span,
.source-panel li,
.source-panel h2 {
  color: #b9c7c0;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

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

.nav-item,
.chip {
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-item {
  width: 100%;
  padding: 11px 12px;
  background: transparent;
  color: #dbe4df;
  text-align: left;
  border-radius: 6px;
}

.nav-item.is-active {
  color: #07120e;
  background: #cce9dc;
}

.source-panel {
  margin-top: auto;
  border-top: 1px solid #33433c;
  padding-top: 18px;
}

.source-panel h2 {
  margin: 0 0 12px;
  font-size: 13px;
}

.source-panel ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 14px;
}

.run-status {
  min-width: 160px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
}

.run-status strong {
  color: var(--ink);
  font-size: 24px;
}

.control-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  min-height: 36px;
  padding: 0 14px;
  color: #34443d;
  background: #fff;
  border-color: var(--line);
  border-radius: 6px;
}

.chip.is-selected {
  color: #fff;
  background: #1d5f49;
  border-color: #1d5f49;
}

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

.metric,
.detail-panel,
.stock-card,
.calendar-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-panel {
  padding: 16px;
  margin-bottom: 18px;
}

.calendar-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.calendar-title-row h2 {
  margin-bottom: 0;
}

.month-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f6;
  flex-shrink: 0;
}

.month-tab {
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 6px;
  color: #34443d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.month-tab:hover {
  background: #eef4ef;
}

.month-tab.is-selected {
  color: #fff;
  background: #1d5f49;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.risk-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(170px, 1fr) 130px minmax(150px, 1fr) 130px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f6;
}

.filter-toggle {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #34443d;
  font-size: 12px;
  line-height: 1.3;
}

.filter-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #1d7657;
}

.filter-toggle strong {
  color: var(--ink);
}

.range-control {
  width: 100%;
  accent-color: #1d7657;
}

.filter-summary {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #2f423b;
  background: #e7efe9;
  font-size: 12px;
  line-height: 1.3;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.pending {
  background: #9aa6a0;
}

.legend-dot.hit {
  background: #15724f;
}

.legend-dot.miss {
  background: #a53e34;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(148px, 1fr));
  gap: 8px;
}

.weekday {
  padding: 7px 8px;
  color: var(--muted);
  background: #f6f8f6;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.day-cell {
  min-height: 172px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.day-cell.is-weekend {
  background: #f3f5f2;
  color: var(--muted);
}

.day-cell.is-today {
  border-color: #1d5f49;
  box-shadow: inset 0 0 0 1px #1d5f49;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-number {
  font-size: 16px;
  font-weight: 850;
}

.target-date {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.calendar-picks {
  display: grid;
  gap: 5px;
}

.calendar-pick {
  min-height: 78px;
  padding: 6px 7px;
  border-radius: 5px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 3px 6px;
  color: #1f2e28;
  background: #eef2ee;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid rgba(29, 53, 43, 0.08);
}

.calendar-pick strong {
  grid-row: 1 / 5;
  font-size: 11px;
}

.calendar-pick span:not(.move):not(.live-price) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-pick .move {
  grid-column: 2;
  font-weight: 850;
}

.calendar-pick .live-price {
  grid-column: 2;
  color: #50625a;
  font-size: 9px;
  white-space: nowrap;
}

.calendar-pick.has-result .live-price {
  color: #41514b;
}

.calendar-pick.direction-right {
  background: #e8f6ee;
  border-color: rgba(35, 124, 86, 0.22);
}

.calendar-pick.direction-wrong {
  background: #f8e9e6;
  border-color: rgba(182, 94, 85, 0.22);
}

.calendar-pick.target-hit,
.calendar-pick.target-hit .move,
.calendar-pick.target-hit .live-price,
.calendar-pick.target-hit .meter-delta,
.calendar-pick.target-hit strong,
.calendar-pick.target-hit span {
  color: #1f7d5a;
}

.calendar-pick.target-hit .meter-scale {
  color: #2e7258;
}

.calendar-pick.target-hit .meter-scale span:nth-child(2) {
  color: #1f7d5a;
}

.calendar-pick.target-miss,
.calendar-pick.target-miss .move,
.calendar-pick.target-miss .live-price,
.calendar-pick.target-miss .meter-delta,
.calendar-pick.target-miss strong,
.calendar-pick.target-miss span {
  color: #1f2e28;
}

.outcome-meter {
  grid-column: 2;
  position: relative;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1px;
}

.outcome-meter .meter-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(74, 92, 83, 0.16);
  background:
    linear-gradient(90deg, transparent 0 24.5%, rgba(99, 112, 106, 0.18) 24.5% 25.5%, transparent 25.5% 49.4%, rgba(99, 112, 106, 0.24) 49.4% 50.6%, transparent 50.6% 74.5%, rgba(99, 112, 106, 0.18) 74.5% 75.5%, transparent 75.5% 100%),
    linear-gradient(90deg, rgba(191, 100, 90, 0.2) 0 50%, rgba(51, 145, 108, 0.2) 50% 100%);
}

.outcome-meter .meter-zero {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(30, 44, 38, 0.7);
}

.outcome-meter .meter-fill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
  min-width: 2px;
}

.outcome-meter.direction-right .meter-fill {
  background: linear-gradient(90deg, #47a37d, #1f7d5a);
}

.outcome-meter.direction-wrong .meter-fill {
  background: linear-gradient(90deg, #d98d85, #b65e55);
}

.outcome-meter .meter-delta {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #1c2a24;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.outcome-meter .meter-dot {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(30, 44, 38, 0.08);
  background: #1f7d5a;
}

.outcome-meter.direction-wrong .meter-dot {
  background: #b65e55;
}

.meter-scale {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: -1px;
  font-size: 8px;
  font-weight: 700;
  color: #6a7972;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meter-scale span:nth-child(2) {
  justify-self: center;
  color: #44534d;
}

.meter-scale span:last-child {
  justify-self: end;
}

.calendar-pick.pending {
  background: #eef2ee;
}

.calendar-pick.pending.down {
  background: #eef1f7;
  border-left: 3px solid #4c668f;
}

.calendar-pick.pending.up {
  border-left: 3px solid #1d7657;
}

.calendar-pick.pending.tone-bull-soft {
  background: #edf7f1;
  border-left-color: #52a37d;
}

.calendar-pick.pending.tone-bull-medium {
  background: #ddf1e6;
  border-left-color: #2d8b65;
}

.calendar-pick.pending.tone-bull-strong {
  color: #f6fff9;
  background: linear-gradient(135deg, #1f7d5a, #135440);
  border-left-color: #8fe1bb;
}

.calendar-pick.pending.tone-bear-soft {
  background: #f9eeec;
  border-left-color: #c37a70;
}

.calendar-pick.pending.tone-bear-medium {
  background: #f3ddda;
  border-left-color: #b2574e;
}

.calendar-pick.pending.tone-bear-strong {
  color: #fff8f7;
  background: linear-gradient(135deg, #b3544a, #7f2f28);
  border-left-color: #f0b1ab;
}


.no-signal {
  min-height: 118px;
  border: 1px dashed #c9d0ca;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #7d8781;
  background: #f7f9f7;
  font-size: 12px;
}

.market-closed {
  margin: auto 0;
  color: #87908b;
  font-size: 12px;
  text-align: center;
}

.metric {
  padding: 15px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 4px 0;
  font-size: 26px;
}

.metric p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading span,
.timeline-head span {
  color: var(--muted);
  font-size: 12px;
}

.stock-list {
  display: grid;
  gap: 10px;
}

.stock-card {
  width: 100%;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.stock-card:hover,
.stock-card.is-active {
  border-color: #1d5f49;
}

.stock-card:hover {
  transform: translateY(-1px);
}

.stock-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ticker {
  font-size: 18px;
  font-weight: 800;
}

.company {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.impact {
  min-width: 72px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.impact strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
}

.stock-card p {
  margin: 10px 0 12px;
  color: #3f4c47;
  line-height: 1.45;
}

.stock-live {
  margin-top: 10px;
  padding: 7px 9px;
  border-left: 3px solid #1d7657;
  background: #f0f5f1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stock-live strong {
  font-size: 15px;
}

.stock-live span {
  color: var(--muted);
  font-size: 10px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 7px;
  border-radius: 5px;
  color: #40504a;
  background: #eef2ee;
  font-size: 11px;
}

.detail-panel {
  padding: 20px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.detail-head h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.score-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 8px solid #cfe6db;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  text-align: center;
}

.score-ring span {
  display: block;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

.score-ring small {
  color: var(--muted);
  font-size: 11px;
}

.thesis {
  padding: 14px;
  background: #f6f8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}

.thesis p {
  margin-bottom: 0;
  color: #33413b;
  line-height: 1.6;
}

.timeline {
  margin-bottom: 16px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.timeline-head h3 {
  margin-bottom: 0;
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(10, minmax(22px, 1fr));
  gap: 7px;
  height: 92px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.bar {
  min-height: 8px;
  border-radius: 5px 5px 2px 2px;
  background: var(--green);
  position: relative;
}

.bar::after {
  content: attr(data-day);
  position: absolute;
  bottom: -21px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 10px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.scenario {
  padding: 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.scenario.good {
  background: var(--teal-soft);
}

.scenario.risk {
  background: var(--red-soft);
}

.scenario.neutral {
  background: var(--blue-soft);
}

.scenario.macro {
  background: var(--amber-soft);
}

.scenario strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.prob {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 850;
}

.scenario p {
  margin-bottom: 0;
  color: #3c4a45;
  font-size: 13px;
  line-height: 1.45;
}

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

.evidence-grid section,
.news-shapes {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.evidence-grid ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 9px;
}

.evidence-grid li {
  color: #3e4b46;
  line-height: 1.45;
}

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

.headline {
  padding: 10px 12px;
  border-left: 4px solid var(--blue);
  background: #f6f8fb;
  color: #26343a;
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding-bottom: 16px;
  }

  .source-panel {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
  }

  .workspace,
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .detail-panel {
    grid-column: 1 / -1;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(142px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .risk-filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .weekday {
    display: none;
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .sidebar {
    gap: 14px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .detail-head,
  .section-heading,
  .timeline-head,
  .calendar-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .metric-grid,
  .scenario-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .risk-filter-panel {
    grid-template-columns: 1fr;
  }

  .calendar-legend {
    justify-content: flex-start;
  }

  .month-tabs {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
}

.membership-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.86);
  border-radius: 8px;
}

.membership-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  font-weight: 700;
}

.membership-bar p {
  margin: 6px 0 0;
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
}

.membership-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.membership-action {
  border: 0;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: #22c55e;
  color: #052e16;
  font-weight: 800;
  cursor: pointer;
}

.membership-action.secondary {
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

.preview-mode .calendar-pick span,
.preview-mode .calendar-pick .outcome-meter,
.preview-mode .detail-panel .thesis,
.preview-mode .detail-panel .timeline,
.preview-mode .detail-panel .scenario-grid,
.preview-mode .detail-panel .evidence-grid,
.preview-mode .detail-panel .news-shapes {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.preview-mode .detail-panel::after {
  content: "订阅 1 Star/月或邀请好友送3天，解锁完整预测依据";
  display: block;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  font-weight: 800;
}

.risk-note {
  margin: 18px 0 0;
  padding: 12px 16px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

@media (max-width: 720px) {
  .membership-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .membership-actions {
    justify-content: stretch;
  }

  .membership-action {
    flex: 1;
  }
}
