* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #1a2234;
  --border: #243049;
  --text: #e8edf7;
  --text-muted: #8b9ab8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --up: #ef4444;
  --down: #22c55e;
  --flat: #94a3b8;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

.header-site-notice {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 40rem;
}

.register-invite-purchase {
  margin-bottom: 12px;
}

#registerInviteWrap[hidden],
.register-invite-purchase[hidden] {
  display: none !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.refresh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
}

.refresh-toggle input {
  accent-color: var(--primary);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 4px 8px;
}

.btn-ghost:hover {
  color: var(--up);
}

.btn-outline {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.search-bar {
  margin-bottom: 12px;
}

.search-input-wrap {
  position: relative;
}

#searchInput {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

.fund-name-text {
  font-weight: 600;
  color: var(--text);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
}

.search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: var(--surface-2);
}

.search-item-name {
  font-size: 0.9rem;
}

.search-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-item-code {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.8rem;
  color: var(--primary);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

#statsBar[hidden],
#searchBar[hidden],
.main-content > [hidden],
.modal-overlay[hidden] {
  display: none !important;
}

.auth-tabs {
  display: none;
}

.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0 16px;
}

.auth-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.auth-links {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-modal-card {
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

.auth-form-compact label {
  margin-bottom: 10px;
}

#authRegisterPanel[hidden],
#authRecoverPanel[hidden],
#authChangePasswordPanel[hidden],
#authLoginPanel[hidden] {
  display: none !important;
}

.index-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

.index-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 88px;
}

.index-card.loading-card {
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.index-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.lbl-short {
  display: none;
}

.valuation-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.valuation-mode-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.valuation-mode-btn {
  padding: 6px 14px;
  font-size: 0.8125rem;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.valuation-mode-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}

.valuation-mode-btn.is-active {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.55);
}

.valuation-mode-hint {
  flex: 1 1 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.mobile-market-hint {
  display: none;
}

.mobile-name-line {
  display: block;
}

/* 自选名称旁：短标签（盘后/盘前）各端显示；长说明用 .session-tag--long，仅窄屏隐藏 */
.session-tag {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #6eb5ff;
  vertical-align: middle;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 4px;
}

.session-tag--banner {
  margin-left: 0;
  margin-right: 6px;
  font-weight: 600;
}

.session-tag.calibration-tag {
  color: #c9a227;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.08);
}

/* 手机：与「盘前/盘后」同排，名称可省略，标签不挤换行 */
@media (max-width: 720px) {
  .session-tag.calibration-tag {
    font-size: 0.62rem;
    padding: 1px 5px;
    margin-left: 2px;
    flex: 0 0 auto;
  }
}

.index-price {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.stat-value.small {
  font-size: 0.85rem;
  font-weight: 500;
}

.stat-value.up { color: var(--up); }
.stat-value.down { color: var(--down); }

.fund-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.fund-table {
  width: 100%;
  border-collapse: collapse;
}

.fund-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.fund-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.fund-table tr:last-child td {
  border-bottom: none;
}

.fund-table tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

.fund-name {
  font-weight: 500;
  max-width: 280px;
}

.col-name--stock .name-cell-inner {
  position: relative;
  display: block;
  padding-bottom: 15px;
  min-height: 2.25em;
}

.col-name--stock .market-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  line-height: 1.2;
  pointer-events: none;
}

@media (max-width: 720px) {
  .col-name--stock .name-cell-inner {
    padding-bottom: 16px;
  }
}

.fund-code {
  font-family: "Cascadia Code", "Consolas", monospace;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.num {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
}

.change-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: "Cascadia Code", "Consolas", monospace;
}

.change-badge.up {
  background: rgba(239, 68, 68, 0.15);
  color: var(--up);
}

.change-badge.down {
  background: rgba(34, 197, 94, 0.15);
  color: var(--down);
}

.change-badge.flat {
  background: rgba(148, 163, 184, 0.15);
  color: var(--flat);
}

.loading, .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
}

.footer {
  margin-top: 24px;
  text-align: center;
}

.footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.back-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.back-link:hover {
  text-decoration: underline;
}

button.back-link {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
  margin-right: 12px;
  margin-bottom: 8px;
}

.fund-link {
  color: var(--text);
  text-decoration: none;
}

.fund-link:hover {
  color: var(--primary);
}

.stat-card.highlight {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
}

.debug-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.debug-panel h3 {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.debug-table td, .debug-table th {
  font-size: 0.8rem;
}

.row-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.mobile-meta {
  display: none;
}

.change-badge-lg {
  font-size: 0.95rem;
  padding: 3px 12px;
}

.btn-remove {
  white-space: nowrap;
}

.member-mode .fund-row.row-draggable {
  cursor: grab;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.member-mode .fund-row.row-draggable.dragging {
  cursor: grabbing;
  touch-action: none;
}

.fund-row.dragging {
  opacity: 0.55;
  transform: scale(0.99);
}

.fund-row.drag-over {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}

.live-price {
  color: #fbbf24;
  font-weight: 600;
}

.official-nav-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.official-nav-line {
  font-variant-numeric: tabular-nums;
}

.official-nav-pct {
  font-size: 0.68rem;
  font-weight: 600;
  margin-left: 4px;
  white-space: nowrap;
  vertical-align: baseline;
}

.official-nav-pct.up {
  color: var(--up);
}

.official-nav-pct.down {
  color: var(--down);
}

.official-nav-pct.flat {
  color: var(--flat);
}

.num.muted {
  color: var(--text-muted);
}

.source-cell {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.health-ok { border-color: rgba(34, 197, 94, 0.4); color: #22c55e; }
.health-warn { border-color: rgba(251, 191, 36, 0.4); color: #fbbf24; }

.issues {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 220px;
}

.estimate-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.session-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.session-chip {
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.session-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.session-pre { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.session-regular { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.session-post { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.session-auction { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.session-closed { background: rgba(148, 163, 184, 0.15); color: var(--flat); }

.holdings-table th,
.holdings-table td {
  white-space: nowrap;
}

.auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-bar-purchase-link.auth-bar-purchase-link--inactive {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-guest-hint,
.auth-user {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-expiry {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-expiry-warn {
  color: #c2410c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.guest-mode .col-action,
.guest-mode th.col-action,
.guest-mode .btn-remove,
.guest-mode .watchlist-remove-toggle,
.member-mode:not(.show-remove-buttons) .col-action,
.member-mode:not(.show-remove-buttons) th.col-action {
  display: none !important;
}

.valuation-mode-bar .watchlist-remove-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.watchlist-remove-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.watchlist-remove-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.search-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 8px;
  max-width: 52rem;
}

.update-toast {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 3000;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.update-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow);
}

.ad-card {
  width: min(560px, 100%);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-card h2 {
  margin-bottom: 16px;
  font-size: 1.25rem;
}

.auth-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.membership-banner {
  margin: 0 20px 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-form label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.form-error {
  color: var(--up);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.auth-switch {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.link-btn {
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.admin-field {
  display: block;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-field input,
.admin-field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.85rem;
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.admin-invite-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.admin-nav-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.admin-nav-link:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-2);
}

.admin-nav-link.is-active {
  color: var(--primary);
  font-weight: 600;
  border-color: var(--primary);
  background: var(--surface-2);
}

.admin-subtitle {
  margin-top: 20px;
  font-size: 1.1rem;
}

.admin-pager-wrap {
  margin-top: 12px;
}

.admin-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.admin-pager-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-pager-muted {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.admin-pager-per {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-pager-per select {
  margin: 0 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.admin-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.admin-table th {
  background: var(--surface-2);
}

.admin-code-box {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-weight: 600;
  user-select: all;
}

.admin-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 10px 0 6px;
}

.admin-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.admin-col-check {
  width: 36px;
  text-align: center;
}

.btn-danger {
  background: #b91c1c;
  color: #fff;
  border: 1px solid #991b1b;
}

.btn-danger:hover {
  background: #991b1b;
}

.admin-btn-sm {
  font-size: 0.75rem;
  padding: 4px 10px;
}

.form-ok {
  color: var(--down);
  font-size: 0.85rem;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .app {
    padding: 12px 10px 28px;
  }

  .header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 12px;
    gap: 10px;
  }

  #pageSubtitle {
    display: none;
  }

  .header h1 {
    font-size: 1.25rem;
    font-weight: 700;
  }

  .header-brand {
    align-items: center;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .auth-bar {
    width: 100%;
    justify-content: center;
    gap: 12px;
  }

  .main-content {
    gap: 10px;
  }

  .mobile-market-hint {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    padding: 0 4px;
  }

  .index-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }

  .index-card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 10px 2px;
    gap: 4px;
    border: none;
    border-radius: 0;
    background: transparent;
    border-right: 1px solid var(--border);
  }

  .index-card:last-child {
    border-right: none;
  }

  .lbl-long {
    display: none;
  }

  .lbl-short {
    display: inline;
  }

  .index-label {
    font-size: 0.68rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    color: var(--text-muted);
  }

  .index-price {
    display: none;
  }

  .index-card .change-badge {
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0;
    background: transparent !important;
    font-family: "Cascadia Code", "Consolas", monospace;
  }

  .index-card .change-badge.up { color: var(--up); }
  .index-card .change-badge.down { color: var(--down); }
  .index-card .change-badge.flat { color: var(--flat); }

  .stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .stat-card {
    padding: 8px 6px;
    text-align: center;
  }

  .stat-label {
    font-size: 0.65rem;
    margin-bottom: 2px;
  }

  .stat-value {
    font-size: 0.95rem;
  }

  .stat-value.small {
    font-size: 0.62rem;
  }

  .fund-table-wrap {
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .fund-table {
    min-width: 0;
    display: block;
  }

  .fund-table thead {
    display: none;
  }

  .fund-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }

  .fund-table tr {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 11px 12px;
    box-shadow: none;
  }

  .fund-table tr:last-child {
    border-bottom: none;
  }

  .fund-table tr td {
    border: none;
    padding: 0;
  }

  .fund-table tr:hover td {
    background: transparent;
  }

  .fund-table tr:has(.empty),
  .fund-table tr:has(.loading) {
    display: block;
    padding: 28px 16px;
    text-align: center;
    border-bottom: none;
  }

  .col-name {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  .mobile-name-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .col-name .fund-link {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
  }

  /* 长文案不占窄屏；短「盘后」「盘前」仍显示 */
  .session-tag.session-tag--long {
    display: none !important;
  }

  .session-tag:not(.session-tag--long) {
    display: inline-block;
    flex: 0 0 auto;
    font-size: 0.62rem;
    color: #6eb5ff;
    white-space: nowrap;
    margin-left: 4px;
  }

  .col-change {
    order: 2;
    flex: 0 0 auto;
    text-align: right;
    align-self: center;
    margin-left: 0;
  }

  .col-action {
    order: 3;
    flex: 0 0 auto;
    margin-left: 0;
    align-self: center;
  }

  .col-code,
  .col-nav,
  .col-est-nav,
  .col-official,
  .col-time {
    display: none;
  }

  .mobile-meta {
    display: none;
  }

  .change-badge-lg {
    font-size: 0.92rem;
    font-weight: 700;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
    font-family: "Cascadia Code", "Consolas", monospace;
  }

  .change-badge-lg.up { color: var(--up); }
  .change-badge-lg.down { color: var(--down); }
  .change-badge-lg.flat { color: var(--flat); }

  .btn-remove {
    padding: 4px 8px;
    font-size: 0.72rem;
    border: 1px solid var(--border);
    border-radius: 6px;
  }

  .footer {
    margin-top: 16px;
  }

  .footer p {
    font-size: 0.68rem;
  }
}

.fund-page .fund-header {
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 12px;
}

.fund-page .fund-header h1 {
  font-size: 1.2rem;
  margin-top: 8px;
}

.fund-page .subtitle {
  font-size: 0.72rem;
  line-height: 1.5;
}

.fund-hero {
  text-align: center;
  padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
}

.fund-hero-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.fund-hero-pct {
  font-size: 2rem;
  font-weight: 700;
  font-family: "Cascadia Code", "Consolas", monospace;
  line-height: 1.2;
}

.fund-hero-pct.up { color: var(--up); }
.fund-hero-pct.down { color: var(--down); }
.fund-hero-pct.flat { color: var(--flat); }

.fund-hero-nav {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: "Cascadia Code", "Consolas", monospace;
}

.fund-hero-official {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0.92;
}

.fund-chips {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  padding: 0 4px;
}

.holdings-list-wrap {
  margin-bottom: 16px;
}

.holdings-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.holding-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}

.holding-card:last-child {
  border-bottom: none;
}

.holding-main {
  flex: 1 1 auto;
  min-width: 0;
}

.holding-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holding-meta {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.holding-side {
  flex: 0 0 auto;
  text-align: right;
}

.holding-pct {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: "Cascadia Code", "Consolas", monospace;
}

.holding-pct.up { color: var(--up); }
.holding-pct.down { color: var(--down); }
.holding-pct.flat { color: var(--flat); }

.holding-contrib {
  display: block;
  margin-top: 2px;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.holding-contrib.up { color: var(--up); }
.holding-contrib.down { color: var(--down); }

.holdings-list .loading,
.holdings-list .empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.fund-footer p {
  font-size: 0.68rem;
}
