:root {
  --bg: #11130f;
  --panel: #1a1d17;
  --panel-2: #22261f;
  --text: #f4f5ef;
  --muted: #aeb4a8;
  --line: #343a30;
  --red: #ff6159;
  --green: #25c487;
  --amber: #f2bd4b;
  --cyan: #4cc9d8;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  color: inherit;
  font: inherit;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 24px;
}

.topbar,
.section-head,
.watch-top,
.metric-row,
.flow-row,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.eyebrow,
.section-label,
.group {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 18px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
}

button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--text);
  color: #151713;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.summary-band {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 148px;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(76, 201, 216, 0.13), rgba(242, 189, 75, 0.06)), var(--panel);
  box-shadow: var(--shadow);
}

.advice-panel,
.audit-panel {
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(26, 29, 23, 0.94);
}

.advice-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) 1.3fr;
  gap: 18px;
  align-items: start;
}

.advice-panel h2 {
  margin-bottom: 10px;
  font-size: 38px;
}

.advice-panel p,
.audit-grid p {
  color: var(--muted);
  line-height: 1.5;
}

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

.advice-lists div,
.audit-grid div {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.advice-lists span,
.audit-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.advice-lists p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.advice-lists b,
.advice-lists small {
  font-variant-numeric: tabular-nums;
}

.advice-lists em {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.audit-grid {
  margin-top: 12px;
}

.audit-grid strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.summary-band h2 {
  margin-bottom: 8px;
  font-size: 48px;
  line-height: 1;
}

.summary-band p:last-child {
  max-width: 760px;
  color: var(--muted);
}

.rule-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.rule-strip span,
.signal {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
}

section {
  margin-bottom: 30px;
}

.section-head {
  margin-bottom: 12px;
}

.section-head.compact {
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.index-card,
.watch-card,
.flow-list,
.holdings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(26, 29, 23, 0.94);
}

.holdings-panel {
  padding: 18px;
}

.holding-form {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(120px, 0.8fr) minmax(130px, 0.8fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
}

.holding-form input,
.holding-form select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
}

.holding-summary {
  display: grid;
  grid-template-columns: minmax(160px, 0.6fr) 1fr;
  gap: 10px;
  margin: 14px 0;
}

.holding-summary div {
  min-height: 70px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.holding-summary span,
.holding-main span,
.holding-signal p {
  color: var(--muted);
  font-size: 13px;
}

.holding-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.holding-list {
  display: grid;
  gap: 10px;
}

.holding-list.empty {
  min-height: 70px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.holding-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.holding-main strong {
  display: block;
  margin-bottom: 7px;
}

.holding-main div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.holding-main span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.holding-signal p {
  margin-top: 8px;
  line-height: 1.45;
}

.ghost-button {
  min-height: 36px;
  background: transparent;
  color: var(--muted);
}

.index-card {
  min-height: 110px;
  padding: 18px;
}

.index-card span,
.metric-row span,
.flow-row span,
footer {
  color: var(--muted);
  font-size: 13px;
}

.index-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.index-card em,
.flow-row em {
  font-style: normal;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

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

.focus-grid.empty {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.watch-card {
  min-height: 214px;
  padding: 18px;
}

.watch-card.favorite {
  border-color: rgba(242, 189, 75, 0.72);
  box-shadow: inset 0 0 0 1px rgba(242, 189, 75, 0.18);
}

.watch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.star-button {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.star-button.active {
  border-color: var(--amber);
  background: rgba(242, 189, 75, 0.16);
  color: var(--amber);
}

.metric-row {
  margin: 18px 0 14px;
}

.metric-row div {
  min-width: 0;
}

.metric-row strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #30352c;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.watch-card.inflow {
  color: var(--red);
}

.watch-card.outflow {
  color: var(--green);
}

.watch-card p {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.signal-add {
  color: #151713;
  background: var(--red);
  border-color: var(--red);
}

.signal-watch {
  color: #151713;
  background: var(--amber);
  border-color: var(--amber);
}

.signal-wait,
.signal-avoid {
  color: var(--amber);
}

.signal-reduce {
  color: #151713;
  background: var(--green);
  border-color: var(--green);
}

.signal-neutral {
  color: var(--muted);
}

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

.flow-list {
  overflow: hidden;
}

.flow-row {
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.flow-row:last-child {
  border-bottom: 0;
}

.flow-row strong {
  display: block;
  margin-bottom: 4px;
}

.red,
.up em {
  color: var(--red);
}

.green,
.down em {
  color: var(--green);
}

footer {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.skeleton-grid {
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .summary-band,
  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .index-grid,
  .watch-grid,
  .flow-columns,
  .holding-form,
  .holding-summary,
  .holding-row,
  .advice-panel,
  .advice-lists,
  .audit-grid {
    grid-template-columns: 1fr;
  }

  .summary-band h2 {
    font-size: 38px;
  }
}
