:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(13, 27, 45, .82);
  --panel-strong: #0e1d30;
  --line: rgba(142, 174, 206, .15);
  --text: #eef6ff;
  --muted: #8da2b8;
  --cyan: #36d7e7;
  --blue: #5a8cff;
  --green: #36d399;
  --red: #ff6b7d;
  --amber: #f8c15c;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    radial-gradient(circle at 15% 10%, #102b49 0, transparent 35%),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.ambient { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .14; pointer-events: none; }
.ambient-one { width: 360px; height: 360px; right: -110px; top: 60px; background: var(--cyan); }
.ambient-two { width: 300px; height: 300px; left: -100px; bottom: 8%; background: var(--blue); }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 80px; position: relative; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.brand-block { display: flex; align-items: center; gap: 20px; min-width: 0; }
.brand-logo-wrap { width: 118px; height: 78px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden; border: 1px solid rgba(54, 215, 231, .24); border-radius: 18px; background: #fff; box-shadow: 0 15px 40px rgba(0, 0, 0, .24), 0 0 24px rgba(54, 215, 231, .1); }
.brand-logo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.eyebrow { color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: .2em; display: flex; align-items: center; gap: 9px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 6px rgba(54, 215, 231, .1), 0 0 18px var(--cyan); }
h1 { font-size: clamp(32px, 5vw, 52px); margin: 10px 0 8px; letter-spacing: -.045em; line-height: 1.08; }
.hero p, .toolbar p { margin: 0; color: var(--muted); }

.date-control { min-width: 210px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(11, 25, 42, .8); box-shadow: var(--shadow); }
.date-control span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.date-control select { width: 100%; color: var(--text); background: transparent; border: 0; outline: 0; font: inherit; font-weight: 700; cursor: pointer; }
.date-control option { color: #102033; background: #eef6ff; }

.top-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 26px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: rgba(11, 25, 42, .74); box-shadow: 0 15px 45px rgba(0, 0, 0, .16); }
.top-tab { min-height: 48px; padding: 0 18px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; transition: color .2s ease, background .2s ease, box-shadow .2s ease; }
.top-tab:hover { color: var(--text); background: rgba(54, 215, 231, .055); }
.top-tab.active { color: var(--text); background: linear-gradient(135deg, rgba(54, 215, 231, .16), rgba(90, 140, 255, .13)); box-shadow: inset 0 0 0 1px rgba(54, 215, 231, .24), 0 8px 24px rgba(0, 0, 0, .16); }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 20px; margin-left: 7px; padding: 0 6px; border-radius: 10px; color: var(--cyan); background: rgba(54, 215, 231, .1); font-size: 11px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 38px; }
.metric { position: relative; overflow: hidden; padding: 21px; min-height: 112px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.metric::after { content: ""; position: absolute; inset: auto -20px -42px auto; width: 95px; height: 95px; border-radius: 50%; background: var(--blue); filter: blur(25px); opacity: .12; }
.metric.entry::after { background: var(--green); }
.metric.exit::after { background: var(--red); }
.metric.win::after { background: var(--cyan); }
.metric.long::after { background: var(--amber); }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 12px; font-size: 28px; letter-spacing: -.03em; }

.filters { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(240px, 1.35fr) minmax(180px, .85fr) auto; align-items: end; gap: 12px; margin-bottom: 28px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(11, 25, 42, .72); box-shadow: 0 15px 45px rgba(0, 0, 0, .16); backdrop-filter: blur(14px); }
.filter-control span { display: block; margin: 0 0 7px 3px; color: var(--muted); font-size: 11px; }
.filter-control select, .filter-control input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--text); background: rgba(7, 17, 31, .74); font: inherit; font-size: 13px; transition: border-color .2s ease, box-shadow .2s ease; }
.filter-control select:focus, .filter-control input:focus { border-color: rgba(54, 215, 231, .55); box-shadow: 0 0 0 3px rgba(54, 215, 231, .08); }
.filter-control select { cursor: pointer; }
.filter-control option { color: #102033; background: #eef6ff; }
.filter-control input::placeholder { color: #60778f; }
.reset-filter { height: 42px; padding: 0 17px; border: 1px solid rgba(54, 215, 231, .28); border-radius: 11px; color: var(--cyan); background: rgba(54, 215, 231, .07); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.reset-filter:hover { border-color: rgba(54, 215, 231, .55); background: rgba(54, 215, 231, .12); }

.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.toolbar h2 { margin: 0 0 5px; font-size: 21px; }
.toolbar p { font-size: 13px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend-entry { background: var(--green); box-shadow: 0 0 10px var(--green); }
.legend-exit { background: var(--red); box-shadow: 0 0 10px var(--red); }

.signal-list { display: grid; gap: 12px; }
.signal-card { display: grid; grid-template-columns: minmax(250px, 1.5fr) repeat(2, minmax(105px, .55fr)) repeat(2, minmax(185px, 1fr)); align-items: center; gap: 18px; padding: 19px 20px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 15px; background: var(--panel); box-shadow: 0 10px 36px rgba(0, 0, 0, .16); transition: transform .2s ease, border-color .2s ease; }
.signal-card:hover { transform: translateY(-2px); border-color: rgba(54, 215, 231, .34); }
.signal-card.exit { border-left-color: var(--red); }
.identity { min-width: 0; }
.signal-kind { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--green); font-weight: 750; font-size: 13px; }
.signal-card.exit .signal-kind { color: var(--red); }
.kind-pill { padding: 4px 8px; border-radius: 20px; background: rgba(54, 211, 153, .1); white-space: nowrap; }
.signal-card.exit .kind-pill { background: rgba(255, 107, 125, .1); }
.stock-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.stock-name { font-size: 18px; font-weight: 800; }
.stock-code { color: #b5c5d6; font: 600 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.sector { margin-top: 6px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reason { margin: 9px 0 0; color: #aebfd0; font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.flow-shadow { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 9px; color: #9eb2c7; font-size: 10px; line-height: 1.45; }
.flow-shadow span { white-space: nowrap; }
.shadow-pill { padding: 2px 6px; border-radius: 10px; color: var(--amber); background: rgba(248, 193, 92, .1); }
.entity-pill { padding: 2px 6px; border-radius: 10px; color: #8fd3ff; background: rgba(69, 170, 242, .12); }
.empty-flow { color: #6f849a; }

.data-cell span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.data-cell strong { font-size: 14px; font-weight: 750; white-space: nowrap; }
.data-cell small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; white-space: nowrap; }
.review-block { border-left: 1px solid var(--line); padding-left: 16px; min-width: 0; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.review-price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; }
.review-price-line strong { font-size: 16px; white-space: nowrap; }
.review-meta { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outcome { text-align: right; }
.result-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 28px; border-radius: 9px; font-weight: 850; font-size: 13px; }
.result-badge.win { color: var(--green); background: rgba(54, 211, 153, .11); }
.result-badge.loss { color: var(--red); background: rgba(255, 107, 125, .11); }
.result-badge.flat { color: var(--amber); background: rgba(248, 193, 92, .11); }
.return { margin-top: 6px; font: 800 14px ui-monospace, SFMono-Regular, Consolas, monospace; }
.return.positive { color: var(--green); }
.return.negative { color: var(--red); }
.reviewing { margin-top: 5px; color: var(--amber); font-size: 10px; }

.loading-card, .empty-card, .error-card { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); background: rgba(11, 24, 40, .5); text-align: center; padding: 30px; }
.spinner { width: 28px; height: 28px; border: 2px solid rgba(54, 215, 231, .15); border-top-color: var(--cyan); border-radius: 50%; animation: spin .75s linear infinite; }
.empty-icon { font-size: 34px; color: var(--cyan); }
.retry-button { border: 1px solid rgba(54, 215, 231, .4); border-radius: 10px; padding: 9px 16px; color: var(--cyan); background: rgba(54, 215, 231, .08); cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }

.report-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 8px 0 20px; }
.report-heading h2 { margin: 8px 0 5px; font-size: 26px; }
.report-heading p, .report-detail-head p { margin: 0; color: var(--muted); }
.report-task-badge { flex: 0 0 auto; padding: 8px 12px; border: 1px solid rgba(248, 193, 92, .25); border-radius: 20px; color: var(--amber); background: rgba(248, 193, 92, .08); font-size: 12px; font-weight: 750; }
.report-list { display: grid; gap: 10px; }
.report-card { width: 100%; display: grid; grid-template-columns: 78px minmax(0, 1fr) auto 18px; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: var(--panel); box-shadow: 0 10px 36px rgba(0, 0, 0, .14); text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease; }
.report-card:hover { transform: translateY(-2px); border-color: rgba(54, 215, 231, .34); }
.report-date-block { display: grid; gap: 2px; padding-right: 15px; border-right: 1px solid var(--line); text-align: center; }
.report-date-block strong { font: 800 17px ui-monospace, SFMono-Regular, Consolas, monospace; }
.report-date-block small, .report-card-main small { color: var(--muted); font-size: 11px; }
.report-card-main { display: grid; min-width: 0; gap: 6px; }
.report-card-main strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.report-status { display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 20px; color: var(--muted); background: rgba(142, 174, 206, .08); font-size: 11px; font-weight: 750; }
.report-status.success { color: var(--green); background: rgba(54, 211, 153, .1); }
.report-status.error { color: var(--red); background: rgba(255, 107, 125, .1); }
.report-status.warning, .report-status.running { color: var(--amber); background: rgba(248, 193, 92, .1); }
.report-arrow { color: var(--cyan); font-size: 26px; font-weight: 300; }
.report-back { margin-bottom: 16px; padding: 9px 13px; border: 1px solid rgba(54, 215, 231, .25); border-radius: 10px; color: var(--cyan); background: rgba(54, 215, 231, .07); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.report-detail-head { margin-bottom: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, rgba(54, 215, 231, .08), rgba(90, 140, 255, .06)); }
.report-detail-head h2 { margin: 10px 0 7px; font-size: clamp(23px, 4vw, 34px); line-height: 1.25; }
.report-detail > .markdown-body { padding: clamp(18px, 4vw, 38px); border: 1px solid var(--line); border-radius: 17px; background: rgba(238, 246, 255, .97); box-shadow: var(--shadow); color: #17283a; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { margin: 1.5em 0 .65em; color: #0c1d2f; line-height: 1.35; }
.markdown-body h1 { font-size: 28px; }
.markdown-body h2 { padding-bottom: 8px; border-bottom: 1px solid #d7e1eb; font-size: 22px; }
.markdown-body h3 { font-size: 18px; }
.markdown-body p { margin: 0 0 1em; }
.markdown-body ul, .markdown-body ol { margin: 0 0 1em; padding-left: 24px; }
.markdown-body blockquote { margin: 1em 0; padding: 10px 16px; border-left: 3px solid #36aabe; background: #eaf5f7; color: #42576b; }
.markdown-body pre { max-width: 100%; margin: 1em 0; padding: 14px; overflow-x: auto; border-radius: 10px; background: #0e1d30; color: #e8f2fc; }
.markdown-body code { padding: 2px 5px; border-radius: 4px; background: #e7edf3; font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-body pre code { padding: 0; background: transparent; }
.markdown-body table { width: 100%; margin: 1em 0; border-collapse: collapse; font-size: 13px; }
.markdown-body th, .markdown-body td { padding: 8px 10px; border: 1px solid #cad6e1; text-align: left; vertical-align: top; }
.markdown-body th { background: #e9f0f6; color: #14283b; }
.markdown-body tr:nth-child(even) td { background: #f5f8fb; }
.markdown-body a { color: #087a91; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body img { display: block; max-width: 100%; height: auto; margin: 18px auto; border-radius: 10px; box-shadow: 0 8px 28px rgba(7, 17, 31, .14); }

.refresh-bar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; color:var(--muted); font-size:13px; }
.direction-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.direction-summary article { display:grid; gap:9px; padding:16px; border:1px solid var(--line); border-radius:12px; }
.direction-summary span,.research-note,.signal-evidence { color:var(--muted); font-size:12px; line-height:1.8; }
.research-note { margin:16px 0 24px; }
.signal-evidence span { display:block; opacity:.8; }
#loadMore { display:block; margin:18px auto; }
#loadMore[hidden] { display:none; }
@media (max-width: 620px) { .direction-summary {grid-template-columns:1fr;} }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .stock-filter { grid-column: 1 / -1; }
  .signal-card { grid-template-columns: minmax(230px, 1.3fr) repeat(2, minmax(170px, 1fr)); }
  .signal-card .signal-time, .signal-card .signal-price { display: none; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); padding: 30px 0 52px; }
  .hero { display: block; margin-bottom: 22px; }
  .brand-block { align-items: flex-start; gap: 13px; }
  .brand-logo-wrap { width: 82px; height: 58px; padding: 6px; border-radius: 13px; }
  h1 { margin-top: 8px; font-size: clamp(27px, 8vw, 38px); }
  .hero p { font-size: 13px; line-height: 1.6; }
  .date-control { display: block; margin-top: 20px; min-width: 0; width: 100%; }
  .top-tabs { grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
  .top-tab:last-child { grid-column: 1 / -1; }
  .top-tab { min-height: 43px; padding: 0 10px; font-size: 13px; }
  .metrics { gap: 9px; margin-bottom: 28px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; padding: 12px; }
  .stock-filter { grid-column: 1 / -1; }
  .reset-filter { width: 100%; }
  .metric { padding: 15px; min-height: 88px; border-radius: 14px; }
  .metric strong { font-size: 23px; margin-top: 8px; }
  .toolbar { align-items: flex-start; }
  .legend { display: none; }
  .signal-card, .signal-card:hover { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; padding: 17px 15px; transform: none; }
  .identity { grid-column: 1 / -1; padding-bottom: 3px; }
  .signal-card .data-cell { display: block !important; }
  .review-block { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 13px 0 0; }
  .outcome { display: flex; align-items: center; gap: 10px; text-align: left; }
  .outcome .return { margin: 0; }
  .outcome .reviewing { margin: 0 0 0 auto; }
  .reason { -webkit-line-clamp: 3; }
  .report-heading { align-items: flex-start; }
  .report-card { grid-template-columns: 60px minmax(0, 1fr) 14px; gap: 11px; padding: 14px 12px; }
  .report-card > .report-status { grid-column: 2; justify-self: start; }
  .report-arrow { grid-column: 3; grid-row: 1 / span 2; }
  .report-date-block { padding-right: 10px; }
  .report-detail > .markdown-body { padding: 18px 14px; font-size: 14px; }
  .markdown-body table { display: block; max-width: 100%; overflow-x: auto; white-space: nowrap; }
}
