﻿:root {
  --bg: #f6f3ea;
  --panel: rgba(255, 252, 244, 0.92);
  --panel-strong: #fffdf7;
  --ink: #1f2a21;
  --muted: #607066;
  --line: rgba(31, 42, 33, 0.09);
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.13);
  --danger: #c2410c;
  --danger-soft: rgba(194, 65, 12, 0.14);
  --gain: #b42318;
  --loss: #047857;
  --shadow: 0 18px 48px rgba(54, 43, 17, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(194, 65, 12, 0.14), transparent 30%),
    linear-gradient(160deg, #f8f4ea 0%, #f1ebde 55%, #ece4d3 100%);
  min-height: 100vh;
}
.shell { width: min(1240px, calc(100vw - 24px)); margin: 0 auto; padding: 20px 0 40px; }
.hero, .panel {
  background: linear-gradient(135deg, rgba(255, 253, 246, 0.92), rgba(255, 247, 235, 0.9));
  border: 1px solid rgba(31, 42, 33, 0.08);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.hero { position: relative; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  inset: auto -100px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.18), transparent 70%);
}
.hero h1 { margin: 0 0 8px; font-size: clamp(28px, 5vw, 44px); }
.hero p { margin: 0; max-width: 820px; color: var(--muted); line-height: 1.65; }
.grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; margin-top: 18px; }
.toolbar, .summary-cards, .filters, .record-actions, .toggle-group { display: flex; gap: 10px; flex-wrap: wrap; }
.summary-cards { margin-top: 16px; }
.card, .holding-item, .ocr-row, .log-row, .metric-pill {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}
.card { flex: 1 1 180px; min-width: 180px; }
.card .label, label, .muted, .metric-pill .k { color: var(--muted); font-size: 13px; }
.card .value { margin-top: 8px; font-size: 28px; font-weight: 700; }
.card .sub { margin-top: 6px; color: var(--muted); font-size: 13px; }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
label { display: block; margin-bottom: 6px; }
input, select {
  width: 100%;
  border: 1px solid rgba(31, 42, 33, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
button {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: white;
}
button.secondary { background: white; color: var(--ink); border: 1px solid rgba(31, 42, 33, 0.12); }
button.warn { background: var(--danger); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.holding-list, .ocr-table, .log-list { display: grid; gap: 14px; }
.holding-head, .holding-metrics, .holding-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.holding-metrics { margin: 14px 0; }
.metric-pill { min-width: 132px; border-radius: 16px; padding: 10px 12px; }
.metric-pill span { display: block; }
.metric-pill .v { margin-top: 4px; font-weight: 700; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.tag.alt { background: rgba(31, 42, 33, 0.06); color: var(--ink); }
.status-bar {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(31, 42, 33, 0.06);
  color: var(--muted);
  font-size: 13px;
}
.chart { width: 100%; height: 300px; }
.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(31, 42, 33, 0.16);
  border-radius: 20px;
}
@media (max-width: 960px) {
  .grid, .form-grid { grid-template-columns: 1fr; }
  .shell { width: min(100vw - 18px, 100%); }
}
.tabbar { display:flex; gap:10px; margin-top:18px; margin-bottom:18px; flex-wrap:wrap; }
.tab-btn { background:white; color:var(--ink); border:1px solid rgba(31,42,33,0.12); }
.tab-btn.active { background:var(--accent); color:white; border-color:transparent; }
.analysis-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:18px; margin-top:0; }
.calendar-grid { display:grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap:10px; }
.calendar-cell { border:1px solid var(--line); border-radius:16px; padding:12px; background:rgba(255,255,255,0.8); }
.calendar-cell.up { background: rgba(180,35,24,0.08); }
.calendar-cell.down { background: rgba(4,120,87,0.08); }
.calendar-date { font-size:12px; color:var(--muted); }
.calendar-value { margin-top:8px; font-weight:700; }
@media (max-width: 960px) { .analysis-grid { grid-template-columns:1fr; } .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 23, 18, 0.42); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.modal-card { width: min(860px, 100%); max-height: 90vh; overflow: auto; background: var(--panel-strong); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.calendar-cell {
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.calendar-cell.active {
  box-shadow: inset 0 0 0 2px var(--accent);
  transform: translateY(-1px);
}
.account-trend {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.trend-bars {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
  min-height: 92px;
}
.trend-bar {
  flex: 1 1 0;
  min-width: 28px;
  border-radius: 12px 12px 6px 6px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 6px 4px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.1;
}
.trend-bar.up { background: rgba(180, 35, 24, 0.12); }
.trend-bar.down { background: rgba(4, 120, 87, 0.12); }
.trend-bar span { writing-mode: vertical-rl; transform: rotate(180deg); }
.subaccount-table-wrap {
  overflow-x: auto;
}
.subaccount-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.subaccount-table th,
.subaccount-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.subaccount-table th {
  background: rgba(31, 42, 33, 0.04);
  color: var(--muted);
  font-size: 13px;
}
.subaccount-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.5);
}
.fund-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.table-actions {
  display: flex;
  gap: 8px;
}
.table-actions button {
  padding: 8px 12px;
}
@media (max-width: 960px) {
  .trend-bar span { font-size: 10px; }
  .subaccount-table th,
  .subaccount-table td { padding: 12px 10px; }
}
.empty-cell {
  background: rgba(31, 42, 33, 0.03);
  color: var(--muted);
}
.calendar-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.mini-trend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}
.mini-trend svg {
  width: 140px;
  height: 28px;
  overflow: visible;
}
.metric-trend {
  min-width: 180px;
}
.trend-bars.inline {
  min-height: 60px;
  margin-top: 8px;
}

.hero-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-meta {
  color: var(--muted);
  font-size: 12px;
}
.account-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
}
.overview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric-trend.compact {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  max-width: 156px;
  padding: 12px;
}
.mini-trend {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.mini-trend svg {
  width: 100%;
  height: 36px;
  overflow: visible;
}
.account-trend,
.status-bar {
  display: none;
}
@media (max-width: 960px) {
  .account-overview-grid {
    grid-template-columns: 1fr;
  }
  .overview-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric-trend.compact {
    max-width: none;
  }
}

.app-tabs {
  display: inline-flex;
  align-items: center;
  padding: 6px;
  background: rgba(255, 253, 246, 0.82);
  border: 1px solid rgba(31, 42, 33, 0.08);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(54, 43, 17, 0.08);
}
.app-tabs .tab-btn {
  min-width: 108px;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all .2s ease;
}
.app-tabs .tab-btn.active {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.24);
}
.subaccount-table th,
.subaccount-table td {
  padding: 11px 8px;
  font-size: 13px;
}
.subaccount-table th {
  font-size: 12px;
}
.fund-cell {
  min-width: 150px;
}
.table-actions {
  gap: 6px;
}
.table-actions button {
  padding: 7px 10px;
  font-size: 12px;
}
@media (max-width: 960px) {
  .app-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .app-tabs .tab-btn {
    min-width: 0;
    flex: 1 1 0;
  }
}

.app-tabs {
  display: flex !important;
  align-items: center;
  width: 100%;
  padding: 8px;
  margin: 18px 0;
  background: linear-gradient(135deg, rgba(255, 253, 246, 0.94), rgba(255, 247, 235, 0.9));
  border: 1px solid rgba(31, 42, 33, 0.08);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.app-tabs .tab-btn {
  min-width: 0 !important;
  flex: 1 1 0;
  padding: 14px 20px;
  border-radius: 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all .2s ease;
}
.app-tabs .tab-btn.active {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.24);
  transform: translateY(-1px);
}
.analysis-grid {
  margin-top: 0 !important;
}
@media (max-width: 960px) {
  .app-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .app-tabs .tab-btn {
    flex: 1 1 0;
  }
}
.tab-page {
  margin-top: 0;
}
.tab-page > .panel,
.tab-page > .analysis-grid {
  width: 100%;
}
.app-tabs {
  position: relative;
  isolation: isolate;
  gap: 10px;
}
.app-tabs::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 10px;
  width: calc((100% - 20px) / 3 - 7px);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(17, 94, 89, 0.08));
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
  transition: transform .26s ease, background .26s ease;
  z-index: 0;
}
.app-tabs:has(.tab-btn:nth-child(2).active)::before {
  transform: translateX(calc(100% + 10px));
}
.app-tabs:has(.tab-btn:nth-child(3).active)::before {
  transform: translateX(calc(200% + 20px));
}
.app-tabs .tab-btn {
  position: relative;
  z-index: 1;
  font-weight: 700;
  letter-spacing: .5px;
}
.app-tabs .tab-btn:not(.active):hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.4);
}
.app-tabs .tab-btn.active {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
  transform: translateY(-1px);
}
.holding-item,
.subaccount-table {
  box-shadow: 0 10px 26px rgba(54, 43, 17, 0.06);
}
.holding-item {
  border-color: rgba(31, 42, 33, 0.07);
}
.subaccount-table {
  border-color: rgba(31, 42, 33, 0.07);
  box-shadow: 0 12px 28px rgba(54, 43, 17, 0.06);
}
.subaccount-table th {
  background: linear-gradient(180deg, rgba(31, 42, 33, 0.05), rgba(31, 42, 33, 0.03));
}
.subaccount-table tbody tr:nth-child(even) {
  background: rgba(255, 252, 246, 0.72);
}
.subaccount-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.05);
}
.account-overview-grid {
  background: rgba(255, 252, 246, 0.42);
  border: 1px solid rgba(31, 42, 33, 0.05);
  border-radius: 22px;
  padding: 12px;
}
.overview-metrics .metric-pill,
.metric-trend.compact {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(31, 42, 33, 0.06);
}
@media (max-width: 960px) {
  .app-tabs::before {
    display: none;
  }
}

html {
  overflow-y: scroll;
}

.tab-page {
  width: 100%;
  margin-top: 0 !important;
}

.tab-page > .holdings-panel,
.tab-page > .watch-panel,
.tab-page > .analysis-shell {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.holdings-panel,
.watch-panel {
  padding: 26px 28px 28px;
}

.analysis-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

.analysis-shell > .panel {
  margin: 0;
  min-width: 0;
  padding: 24px 26px 26px;
  border: 1px solid rgba(31, 42, 33, 0.07);
  box-shadow: 0 12px 28px rgba(54, 43, 17, 0.06);
}

.app-tabs {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  margin: 18px 0;
  padding: 7px;
  gap: 8px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(251, 246, 237, 0.92));
  border: 1px solid rgba(31, 42, 33, 0.08);
  box-shadow: 0 12px 32px rgba(54, 43, 17, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  isolation: isolate;
}

.app-tabs::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  z-index: -1;
}

.app-tabs::after {
  content: "";
  position: absolute;
  inset: 7px auto 7px 7px;
  width: calc((100% - 14px - 16px) / 3);
  border-radius: 18px;
  background: linear-gradient(135deg, #0f766e, #115e59);
  box-shadow: 0 14px 26px rgba(15, 118, 110, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform .28s ease;
  z-index: 0;
}

.app-tabs:has(.tab-btn:nth-child(2).active)::after {
  transform: translateX(calc(100% + 8px));
}

.app-tabs:has(.tab-btn:nth-child(3).active)::after {
  transform: translateX(calc(200% + 16px));
}

.app-tabs .tab-btn {
  position: relative;
  z-index: 1;
  min-width: 0 !important;
  min-height: 50px;
  padding: 14px 18px;
  border: none;
  border-radius: 18px;
  background: transparent !important;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  transition: color .22s ease, transform .22s ease;
}

.app-tabs .tab-btn.active {
  color: #fff;
  box-shadow: none;
  transform: translateY(-1px);
}

.app-tabs .tab-btn:not(.active):hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.watch-panel .holding-head {
  align-items: flex-end;
}

.watch-panel .filters {
  margin-top: 14px !important;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.72);
  border: 1px solid rgba(31, 42, 33, 0.06);
}

.watch-panel .holding-list {
  display: grid;
  gap: 14px;
}

.watch-panel .holding-item {
  padding: 18px 20px;
  border-radius: 22px;
}

.watch-panel .holding-item .holding-head {
  margin-bottom: 14px;
}

.watch-panel .holding-item .holding-head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.watch-panel .holding-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.watch-panel .metric-pill {
  min-height: 74px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 42, 33, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.watch-panel .metric-pill .k {
  font-size: 11px;
  letter-spacing: 0.2px;
}

.watch-panel .metric-pill .v {
  font-size: 15px;
  line-height: 1.3;
}

.analysis-shell .holding-head {
  align-items: flex-start;
}

.analysis-shell .tabbar {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(252, 248, 240, 0.88);
  border: 1px solid rgba(31, 42, 33, 0.06);
}

.analysis-shell .tabbar .tab-btn {
  min-width: 88px;
  padding: 10px 16px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.analysis-shell .tabbar .tab-btn.active {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(17, 94, 89, 0.08));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.1);
}

.analysis-shell .filters {
  gap: 10px;
}

.analysis-shell .holding-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analysis-shell .metric-pill {
  min-height: 84px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 42, 33, 0.06);
}

.analysis-shell .chart {
  min-height: 308px;
  margin-top: 16px !important;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.82), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(31, 42, 33, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.analysis-shell .calendar-grid {
  margin-top: 18px;
}

.analysis-shell .holding-item {
  padding: 16px 18px;
  border-radius: 18px;
}

.modal-card .status-bar {
  display: block;
}

@media (max-width: 1160px) {
  .watch-panel .holding-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .holdings-panel,
  .watch-panel {
    padding: 20px 18px 22px;
  }

  .analysis-shell {
    grid-template-columns: 1fr;
  }

  .app-tabs::after,
  .app-tabs::before {
    display: none;
  }

  .app-tabs .tab-btn.active {
    background: linear-gradient(135deg, #0f766e, #115e59) !important;
    box-shadow: 0 10px 18px rgba(15, 118, 110, 0.2);
  }

  .watch-panel .holding-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.nav-confirmed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.fund-name-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.subaccount-table tbody td {
  vertical-align: middle;
}

.subaccount-table tbody td:first-child {
  min-width: 176px;
}

.subaccount-table .fund-cell {
  min-height: 48px;
  justify-content: center;
}
.aggregate-accounts {
  display: inline-block;
  max-width: 180px;
  white-space: normal;
  line-height: 1.45;
}
.nav-estimate-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #c2410c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.holdings-panel .toolbar {
  gap: 10px;
}

.holdings-panel .toolbar-mini {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(54, 43, 17, 0.08);
}

.holdings-panel .toolbar .secondary.toolbar-mini {
  background: rgba(255, 252, 246, 0.88);
  border: 1px solid rgba(31, 42, 33, 0.08);
  color: var(--ink);
  box-shadow: none;
}

.account-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  width: 100%;
  padding: 6px;
  gap: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(251, 246, 237, 0.92));
  border: 1px solid rgba(31, 42, 33, 0.08);
  box-shadow: 0 10px 24px rgba(54, 43, 17, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  isolation: isolate;
  overflow: hidden;
}

.account-switch-glider {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f766e, #115e59);
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform .28s ease;
  z-index: 0;
}

.account-switch .tab-btn {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.account-switch .tab-btn.active {
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.account-switch .tab-btn:not(.active):hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 960px) {
  .account-switch {
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  }

  .holdings-panel .toolbar-mini {
    min-height: 36px;
    padding: 8px 12px;
  }
}
.holdings-panel .holding-head {
  align-items: center;
  margin-bottom: 8px;
}

.holdings-panel .holding-head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.holdings-panel h2 {
  margin: 0;
  letter-spacing: 0.2px;
}

.holdings-panel .toolbar {
  padding: 4px;
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.7);
  border: 1px solid rgba(31, 42, 33, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.holdings-panel .toolbar-mini {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15px;
  box-shadow: 0 6px 14px rgba(54, 43, 17, 0.07);
}

.holdings-panel .toolbar-mini:not(.secondary) {
  background: linear-gradient(135deg, #155e59, #0f766e);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.holdings-panel .toolbar .secondary.toolbar-mini {
  background: rgba(255, 255, 255, 0.82);
  color: #203029;
}

.account-switch {
  margin-top: 16px !important;
  padding: 7px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(250, 245, 236, 0.94));
  box-shadow: 0 14px 30px rgba(54, 43, 17, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.account-switch::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 0;
}

.account-switch-glider {
  top: 7px;
  bottom: 7px;
  border-radius: 17px;
  background: linear-gradient(135deg, #0f766e, #115e59 55%, #0b5f58);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.account-switch .tab-btn {
  min-height: 42px;
  padding: 10px 10px;
  border-radius: 15px;
  font-size: 12px;
  letter-spacing: 0.15px;
}

.account-switch .tab-btn.active {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.account-switch + .holding-list,
.account-switch + .subaccount-table-wrap {
  margin-top: 18px !important;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.42), rgba(255, 255, 255, 0));
  border: 1px solid rgba(31, 42, 33, 0.05);
}

.account-switch + .subaccount-table-wrap {
  padding: 12px;
}

@media (max-width: 960px) {
  .holdings-panel .holding-head {
    align-items: stretch;
    gap: 12px;
  }

  .holdings-panel .toolbar {
    width: 100%;
    justify-content: flex-end;
  }

  .account-switch + .holding-list,
  .account-switch + .subaccount-table-wrap {
    padding: 10px;
  }
}
.analysis-shell > .analysis-account-panel {
  grid-column: 1 / -1;
  padding: 14px 16px;
}

.analysis-account-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  width: 100%;
  padding: 6px;
  gap: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(251, 246, 237, 0.92));
  border: 1px solid rgba(31, 42, 33, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.analysis-account-switch .tab-btn {
  min-width: 0;
  min-height: 42px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.analysis-account-switch .tab-btn.active {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.trend-panel {
  grid-column: 1 / -1;
  padding: 0 !important;
  overflow: hidden;
}

.trend-panel .holding-head {
  padding: 24px 26px 0;
}

.analysis-trend-hero {
  position: relative;
  padding: 22px 28px 26px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 34%),
    radial-gradient(circle at 75% 15%, rgba(255,255,255,0.12), transparent 28%),
    linear-gradient(135deg, #4f83ff 0%, #5a87ff 34%, #6aa0ff 68%, #78b2ff 100%);
  color: #fff;
}

.analysis-trend-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 110% 50%, rgba(255,255,255,0.14) 0 2px, transparent 2px 22px);
  opacity: 0.35;
  pointer-events: none;
}

.analysis-trend-hero > * {
  position: relative;
  z-index: 1;
}

.analysis-trend-range {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  opacity: 0.95;
}

.analysis-trend-profit {
  margin-top: 12px;
  font-size: 52px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1.8px;
  color: #fff !important;
}

.analysis-trend-rate {
  margin-top: 10px;
  font-size: 15px;
  color: rgba(255,255,255,0.92);
}

.analysis-trend-rate .gain,
.analysis-trend-rate .loss {
  color: #fff !important;
}

.analysis-range-switch {
  margin: 0 !important;
  padding: 8px 18px 0 !important;
  background: transparent !important;
  border: none !important;
}

.analysis-range-switch .tab-btn {
  min-width: 84px;
  padding: 10px 14px;
  border-radius: 14px;
  color: #6d7b72;
}

.analysis-range-switch .tab-btn.active {
  background: rgba(79, 131, 255, 0.12) !important;
  color: #3f6ff5 !important;
  box-shadow: inset 0 0 0 1px rgba(79, 131, 255, 0.12);
}

.analysis-trend-chart {
  min-height: 360px !important;
  margin: 10px 18px 20px !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.96), rgba(255, 255, 255, 1)) !important;
}

.analysis-shell .chart.analysis-trend-chart {
  border: 1px solid rgba(79, 131, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

@media (max-width: 960px) {
  .analysis-account-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analysis-trend-hero {
    padding: 18px 18px 22px;
  }

  .analysis-trend-profit {
    font-size: 40px;
  }

  .analysis-range-switch {
    padding: 8px 12px 0 !important;
  }

  .analysis-trend-chart {
    margin: 10px 12px 14px !important;
    min-height: 300px !important;
  }
}
.detail-head {
  align-items: center !important;
}

.detail-link {
  color: #4f83ff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.detail-link:hover {
  color: #3f6ff5;
}

.trend-chart-section {
  padding: 0 18px 18px;
}

.trend-chart-section .holding-head {
  padding: 16px 8px 0;
  margin-bottom: 0;
}

.trend-chart-section h2 {
  margin: 0;
}

.analysis-range-switch {
  margin-top: 16px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.analysis-trend-hero .analysis-account-switch {
  margin-bottom: 18px;
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.analysis-trend-hero .analysis-account-switch .tab-btn {
  color: rgba(255,255,255,0.74);
}

.analysis-trend-hero .analysis-account-switch .tab-btn.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 8px 20px rgba(38, 89, 214, 0.18);
}

.analysis-trend-hero .analysis-range-switch {
  display: inline-flex;
  gap: 6px;
  margin-top: 20px !important;
}

.analysis-trend-hero .analysis-range-switch .tab-btn {
  min-width: 74px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.82);
}

.analysis-trend-hero .analysis-range-switch .tab-btn.active {
  background: #fff !important;
  color: #4f83ff !important;
  box-shadow: 0 10px 20px rgba(30, 71, 184, 0.18);
}


html {
  overflow-y: scroll;
}

.analysis-trend-hero {
  text-align: center;
  align-items: center;
}

.analysis-trend-hero .analysis-account-switch {
  max-width: 880px;
  margin: 0 auto 20px;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.analysis-account-glider {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0.18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 10px 22px rgba(33, 74, 182, 0.18);
  transition: transform 220ms ease, width 220ms ease;
  z-index: 0;
}

.analysis-trend-hero .analysis-account-switch .tab-btn {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.78);
  background: transparent !important;
  box-shadow: none !important;
}

.analysis-trend-hero .analysis-account-switch .tab-btn.active {
  color: #ffffff;
}

.analysis-trend-range,
.analysis-trend-profit,
.analysis-trend-rate,
.analysis-trend-hero .analysis-range-switch {
  width: 100%;
  justify-content: center;
}

.analysis-trend-range {
  margin-top: 4px;
}

.analysis-trend-rate {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.analysis-trend-hero .analysis-range-switch {
  display: inline-flex;
  margin: 20px auto 0 !important;
  padding: 6px !important;
  gap: 6px;
  border-radius: 20px;
  background: rgba(255,255,255,0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

.analysis-trend-hero .analysis-range-switch .tab-btn {
  min-width: 78px;
  padding: 10px 14px;
  border-radius: 14px;
  background: transparent;
  color: rgba(255,255,255,0.84);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.analysis-trend-hero .analysis-range-switch .tab-btn.active {
  background: rgba(255,255,255,0.96) !important;
  color: #4f83ff !important;
  box-shadow: 0 10px 20px rgba(30, 71, 184, 0.18);
}

.analysis-shell .panel .filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 0;
}

.analysis-shell .panel .filters .tabbar {
  position: relative;
  display: inline-flex;
  padding: 5px;
  gap: 4px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbf7ef, #f5efe4);
  border: 1px solid rgba(31, 42, 33, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.76);
}

.analysis-shell .panel .filters .tabbar .tab-btn {
  min-width: 62px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
}

.analysis-shell .panel .filters .tabbar .tab-btn.active {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.analysis-shell .panel .filters select {
  min-height: 42px;
  padding: 0 40px 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 33, 0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,244,237,0.96));
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.analysis-shell .calendar-grid {
  gap: 10px;
  padding: 8px 18px 18px;
}

.analysis-shell .calendar-cell {
  border-radius: 18px;
  border: 1px solid rgba(31, 42, 33, 0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,246,241,0.98));
  box-shadow: 0 10px 26px rgba(31, 42, 33, 0.05), inset 0 1px 0 rgba(255,255,255,0.88);
}

.analysis-shell .calendar-cell.active {
  border-color: rgba(79,131,255,0.22);
  box-shadow: 0 14px 30px rgba(79,131,255,0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}

.analysis-shell .calendar-date {
  font-size: 12px;
  font-weight: 700;
  color: #6f7b73;
}

.analysis-shell .calendar-value {
  font-size: 15px;
  font-weight: 800;
}

.analysis-shell .distribution-panel,
.analysis-shell .top-stock-panel,
.analysis-shell .detail-panel,
.analysis-shell .calendar-panel,
.analysis-shell .trend-panel {
  border: 1px solid rgba(31, 42, 33, 0.06);
  box-shadow: 0 18px 42px rgba(31, 42, 33, 0.06), inset 0 1px 0 rgba(255,255,255,0.78);
}

@media (max-width: 960px) {
  .analysis-trend-hero .analysis-account-switch {
    max-width: none;
  }

  .analysis-trend-rate {
    flex-direction: column;
    gap: 4px;
  }

  .analysis-shell .panel .filters {
    padding: 14px 12px 0;
  }
}


.analysis-trend-hero {
  text-align: left;
  align-items: stretch;
}

.analysis-trend-hero .analysis-account-switch {
  margin: 0 0 18px;
}

.analysis-trend-range,
.analysis-trend-profit,
.analysis-trend-rate {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.analysis-trend-hero .analysis-range-switch {
  width: auto;
  justify-content: flex-start;
  margin: 20px 0 0 !important;
}

.analysis-shell .panel .filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 0;
}

.analysis-shell .panel .filters > .tabbar:first-child {
  flex: 0 0 auto;
}

.analysis-shell .panel .filters select,
.analysis-shell .panel .filters .tag.alt {
  flex: 0 0 auto;
  width: auto;
  min-width: 124px;
}

.analysis-shell .panel .filters > .tabbar:last-child {
  margin-left: auto !important;
  flex: 0 0 auto;
}

.analysis-shell .panel .filters .tag.alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 33, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,244,237,0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

@media (max-width: 960px) {
  .analysis-shell .panel .filters {
    flex-wrap: wrap;
  }

  .analysis-shell .panel .filters > .tabbar:last-child {
    margin-left: 0 !important;
  }
}

.top-stock-row {
  position: relative;
}

.top-stock-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-stock-name-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.top-stock-name {
  font-weight: 700;
}

.top-stock-ratio {
  font-weight: 700;
  color: #0f766e;
  white-space: nowrap;
}

.stock-bubble {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  min-width: 260px;
  max-width: 420px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(31, 42, 33, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 14px 30px rgba(31, 42, 33, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 10;
}

.top-stock-name-wrap:hover .stock-bubble {
  opacity: 1;
  transform: translateY(0);
}

.sortable-th {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sortable-th span {
  min-width: 10px;
  color: #7b8a80;
  font-size: 11px;
}

.subaccount-table th {
  white-space: nowrap;
}

.watchlist-table-wrap .subaccount-table td,
.watchlist-table-wrap .subaccount-table th {
  font-size: 13px;
}

.watchlist-table .fund-cell {
  min-width: 180px;
}

.subaccount-table-wrap {
  overflow-x: hidden;
}

.subaccount-table {
  table-layout: fixed;
}

.subaccount-table th,
.subaccount-table td {
  padding: 10px 7px;
  font-size: 12px;
}

.subaccount-table th {
  font-size: 11px;
}

.subaccount-table tbody td:first-child {
  width: 18%;
  min-width: 0;
}

.subaccount-table .fund-cell {
  min-width: 0;
}

.subaccount-table .fund-name-row strong {
  font-size: 13px;
}

.subaccount-table .muted {
  font-size: 11px;
}

.subaccount-table .table-actions {
  gap: 6px;
}

.subaccount-table .table-actions button {
  padding: 6px 8px;
  font-size: 12px;
}

.analysis-trend-hero .analysis-account-switch {
  display: flex;
  gap: 0;
  max-width: 880px;
  padding: 6px;
  overflow: hidden;
}

.analysis-trend-hero .analysis-account-switch .tab-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 10px 8px;
  text-align: center;
}

.analysis-account-glider {
  left: 6px;
  width: calc((100% - 12px) / 1);
}

.analysis-shell .panel .chart,
.analysis-shell .chart {
  width: 100% !important;
  min-height: 308px;
}

.subaccount-table-wrap {
  overflow-x: auto;
}

.subaccount-table {
  table-layout: auto;
}

.subaccount-table th,
.subaccount-table td {
  padding: 10px 8px;
  font-size: 12px;
}

.subaccount-table tbody td {
  vertical-align: middle;
}

.subaccount-table tbody td:first-child {
  min-width: 168px;
  width: auto;
  white-space: normal;
}

.subaccount-table .fund-cell {
  min-width: 0;
  min-height: 44px;
  justify-content: center;
}

.subaccount-table .fund-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}

.subaccount-table .fund-name-row strong {
  font-size: 13px;
  line-height: 1.25;
}

.subaccount-table .muted {
  display: block;
  margin-top: 2px;
  line-height: 1.25;
  white-space: normal;
}

.watchlist-table .fund-cell,
.subaccount-table .fund-cell {
  overflow: hidden;
}

.watchlist-table .fund-name-row,
.subaccount-table .fund-name-row {
  flex-wrap: wrap;
}

.analysis-trend-hero .analysis-account-switch {
  display: flex;
  gap: 0;
  max-width: 880px;
  padding: 6px;
  overflow: hidden;
}

.analysis-trend-hero .analysis-account-switch .tab-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 10px 8px;
  text-align: center;
}

.analysis-account-glider {
  left: 6px;
  top: 6px;
  bottom: 6px;
  border-radius: 16px;
}

.analysis-shell .calendar-cell.up {
  border-color: rgba(180, 35, 24, 0.12);
  background: linear-gradient(180deg, rgba(180, 35, 24, 0.14), rgba(255, 255, 255, 0.98));
}

.analysis-shell .calendar-cell.down {
  border-color: rgba(4, 120, 87, 0.12);
  background: linear-gradient(180deg, rgba(4, 120, 87, 0.14), rgba(255, 255, 255, 0.98));
}

.analysis-shell .calendar-cell.up .calendar-value {
  color: #b42318;
}

.analysis-shell .calendar-cell.down .calendar-value {
  color: #047857;
}

.analysis-shell .calendar-cell.empty-cell {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(249,246,241,0.98));
  border-color: rgba(31, 42, 33, 0.06);
}

.analysis-shell .panel .filters {
  justify-content: flex-start;
}

.analysis-shell .panel .filters > .tabbar:last-child {
  margin-left: auto !important;
  justify-self: end;
}

.analysis-shell .panel .filters select,
.analysis-shell .panel .filters .tag.alt {
  width: 148px;
  min-width: 148px;
  max-width: 148px;
}

.analysis-shell .panel .filters > .tabbar:last-child {
  margin-left: auto !important;
}

.analysis-shell .panel .filters > .tabbar:last-child,
.analysis-shell .panel .filters > .tabbar:last-child .tab-btn {
  flex-shrink: 0;
}

.analysis-shell .panel .filters .tag.alt {
  justify-content: flex-start;
  text-align: left;
  padding-left: 14px;
}

.analysis-shell .panel .filters select {
  text-align: left;
  text-align-last: left;
}

.analysis-shell .panel .filters .tag.alt {
  min-height: 42px;
  padding: 0 40px 0 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 42px;
  box-sizing: border-box;
}

.fund-link {
  color: #1f2a21;
  text-decoration: none;
}

.fund-link:hover {
  color: #0f766e;
}

.detail-page-shell {
  min-height: 100vh;
  padding: 32px 20px 48px;
  background:
    radial-gradient(circle at top right, rgba(80, 132, 255, 0.16), transparent 34%),
    radial-gradient(circle at top left, rgba(26, 188, 156, 0.1), transparent 28%),
    linear-gradient(180deg, #f7f3ec 0%, #f3eee5 100%);
}

.detail-page {
  max-width: 1220px;
  margin: 0 auto;
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.detail-actions {
  display: flex;
  gap: 10px;
}

.ghost-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.72);
  color: #2b312d;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(31, 42, 33, 0.08);
  cursor: pointer;
}

.detail-hero {
  border-radius: 30px;
  padding: 28px 30px 26px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,0.2), transparent 26%),
    radial-gradient(circle at 88% 0%, rgba(255,255,255,0.16), transparent 28%),
    linear-gradient(135deg, #4a78f0 0%, #6b8bff 56%, #7aa0ff 100%);
  color: #fff;
  box-shadow: 0 24px 56px rgba(48, 85, 189, 0.26);
}

.detail-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.detail-code {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.82;
}

.detail-hero h1 {
  margin: 8px 0 6px;
  font-size: 34px;
  line-height: 1.1;
}

.detail-subtitle {
  font-size: 14px;
  opacity: 0.84;
}

.detail-profit-pill {
  min-width: 180px;
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 8px;
  text-align: right;
}

.detail-profit-pill strong {
  font-size: 28px;
  line-height: 1;
}

.detail-account-switch {
  position: relative;
  margin-top: 22px;
  border-radius: 20px;
  background: rgba(255,255,255,0.16);
  padding: 6px;
  overflow: hidden;
}

.detail-account-switch .tab-btn {
  position: relative;
  z-index: 1;
  background: transparent;
  color: rgba(255,255,255,0.76);
}

.detail-account-switch .tab-btn.active {
  color: #ffffff;
}

.detail-account-switch .account-switch-glider {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  border-radius: 16px;
  background: rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 10px 20px rgba(27, 59, 160, 0.2);
  transition: transform 0.22s ease, width 0.22s ease;
}

.detail-metrics-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.detail-metric-card {
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  min-height: 104px;
}

.detail-metric-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  opacity: 0.82;
}

.detail-metric-value {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.detail-metric-sub {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.76;
}

.detail-panel {
  margin-top: 18px;
  border-radius: 28px;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-section-head h2 {
  margin: 0;
  font-size: 24px;
}

.detail-head-controls {
  display: flex;
  gap: 10px;
}

.detail-mini-tabs {
  padding: 5px;
  border-radius: 18px;
  background: rgba(31, 42, 33, 0.06);
}

.detail-mini-tabs .tab-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 14px;
}

.detail-mini-tabs .tab-btn.active {
  background: linear-gradient(180deg, #ffffff, #f4efe6);
  box-shadow: 0 10px 18px rgba(31, 42, 33, 0.08);
}

.detail-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.detail-select {
  min-width: 150px;
  max-width: 150px;
}

.detail-chart {
  width: 100%;
  min-height: 360px;
}

.detail-split-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 18px;
}

.detail-table-wrap {
  overflow: auto;
}

.detail-table td,
.detail-table th {
  white-space: nowrap;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-info-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,243,234,0.86));
  display: grid;
  gap: 6px;
}

.detail-info-item span {
  font-size: 12px;
  color: #7c856f;
}

.detail-info-item strong {
  font-size: 15px;
  color: #1f2a21;
}

.detail-top-stocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-stock-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,243,234,0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.detail-stock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}

.detail-loading {
  margin-top: 24px;
  text-align: center;
  font-size: 16px;
  padding: 42px 24px;
}

.detail-link {
  color: #3d63dd;
  text-decoration: none;
  font-weight: 700;
}

.detail-more-wrap {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.history-hero {
  padding-bottom: 20px;
}

@media (max-width: 1024px) {
  .detail-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-split-grid,
  .detail-top-stocks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .detail-page-shell {
    padding: 18px 12px 28px;
  }

  .detail-hero,
  .panel.detail-panel,
  .panel.detail-loading {
    border-radius: 22px;
  }

  .detail-hero {
    padding: 22px 18px;
  }

  .detail-hero-head,
  .detail-chart-toolbar,
  .detail-topbar,
  .detail-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-profit-pill,
  .detail-actions {
    width: 100%;
  }

  .detail-metrics-grid,
  .detail-info-grid {
    grid-template-columns: 1fr;
  }
}

.detail-topbar {
  gap: 14px;
}

.detail-actions .toolbar-mini,
.detail-actions .ghost-btn {
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
}

.detail-hero::after {
  content: '';
  position: absolute;
  inset: auto -8% -42% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 68%);
  pointer-events: none;
}

.detail-account-switch {
  display: flex;
  gap: 0;
  align-items: center;
}

.detail-account-switch .tab-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 9px 8px;
  border-radius: 16px;
  font-weight: 700;
}

.detail-account-switch .account-switch-glider {
  left: 6px;
  right: auto;
}

.detail-metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-metric-card {
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.detail-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,243,234,0.96));
  box-shadow: 0 18px 36px rgba(31, 42, 33, 0.08);
}

.detail-chart-toolbar {
  flex-wrap: wrap;
}

.detail-chart {
  min-height: 392px;
}

.detail-table-wrap {
  border-radius: 20px;
  background: rgba(255,255,255,0.55);
}

.detail-stock-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.detail-stock-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(31, 42, 33, 0.08);
}

@media (max-width: 720px) {
  .detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .detail-account-switch {
    overflow-x: auto;
  }

  .detail-account-switch .tab-btn {
    flex: 0 0 auto;
    min-width: 112px;
  }

  .detail-chart {
    min-height: 320px;
  }
}

.detail-mini-tabs {
  padding: 6px;
  border-radius: 18px;
  background: rgba(31, 42, 33, 0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.detail-mini-tabs .tab-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 14px;
  color: #657060;
  font-weight: 700;
}

.detail-mini-tabs .tab-btn.active {
  color: #1f2a21;
  background: linear-gradient(180deg, #ffffff, #f4efe6);
  box-shadow: 0 10px 18px rgba(31, 42, 33, 0.08);
}

.detail-chart-caption {
  margin-top: 6px;
  font-size: 12px;
}

.detail-hero-head {
  align-items: flex-end;
}

.detail-code {
  margin-bottom: 4px;
}

.detail-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 1;
}

.detail-metrics-grid {
  margin-top: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-metric-card {
  min-height: 94px;
  padding: 15px 16px;
}

.detail-metric-label {
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.74;
}

.detail-metric-value {
  margin-top: 8px;
  font-size: 22px;
}

.detail-metric-sub {
  margin-top: 8px;
}

.detail-trend-head {
  margin-bottom: 10px;
}

.detail-trend-head h2 {
  margin-bottom: 4px;
}

.detail-chart-caption {
  font-size: 12px;
  line-height: 1.5;
}

.detail-head-controls {
  align-items: flex-start;
}

.detail-mini-tabs {
  padding: 6px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(31, 42, 33, 0.07), rgba(31, 42, 33, 0.045));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.detail-mini-tabs .tab-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 14px;
  color: #697363;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.detail-mini-tabs .tab-btn.active {
  color: #1f2a21;
  background: linear-gradient(180deg, #fffdfa, #f4efe6);
  box-shadow: 0 10px 18px rgba(31, 42, 33, 0.08);
}

.detail-chart-toolbar {
  margin-bottom: 10px;
}

.detail-chart {
  min-height: 376px;
}

.detail-top-stocks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-stock-card {
  padding: 16px 18px;
}

.detail-stock-head {
  font-size: 14px;
}

.detail-stock-head span {
  font-weight: 800;
  color: #b42318;
}

.profit-linkage-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.profit-linkage-card {
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15,118,110,0.08), rgba(15,118,110,0.03));
  border: 1px solid rgba(15,118,110,0.08);
  display: grid;
  gap: 8px;
}

.profit-linkage-card span {
  font-size: 12px;
  color: #6d7768;
  font-weight: 700;
}

.profit-linkage-card strong {
  font-size: 20px;
  color: #1f2a21;
  line-height: 1.1;
}

.detail-table-wrap {
  border: 1px solid rgba(31,42,33,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.detail-table thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #fbf8f2, #f3ede2);
  color: #687161;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.detail-table tbody tr {
  transition: background 0.16s ease;
}

.detail-table tbody tr:hover {
  background: rgba(61, 99, 221, 0.05);
}

.detail-table tbody td:first-child {
  font-weight: 700;
  color: #1f2a21;
}

@media (max-width: 720px) {
  .profit-linkage-strip {
    grid-template-columns: 1fr;
  }
}

.profit-linkage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profit-linkage-title {
  font-size: 13px;
  font-weight: 800;
  color: #1f2a21;
  letter-spacing: 0.03em;
}

.profit-linkage-note {
  margin-top: 4px;
  font-size: 12px;
  color: #7c856f;
}

.profit-linkage-strip {
  margin-bottom: 14px;
}

.profit-linkage-card {
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(15,118,110,0.09), rgba(15,118,110,0.025));
  border: 1px solid rgba(15,118,110,0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.profit-linkage-card span {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #778172;
}

.profit-linkage-card strong {
  font-size: 22px;
  font-weight: 800;
}

.profit-linkage-card:nth-child(2) {
  background: linear-gradient(180deg, rgba(61,99,221,0.08), rgba(61,99,221,0.025));
  border-color: rgba(61,99,221,0.08);
}

.profit-linkage-card:nth-child(3) {
  background: linear-gradient(180deg, rgba(31,42,33,0.05), rgba(31,42,33,0.02));
  border-color: rgba(31,42,33,0.06);
}

@media (max-width: 720px) {
  .profit-linkage-head {
    align-items: stretch;
  }
}

.detail-select {
  min-width: 166px;
  max-width: 166px;
  height: 42px;
  padding: 0 40px 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(31,42,33,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,239,230,0.96));
  color: #1f2a21;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(31,42,33,0.06), inset 0 1px 0 rgba(255,255,255,0.68);
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6f786a 50%),
    linear-gradient(135deg, #6f786a 50%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,239,230,0.96));
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}

.detail-select:focus {
  outline: none;
  border-color: rgba(61,99,221,0.28);
  box-shadow: 0 0 0 4px rgba(61,99,221,0.10), 0 10px 18px rgba(31,42,33,0.06);
}

.chart-tip {
  min-width: 156px;
}

.chart-tip-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #1f2a21;
}

.chart-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.chart-tip-row + .chart-tip-row {
  margin-top: 6px;
}

.chart-tip-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6f786a;
  font-weight: 700;
}

.chart-tip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.88);
}


.detail-select-wrap {
  display: inline-grid;
  gap: 6px;
  min-width: 190px;
}

.detail-select-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #7e8777;
  padding-left: 4px;
}

.detail-select {
  min-width: 190px;
  max-width: 190px;
  height: 46px;
  padding: 0 42px 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(31,42,33,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(244,239,230,0.98));
  color: #1f2a21;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(31,42,33,0.07), inset 0 1px 0 rgba(255,255,255,0.72);
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6f786a 50%),
    linear-gradient(135deg, #6f786a 50%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,0.99), rgba(244,239,230,0.98));
  background-position:
    calc(100% - 20px) 20px,
    calc(100% - 14px) 20px,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}

.detail-select:hover {
  border-color: rgba(61,99,221,0.18);
  box-shadow: 0 16px 30px rgba(31,42,33,0.09), inset 0 1px 0 rgba(255,255,255,0.82);
}

.detail-select:focus {
  outline: none;
  border-color: rgba(61,99,221,0.28);
  box-shadow: 0 0 0 4px rgba(61,99,221,0.10), 0 16px 30px rgba(31,42,33,0.08);
}

.chart-tip {
  min-width: 178px;
}

.chart-tip-kicker {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #8b9383;
}

.chart-tip-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #1f2a21;
}

.chart-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.chart-tip-value {
  color: #1f2a21;
  font-weight: 800;
}


.import-hint-block {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.76);
  border: 1px solid rgba(31, 42, 33, 0.06);
}

.hint-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.hint-code {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #1f2a21;
  color: #f8f5ec;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-import-input {
  width: 100%;
  min-height: 140px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

.modal-import-tabs {
  margin-bottom: 10px;
  padding: 6px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbf7ef, #f3ecdf);
  border: 1px solid rgba(31, 42, 33, 0.06);
}

.modal-import-tabs .tab-btn {
  min-width: 116px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 700;
}

.modal-card .toolbar {
  align-items: center;
}

.modal-card .holding-head > button.secondary {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(31, 42, 33, 0.08);
  color: #425248;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(31, 42, 33, 0.06);
}

.modal-card .holding-head > button.secondary:hover {
  background: rgba(255,255,255,0.94);
  color: #1f2a21;
  box-shadow: 0 6px 12px rgba(31, 42, 33, 0.08);
}

.json-import-input {
  min-height: 220px;
  line-height: 1.65;
  font-size: 13px;
  resize: vertical;
}

.modal-card input[type="file"] {
  max-width: 280px;
  font-size: 13px;
  color: #203029;
}

.modal-card input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #155e59, #0f766e);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.modal-card input[type="file"]::file-selector-button:hover {
  filter: brightness(1.02);
}


.modal-close-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(31, 42, 33, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  color: #6a786f;
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
  box-shadow: 0 2px 6px rgba(31, 42, 33, 0.05);
  backdrop-filter: blur(6px);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.92);
  color: #1f2a21;
  border-color: rgba(31, 42, 33, 0.1);
  box-shadow: 0 6px 14px rgba(31, 42, 33, 0.1);
}


.modal-recommend {
  display: inline-block;
  margin-left: 8px;
  color: #c2410c;
  font-weight: 700;
}

.summary-cards .card {
  min-width: 0;
}

.summary-cards .card .value {
  font-size: clamp(16px, 0.9vw + 12px, 28px);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  letter-spacing: -0.02em;
}


.summary-cards {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.summary-cards::-webkit-scrollbar {
  display: none;
}
.summary-cards .card {
  flex: 0 0 190px;
}
.account-switch-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.account-switch-scroll::-webkit-scrollbar {
  display: none;
}
.account-switch-scroll .tab-btn {
  flex: 0 0 auto;
  min-width: 88px;
}
.mobile-holdings-list {
  display: none;
}
.mobile-holding-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
  overflow: hidden;
}
.mobile-holding-card + .mobile-holding-card {
  margin-top: 12px;
}
.mobile-holding-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
}
.mobile-holding-summary::-webkit-details-marker {
  display: none;
}
.mobile-holding-main {
  min-width: 0;
}
.mobile-holding-title {
  font-size: 16px;
}
.mobile-holding-title strong {
  display: inline;
}
.mobile-holding-sub {
  margin-top: 4px;
}
.mobile-holding-side {
  text-align: right;
}
.mobile-profit {
  font-size: 16px;
  font-weight: 700;
}
.mobile-rate {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
}
.mobile-holding-quick {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mobile-holding-quick > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(31, 42, 33, 0.04);
}
.mobile-holding-quick .k {
  color: var(--muted);
  font-size: 11px;
}
.mobile-holding-quick .v {
  font-size: 13px;
  font-weight: 700;
}
.mobile-holding-detail {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}
.mobile-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mobile-detail-grid .metric-pill {
  min-width: 0;
}
.mobile-detail-foot {
  margin-top: 12px;
}
.mobile-detail-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

@media (max-width: 960px) {
  .summary-cards {
    margin-top: 14px;
    margin-inline: -4px;
    padding-inline: 4px;
  }
  .summary-cards .card {
    flex-basis: 165px;
    padding: 14px;
    border-radius: 18px;
  }
  .hero,
  .panel {
    padding: 18px;
  }
  .account-switch-scroll {
    margin-inline: -4px;
    padding-inline: 4px 8px;
  }
  .account-switch-scroll .tab-btn {
    min-width: 82px;
  }
  .account-summary-list .holding-item {
    padding: 14px;
  }
  .account-overview-grid {
    grid-template-columns: 1fr;
  }
  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-trend.compact {
    max-width: none;
  }
  .desktop-holdings-table {
    display: none;
  }
  .mobile-holdings-list {
    display: block;
  }
  .mobile-detail-actions {
    justify-content: stretch;
  }
  .mobile-detail-actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 640px) {
  .hero-head {
    align-items: stretch;
  }
  .hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .holdings-panel .holding-head {
    align-items: stretch;
  }
  .holdings-panel .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .holdings-panel .toolbar .toolbar-mini {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
  }
  .mobile-holding-summary {
    grid-template-columns: 1fr;
  }
  .mobile-holding-side {
    text-align: left;
  }
  .mobile-holding-quick {
    grid-template-columns: 1fr;
  }
  .mobile-detail-grid {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 960px) {
  .holdings-panel .desktop-holdings-table {
    display: block !important;
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    margin-inline: -6px;
    padding-inline: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .holdings-panel .desktop-holdings-table::-webkit-scrollbar {
    display: none;
  }
  .holdings-panel .mobile-holdings-list {
    display: none !important;
  }
  .holdings-panel .subaccount-table {
    min-width: 1180px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
  }
  .holdings-panel .subaccount-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px 10px;
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
    background: #fffaf0;
    box-shadow: inset 0 -1px 0 rgba(216, 198, 158, 0.7);
  }
  .holdings-panel .subaccount-table tbody td {
    padding: 12px 10px;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.96);
  }
  .holdings-panel .subaccount-table th:first-child,
  .holdings-panel .subaccount-table td:first-child {
    position: sticky;
    left: 0;
    min-width: 168px;
    max-width: 168px;
    z-index: 6;
    background: #fffdf8;
    box-shadow: 10px 0 14px rgba(243, 233, 212, 0.9);
  }
  .holdings-panel .subaccount-table thead th:first-child {
    z-index: 7;
    background: #fff7e9;
  }
  .holdings-panel .subaccount-table tbody tr:nth-child(even) td {
    background: #fffcf6;
  }
  .holdings-panel .subaccount-table tbody tr:nth-child(even) td:first-child {
    background: #fff8ec;
  }
  .holdings-panel .subaccount-table .sortable-th {
    justify-content: center;
    font-size: 12px;
    gap: 4px;
  }
  .holdings-panel .subaccount-table .fund-cell {
    min-width: 0;
    max-width: 148px;
  }
  .holdings-panel .subaccount-table .fund-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
  }
  .holdings-panel .subaccount-table .fund-link {
    min-width: 0;
    overflow: hidden;
  }
  .holdings-panel .subaccount-table .fund-link strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.3;
  }
  .holdings-panel .subaccount-table .muted {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
  }
  .holdings-panel .subaccount-table .table-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .holdings-panel .subaccount-table .table-actions button {
    min-width: 0;
    padding: 7px 10px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .holdings-panel .subaccount-table {
    min-width: 1080px;
  }
  .holdings-panel .subaccount-table th:first-child,
  .holdings-panel .subaccount-table td:first-child {
    min-width: 154px;
    max-width: 154px;
  }
  .holdings-panel .subaccount-table tbody td,
  .holdings-panel .subaccount-table thead th {
    padding-inline: 8px;
  }
}


@media (max-width: 960px) {
  .holdings-panel {
    padding: 18px 0 20px;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .holdings-panel > .holding-head,
  .holdings-panel > .account-switch {
    margin-inline: 16px;
  }
  .holdings-panel .holding-head {
    margin-bottom: 10px;
  }
  .holdings-panel .holding-head h2 {
    font-size: 21px;
  }
  .holdings-panel .desktop-holdings-table {
    margin-top: 12px !important;
    padding-inline: 0 0;
    margin-inline: 0;
    border-top: 1px solid rgba(214, 204, 181, 0.6);
    border-bottom: 1px solid rgba(214, 204, 181, 0.45);
    background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,252,247,0.92));
  }
  .holdings-panel .subaccount-table {
    min-width: 1120px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .holdings-panel .subaccount-table thead th {
    height: 42px;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #8b7a58;
    text-align: center;
    background: linear-gradient(180deg, #fffaf1, #fdf4e5);
    box-shadow: inset 0 -1px 0 rgba(214, 204, 181, 0.9);
  }
  .holdings-panel .subaccount-table tbody td {
    height: 62px;
    padding: 10px 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    color: #2a332d;
    border-bottom: 1px solid rgba(228, 220, 200, 0.75);
    background: rgba(255, 255, 255, 0.96);
  }
  .holdings-panel .subaccount-table tbody tr:last-child td {
    border-bottom: 0;
  }
  .holdings-panel .subaccount-table tbody tr:nth-child(even) td {
    background: #fffdf8;
  }
  .holdings-panel .subaccount-table th:first-child,
  .holdings-panel .subaccount-table td:first-child {
    min-width: 160px;
    max-width: 160px;
    text-align: left;
    background: #fffdf9;
    box-shadow: 14px 0 18px rgba(247, 241, 228, 0.98);
  }
  .holdings-panel .subaccount-table thead th:first-child {
    background: linear-gradient(180deg, #fff8ec, #fef1dd);
    box-shadow: 14px 0 18px rgba(247, 241, 228, 0.98), inset 0 -1px 0 rgba(214, 204, 181, 0.9);
  }
  .holdings-panel .subaccount-table td:last-child,
  .holdings-panel .subaccount-table th:last-child {
    text-align: center;
  }
  .holdings-panel .subaccount-table .sortable-th {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
  }
  .holdings-panel .subaccount-table .sortable-th span {
    font-size: 10px;
  }
  .holdings-panel .subaccount-table .fund-cell {
    max-width: 142px;
    min-height: 42px;
    gap: 3px;
    justify-content: center;
  }
  .holdings-panel .subaccount-table .fund-name-row {
    gap: 5px;
    align-items: flex-start;
  }
  .holdings-panel .subaccount-table .fund-link strong {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    color: #26332d;
  }
  .holdings-panel .subaccount-table .muted {
    margin-top: 1px;
    font-size: 10px;
    line-height: 1.2;
    color: #a59a84;
  }
  .holdings-panel .subaccount-table .gain,
  .holdings-panel .subaccount-table .loss {
    font-weight: 700;
  }
  .holdings-panel .subaccount-table .table-actions {
    align-items: center;
    justify-content: center;
  }
  .holdings-panel .subaccount-table .table-actions button {
    min-width: 54px;
    padding: 6px 8px;
    border-radius: 10px;
  }
  .holdings-panel .nav-confirmed-badge,
  .holdings-panel .nav-estimate-badge {
    margin-top: 1px;
  }
}

@media (max-width: 640px) {
  .holdings-panel > .holding-head,
  .holdings-panel > .account-switch {
    margin-inline: 12px;
  }
  .holdings-panel .desktop-holdings-table {
    border-top-color: rgba(214, 204, 181, 0.5);
  }
  .holdings-panel .subaccount-table {
    min-width: 1020px;
  }
  .holdings-panel .subaccount-table th:first-child,
  .holdings-panel .subaccount-table td:first-child {
    min-width: 152px;
    max-width: 152px;
  }
  .holdings-panel .subaccount-table tbody td {
    height: 58px;
    font-size: 12px;
  }
  .holdings-panel .subaccount-table .fund-link strong {
    font-size: 13px;
  }
}

.mobile-frozen-runtime {
  display: none;
}

@media (max-width: 960px) {
  .holdings-panel .mobile-frozen-runtime.is-ready {
    display: block;
    margin-top: 14px;
    border-top: 1px solid rgba(214, 204, 181, 0.55);
    border-bottom: 1px solid rgba(214, 204, 181, 0.4);
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,252,247,0.96));
    overflow: hidden;
  }
  .holdings-panel .mobile-frozen-runtime.is-ready + .desktop-holdings-table {
    display: none !important;
  }
  .holdings-panel .mobile-frozen-runtime.is-ready ~ .mobile-holdings-list {
    display: none !important;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-head,
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-body {
    display: grid;
    grid-template-columns: 196px minmax(0, 1fr);
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-name-head,
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-name-cell {
    position: relative;
    z-index: 2;
    background: #fffdf8;
    box-shadow: 14px 0 20px rgba(247, 241, 228, 0.96);
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-name-head {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    font-size: 11px;
    font-weight: 700;
    color: #8b7a58;
    background: linear-gradient(180deg, #fff8ec, #fef1dd);
    border-bottom: 1px solid rgba(214, 204, 181, 0.85);
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-head-scroll,
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-metrics-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-head-scroll::-webkit-scrollbar,
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-metrics-scroll::-webkit-scrollbar {
    display: none;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-metrics-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 92px;
    min-width: max-content;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-col,
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    text-align: right;
    white-space: nowrap;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-col {
    min-height: 44px;
    font-size: 11px;
    font-weight: 700;
    color: #8b7a58;
    background: linear-gradient(180deg, #fffaf1, #fdf4e5);
    border-bottom: 1px solid rgba(214, 204, 181, 0.85);
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-name-cell {
    min-height: 74px;
    padding: 12px 14px 11px;
    border-bottom: 1px solid rgba(228, 220, 200, 0.78);
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-name-row {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
  }
  .holdings-panel .mobile-frozen-runtime .fund-link {
    min-width: 0;
    overflow: hidden;
  }
  .holdings-panel .mobile-frozen-runtime .fund-link strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #26332d;
  }
  .holdings-panel .mobile-frozen-runtime .muted {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.2;
    color: #a59a84;
    white-space: normal;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-row {
    border-bottom: 1px solid rgba(228, 220, 200, 0.78);
    background: rgba(255, 255, 255, 0.96);
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-row:nth-child(even) {
    background: #fffdf8;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-row .mobile-frozen-cell {
    min-height: 74px;
    font-size: 13px;
    font-weight: 700;
    color: #2a332d;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    min-width: 64px;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-actions button {
    min-width: 64px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-head,
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-body {
    grid-template-columns: 184px minmax(0, 1fr);
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-metrics-grid {
    grid-auto-columns: 88px;
  }
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-name-cell,
  .holdings-panel .mobile-frozen-runtime .mobile-frozen-row .mobile-frozen-cell {
    min-height: 70px;
  }
}
