:root {
  color-scheme: dark;
  --bg: #111516;
  --panel: #191e20;
  --surface: #202628;
  --line: #30383a;
  --text: #e7eae5;
  --muted: #a1abaa;
  --accent: #b2d0b3;
  --up: #f08989;
  --down: #78c4a2;
  --radius: 12px;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  font-weight: 500;
  transition: background 0.18s ease;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
input,
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid #465052;
  border-radius: 7px;
  padding: 11px 13px;
  color: var(--text);
  outline: none;
  caret-color: var(--accent);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #b2d0b31a;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
textarea {
  resize: vertical;
  min-height: 76px;
}
label {
  display: block;
  color: #c7ceca;
  font-size: 13px;
  margin: 16px 0 7px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 15px;
  font-weight: 550;
}
svg {
  display: block;
}
::selection {
  background: #b2d0b3;
  color: #14221a;
}
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-thumb {
  background: #465052;
  border-radius: 9px;
}
[hidden] {
  display: none !important;
}
.muted,
.fine {
  color: var(--muted);
}
.fine {
  font-size: 12px;
}
.up {
  color: var(--up) !important;
}
.down {
  color: var(--down) !important;
}
.num {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}
.primary,
.quiet,
.danger {
  padding: 9px 15px;
  white-space: nowrap;
  min-height: 40px;
}
.primary {
  background: var(--accent);
  color: #14221a;
}
.primary:hover {
  background: #c3dec4;
}
.quiet {
  background: var(--surface);
}
.quiet:hover {
  background: #303b3c;
}
.danger {
  background: #603839;
  color: #ffe0df;
}
.text-button {
  background: none;
  color: var(--muted);
  padding: 5px 0;
  font-size: 12px;
}
.text-button:hover {
  color: var(--accent);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.brand img {
  width: 34px;
  height: 34px;
}
.brand span {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-left: 1px;
}
.sidebar .brand span {
  display: none;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 206px;
  padding: 32px 22px;
  background: #151a1b;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.sidebar nav {
  display: grid;
  gap: 9px;
  margin-top: 60px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 12px 15px;
  min-height: 46px;
}
.nav-item svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.nav-item:hover {
  color: var(--text);
  background: var(--surface);
}
.nav-item.active {
  background: #26342c;
  color: #c2dbc5;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 10px 0;
  color: var(--muted);
  font-size: 12px;
}
.sidebar-bottom button {
  display: block;
  margin-top: 7px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 6px;
}
.workspace {
  margin-left: 206px;
}
.topbar {
  min-height: 83px;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
}
.top-divider {
  color: #52605e;
  margin: 0 14px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 36px 40px 48px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 28px;
}
.page-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}
.date-label {
  color: var(--muted);
  font-size: 12px;
}
.observation-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.observation-head {
  padding: 26px 28px 21px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.asset-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.asset-title h2 {
  font-size: 20px;
}
.tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid #46524d;
  border-radius: 4px;
  color: #becac1;
  font-size: 11px;
  white-space: nowrap;
}
.asset-code {
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 13px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}
.metrics {
  display: grid;
  grid-template-columns: 1.3fr 1.15fr 1fr 1fr;
  padding: 4px 28px 25px;
  gap: 22px;
}
.metric-label {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-bottom: 7px;
}
.metric-value {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 500;
}
.metric-value.large {
  font-size: 35px;
}
.metric-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.chart-wrap {
  border-top: 1px solid var(--line);
  padding: 20px 20px 10px;
}
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 8px;
}
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.legend span:before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 7px;
}
.legend span:last-child:before {
  background: #9ea9cf;
}
.ranges {
  display: flex;
  background: var(--bg);
  padding: 3px;
  border-radius: 6px;
  gap: 1px;
}
.ranges button {
  padding: 4px 9px;
  font-size: 11px;
  background: transparent;
  color: var(--muted);
  min-height: 29px;
}
.ranges button.selected {
  background: #303b36;
  color: #d6e7d7;
}
.chart {
  height: 274px;
  width: 100%;
  margin-top: 10px;
}
.chart-note {
  padding: 0 8px 7px;
  font-size: 11px;
  color: var(--muted);
}
.section {
  margin-top: 30px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  gap: 12px;
}
.section-head h2 {
  font-size: 18px;
}
.section-head .fine {
  margin-left: 10px;
}
.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  text-align: right;
  font-size: 13px;
}
th {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  padding: 12px 18px;
  background: #181e1f;
}
td {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}
th:first-child,
td:first-child {
  text-align: left;
}
td .name-button {
  padding: 0;
  background: none;
  font-size: 13px;
  text-align: left;
}
.name-button:hover {
  color: var(--accent);
}
td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
td .quiet,
td .text-button {
  font-size: 12px;
}
.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}
.market-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.market-item {
  padding: 18px 21px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  border-radius: 0;
  min-width: 0;
}
.market-item:hover {
  background: #21282a;
}
.market-item:nth-child(3n) {
  border-right: 0;
}
.market-item:nth-last-child(-n + 3) {
  border-bottom: 0;
}
.market-top,
.market-price {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.market-top {
  font-size: 12px;
  color: #c0c9c5;
}
.market-price {
  margin-top: 11px;
}
.market-price strong {
  font-size: 23px;
  font-weight: 500;
}
.market-item .fine {
  font-size: 10px;
  margin-top: 8px;
  display: block;
  white-space: normal;
}
.market-price > span {
  font-size: 12px;
}
.breadth {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 16px 21px;
  margin-top: 12px;
  background: #191f20;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}
.breadth strong {
  color: var(--text);
  font-size: 14px;
  margin-left: 8px;
  font-weight: 500;
}
.notice {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 7px;
  background: #2c2920;
  color: #d3c5a1;
  font-size: 12px;
}
.error-notice {
  background: #352626;
  color: #efb9b9;
}
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty p {
  margin-bottom: 16px;
}
.position-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 10px 0 26px;
  padding: 24px;
  background: var(--panel);
  border-radius: var(--radius);
}
.position-totals .metric-value {
  font-size: 24px;
}
footer {
  border-top: 1px solid var(--line);
  margin: 0 40px;
  padding: 20px 0 25px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #46524e;
  border-radius: 14px;
  padding: 25px;
  width: calc(100% - 30px);
  box-shadow: 0 20px 70px #0008;
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #080c0dbd;
}
.search-dialog {
  max-width: 600px;
}
.editor-dialog {
  max-width: 490px;
}
.detail-dialog {
  max-width: 1000px;
  padding: 28px;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 13px;
}
.close {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 27px;
  line-height: 34px;
  width: 36px;
  flex-shrink: 0;
}
.close:hover {
  color: var(--text);
  background: var(--surface);
}
.search-row {
  display: flex;
  gap: 10px;
}
.search-results {
  margin-top: 20px;
  font-size: 13px;
}
.search-result {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.search-result .meta {
  margin-top: 2px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}
.form-error {
  color: var(--up);
  font-size: 12px;
  min-height: 19px;
  margin-top: 10px;
}
.editor-dialog .fine {
  margin-top: 12px;
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin: 22px 0;
}
.detail-stats .metric-value {
  font-size: 21px;
}
.action-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.action-item .meta {
  margin-top: 3px;
}
.status-list {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0;
}
.status-list span {
  max-width: 100%;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: #c8dec9;
  color: #14221a;
  border-radius: 8px;
  padding: 12px 20px;
  box-shadow: 0 8px 28px #0005;
  font-size: 13px;
  max-width: calc(100% - 30px);
}
#login {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8vw;
  padding: 50px;
}
.login-form {
  width: 360px;
  max-width: 100%;
}
.login-form .brand {
  margin-bottom: 45px;
}
.login-form h1 {
  font-size: 38px;
  line-height: 1.45;
  margin-bottom: 18px;
  font-weight: 550;
}
.login-form > .muted {
  font-size: 13px;
  margin-bottom: 32px;
}
.login-form .primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  padding: 12px 16px;
}
.login-form .fine {
  font-size: 11px;
  margin-top: 16px;
}
.login-art {
  width: 400px;
  max-width: 40vw;
}
.login-art svg {
  width: 100%;
  fill: var(--accent);
}
.art-grid {
  stroke: #2a3431;
  fill: none;
  stroke-width: 1;
}
.art-line {
  fill: none;
  stroke: #a4c6a9;
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.art-mark {
  stroke: #68826d;
  stroke-width: 1;
  stroke-dasharray: 5 7;
}
.initial-error {
  margin: 60px auto;
  max-width: 500px;
  padding: 25px;
  color: var(--up);
}
@media (min-width: 1600px) {
  main {
    padding-top: 44px;
  }
  .chart {
    height: 310px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 176px;
    padding: 28px 16px;
  }
  .workspace {
    margin-left: 176px;
  }
  .topbar {
    padding: 16px 25px;
  }
  main {
    padding: 28px 25px 40px;
  }
  .topbar .muted,
  .top-divider {
    display: none;
  }
  .metrics {
    grid-template-columns: 1.2fr 1.1fr 1fr;
    gap: 18px;
  }
  .metrics .metric:last-child {
    display: none;
  }
  .metric-value {
    font-size: 26px;
  }
  .metric-value.large {
    font-size: 32px;
  }
  .top-actions .fine {
    display: none;
  }
  footer {
    margin: 0 25px;
  }
  .market-item {
    padding: 16px;
  }
  .market-price strong {
    font-size: 21px;
  }
  .position-totals {
    gap: 16px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    inset: auto 0 0;
    width: 100%;
    height: 70px;
    padding: 0 8px calc(env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    background: #171e1ff5;
  }
  .sidebar > .brand,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin: 0;
  }
  .nav-item {
    flex-direction: column;
    gap: 3px;
    padding: 9px 3px 6px;
    align-items: center;
    text-align: center;
    font-size: 10px;
    border-radius: 0;
    background: none !important;
    min-height: 60px;
  }
  .nav-item svg {
    width: 21px;
    height: 21px;
  }
  .workspace {
    margin: 0;
    padding-bottom: 70px;
  }
  .topbar {
    min-height: 67px;
    padding: 13px 18px;
    gap: 10px;
  }
  .topbar > div:first-child {
    font-size: 15px;
    font-weight: 550;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions button {
    font-size: 11px;
    padding: 7px 10px;
    min-height: 34px;
  }
  main {
    padding: 24px 16px 30px;
  }
  h1 {
    font-size: 24px;
  }
  .page-heading {
    margin-bottom: 21px;
    align-items: flex-start;
  }
  .page-heading p {
    font-size: 11px;
  }
  .page-heading .date-label {
    display: none;
  }
  .observation-head {
    padding: 20px 18px 17px;
    gap: 12px;
  }
  .asset-title {
    gap: 7px;
  }
  .asset-title h2 {
    font-size: 17px;
  }
  .asset-code {
    font-size: 12px;
  }
  .meta {
    font-size: 10px;
    gap: 3px 12px;
  }
  .observation-head > .quiet {
    font-size: 10px;
    min-height: 32px;
    padding: 6px 9px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    padding: 5px 18px 20px;
    gap: 24px 14px;
  }
  .metrics .metric:last-child {
    display: block;
  }
  .metric-value,
  .metric-value.large {
    font-size: 27px;
  }
  .metric-label {
    font-size: 11px;
  }
  .metric-sub {
    font-size: 10px;
    margin-top: 5px;
  }
  .chart-wrap {
    padding: 14px 7px 7px;
  }
  .chart-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }
  .chart {
    height: 235px;
    margin-top: 3px;
  }
  .chart-note {
    font-size: 10px;
  }
  .section {
    margin-top: 26px;
  }
  .section-head h2 {
    font-size: 16px;
  }
  .market-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .market-item {
    padding: 14px 15px;
  }
  .market-item:nth-child(3n) {
    border-right: 1px solid var(--line);
  }
  .market-item:nth-child(2n) {
    border-right: 0;
  }
  .market-item:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
  .market-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .market-price strong {
    font-size: 22px;
  }
  .market-price {
    gap: 5px;
    flex-wrap: wrap;
  }
  .market-price > span {
    font-size: 11px;
  }
  .market-top {
    font-size: 11px;
  }
  .market-top .tag {
    font-size: 9px;
    padding: 0 4px;
  }
  .breadth {
    gap: 9px 19px;
    padding: 12px 15px;
    font-size: 11px;
  }
  .breadth strong {
    font-size: 12px;
  }
  .table-wrap th,
  .table-wrap td {
    padding: 12px 14px;
  }
  .desktop-only {
    display: none !important;
  }
  .position-totals {
    grid-template-columns: 1fr 1fr;
    gap: 23px 16px;
    padding: 20px;
  }
  .position-totals .metric-value {
    font-size: 23px;
  }
  footer {
    margin: 0 16px;
    font-size: 10px;
    flex-direction: column;
    gap: 5px;
  }
  .detail-dialog {
    padding: 18px;
    max-height: 94dvh;
  }
  .detail-stats {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .detail-stats .metric-value {
    font-size: 22px;
  }
  .action-item {
    align-items: flex-start;
    gap: 12px;
  }
  .action-item > .inline-actions {
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-end;
  }
  .detail-dialog .section-head {
    flex-wrap: wrap;
  }
  .detail-dialog .inline-actions .quiet {
    font-size: 11px;
    padding: 7px 10px;
    min-height: 34px;
  }
  .search-dialog,
  .editor-dialog {
    padding: 20px;
  }
  .login-art {
    display: none;
  }
  #login {
    padding: 32px 25px;
  }
  .login-form h1 {
    font-size: 35px;
  }
  .login-form .brand {
    margin-bottom: 50px;
  }
  .login-form > .muted {
    margin-bottom: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
