:root {
  --ink: #203f57;
  --text: #273b4a;
  --muted: #5c6f7e;
  --bg: #f2f5f7;
  --paper: #fff;
  --border: #d7e0e7;
  --accent: #176b70;
  --soft: #e8f2f1;
  --danger: #ab3936;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  color: var(--ink);
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 6px;
  transition: background 0.15s;
}
button:hover {
  background: #eaf0f4;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: var(--accent);
}
:focus-visible {
  outline: 3px solid #377f9e;
  outline-offset: 3px;
}
button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
button.primary:hover {
  background: #31566f;
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
.subtle,
small {
  color: var(--muted);
}
p {
  line-height: 1.75;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 24px;
  font-weight: 600;
}
h3 {
  font-size: 18px;
}
label {
  display: block;
  font-size: 14px;
  margin: 16px 0 7px;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--paper);
}
textarea {
  resize: vertical;
}
input[type="date"] {
  min-width: 0;
}
small {
  line-height: 1.6;
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 84px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  gap: 48px;
  border-bottom: 1px solid var(--border);
  background: white;
}
.brand {
  text-decoration: none;
  font-size: 26px;
  font-weight: 750;
  color: var(--ink);
  white-space: nowrap;
}
.brand span {
  font-size: 16px;
  font-weight: 400;
  margin-left: 12px;
}
.topbar nav {
  display: flex;
  gap: 10px;
  flex: 1;
}
.topbar nav button {
  border: 0;
  background: transparent;
  border-radius: 0;
  height: 84px;
  color: var(--muted);
}
.topbar nav button.active {
  box-shadow: inset 0 -3px var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.overview {
  padding: 38px 4vw;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 200px 250px;
  gap: 36px;
}
.overview h1 {
  margin-bottom: 10px;
}
.overview p {
  margin-bottom: 0;
  font-size: 14px;
}
.overview .subtle {
  margin: 0 0 9px;
}
.holding-summary,
.latest-summary {
  border-left: 1px solid var(--border);
  padding-left: 30px;
  align-self: center;
}
.holding-summary > span,
.latest-summary > span {
  font-size: 13px;
  color: var(--muted);
}
.holding-summary strong {
  font-size: 32px;
  margin-right: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.holding-summary div {
  margin: 9px 0;
}
.latest-summary strong {
  display: block;
  font-size: 18px;
  font-weight: 500;
  margin: 12px 0;
}
.research-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  margin: 0 4vw 40px;
  align-items: start;
}
.archive {
  background: #eaf0f4;
  padding: 23px 20px;
  border-radius: 8px;
}
.archive-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.archive h2 {
  font-size: 18px;
  margin: 0;
}
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.filter-row label {
  font-size: 12px;
}
.filter-row input,
.filter-row select {
  font-size: 13px;
  padding: 8px;
}
.filter-actions {
  display: flex;
  gap: 10px;
  margin: 14px 0 22px;
}
.filter-actions button {
  font-size: 13px;
  min-height: 36px;
  padding: 5px 12px;
}
.date-group {
  font-size: 13px;
  margin: 24px 0 9px;
  color: var(--muted);
}
.report-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 7px;
  background: transparent;
}
.report-item.active {
  background: white;
  border-color: var(--border);
  border-left: 3px solid var(--accent);
}
.report-item:hover {
  background: white;
}
.report-item .item-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 9px;
}
.report-item strong {
  display: block;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
}
.report-item p {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge {
  display: inline-block;
  background: var(--soft);
  color: #205d60;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}
.badge.intraday {
  background: #e7eff9;
  color: #2c5882;
}
.badge.overnight {
  background: #eceaf5;
  color: #655381;
}
.badge.baseline {
  background: #edf0f2;
  color: #52616c;
}
.reader {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px clamp(22px, 4vw, 64px);
  min-height: 600px;
}
.reader-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--muted);
}
.reader h2 {
  font-size: 29px;
  line-height: 1.5;
  max-width: 28em;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
}
.times {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}
.reader .lead {
  font-size: 17px;
  line-height: 1.9;
  margin: 25px 0;
  color: #344d5e;
  white-space: pre-wrap;
}
.decision {
  background: var(--soft);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  margin: 26px 0;
}
.decision h3 {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 9px;
}
.decision p {
  font-size: 16px;
  margin: 0;
  white-space: pre-wrap;
}
.report-section {
  padding-top: 26px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}
.report-section h3 {
  font-size: 19px;
  color: var(--ink);
}
.report-section p {
  font-size: 15px;
  white-space: pre-wrap;
  line-height: 1.95;
  overflow-wrap: anywhere;
  max-width: 75ch;
}
.position-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
  padding: 14px 0;
}
.gaps {
  background: #fbf4e7;
  border-radius: 5px;
  padding: 18px 22px;
  font-size: 14px;
  line-height: 1.8;
  margin-top: 25px;
}
.sources {
  padding-left: 21px;
}
.sources li {
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.sources small {
  display: block;
  font-size: 12px;
}
.reader-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 30px;
}
.reader-actions button {
  font-size: 13px;
}
.empty {
  padding: 100px 10px;
  text-align: center;
  color: var(--muted);
}
.empty-symbol {
  font-size: 60px;
  color: #b9cbd4;
  font-weight: 300;
  margin-bottom: 22px;
}
.empty h2 {
  font-size: 24px;
}
.empty p {
  font-size: 14px;
}
.settings-view {
  max-width: 1120px;
  margin: 0 auto 60px;
  padding: 0 30px;
}
.section-intro {
  margin: 24px 0 32px;
  max-width: 700px;
}
.position-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 30px;
}
.panel fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}
.panel fieldset:disabled {
  opacity: 0.45;
}
.broker-panel dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  line-height: 2.5;
  font-size: 15px;
}
.broker-panel dt {
  color: var(--muted);
}
.broker-panel dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.broker-panel .subtle {
  font-size: 13px;
  margin-top: 35px;
}
.cadence {
  display: grid;
  grid-template-columns: 1fr 1.2fr 2fr;
  gap: 20px;
  border-block: 1px solid var(--border);
  padding: 25px 0;
}
.cadence strong,
.cadence span {
  display: block;
}
.cadence strong {
  font-size: 20px;
  margin-bottom: 12px;
}
.cadence span {
  font-size: 13px;
  color: var(--muted);
}
.run {
  display: grid;
  grid-template-columns: 150px 70px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
}
.run:last-child {
  border: 0;
}
.run small {
  font-size: 12px;
}
footer {
  margin: 0 4vw;
  padding: 24px 0;
  display: flex;
  gap: 25px;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  background: white;
}
.login-intro {
  background: #e4edf2;
  padding: clamp(40px, 8vw, 130px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.mark {
  font-size: 48px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 70px;
}
.mark span {
  font-size: 19px;
  font-weight: 400;
  margin-left: 18px;
  vertical-align: middle;
}
.login-intro h1 {
  font-size: clamp(32px, 3.5vw, 50px);
  line-height: 1.6;
  font-weight: 500;
}
.login-intro p {
  color: var(--muted);
  font-size: 16px;
  line-height: 2;
}
.session-line {
  display: flex;
  justify-content: space-between;
  margin-top: 70px;
  border-top: 2px solid #a6bcc9;
  padding-top: 18px;
  font-size: 13px;
  color: var(--muted);
}
.login-form {
  align-self: center;
  width: min(350px, 80%);
  margin: 70px auto;
}
.login-form h2 {
  font-size: 32px;
  margin-bottom: 35px;
}
.login-form button {
  width: 100%;
  margin-top: 24px;
}
.login-form small {
  font-size: 12px;
}
.error {
  color: var(--danger);
  font-size: 14px;
}
.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;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 15px 25px;
  border-radius: 7px;
  max-width: 90vw;
  z-index: 10;
  font-size: 14px;
}
#load-more {
  width: 100%;
  margin-top: 18px;
}
.warning {
  color: #906112;
}
.error-note {
  color: var(--danger);
  padding: 15px;
  background: #fff1ef;
  border-radius: 5px;
}
.report-list-empty {
  font-size: 14px;
  color: var(--muted);
  padding: 25px 0;
  line-height: 1.8;
}
@media (max-width: 1100px) {
  .overview {
    grid-template-columns: 1fr 180px;
  }
  .latest-summary {
    display: none;
  }
  .research-layout {
    grid-template-columns: 290px 1fr;
    gap: 16px;
  }
  .reader {
    padding: 28px;
  }
  .topbar {
    gap: 25px;
  }
  .reader h2 {
    font-size: 25px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    gap: 0;
    padding: 15px 20px 0;
  }
  .brand {
    flex: 1;
    font-size: 23px;
  }
  .topbar #logout {
    order: 1;
  }
  .topbar nav {
    order: 2;
    width: 100%;
    flex-basis: 100%;
    gap: 14px;
  }
  .topbar nav button {
    height: 55px;
    padding: 8px 5px;
    font-size: 14px;
  }
  .overview {
    padding: 25px 20px;
    grid-template-columns: 1fr 115px;
    gap: 12px;
  }
  .overview h1 {
    font-size: 23px;
  }
  .overview p {
    font-size: 12px;
  }
  .holding-summary {
    padding-left: 14px;
  }
  .holding-summary strong {
    font-size: 27px;
  }
  .research-layout {
    display: block;
    margin: 0 16px 30px;
  }
  .archive {
    padding: 18px;
    margin-bottom: 18px;
  }
  .archive-heading {
    margin-bottom: 12px;
  }
  .filter-row {
    grid-template-columns: 1fr 1fr;
  }
  .filter-actions {
    margin-bottom: 12px;
  }
  #report-list {
    max-height: 300px;
    overflow: auto;
  }
  .reader {
    padding: 24px 20px;
    min-height: 420px;
  }
  .reader h2 {
    font-size: 24px;
  }
  .reader .lead {
    font-size: 16px;
  }
  .reader-top {
    flex-wrap: wrap;
  }
  .decision {
    padding: 18px;
  }
  .position-columns {
    grid-template-columns: 1fr;
  }
  .settings-view {
    padding: 0 20px;
  }
  .panel {
    padding: 24px;
  }
  .cadence {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .run {
    grid-template-columns: 1fr 70px;
    gap: 8px;
  }
  .run p {
    grid-column: 1/-1;
    margin: 0;
  }
  footer {
    flex-direction: column;
    gap: 9px;
    margin: 0 20px;
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-intro {
    padding: 35px 30px;
  }
  .mark {
    font-size: 34px;
    margin-bottom: 25px;
  }
  .login-intro h1 {
    font-size: 29px;
  }
  .login-intro p,
  .session-line {
    display: none;
  }
  .login-form {
    margin: 40px auto;
  }
  .login-form h2 {
    font-size: 27px;
  }
  .empty {
    padding: 60px 0;
  }
  .times {
    font-size: 11px;
  }
}
@media print {
  .topbar,
  .overview,
  .archive,
  footer,
  .reader-actions,
  #toast {
    display: none !important;
  }
  .research-layout {
    display: block;
    margin: 0;
  }
  .reader {
    border: 0;
    padding: 0;
  }
  .decision,
  .gaps {
    break-inside: avoid;
  }
  .report-section h3 {
    break-after: avoid;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
