/* 13F clone dashboard — sibling of the 三层楼 dashboard family.
   Tokens are copied verbatim from invest-hub/site/three-floor.css so the two
   pages read as one system. No webfonts, no frameworks, no external requests. */

:root {
  --accent: #9c3b22;
  --paper: #f6f2ea;
  --ink: #211d16;
  --muted: #7a7264;
  --line: #211d16;
  --soft-line: #d8d0be;
  --faint-line: #ece5d6;
  --card: #fdfcf9;
  --card-warm: #fbf6ec;
  --green: #2f5c3e;
  --green-2: #5a8150;
  --neutral: #8c7c52;
  --amber: #b3702c;
  --red: #a03d2a;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #d9764f;
    --paper: #17150f;
    --ink: #efe8d8;
    --muted: #9a917f;
    --line: #efe8d8;
    --soft-line: #423b2d;
    --faint-line: #2c271d;
    --card: #1e1b14;
    --card-warm: #232017;
    --green: #79ad83;
    --green-2: #8fb37f;
    --neutral: #b8a473;
    --amber: #d69a55;
    --red: #d9764f;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: min(1120px, calc(100vw - 48px));
  margin: 44px auto 72px;
}

/* ─── header ─── */
.topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.22em;
}

.topline-meta {
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.titlebar {
  margin-top: 22px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--line);
}

.titlebar h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.title-sub {
  margin-top: 14px;
  max-width: 860px;
  font-size: clamp(16px, 1.7vw, 20px);
  font-weight: 800;
  line-height: 1.6;
}

.title-sub strong {
  color: var(--accent);
  font-weight: 900;
}

/* ─── stats strip ─── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 0;
  padding: 22px 0;
  border-bottom: 3px double var(--line);
}

.stat {
  padding: 0 22px;
  border-left: 1px solid var(--soft-line);
}

.stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.stat-value {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.05;
}

.stat-value.is-date {
  font-size: clamp(15px, 1.75vw, 21px);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.stat-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

/* ─── sections ─── */
.section {
  margin-top: 46px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.section-num {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.section-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.section-sub {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.section-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ─── fund card ─── */
.fund {
  margin-top: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--soft-line);
}

.fund-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
}

.fund-name {
  display: flex;
  align-items: baseline;
  gap: 11px;
  flex-wrap: wrap;
  min-width: 0;
}

.fund-name h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.chip {
  padding: 3px 10px;
  background: var(--neutral);
  color: #f9f6ef;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.chip.is-radar {
  background: var(--amber);
}

.fund-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
}

.fund-meta a {
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid rgba(156, 59, 34, 0.5);
}

.fund-meta a:hover,
.fund-meta a:focus-visible {
  color: var(--red);
  border-bottom-color: currentColor;
}

.fund-port {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.fund-port b {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
}

/* count strip */
.counts {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--faint-line);
  border-bottom: 1px solid var(--faint-line);
}

.count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.count-n {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.count-n.is-zero {
  color: var(--muted);
  opacity: 0.55;
}

.count.is-new .count-n:not(.is-zero) {
  color: var(--green);
}

.count.is-exited .count-n:not(.is-zero) {
  color: var(--red);
}

.count-l {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

/* ─── detail disclosure ─── */
.detail {
  margin-top: 12px;
}

.detail > summary {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  cursor: pointer;
  list-style: none;
}

.detail > summary::-webkit-details-marker {
  display: none;
}

.detail > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform .15s ease;
}

.detail[open] > summary::before {
  content: "▾ ";
}

.detail-body {
  margin-top: 12px;
  padding: 4px 0 2px;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

/* ─── tables ─── */
.tbl-label {
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.tbl-label:first-child {
  margin-top: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  padding: 7px 10px 6px;
  border-top: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--faint-line);
  vertical-align: baseline;
}

tbody tr:last-child td {
  border-bottom: 2px solid var(--soft-line);
}

th.r,
td.r {
  text-align: right;
}

td.issuer {
  font-weight: 700;
  line-height: 1.35;
}

td.num,
td.cusip,
td.tkr {
  font-family: var(--mono);
  font-size: 12px;
}

td.cusip {
  color: var(--muted);
  letter-spacing: 0.02em;
}

td.tkr {
  font-weight: 700;
}

.dir {
  display: inline-block;
  min-width: 44px;
  padding: 2px 7px;
  color: #f9f6ef;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.dir.add {
  background: var(--green-2);
}

.dir.trim {
  background: var(--amber);
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

.filing-link {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  border-bottom: 1px solid rgba(156, 59, 34, 0.5);
}

.filing-link:hover,
.filing-link:focus-visible {
  color: var(--red);
  border-bottom-color: currentColor;
}

/* ─── radar banner ─── */
.radar-banner {
  margin-top: 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--amber);
  background: var(--card-warm);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.7;
}

.radar-banner b {
  color: var(--amber);
}

/* ─── footer ─── */
.foot {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 3px double var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.85;
}

.foot h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.foot ul {
  margin: 0;
  padding-left: 18px;
}

.foot li {
  margin-bottom: 7px;
}

.foot li b {
  color: var(--ink);
}

.foot-rule {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--soft-line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

.disclaimer {
  margin-top: 20px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.75;
  text-align: center;
}

.loading,
.error {
  padding: 60px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.error {
  color: var(--red);
}

/* ─── responsive ─── */
@media (max-width: 820px) {
  .page {
    width: calc(100vw - 32px);
    margin: 28px auto 48px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .stat {
    padding: 0 0 16px;
    border-left: 0;
    border-bottom: 1px solid var(--faint-line);
  }

  .stats .stat:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .fund-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fund-meta {
    text-align: left;
    white-space: normal;
  }

  .counts {
    gap: 18px;
  }

  /* tables become stacked records */
  .scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .scroll-x table {
    min-width: 620px;
  }
}

@media (max-width: 520px) {
  .topline {
    letter-spacing: 0.14em;
  }

  .count-n {
    font-size: 19px;
  }
}
