:root {
  --bg-top: #f5f7fb;
  --bg-bottom: #eef4f7;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff6ff;
  --teal: #0f766e;
  --teal-soft: #ecfdf5;
  --danger: #dc2626;
  --warn: #b45309;
  --gold: #f59e0b;
  --border: #e5e7eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-strong: 0 20px 50px rgba(15, 23, 42, .11);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(rgba(24, 35, 45, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 35, 45, .025) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 32rem),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  background-size: 42px 42px, 42px 42px, auto, auto;
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; width: 100%; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar .bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: .3px; }
.logo a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }

.logo-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: linear-gradient(135deg, #fff, #eff6ff);
}

.logo-mark::before,
.logo-mark::after,
.logo-mark i {
  content: "";
  position: absolute;
  background: var(--accent);
}

.logo-mark::before { width: 6px; height: 6px; border-radius: 50%; left: 6px; top: 6px; }
.logo-mark::after { width: 6px; height: 6px; border-radius: 50%; right: 5px; bottom: 5px; background: var(--teal); }
.logo-mark i { left: 10px; top: 10px; width: 12px; height: 1px; transform: rotate(35deg); transform-origin: left center; opacity: .75; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: none;
  background: transparent;
  color: #526273;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 8px 9px;
  border-radius: 8px;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  outline: none;
  color: var(--accent);
  background: rgba(239, 246, 255, .9);
}

.search { flex: 1; min-width: 200px; }
.actions { display: flex; align-items: center; gap: 8px; }

.search input,
.editor input,
.modal-box input,
.modal-box textarea,
.account-form input,
.recovery-create-form input,
.select {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}

.search input:focus,
.editor input:focus,
.modal-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-box textarea:focus,
.account-form input:focus,
.recovery-create-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select { width: auto; padding: 8px 12px; }

.btn {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: all .15s;
  white-space: nowrap;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 12px; }

.identity-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  padding: 7px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #315574;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.identity-btn::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #94a3b8; }
.identity-btn.identity-admin { border-color: #99d9cf; background: #eefaf8; color: #0f766e; }
.identity-btn.identity-admin::before { background: #0f9488; }

.hidden { display: none !important; }
.muted { color: var(--muted); }

.warn {
  background: #fef3c7;
  color: var(--warn);
  border-bottom: 1px solid #fde68a;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}

.layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding-top: 26px;
  flex: 1;
  padding-bottom: 48px;
}

.sidebar {
  width: 210px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}

.profile-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.profile-text strong { font-size: 14px; }
.profile-text span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sb-title { font-size: 12px; color: var(--muted); margin: 4px 8px 8px; letter-spacing: 1px; }

.sb-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-item:hover { background: var(--accent-soft); color: var(--accent); }
.sb-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.sb-more { color: var(--muted); }

.sb-sep { height: 1px; background: var(--border); margin: 8px 0; }

.view { flex: 1; min-width: 0; }

body.garden-mode .layout {
  display: block;
  max-width: 1220px;
}

body.garden-mode .sidebar { display: none; }
body.garden-mode .view { width: 100%; }
body.quant-mode .layout { max-width: 1500px; padding-left: 14px; padding-right: 14px; }

.page-title { margin: 4px 0 16px; }

.list-head { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 14px; }
.list-head h2 { font-size: 18px; margin: 0; }

.garden-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.garden-page::before {
  content: "0101  FFT  MATRIX  SIGNAL  RISK  HDL";
  position: fixed;
  right: 4vw;
  bottom: 8vh;
  pointer-events: none;
  color: rgba(24, 35, 45, .035);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 36px;
  max-width: 520px;
  line-height: 1.4;
  letter-spacing: .08em;
  z-index: -1;
}

.garden-hero {
  position: relative;
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr);
  gap: 28px;
  align-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(203, 213, 225, .88);
  border-radius: 18px;
  padding: clamp(28px, 5vw, 56px);
  box-shadow: var(--shadow-strong);
}

.garden-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background:
    radial-gradient(circle at 72% 20%, rgba(20, 184, 166, .14), transparent 18rem),
    radial-gradient(circle at 20% 82%, rgba(245, 158, 11, .08), transparent 14rem);
}

.garden-hero > * { position: relative; }

.garden-hero .home-copy h2 {
  margin: 10px 0 12px;
  color: #18232d;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.04;
  letter-spacing: 0;
  max-width: 720px;
}

.garden-hero .home-copy p {
  margin: 0;
  color: #526273;
  max-width: 600px;
  font-size: 16px;
}

.garden-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.garden-action {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #263746;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  padding: 10px 14px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}

.garden-action:first-child {
  color: #fff;
  background: #18232d;
  border-color: #18232d;
}

.garden-action:hover,
.garden-action:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(37, 99, 235, .12);
}

.network-field {
  position: relative;
  min-height: 320px;
  border: 1px solid rgba(203, 213, 225, .76);
  border-radius: 18px;
  background:
    linear-gradient(rgba(15, 118, 110, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .05) 1px, transparent 1px),
    rgba(255, 255, 255, .68);
  background-size: 28px 28px;
  overflow: hidden;
}

.network-lines,
.graph-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.network-lines line {
  stroke: rgba(38, 55, 70, .16);
  stroke-width: .35;
}

.network-node {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 9px;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: rgba(38, 55, 70, .64);
  font-size: 12px;
  transition: transform .18s ease-out;
  animation: float-soft 8s ease-in-out infinite;
}

.network-node::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.node-1::before { background: var(--teal); }
.node-2::before { background: #8b7bb4; }
.node-3::before { background: var(--gold); }

.network-axis {
  position: absolute;
  left: 12%;
  bottom: 15%;
  width: 28%;
  height: 28%;
  border-left: 1px solid rgba(24, 35, 45, .14);
  border-bottom: 1px solid rgba(24, 35, 45, .14);
}

.network-axis::after {
  content: "";
  position: absolute;
  left: 14%;
  bottom: 20%;
  width: 78%;
  height: 34%;
  border-bottom: 1px solid rgba(15, 118, 110, .26);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.bento-card,
.graph-section,
.timeline-section {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(203, 213, 225, .84);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.bento-card:hover,
.graph-section:hover,
.timeline-section:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, .26);
  box-shadow: var(--shadow);
}

.bento-card { grid-column: span 2; }
.bento-card.span-2 { grid-column: span 4; }

.section-label span {
  display: block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-label h2 {
  margin: 4px 0 16px;
  font-size: 20px;
  color: #18232d;
}

.note-stream {
  display: grid;
  gap: 10px;
}

.note-line {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: rgba(248, 250, 252, .72);
  padding: 14px;
  cursor: default;
}

button.note-line { cursor: pointer; }
button.note-line:hover { border-color: #bfdbfe; background: #fff; }
.note-line h3 { margin: 0 0 4px; font-size: 16px; }
.note-line p { margin: 0; color: var(--muted); font-size: 13px; }
.empty-note { cursor: default; }
.note-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; color: var(--muted); font-size: 12px; }
.chip.ghost { background: #f8fafc; border: 1px solid #e2e8f0; color: #526273; }
.knowledge-path { margin-top: 14px; color: rgba(38, 55, 70, .62); font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; font-size: 12px; }

.project-item {
  padding: 13px 0;
  border-top: 1px solid #e2e8f0;
}

.project-item h3 { margin: 4px 0; font-size: 16px; }
.project-item p { margin: 0; color: var(--muted); font-size: 13px; }
.project-item em { display: block; margin-top: 6px; color: #64748b; font-style: normal; font-size: 12px; }
.project-status { color: #526273; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.section-open {
  margin-top: 14px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.bento-link { width: auto; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.bento-link:focus-visible { outline: 3px solid rgba(37, 99, 235, .14); outline-offset: 2px; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.archive-item {
  min-height: 70px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  padding: 12px;
}

.archive-item strong { display: block; color: var(--accent); font-size: 22px; line-height: 1.1; }
.archive-item span { color: var(--muted); font-size: 12px; }

.quant-bento h3 { margin: 0 0 8px; font-size: 18px; }
.quant-bento p, .about-bento p { color: var(--muted); margin: 0; font-size: 13px; }
.quant-flow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.quant-flow span { border: 1px solid #dbeafe; border-radius: 999px; padding: 4px 8px; color: #526273; font-size: 12px; background: #fff; }
.about-bento blockquote { margin: 18px 0 0; padding-left: 14px; border-left: 2px solid var(--teal); color: #263746; font-size: 15px; }

.graph-section,
.timeline-section {
  padding: 24px;
}

.graph-map {
  position: relative;
  min-height: 390px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(248, 250, 252, .68);
  overflow: hidden;
}

.graph-link {
  stroke: rgba(38, 55, 70, .2);
  stroke-width: .4;
  transition: opacity .18s, stroke .18s, stroke-width .18s;
}

.graph-link.dim { opacity: .12; }
.graph-link.active { stroke: rgba(37, 99, 235, .52); stroke-width: .75; }

.graph-node {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #263746;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 7px 11px;
  transition: opacity .18s, border-color .18s, box-shadow .18s, transform .18s;
}

.graph-node:hover,
.graph-node.active {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(37, 99, 235, .14);
}

.graph-node.dim { opacity: .28; }
.graph-note { color: var(--muted); margin: 12px 0 0; font-size: 13px; }

.timeline-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.timeline-item {
  position: relative;
  min-height: 112px;
  padding: 16px 16px 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--teal));
}

.timeline-item .time { color: var(--accent); font-size: 12px; font-weight: 700; }
.timeline-item strong { display: block; margin-top: 8px; color: #18232d; }
.timeline-item p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

@keyframes float-soft {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -6px; }
}

.home-shell { margin-bottom: 22px; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 38%);
  gap: 28px;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, .98) 0%, #f7fbff 58%, #eefbf7 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow-strong);
}

.home-copy h2 {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1.25;
}

.home-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
  font-size: 15px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.hero-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-stat {
  display: inline-flex;
  flex-direction: column;
  min-width: 92px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
}

.hero-stat strong { color: var(--accent); font-size: 18px; line-height: 1.1; }
.hero-stat em { color: var(--muted); font-style: normal; font-size: 12px; margin-top: 3px; }

.hero-visual {
  aspect-ratio: 13 / 9;
  min-height: 190px;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(15, 23, 42, .09));
}

.home-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.home-panel {
  appearance: none;
  text-align: left;
  font: inherit;
  color: var(--text);
  min-height: 132px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}

.home-panel:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  background: #fff;
  box-shadow: var(--shadow);
}

.home-panel:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}

.panel-num {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.home-panel h3 { margin: 8px 0 6px; font-size: 17px; }
.home-panel p { margin: 0; color: var(--muted); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  content-visibility: auto;
  contain-intrinsic-size: 210px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
}

.card-tone-1::before { background: linear-gradient(90deg, #0f766e, #22c55e); }
.card-tone-2::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.card-tone-3::before { background: linear-gradient(90deg, #7c3aed, #2563eb); }

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d3d7e3; }
.card-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.card-title { margin: 0; font-size: 16px; font-weight: 600; }
.card-snippet { color: var(--muted); font-size: 13px; margin: 0; min-height: 2.4em; overflow: hidden; }
.card-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }

.chip {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: 2px;
}

.badge.gold { background: #fef3c7; color: var(--warn); }

.empty-box { text-align: center; padding: 48px 16px; }
.empty-box.soft { background: rgba(255, 255, 255, .7); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-box h2 { font-size: 24px; margin: 0 0 12px; }
.empty { color: var(--muted); margin: 48px 0; text-align: center; }

.detail-head { margin: 16px 0 12px; }
.detail-head h2 { margin: 0 0 6px; font-size: 24px; }
.detail-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }

.md {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  line-height: 1.85;
  font-size: 15px;
  word-break: break-word;
  overflow-x: auto;
}

.md p { margin: 12px 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 26px 0 12px; line-height: 1.4; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3 { font-size: 17px; }
.md img { max-width: 100%; border-radius: 12px; box-shadow: var(--shadow); height: auto; }
.ql-editor img { max-width: 100%; }
.ql-editor img.ql-selected { outline: 1px dashed var(--accent); }
.md a { color: var(--accent); }
.md code {
  background: #f1f3f5;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
}
.md pre { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md ul, .md ol { padding-left: 26px; }
.md blockquote { border-left: 3px solid var(--accent); margin: 12px 0; padding: 4px 16px; color: var(--muted); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.md table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.md th, .md td { border: 1px solid var(--border); padding: 8px 12px; }
.md th { background: #f8fafc; }

.ops { margin: 16px 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ops.inline { margin: 0; gap: 6px; }

.editor {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  margin-top: 8px;
  position: relative;
}

.editor-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f3f5;
  color: var(--muted);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.editor-close:hover { background: var(--danger); color: #fff; }

.editor-title { margin: 0 0 18px; font-size: 20px; }
.editor label { display: block; margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.editor input, .editor .select { margin-top: 6px; color: var(--text); }
.editor .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.editor .check input { width: auto; margin: 0; }
.editor .check .select { width: auto; }

.editor-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.editor-row label { margin-bottom: 0; }

.editor-field { display: block; margin-bottom: 18px; font-size: 13px; color: var(--muted); }

.quill-wrap { margin-top: 6px; }
.quill-wrap .ql-toolbar { border-radius: 10px 10px 0 0; background: #f8fafc; }
.quill-wrap .ql-container { border-radius: 0 0 10px 10px; min-height: 320px; font-size: 15px; }
.quill-wrap .ql-editor { min-height: 320px; }

.attach-box { margin: 6px 0 18px; border: 1px dashed var(--border); border-radius: 10px; padding: 14px; }
.attach-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.attach-list { margin-bottom: 10px; }
.attach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fafbfc;
}

.attach-name { font-size: 14px; font-weight: 500; flex: 1; min-width: 120px; }
.attach-meta { color: var(--muted); font-size: 12px; }

.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-row input[type="file"] { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: #fff; }

.file-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 20px;
}

.file-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.file-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #eef1f5; }
.file-row:last-child { border-bottom: none; }
.file-name { color: var(--accent); text-decoration: none; font-size: 14px; }
.file-name:hover { text-decoration: underline; }
.file-size { color: var(--muted); font-size: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-val { font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.bars { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.bar-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.bar-label { font-size: 13px; margin-bottom: 8px; }
.bar-track { height: 10px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
.bar-fill.danger { background: var(--danger); }

.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.admin-quick-card {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  padding: 16px;
  color: var(--text);
  font: inherit;
  text-align: left;
}

button.admin-quick-card { cursor: pointer; }
button.admin-quick-card:hover { border-color: var(--accent); color: var(--accent); }
.admin-quick-card strong,
.admin-quick-card span { display: block; }
.admin-quick-card span { margin-top: 6px; color: var(--muted); font-size: 12px; }

.sec-title { margin: 8px 0 10px; font-size: 16px; }
.side-list { display: flex; flex-direction: column; gap: 6px; }
.side-item { display: block; padding: 8px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.side-item:hover { border-color: var(--accent); color: var(--accent); }

.rev-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rev-row span:nth-child(2) { flex: 1; font-weight: 500; }

.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { background: #f8fafc; font-size: 13px; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.table td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.up-panel,
.store-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.up-panel { border-color: var(--accent); }

.panel-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.panel-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.download-note { margin: 0 0 14px; }
.user-form-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.2fr) auto auto; gap: 10px; align-items: center; }
.owner-mark { display: inline-block; margin-left: 8px; padding: 1px 7px; border: 1px solid #99d9cf; border-radius: 999px; color: #0f766e; background: #eefaf8; font-size: 11px; }

.account-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px 14px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #cbdce7;
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
}
.account-identity strong { font-size: 19px; }
.account-identity p, .account-identity small { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.account-identity small { font-size: 12px; }
.identity-role { padding: 3px 9px; border-radius: 999px; font-size: 12px; border: 1px solid #bfdbfe; color: #2563eb; background: #eff6ff; }
.identity-role.admin { border-color: #99d9cf; color: #0f766e; background: #eefaf8; }
.account-panel { max-width: 720px; }
.account-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.account-form label { display: grid; gap: 5px; color: var(--muted); font-size: 13px; }
.account-form .btn { align-self: end; justify-self: start; }
.recovery-panel { border-left: 3px solid #d5a742; }
.recovery-create-form { display: flex; gap: 10px; max-width: 520px; }
.key-state { display: inline-block; padding: 5px 10px; border-radius: 7px; font-size: 12px; }
.key-state.ready { color: #0f766e; border: 1px solid #99d9cf; background: #eefaf8; }

.store-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.panel-info { font-size: 13px; color: var(--muted); }

.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 16px; }
.pager-info { font-size: 13px; color: var(--muted); }

.img-resize-handle {
  position: fixed;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
  z-index: 30;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
  transform: translate(-50%, -50%);
}

.vis-badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.vis-guest { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.vis-member { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.vis-admin { background: #fef3c7; color: var(--warn); border: 1px solid #fde68a; }
.vis-pub { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.vis-priv { background: #fef3c7; color: var(--warn); border: 1px solid #fde68a; }

.seg { display: inline-flex; background: #eef1f5; border-radius: 9px; padding: 3px; gap: 3px; }
.seg-btn {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s;
}
.seg-btn.active { background: var(--accent); color: #fff; }
.seg-btn:not(.active):hover { color: var(--accent); }
.vis-seg { flex: 1 1 320px; flex-wrap: wrap; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}

.modal.show { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .2);
}

.modal-box.wide { max-width: 760px; max-height: 85vh; overflow: auto; }
.modal-box h2 { margin: 0 0 14px; font-size: 18px; }
.modal-box label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.modal-box textarea { width: 100%; display: block; margin-top: 5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.modal-help { margin: -4px 0 16px; color: var(--muted); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.error { color: var(--danger); font-size: 13px; margin: 4px 0 0; }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .6);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Independent garden pages */
.section-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 65vh;
}

.page-intro {
  position: relative;
  padding: 38px 0 28px;
  border-bottom: 1px solid rgba(148, 163, 184, .34);
}

.page-intro .page-kicker,
.page-kicker {
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}

.page-intro h2 {
  max-width: 760px;
  margin: 8px 0 10px;
  color: #18232d;
  font-size: 36px;
  line-height: 1.2;
}

.page-intro p { max-width: 720px; margin: 0; color: #64748b; }
.page-intro > .btn { position: absolute; right: 0; bottom: 28px; }

.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-tab {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #dbe3ea;
  border-radius: 7px;
  background: rgba(255,255,255,.72);
  color: #526273;
  text-decoration: none;
  font-size: 13px;
}

.category-tab:hover,
.category-tab.active { border-color: #8ab4ae; color: #0f766e; background: #f0fdfa; }
.category-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.category-block {
  min-height: 210px;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 8px;
  background: rgba(255,255,255,.8);
  overflow: hidden;
}

.category-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  padding: 14px 17px;
  border-bottom: 1px solid #e5eaf0;
  background: rgba(248,250,252,.82);
}

.category-head > div { display: flex; align-items: center; gap: 10px; }
.category-head h3 { margin: 0; font-size: 17px; }
.category-index { color: #8aa0b3; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.category-count { color: #81909f; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.category-note-list { padding: 5px 15px 9px; }

.category-note {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(128px, auto) 18px;
  gap: 12px;
  align-items: center;
  padding: 13px 2px;
  border-bottom: 1px solid #edf0f3;
  color: #263746;
  text-decoration: none;
}

.category-note:last-child { border-bottom: 0; }
.category-note:hover strong, .category-note:hover i { color: var(--accent); }
.category-note-copy { min-width: 0; }
.category-note-copy strong, .category-note-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-note-copy strong { font-size: 14px; }
.category-note-copy small { margin-top: 3px; color: #7b8997; font-size: 12px; }
.category-note-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.category-note time { color: #8a98a5; font-size: 11px; }
.category-note i { color: #94a3b8; font-style: normal; }
.category-empty { margin: 28px 2px; color: #94a3b8; font-size: 13px; }

.project-page-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.project-page-card { position: relative; min-height: 230px; padding: 24px; border: 1px solid #dbe3ea; border-radius: 8px; background: rgba(255,255,255,.8); }
.project-page-card::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 52px; height: 1px; background: linear-gradient(90deg,#15968d,transparent); }
.project-page-card h3 { margin: 20px 0 8px; font-size: 21px; }
.project-page-card p { max-width: 430px; margin: 0; color: #64748b; }
.project-page-card small { position: absolute; left: 24px; bottom: 22px; color: #718096; }
.project-no { float: right; color: #b8c4cf; font: 12px ui-monospace,monospace; }

.resource-shelves { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.resource-shelf { min-height: 190px; padding: 20px; border: 1px solid #dbe3ea; border-radius: 8px; background: linear-gradient(145deg,rgba(255,255,255,.92),rgba(240,246,248,.75)); }
.resource-shelf h3 { margin: 28px 0 5px; font-size: 18px; }
.resource-shelf strong { display: block; color: #0f766e; font: 30px ui-monospace, SFMono-Regular, Consolas, monospace; }
.resource-shelf > span:last-child { color: #82909e; font-size: 11px; }
.shelf-code { color: #9aa8b5; font: 10px ui-monospace,monospace; }

.about-page { max-width: 920px; margin: 0 auto; }
.manifesto { display: grid; grid-template-columns: 1fr 80px 1fr 80px 1fr; align-items: center; padding: 60px 20px; }
.manifesto p { text-align: center; color: #263746; font: 18px ui-monospace,monospace; }
.manifesto i { height: 1px; background: linear-gradient(90deg,#94a3b8,#15968d); }
.about-page blockquote { margin: 0; padding: 34px; border-left: 2px solid #15968d; background: rgba(255,255,255,.7); color: #18232d; font-size: 24px; }

/* Quant research module */
.quant-shell { display: grid; grid-template-columns: 138px minmax(0,1fr) 220px; gap: 18px; align-items: start; color: #263746; }
.quant-side, .quant-info { position: sticky; top: 88px; }
.quant-side { display: flex; flex-direction: column; gap: 3px; padding-top: 14px; }
.quant-side-label { margin: 0 10px 13px; color: #83919e; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.quant-nav { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: #687785; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.quant-nav:hover, .quant-nav.active { color: #155f5b; background: rgba(214,237,234,.62); }
.quant-nav-icon { width: 11px; height: 11px; border: 1px solid currentColor; border-radius: 50%; opacity: .65; }
.quant-nav.active .quant-nav-icon { border-radius: 2px; background: currentColor; transform: scale(.55); }
.quant-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.quant-status { display: flex; justify-content: space-between; gap: 12px; color: #84919c; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.status-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #15968d; box-shadow: 0 0 0 3px rgba(21,150,141,.1); }

.quant-hero, .portfolio-state, .equity-panel, .risk-panel, .signal-panel, .quant-section, .quant-info {
  border: 1px solid rgba(203,213,225,.86);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
}

.quant-hero { overflow: hidden; }
.quant-hero-copy { padding: 30px 30px 8px; }
.quant-hero h2 { margin: 6px 0 5px; color: #18232d; font-size: 34px; letter-spacing: 0; }
.quant-hero p { margin: 0; color: #71808e; }
.noise-stages { display: flex; justify-content: space-between; max-width: 520px; margin-top: 22px; color: #748391; font: 10px ui-monospace,monospace; text-transform: uppercase; }
.noise-visual { height: 160px; padding: 0 20px 10px; }
.noise-visual svg { width: 100%; height: 100%; overflow: visible; }
.noise-guide { fill: none; stroke: #dce4e9; stroke-width: 1; stroke-dasharray: 3 6; }
.noise-path { fill: none; stroke: #15968d; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.quant-shell.ready .noise-path { animation: trace-line 2.2s ease-out forwards; }
@keyframes trace-line { to { stroke-dashoffset: 0; } }

.quant-overview { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(220px,.7fr); gap: 14px; scroll-margin-top: 90px; }
.portfolio-state { grid-column: 1 / -1; padding: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.metric-item { padding: 11px; border-left: 1px solid #e4e9ed; }
.metric-item:first-child { border-left: 0; }
.metric-item span, .metric-item strong, .metric-item small { display: block; }
.metric-item span { min-height: 28px; color: #7b8996; font-size: 10px; }
.metric-item strong { margin: 4px 0; color: #233542; font: 20px ui-monospace,SFMono-Regular,Consolas,monospace; }
.metric-item small { color: #39827c; font-size: 10px; }
.metric-item small.negative { color: #a55f57; }
.equity-panel, .risk-panel, .signal-panel, .quant-section { padding: 20px; scroll-margin-top: 90px; }
.chart-legend { display: flex; justify-content: flex-end; gap: 14px; color: #7d8b98; font-size: 10px; }
.chart-legend span::before { content: ""; display: inline-block; width: 14px; height: 2px; margin-right: 5px; vertical-align: 3px; background: #15968d; }
.chart-legend .benchmark-key::before { background: #b7c2cc; }
.equity-chart { display: block; width: 100%; min-height: 230px; }
.chart-grid path { fill: none; stroke: #e8edf0; stroke-width: 1; }
.drawdown-area { fill: rgba(166,89,77,.11); }
.benchmark-line { fill: none; stroke: #b6c1ca; stroke-width: 1.5; stroke-dasharray: 5 6; }
.equity-fill { fill: url(#equityFill); }
.equity-line { fill: none; stroke: #15968d; stroke-width: 2.2; }
.risk-panel { background: rgba(249,250,251,.9); }
.risk-row { display: grid; grid-template-columns: 82px minmax(40px,1fr) 44px; gap: 8px; align-items: center; margin: 13px 0; font-size: 10px; }
.risk-row > span { color: #748290; }
.risk-row > strong { color: #536370; font: 10px ui-monospace,monospace; text-align: right; }
.risk-track { height: 4px; overflow: hidden; background: #e3e8ec; }
.risk-fill { display: block; height: 100%; background: #8c6d73; }

.signal-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; }
.signal-node { min-height: 94px; display: flex; flex-direction: column; justify-content: center; padding: 12px; border: 1px solid #e0e7eb; background: #f9fbfc; text-align: center; }
.signal-node > span { color: #5f7e8a; font: 18px ui-monospace,monospace; }
.signal-node > strong { margin-top: 9px; color: #667683; font-size: 10px; }
.signal-node.decision { border-color: #9fcac5; background: #f1faf8; }
.flow-arrow { color: #9cabb7; font-style: normal; }
.strategy-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.strategy-card { padding: 14px; border: 1px solid #e0e6ea; border-radius: 6px; background: #fbfcfd; }
.strategy-top { display: flex; flex-direction: column; }
.strategy-top h3 { margin: 5px 0 0; font-size: 15px; }
.strategy-status { color: #66817f; font: 9px ui-monospace,monospace; letter-spacing: .08em; text-transform: uppercase; }
.strategy-fingerprint { display: block; width: 100%; height: 58px; margin: 8px 0; }
.strategy-fingerprint path { fill: none; stroke: rgba(21,150,141,.56); stroke-width: 1.3; }
.strategy-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; border-top: 1px solid #e7ecef; padding-top: 9px; }
.strategy-stats small, .strategy-stats strong { display: block; }
.strategy-stats small { color: #8a97a2; font-size: 8px; }
.strategy-stats strong { margin-top: 2px; color: #465763; font: 10px ui-monospace,monospace; }
.test-periods { display: flex; gap: 3px; }
.test-period { flex-grow: 1; padding: 13px; background: #edf3f5; border-bottom: 2px solid #829ba5; }
.test-period:nth-child(2) { background: #edf6f5; border-color: #5e9c95; }
.test-period:nth-child(3) { background: #f8f5ef; border-color: #b49464; }
.test-period strong, .test-period span { display: block; }
.test-period strong { font-size: 11px; }
.test-period span { margin-top: 3px; color: #80909c; font: 9px ui-monospace,monospace; }
.backtest-minis { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 10px; }
.backtest-mini { padding: 11px; border: 1px solid #e4e9ed; }
.backtest-mini span, .backtest-mini strong, .backtest-mini small { display: block; }
.backtest-mini span { min-height: 30px; color: #7a8995; font-size: 9px; }
.backtest-mini strong { font: 16px ui-monospace,monospace; }
.backtest-mini small { margin-top: 3px; color: #83928d; font-size: 9px; }
.factor-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(180px,.6fr); gap: 16px; }
.factor-table { display: flex; flex-direction: column; gap: 2px; }
.factor-row { display: grid; grid-template-columns: 1.4fr repeat(5,1fr); gap: 5px; padding: 9px; background: #f7f9fa; font: 10px ui-monospace,monospace; }
.factor-row strong { font-family: inherit; }
.factor-row span { color: #6f7e8a; text-align: right; }
.factor-matrix h3 { margin: 0 0 8px; color: #687784; font-size: 11px; }
.matrix-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 3px; }
.matrix-cell { display: grid; place-items: center; aspect-ratio: 1; background: rgba(57,117,142,var(--matrix)); color: #fff; font: 9px ui-monospace,monospace; cursor: help; }
.matrix-cell.negative { background: rgba(142,105,91,var(--matrix)); }
.quant-info { padding: 18px; }
.research-row { padding: 11px 0; border-top: 1px solid #e5eaed; }
.research-row span, .research-row strong { display: block; }
.research-row span { color: #8a97a2; font: 9px ui-monospace,monospace; text-transform: uppercase; }
.research-row strong { margin-top: 4px; color: #52636f; font-size: 11px; font-weight: 500; }
.quant-knowledge-chain { margin-top: 18px; padding: 13px; border-left: 2px solid #15968d; background: #f1f7f7; }
.quant-knowledge-chain small { color: #78908f; font: 8px ui-monospace,monospace; }
.quant-knowledge-chain p { margin: 7px 0 0; color: #526872; font-size: 10px; line-height: 1.8; }

.toast-item {
  background: #111827;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  max-width: 90vw;
}

.toast-item.show { opacity: 1; transform: translateY(0); }
.toast-item.error { background: var(--danger); }

@media (max-width: 720px) {
  .topbar .bar { gap: 10px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .nav-link { flex: 0 0 auto; }
  .search { order: 2; min-width: 100%; }
  .actions { margin-left: auto; flex-wrap: wrap; }
  .identity-btn { max-width: 160px; }
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; }
  .md, .editor { padding: 20px; }
  .garden-hero { grid-template-columns: 1fr; min-height: auto; padding: 24px; }
  .garden-hero .home-copy h2 { font-size: 36px; }
  .network-field { min-height: 250px; }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-card, .bento-card.span-2 { grid-column: span 1; }
  .graph-map { min-height: 330px; }
  .timeline-list { grid-template-columns: 1fr; }
  .home-hero { grid-template-columns: 1fr; padding: 24px; }
  .home-copy h2 { font-size: 26px; }
  .hero-visual { min-height: 150px; }
  .home-panels { grid-template-columns: 1fr; }
  .page-intro { padding: 28px 0 20px; }
  .page-intro h2 { font-size: 28px; }
  .page-intro > .btn { position: static; margin-top: 18px; }
  .category-blocks, .project-page-grid, .resource-shelves { grid-template-columns: 1fr; }
  .category-note { grid-template-columns: minmax(0,1fr) 18px; }
  .category-note-meta { grid-column: 1 / -1; justify-content: flex-start; }
  .category-note time { display: none; }
  .admin-quick-grid, .user-form-row { grid-template-columns: 1fr; }
  .account-form { grid-template-columns: 1fr; }
  .recovery-create-form { flex-direction: column; }
  .table { display: block; overflow-x: auto; }
  .manifesto { grid-template-columns: 1fr; gap: 12px; padding: 28px 0; }
  .manifesto i { width: 1px; height: 34px; margin: 0 auto; background: linear-gradient(#94a3b8,#15968d); }
  .about-page blockquote { padding: 24px; font-size: 20px; }
  .quant-shell { display: block; }
  .quant-side { position: sticky; top: 120px; z-index: 3; flex-direction: row; overflow-x: auto; margin: 0 -20px 12px; padding: 8px 20px; background: rgba(245,248,249,.94); backdrop-filter: blur(10px); }
  .quant-side-label { display: none; }
  .quant-nav { width: auto; flex: 0 0 auto; }
  .quant-info { position: static; margin-top: 14px; }
  .quant-status { flex-direction: column; }
  .quant-hero-copy { padding: 24px 20px 6px; }
  .quant-hero h2 { font-size: 29px; }
  .noise-visual { height: 130px; padding: 0 8px; }
  .quant-overview { grid-template-columns: 1fr; }
  .portfolio-state { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-item { border-left: 0; border-top: 1px solid #e4e9ed; }
  .metric-item:first-child { grid-column: 1 / -1; }
  .signal-flow { display: flex; flex-direction: column; }
  .signal-node { width: 100%; min-height: 72px; }
  .flow-arrow { transform: rotate(90deg); }
  .strategy-grid, .factor-layout { grid-template-columns: 1fr; }
  .test-periods { flex-direction: column; }
  .backtest-minis { grid-template-columns: repeat(2,1fr); }
}

@media (min-width: 721px) and (max-width: 1040px) {
  .garden-hero { grid-template-columns: 1fr; }
  .bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-card, .bento-card.span-2 { grid-column: span 1; }
  .timeline-list { grid-template-columns: 1fr; }
  .quant-shell { grid-template-columns: 120px minmax(0,1fr); }
  .quant-info { position: static; grid-column: 2; }
  .metric-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .quant-overview { grid-template-columns: 1fr; }
  .portfolio-state { grid-column: auto; }
  .signal-flow { grid-template-columns: 1fr auto 1fr auto 1fr; }
  .signal-flow .probability, .signal-flow .decision { margin-top: 8px; }
  .resource-shelves { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Reading, search and writing share the site's blue / teal palette. */
.menu-toggle { display: none; }
.hero-phrase { display: inline-block; white-space: nowrap; }
.garden-hero { min-height: 300px; }
.garden-hero .home-copy h2 { max-width: 620px; font-size: clamp(30px, 3.5vw, 48px); }
.list-filters, .pagination, .category-manage-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.list-filters input { max-width: 220px; }
.note-results .category-block { width: 100%; }
.note-labels { display: block; margin-top: 8px; color: var(--teal); font-size: 12px; }
.pagination { justify-content: center; margin-top: 24px; }
mark { background: #d4f2e9; color: #115e59; padding: 0 2px; border-radius: 3px; }
.md { font-size: 17px; line-height: 1.85; max-width: 850px; margin-inline: auto; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { scroll-margin-top: 140px; }
.md li[data-list="bullet"] { list-style-type: disc; }
.md .ql-ui { display: none; }
.md .ql-code-block-container { white-space: pre-wrap; background: #f3f6f9; font: 14px/1.7 ui-monospace, monospace; padding: 18px; border-radius: 8px; }
.code-copy { display: block; margin: 0 0 8px auto; }
.article-toc, .related-notes { border: 1px solid var(--border); background: #fff; border-radius: var(--radius); padding: 16px 24px; margin: 20px 0; }
.article-toc a, .related-notes a { display: block; color: var(--teal); padding: 5px 0; }
.article-toc summary { cursor: pointer; font-weight: 600; }
.save-state { color: var(--teal); font-size: 14px; }
.editor-row { flex-wrap: wrap; }
.editor input, .editor select { max-width: 100%; }
.category-manage-row input { flex: 1; min-width: 160px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 720px) {
  .topbar .bar { gap: 6px; padding-top: 8px; padding-bottom: 8px; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .topbar .main-nav, .topbar .actions { display: none; }
  .topbar.menu-open .main-nav, .topbar.menu-open .actions { display: flex; }
  .topbar .search { order: 2; min-width: 100%; }
  .topbar .actions { order: 4; margin: 0; }
  .topbar .main-nav { order: 3; }
  .garden-hero { padding: 22px; }
  .garden-hero .network-field { display: none; }
  .garden-page .project-bento, .garden-page .resources-bento, .garden-page .graph-section, .garden-page .timeline-section { display: none; }
  .page-intro { padding-top: 14px; }
  .md { padding: 18px; font-size: 16px; }
  .editor { padding: 16px; }
  .editor-row { display: flex; flex-direction: column; align-items: stretch; }
  .list-filters { gap: 8px; }
  .list-filters input { max-width: 100%; }
  .category-manage-row { padding: 14px; background: white; border-radius: 10px; }
}
