:root {
  --paper: #f5f2ea;
  --paper-2: #ece7dc;
  --card: #fbf9f4;
  --card-soft: #f8f5ee;
  --ink: #232a26;
  --ink-soft: #49514a;
  --muted: #7d8178;
  --line: #ded8cb;
  --line-soft: #e9e4d8;
  --pine: #2f5d50;
  --pine-deep: #23463c;
  --pine-soft: #e5ede9;
  --brass: #a9812f;
  --brass-soft: #f3ead6;
  --up: #b44338;
  --up-soft: #f7e8e5;
  --down: #2e7a58;
  --down-soft: #e5f1eb;
  --shadow: 0 10px 34px rgba(66, 53, 34, 0.06);
  --shadow-lift: 0 18px 42px rgba(47, 93, 80, 0.12);
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", "Iowan Old Style", Georgia, serif;
  --number: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(47, 93, 80, 0.055) 0.7px, transparent 0.7px);
  background-size: 16px 16px;
  opacity: 0.55;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

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

::selection {
  background: rgba(47, 93, 80, 0.18);
}

:focus-visible {
  outline: 2px solid rgba(169, 129, 47, 0.7);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(125, 129, 120, 0.28);
  border-radius: 99px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 登录 ---------- */

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
  overflow: hidden;
}

.login-deco {
  position: absolute;
  width: min(820px, 92vw);
  aspect-ratio: 1;
  border: 1px solid rgba(47, 93, 80, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.login-deco::before,
.login-deco::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(169, 129, 47, 0.13);
  border-radius: 50%;
}

.login-deco::before {
  inset: 12%;
}

.login-deco::after {
  inset: 27%;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(404px, 100%);
  padding: 38px 34px 28px;
  background: rgba(251, 249, 244, 0.9);
  border: 1px solid rgba(222, 216, 203, 0.9);
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(66, 53, 34, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(145deg, var(--pine), var(--pine-deep));
  color: #f7f3e9;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(47, 93, 80, 0.25);
}

.brand-mark.large {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  font-size: 26px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brass);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.login-card h1 {
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.login-sub {
  margin: 9px 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.login-card .field {
  margin-bottom: 14px;
}

.login-btn {
  width: 100%;
  height: 44px;
  margin-top: 2px;
}

.login-card .form-error {
  min-height: 20px;
  margin-top: 8px;
}

.login-foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

/* ---------- 应用框架 ---------- */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 27px 18px 20px;
  border-right: 1px solid var(--line);
  background: rgba(251, 249, 244, 0.55);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  margin-bottom: 38px;
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  background: rgba(47, 93, 80, 0.06);
  color: var(--ink);
}

.nav-item.active {
  background: var(--pine);
  color: #f7f3e9;
  box-shadow: 0 7px 18px rgba(47, 93, 80, 0.18);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  right: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(247, 243, 233, 0.6);
}

.side-foot {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid var(--line);
}

.side-status {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.side-status strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.side-logout {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.side-logout:hover {
  color: var(--up);
}

.side-logout .icon {
  width: 14px;
  height: 14px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 79px;
  padding: 0 38px;
  background: rgba(245, 242, 234, 0.84);
  border-bottom: 1px solid rgba(222, 216, 203, 0.35);
  backdrop-filter: blur(14px);
}

.top-page {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.top-date {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

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

.market-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(251, 249, 244, 0.7);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--down);
  box-shadow: 0 0 0 3px rgba(46, 122, 88, 0.1);
}

.dot.warn {
  background: var(--brass);
  box-shadow: 0 0 0 3px rgba(169, 129, 47, 0.12);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(251, 249, 244, 0.75);
  color: var(--muted);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.icon-btn:hover {
  color: var(--pine);
  border-color: rgba(47, 93, 80, 0.32);
  background: var(--card);
}

.icon-btn .icon {
  width: 16px;
  height: 16px;
}

.icon-btn.spinning .icon,
.spinning .icon {
  animation: spin 0.9s linear infinite;
}

.view {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 38px 64px;
}

/* ---------- 页面头部与基础组件 ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 22px;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.015em;
}

.page-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 37px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 93, 80, 0.32);
  color: var(--pine);
}

.btn.primary {
  border-color: var(--pine);
  background: var(--pine);
  color: #f8f5ee;
  box-shadow: 0 7px 17px rgba(47, 93, 80, 0.18);
}

.btn.primary:hover {
  background: var(--pine-deep);
  color: #fffdf7;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: var(--up);
  border-color: rgba(180, 67, 56, 0.28);
}

.btn.danger:hover {
  color: #99362c;
  border-color: rgba(180, 67, 56, 0.5);
  background: var(--up-soft);
}

.btn.sm {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.btn.sm .icon {
  width: 13px;
  height: 13px;
}

.btn:disabled {
  opacity: 0.55;
  transform: none;
}

.card {
  position: relative;
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card.flush {
  padding: 0;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.card-link:hover {
  color: var(--pine);
}

.card-link .icon {
  width: 13px;
  height: 13px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr);
  gap: 17px;
  margin-bottom: 17px;
}

.grid-2.even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

.up {
  color: var(--up) !important;
}

.down {
  color: var(--down) !important;
}

.flat {
  color: var(--muted) !important;
}

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

.num {
  font-variant-numeric: tabular-nums lining-nums;
}

.money {
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- 总览 Hero ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.76fr);
  gap: 17px;
  margin-bottom: 17px;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 258px;
  padding: 27px 30px 23px;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(148deg, #345f53 0%, #2f5d50 42%, #24483e 100%);
  color: #f6f2e8;
  box-shadow: 0 20px 48px rgba(47, 93, 80, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -120px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(246, 242, 232, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(246, 242, 232, 0.035), 0 0 0 88px rgba(246, 242, 232, 0.022);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  right: 26%;
  bottom: -90px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(169, 129, 47, 0.25);
  border-radius: 50%;
  pointer-events: none;
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hero-label {
  color: rgba(246, 242, 232, 0.68);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-tag {
  padding: 4px 9px;
  border: 1px solid rgba(246, 242, 232, 0.18);
  border-radius: 99px;
  color: rgba(246, 242, 232, 0.72);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.hero-value {
  position: relative;
  z-index: 1;
  margin: 15px 0 11px;
  font-family: var(--number);
  font-size: clamp(39px, 5.2vw, 59px);
  font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.06;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.hero-value .currency {
  margin-right: 4px;
  color: rgba(246, 242, 232, 0.66);
  font-size: 0.55em;
  vertical-align: 0.35em;
}

.hero-delta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(246, 242, 232, 0.72);
  font-size: 12px;
}

.hero-delta .pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.hero-delta .pill.up {
  background: rgba(240, 167, 158, 0.16);
  color: #f2b2a9 !important;
}

.hero-delta .pill.down {
  background: rgba(159, 211, 184, 0.14);
  color: #a9d9c1 !important;
}

.hero-delta .pill.flat {
  background: rgba(246, 242, 232, 0.1);
  color: rgba(246, 242, 232, 0.7) !important;
}

.hero-delta .icon {
  width: 13px;
  height: 13px;
}

.hero-foot {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(246, 242, 232, 0.14);
}

.hero-foot .k {
  color: rgba(246, 242, 232, 0.55);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.hero-foot .v {
  margin-top: 4px;
  font-family: var(--number);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.hero-spark {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 46%;
  height: 112px;
  opacity: 0.32;
  pointer-events: none;
}

/* ---------- 配置环 ---------- */

.alloc-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.alloc-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 2px 0 6px;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  flex: none;
  border-radius: 50%;
  background: var(--paper-2);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 1px 3px rgba(66, 53, 34, 0.05);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center .k {
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.donut-center .v {
  margin-top: 2px;
  font-family: var(--number);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 2.5px;
}

.legend-name {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-value {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.legend-pct {
  width: 39px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---------- 资产卡 ---------- */

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 17px;
}

.asset-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 18px 19px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

button.asset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 93, 80, 0.26);
  box-shadow: var(--shadow-lift);
}

.asset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asset-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 10px;
  background: rgba(47, 93, 80, 0.08);
  color: var(--pine);
}

.asset-icon .icon {
  width: 17px;
  height: 17px;
}

.asset-icon.gold {
  background: rgba(169, 129, 47, 0.1);
  color: var(--brass);
}

.asset-icon.rust {
  background: rgba(194, 112, 61, 0.1);
  color: #b06a3c;
}

.asset-arrow {
  color: var(--line);
}

.asset-arrow .icon {
  width: 15px;
  height: 15px;
}

.asset-name {
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.asset-value {
  margin-top: 3px;
  font-family: var(--number);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.asset-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
}

.asset-meta b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- 页头统计条 ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 17px;
  padding: 17px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat-cell {
  min-width: 0;
  padding: 0 20px;
  border-right: 1px solid var(--line-soft);
}

.stat-cell:last-child {
  border-right: 0;
}

.stat-k {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.stat-v {
  margin-top: 4px;
  overflow: hidden;
  font-family: var(--number);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 图表 ---------- */

.chart-box {
  position: relative;
  width: 100%;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--line-soft);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.chart-line {
  fill: none;
  stroke: var(--pine);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-line.thin {
  stroke-width: 1.5;
}

.chart-area {
  stroke: none;
}

.chart-label {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.chart-end {
  fill: var(--card);
  stroke: var(--pine);
  stroke-width: 2;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--paper-2);
}

.seg button {
  padding: 4px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}

.seg button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(66, 53, 34, 0.1);
}

/* ---------- 提醒 ---------- */

.alert-list {
  display: flex;
  flex-direction: column;
}

.alert-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.alert-item:first-child {
  padding-top: 0;
}

.alert-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.alert-mark {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--brass-soft);
  color: var(--brass);
}

.alert-mark .icon {
  width: 11px;
  height: 11px;
}

.alert-mark.info {
  background: var(--pine-soft);
  color: var(--pine);
}

.alert-body {
  min-width: 0;
}

.alert-title {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
}

.alert-text {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

/* ---------- 定投计划 ---------- */

.plan-list {
  display: flex;
  flex-direction: column;
}

.plan-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.plan-row:first-child {
  padding-top: 0;
}

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

.plan-date {
  width: 44px;
  flex: none;
  padding: 4px 2px;
  border-radius: 8px;
  background: var(--paper-2);
  text-align: center;
}

.plan-date .d {
  font-family: var(--number);
  font-size: 16px;
  line-height: 1.15;
}

.plan-date .m {
  color: var(--muted);
  font-size: 8.5px;
}

.plan-main {
  min-width: 0;
  flex: 1;
}

.plan-name {
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}

.plan-amount {
  font family: var(--number);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 最近动态 ---------- */

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.activity-row:first-child {
  padding-top: 0;
}

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

.activity-date {
  width: 31px;
  flex: none;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.activity-main {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-tag {
  margin-right: 4px;
  color: var(--muted);
  font-size: 9px;
}

.activity-amt {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 引导 ---------- */

.onboard {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 17px;
  padding: 17px 20px;
  border: 1px dashed rgba(169, 129, 47, 0.48);
  border-radius: 15px;
  background: rgba(169, 129, 47, 0.055);
}

.onboard-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: rgba(169, 129, 47, 0.12);
  color: var(--brass);
}

.onboard-body {
  min-width: 0;
  flex: 1;
}

.onboard-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.onboard-text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.onboard-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- ETF 基金卡 ---------- */

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

.fund-card {
  position: relative;
  padding: 17px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.fund-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 93, 80, 0.26);
  box-shadow: var(--shadow-lift);
}

.fund-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.fund-dot {
  width: 8px;
  height: 8px;
  flex: none;
  margin-top: 5px;
  border-radius: 50%;
}

.fund-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.fund-code {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.fund-group {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
}

.fund-mid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 2px;
}

.fund-nav {
  font-family: var(--number);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.fund-nav-date {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.fund-spark {
  width: 106px;
  height: 34px;
  flex: none;
}

.fund-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.fund-stat {
  min-width: 0;
}

.fund-stat .k {
  color: var(--muted);
  font-size: 8.5px;
}

.fund-stat .v {
  margin-top: 2px;
  overflow: hidden;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fund-plan {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9.5px;
}

.fund-plan .icon {
  width: 11px;
  height: 11px;
}

.fund-plan .on {
  color: var(--brass);
}

.plan-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
  padding: 13px 17px;
  border: 1px solid rgba(169, 129, 47, 0.22);
  border-radius: 13px;
  background: rgba(169, 129, 47, 0.055);
}

.plan-banner .icon {
  color: var(--brass);
}

.plan-banner-text {
  flex: 1;
  font-size: 11.5px;
  line-height: 1.55;
}

.plan-banner-text b {
  font-family: var(--number);
  font-size: 15px;
  font-weight: 500;
}

/* ---------- 基金详情 ---------- */

.fund-detail-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
  padding: 18px 20px;
  border-radius: 15px;
  background: linear-gradient(140deg, rgba(47, 93, 80, 0.07), rgba(47, 93, 80, 0.02));
  border: 1px solid rgba(47, 93, 80, 0.12);
}

.fund-detail-nav {
  font-family: var(--number);
  font-size: 33px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.fund-detail-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 17px;
}

.detail-stat {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.detail-stat .k {
  color: var(--muted);
  font-size: 9px;
}

.detail-stat .v {
  margin-top: 2px;
  font-family: var(--number);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.section-title .actions {
  display: flex;
  gap: 5px;
}

.plan-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
  font-size: 11px;
}

.plan-inline .grow {
  flex: 1;
}

.plan-inline b {
  font-family: var(--number);
  font-size: 14px;
  font-weight: 500;
}

/* ---------- 表格 ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.45);
}

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

th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(47, 93, 80, 0.025);
}

.num {
  text-align: right;
}

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

.table-empty {
  padding: 24px 12px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.icon-mini {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.icon-mini:hover {
  border-color: var(--line);
  background: var(--card);
  color: var(--pine);
}

.icon-mini.danger:hover {
  border-color: rgba(180, 67, 56, 0.22);
  background: var(--up-soft);
  color: var(--up);
}

.icon-mini .icon {
  width: 13px;
  height: 13px;
}

/* ---------- 股票 ---------- */

.stock-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.stock-tab {
  position: relative;
  padding: 8px 4px 11px;
  margin-right: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
}

.stock-tab.active {
  color: var(--ink);
  font-weight: 600;
}

.stock-tab.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--pine);
}

.stock-tab .count {
  margin-left: 3px;
  color: var(--muted);
  font-size: 9px;
}

.stock-list {
  display: flex;
  flex-direction: column;
}

.stock-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.45fr) repeat(4, minmax(68px, 0.72fr)) 54px;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.stock-row:first-child {
  padding-top: 2px;
}

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

.stock-id {
  min-width: 0;
}

.stock-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
}

.stock-code {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.stock-tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--brass-soft);
  color: #8a6a25;
  font-size: 8px;
  font-weight: 400;
  white-space: nowrap;
}

.stock-quote {
  text-align: right;
}

.stock-price {
  font-family: var(--number);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.stock-chg {
  margin-top: 1px;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.stock-cell {
  text-align: right;
}

.stock-cell .k {
  display: none;
}

.stock-cell .v {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.stock-yield {
  text-align: right;
}

.stock-yield .v {
  color: var(--brass);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.stock-more {
  display: flex;
  justify-content: flex-end;
}

/* ---------- 期货 ---------- */

.futures-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
  padding: 20px 23px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(135deg, var(--card) 0%, #f7f2e7 100%);
  box-shadow: var(--shadow);
}

.futures-equity .k {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.futures-equity .v {
  margin-top: 3px;
  font-family: var(--number);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.futures-equity .s {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.futures-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bar-chart {
  width: 100%;
  height: auto;
}

.bar-pos {
  fill: var(--up);
  opacity: 0.88;
}

.bar-neg {
  fill: var(--down);
  opacity: 0.88;
}

.bar-zero {
  stroke: var(--line);
  stroke-width: 1;
}

/* ---------- 设置 ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 17px;
  align-items: start;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.setting-row:first-child {
  padding-top: 0;
}

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

.setting-label {
  font-size: 12px;
  font-weight: 500;
}

.setting-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.setting-control {
  flex: none;
}

.setting-control select {
  width: auto;
  min-width: 84px;
  height: 33px;
  font-size: 11px;
}

.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.password-form .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.backup-list {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
}

.backup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 10.5px;
}

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

.backup-name {
  flex: 1;
  font-variant-numeric: tabular-nums;
}

.backup-size {
  color: var(--muted);
  font-size: 9.5px;
}

.about-text {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.8;
}

.about-text b {
  color: var(--ink-soft);
  font-weight: 500;
}

/* ---------- 表单 / 弹层 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field > span,
.field > .label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.input,
.field select,
.field textarea {
  width: 100%;
  height: 39px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  height: auto;
  min-height: 68px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.55;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 17px, calc(100% - 10px) 17px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 26px;
}

.input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(47, 93, 80, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.08);
}

.input[type="color"] {
  padding: 4px;
  cursor: pointer;
}

.input[type="date"],
.input[type="month"] {
  font-variant-numeric: tabular-nums;
}

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

.field.full,
.form-grid > .full {
  grid-column: 1 / -1;
}

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

.form-error {
  color: var(--up);
  font-size: 11px;
  line-height: 1.5;
}

.form-section {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 9px 0 -2px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  color: var(--brass);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-soft);
}

.switch-row .switch-label {
  font-size: 11px;
  font-weight: 500;
}

.switch-row .switch-desc {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
}

.switch input {
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  border-radius: 99px;
  background: #d8d2c4;
  cursor: pointer;
  transition: background 0.18s ease;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s ease;
}

.switch input:checked {
  background: var(--pine);
}

.switch input:checked::after {
  transform: translateX(16px);
}

.modal-form {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(28, 39, 33, 0.56);
  backdrop-filter: blur(5px);
  animation: fade-in 0.16s ease;
}

.modal {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 32px 90px rgba(18, 28, 23, 0.34);
  animation: rise-in 0.2s ease;
}

.modal.wide {
  width: min(780px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 23px 14px;
  background: linear-gradient(var(--paper) 72%, rgba(245, 242, 234, 0));
}

.modal-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

.modal-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.modal-body {
  padding: 6px 23px 20px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 23px 22px;
}

.modal-foot .left {
  margin-right: auto;
}

.modal-close {
  width: 31px;
  height: 31px;
}

.confirm-text {
  padding: 7px 0 13px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.7;
}

.confirm-text b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Toast / 空状态 ---------- */

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}

.toast {
  max-width: 330px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #f8f5ee;
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow: 0 12px 34px rgba(18, 28, 23, 0.24);
  animation: toast-in 0.2s ease;
}

.toast.success {
  background: var(--pine);
}

.toast.error {
  background: #96382f;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
}

.empty .icon {
  width: 26px;
  height: 26px;
  margin-bottom: 9px;
  opacity: 0.45;
}

.empty-title {
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-text {
  max-width: 300px;
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.6;
}

.empty .btn {
  margin-top: 12px;
}

/* ---------- 移动端底部导航 ---------- */

.bottom-nav {
  display: none;
}

/* ---------- 动画 ---------- */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1120px) {
  .app {
    grid-template-columns: 213px minmax(0, 1fr);
  }

  .view {
    padding-right: 26px;
    padding-left: 26px;
  }

  .topbar {
    padding: 0 26px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.8fr);
  }

  .hero-value {
    font-size: clamp(37px, 4.8vw, 52px);
  }

  .asset-value {
    font-size: 22px;
  }

  .stat-v {
    font-size: 19px;
  }
}

@media (max-width: 940px) {
  .app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    right: 12px;
    bottom: 10px;
    left: 12px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    border: 1px solid rgba(222, 216, 203, 0.9);
    border-radius: 17px;
    background: rgba(251, 249, 244, 0.92);
    box-shadow: 0 14px 40px rgba(47, 60, 50, 0.16);
    backdrop-filter: blur(16px);
  }

  .bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
  }

  .bottom-item .icon {
    width: 18px;
    height: 18px;
  }

  .bottom-item.active {
    background: rgba(47, 93, 80, 0.08);
    color: var(--pine);
    font-weight: 600;
  }

  .topbar {
    height: 68px;
    padding: 0 18px;
  }

  .view {
    padding: 4px 18px 104px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 238px;
  }

  .alloc-card {
    min-height: auto;
  }

  .alloc-wrap {
    justify-content: flex-start;
  }

  .asset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-2,
  .grid-2.even,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .fund-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-pill {
    display: none;
  }
}

@media (max-width: 680px) {
  .view {
    padding-right: 14px;
    padding-left: 14px;
  }

  .topbar {
    padding: 0 14px;
  }

  .top-page {
    font-size: 17px;
  }

  .top-date {
    font-size: 9.5px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
  }

  .page-head h1 {
    font-size: 28px;
  }

  .page-sub {
    font-size: 11px;
  }

  .head-actions {
    width: 100%;
  }

  .head-actions .btn {
    flex: 1;
  }

  .hero {
    padding: 22px 21px 20px;
    border-radius: 19px;
  }

  .hero-value {
    font-size: clamp(34px, 10.5vw, 47px);
  }

  .hero-foot {
    gap: 9px;
  }

  .hero-foot .v {
    font-size: 14.5px;
  }

  .hero-foot .k {
    font-size: 8.5px;
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }

  .asset-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 14px 15px;
  }

  .asset-top {
    display: contents;
  }

  .asset-icon {
    grid-row: 1 / 3;
  }

  .asset-arrow {
    display: none;
  }

  .asset-name {
    grid-column: 2;
    margin-top: 0;
    font-size: 10px;
  }

  .asset-value {
    grid-column: 2;
    margin-top: -1px;
    font-size: 21px;
  }

  .asset-meta {
    grid-column: 3;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    font-size: 9px;
    text-align: right;
  }

  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 4px 0;
  }

  .stat-cell {
    padding: 12px 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .stat-cell:nth-child(odd) {
    border-right: 1px solid var(--line-soft);
  }

  .stat-cell:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .stat-v {
    font-size: 19px;
  }

  .card {
    padding: 17px 16px;
    border-radius: 15px;
  }

  .fund-grid {
    grid-template-columns: 1fr;
  }

  .fund-card {
    padding: 15px 16px 13px;
  }

  .fund-spark {
    width: 90px;
  }

  .fund-stats {
    gap: 4px;
  }

  .fund-stat .v {
    font-size: 11px;
  }

  .detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fund-detail-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .futures-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 17px 18px;
  }

  .futures-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .futures-equity .v {
    font-size: 29px;
  }

  .stock-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr) minmax(0, 0.85fr) 36px;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: 12px 2px;
  }

  .stock-id {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .stock-quote {
    grid-column: 2;
    grid-row: 1;
  }

  .stock-cell {
    grid-row: 2;
  }

  .stock-cell.value {
    grid-column: 2;
  }

  .stock-cell.pnl {
    grid-column: 3;
  }

  .stock-cell.yield {
    display: none;
  }

  .stock-yield {
    display: none;
  }

  .stock-more {
    grid-column: 4;
    grid-row: 1 / 3;
  }

  .stock-cell .k {
    display: block;
    color: var(--muted);
    font-size: 8px;
  }

  .stock-cell .v {
    font-size: 10.5px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .password-form {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .modal {
    max-height: 92vh;
    border-radius: 18px;
  }

  .modal-head {
    padding: 18px 18px 12px;
  }

  .modal-body {
    padding: 5px 18px 18px;
  }

  .modal-foot {
    padding: 0 18px 18px;
  }

  .modal-title {
    font-size: 19px;
  }

  .plan-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .plan-banner .btn {
    margin-left: 28px;
  }

  .onboard {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .onboard-actions {
    width: 100%;
    padding-left: 54px;
  }

  .settings-grid {
    gap: 13px;
  }

  .toast-root {
    right: 14px;
    bottom: 84px;
    left: 14px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
    text-align: center;
  }

  .bottom-nav {
    right: 10px;
    bottom: 8px;
    left: 10px;
  }
}

@media (max-width: 390px) {
  .hero-value {
    font-size: 32px;
  }

  .hero-delta {
    flex-wrap: wrap;
    gap: 6px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }
}

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

/* ---------- 补充：徽章与深色卡内的涨跌色 ---------- */

.hero .up {
  color: #f0b3aa !important;
}

.hero .down {
  color: #a9d9c1 !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.badge.up {
  background: var(--up-soft);
  color: var(--up);
}

.badge.down {
  background: var(--down-soft);
  color: var(--down);
}

.alert-item.as-button {
  width: 100%;
  border: 0;
  border-bottom: 1px dashed var(--line-soft);
  background: transparent;
  text-align: left;
}

.alert-item.as-button:hover {
  background: rgba(47, 93, 80, 0.025);
}

.alert-item.as-button:last-child {
  border-bottom: 0;
}

.toast.out {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46vh;
  color: var(--muted);
  font-size: 12px;
}

.loading-page .spinner {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--line);
  border-top-color: var(--pine);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--pine-soft);
  color: var(--pine);
  font-size: 8.5px;
  white-space: nowrap;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
