:root {
  color-scheme: light;
  --bg: #f3f7fc;
  --bg-deep: #edf1f7;
  --panel: #ffffff;
  --panel-2: #f8fafd;
  --panel-hover: #eef3fa;
  --line: rgba(220, 230, 241, .85);
  --line-strong: rgba(22, 119, 255, .28);
  --text: #172b4d;
  --text-soft: #52677d;
  --text-muted: #8494a7;
  --primary: #1677ff;
  --primary-bright: #1677ff;
  --cyan: #13a8a8;
  --green: #52c41a;
  --yellow: #faad14;
  --orange: #fa8c16;
  --red: #f5222d;
  --violet: #722ed1;
  --pink: #eb2f96;
  --shadow: 0 18px 55px rgba(0, 0, 0, .08);
  --radius: 14px;
  --radius-sm: 9px;
  --header-height: 84px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

[hidden] {
  display: none !important;
}


* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(22, 119, 255, .04), transparent 34rem),
    radial-gradient(circle at 90% 15%, rgba(22, 119, 255, .03), transparent 32rem),
    var(--bg);
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

button, input, select { font: inherit; }
button { color: inherit; }
a { color: var(--primary); }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  background: white;
  color: #07111d;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 3vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.brand-group, .header-actions, .task-summary, .heading-actions, .history-top,
.source-name, .card-meta, .filter-actions, .compare-bar, .result-toolbar {
  display: flex;
  align-items: center;
}

.brand-group { gap: 14px; min-width: 0; }
.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(22, 119, 255, .3);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(22, 119, 255, .08), rgba(22, 119, 255, .03));
  box-shadow: inset 0 0 18px rgba(22, 119, 255, .06);
}
.brand-mark span { border-radius: 2px 2px 0 0; background: linear-gradient(#55dceb, #2b8eff); }
.brand-mark span:nth-child(1) { height: 38%; }
.brand-mark span:nth-child(2) { height: 72%; }
.brand-mark span:nth-child(3) { height: 100%; }

.eyebrow {
  margin: 0 0 5px;
  color: #1677ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .19em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(19px, 2vw, 27px); letter-spacing: .03em; white-space: nowrap; }
h2 { margin-bottom: 0; font-size: 23px; }
h3 { margin-bottom: 4px; font-size: 15px; letter-spacing: .01em; }

.header-actions { gap: 20px; }
.last-refresh { display: grid; text-align: right; gap: 3px; }
.last-refresh span { color: var(--text-muted); font-size: 11px; }
.last-refresh strong { color: var(--text-soft); font-size: 12px; font-weight: 600; }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: .18s ease;
}
.button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary {
  border-color: #1677ff;
  background: linear-gradient(135deg, #1677ff, #4096ff);
  box-shadow: 0 7px 24px rgba(22, 119, 255, .18);
}
.button-primary:hover:not(:disabled) { box-shadow: 0 9px 30px rgba(22, 119, 255, .28); }
.button-secondary { border-color: var(--line-strong); background: rgba(22, 119, 255, .06); }
.button-secondary:hover:not(:disabled) { background: rgba(22, 119, 255, .12); }
.button-ghost { border-color: var(--line); background: transparent; color: var(--text-soft); }
.button-ghost:hover:not(:disabled) { background: rgba(22, 119, 255, .06); color: var(--text); }

.refresh-button.refreshing svg { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.main-nav {
  height: 51px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0 clamp(18px, 3vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
}
.nav-tab {
  position: relative;
  min-width: 86px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.main-nav a.nav-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.nav-tab:hover, .nav-tab.active { color: var(--text); }
.nav-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
  box-shadow: 0 -4px 12px rgba(22, 119, 255, .3);
}
.nav-meta { margin-left: auto; align-self: center; color: var(--text-muted); font-size: 11px; }

main { width: min(1800px, 100%); margin: 0 auto; padding: 20px clamp(18px, 3vw, 52px) 70px; }

.task-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(280px, 1.35fr) auto;
  align-items: center;
  gap: 30px;
  min-height: 85px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98));
  box-shadow: var(--shadow);
}
.task-summary { gap: 12px; min-width: 0; }
.task-summary > div:last-child { display: grid; min-width: 0; gap: 2px; }
.task-summary strong { font-size: 14px; }
.task-summary small { overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.task-label { color: var(--text-soft); font-size: 10px; }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 0 5px rgba(132, 148, 167, .1); }
.status-dot.running { background: var(--primary-bright); box-shadow: 0 0 0 5px rgba(22, 119, 255, .1), 0 0 10px rgba(22, 119, 255, .4); animation: pulse 1.5s ease-in-out infinite; }
.status-dot.completed { background: var(--green); box-shadow: 0 0 0 5px rgba(82, 196, 26, .1); }
.status-dot.failed { background: var(--red); box-shadow: 0 0 0 5px rgba(245, 34, 45, .1); }
@keyframes pulse { 50% { opacity: .5; transform: scale(.78); } }

.progress-area { min-width: 0; }
.progress-caption { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--text-muted); font-size: 10px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 5px; background: rgba(22, 119, 255, .08); }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--cyan)); box-shadow: 0 0 8px rgba(22, 119, 255, .3); transition: width .35s ease; }

.task-counters { display: flex; align-items: center; gap: 21px; }
.task-counters > div { display: grid; justify-items: center; gap: 2px; }
.task-counters span { font-size: 16px; font-weight: 750; }
.task-counters small { color: var(--text-muted); font-size: 9px; }
.counter-success { color: var(--green); }
.counter-error { color: var(--red); }
.counter-muted { color: var(--text-soft); }
.text-button { padding: 6px 0; border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 11px; }

.task-source-panel {
  grid-column: 1 / -1;
  max-height: 240px;
  overflow: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.task-source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 7px; }
.task-source-item { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 7px; background: rgba(245, 248, 252, .8); font-size: 11px; }
.task-source-item span:first-child { overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }

.disclaimer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 27px;
  padding: 10px 13px;
  border: 1px solid rgba(250, 173, 20, .3);
  border-radius: 9px;
  background: rgba(250, 173, 20, .06);
  color: #ad6800;
  font-size: 11px;
  line-height: 1.55;
}
.disclaimer svg { width: 17px; flex: 0 0 auto; fill: none; stroke: #faad14; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.view { display: none; animation: reveal .25s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
}
.data-scope { color: var(--text-muted); font-size: 10px; }

.strategy-section { margin-bottom: 22px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, rgba(22, 119, 255, .05), rgba(255, 255, 255, .98)); box-shadow: var(--shadow); }
.strategy-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.strategy-heading h3 { margin: 0; font-size: 18px; }
.strategy-filters { display: flex; gap: 10px; }
.strategy-filters label { display: grid; gap: 4px; color: var(--text-muted); font-size: 9px; }
.strategy-filters select { min-width: 112px; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--text); }
.strategy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 11px; }
.strategy-card { position: relative; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .96); }
.strategy-card-link { display: block; color: inherit; text-decoration: none; }
.strategy-card-link:hover h4 { color: var(--primary); }
.strategy-card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 11px; }
.strategy-level, .strategy-kind { padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.strategy-level { background: rgba(245, 34, 45, .1); color: #cf1322; }
.strategy-level.level-推荐 { background: rgba(22, 119, 255, .1); color: var(--primary); }
.strategy-level.level-观察 { background: rgba(250, 173, 20, .12); color: #ad6800; }
.strategy-kind { margin-left: auto; background: rgba(82, 196, 26, .1); color: #389e0d; }
.strategy-card code { color: var(--text-muted); font-size: 9px; overflow-wrap: anywhere; }
.strategy-card h4 { min-height: 42px; margin: 5px 0 10px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; transition: color .18s ease; }
.strategy-yield { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.strategy-yield strong { color: var(--primary); font-size: 24px; }
.strategy-yield span { color: var(--text-muted); font-size: 9px; }
.strategy-card dl { display: grid; gap: 6px; margin: 0; }
.strategy-card dl div { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 7px; font-size: 10px; }
.strategy-card dt { color: var(--text-muted); }
.strategy-card dd { margin: 0; color: var(--text-soft); overflow-wrap: anywhere; }
.strategy-card p { min-height: 44px; margin: 12px 0; color: var(--text-soft); font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.strategy-card footer { padding-top: 10px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 9px; }
.strategy-compare-button { position: absolute; right: 15px; bottom: 10px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--primary); cursor: pointer; font-size: 9px; }
.strategy-empty { grid-column: 1 / -1; padding: 28px 12px; color: var(--text-muted); text-align: center; font-size: 11px; }

.detail-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 0 clamp(18px, 5vw, 72px); border-bottom: 1px solid var(--line); background: white; }
.detail-topbar a { color: var(--primary); text-decoration: none; }
.instrument-page { width: min(1180px, calc(100% - 32px)); margin: 32px auto 64px; }
.instrument-state { padding: 56px 20px; color: var(--text-muted); text-align: center; }
.instrument-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.instrument-hero h1 { margin: 5px 0; font-size: clamp(24px, 4vw, 38px); }
.instrument-hero code { color: var(--text-muted); }
.instrument-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.instrument-metrics > div { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.instrument-metrics > .primary { grid-column: span 2; }
.instrument-metrics span, .instrument-metrics small { display: block; color: var(--text-muted); font-size: 10px; }
.instrument-metrics strong { display: block; margin: 10px 0; font-size: 21px; overflow-wrap: anywhere; }
.instrument-metrics .primary strong { color: var(--primary); font-size: 28px; }
.detail-panel { margin-top: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.detail-panel h2 { margin: 0 0 18px; font-size: 17px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.detail-list div { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--text-muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.recommendation p { margin: 0; line-height: 1.8; }
.recommendation b { margin-right: 10px; color: var(--primary); }
.instrument-updated { padding: 18px 2px; color: var(--text-muted); text-align: right; font-size: 10px; }
.instrument-table-wrap, .instrument-compare-wrap { overflow-x: auto; }
.instrument-table { width: 100%; border-collapse: collapse; background: white; }
.instrument-table th, .instrument-table td { min-width: 120px; padding: 13px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.instrument-table th { background: var(--surface); color: var(--text-soft); }
.compare-table thead th:not(:first-child) { min-width: 220px; }
.compare-table a { color: var(--text); text-decoration: none; }
.compare-table a:hover { color: var(--primary); }
.compare-table a small { display: block; margin-top: 6px; color: var(--text-muted); }
.nav-trend-chart { height: 360px; }

@media (max-width: 700px) {
  .instrument-page { width: min(100% - 20px, 1180px); margin-top: 20px; }
  .instrument-hero { align-items: flex-start; }
  .instrument-metrics { grid-template-columns: 1fr 1fr; }
  .instrument-metrics > .primary { grid-column: 1 / -1; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-topbar { padding: 0 12px; font-size: 11px; }
}

.fund-toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 14px; }
.fund-toolbar label { display: grid; gap: 5px; color: var(--text-muted); font-size: 10px; }
.fund-toolbar input, .fund-toolbar select { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--text); }
.fund-search { width: min(360px, 100%); }
.period-switch { display: flex; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.period-switch button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 11px; }
.period-switch button.active { background: var(--primary); color: white; }
.fund-status { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(22, 119, 255, .06); color: var(--text-soft); font-size: 11px; }
.fund-status.error { background: rgba(245, 34, 45, .07); color: #cf1322; }
.fund-status.stale { background: rgba(250, 173, 20, .09); color: #ad6800; }
.fund-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.fund-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 24px rgba(0, 0, 0, .06); cursor: pointer; transition: .18s ease; }
.fund-card:hover, .fund-card:focus-visible { transform: translateY(-2px); border-color: var(--line-strong); }
.fund-card-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.fund-card code { color: var(--text-muted); font-size: 10px; }
.fund-card h3 { margin: 5px 0 0; font-size: 13px; line-height: 1.45; }
.fund-type { flex: 0 0 auto; padding: 3px 7px; border-radius: 6px; background: rgba(22, 119, 255, .07); color: var(--primary); font-size: 9px; }
.fund-card-return { margin: 20px 0; }
.fund-card-return > span:first-child { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: 9px; }
.fund-return { font-size: 24px; font-weight: 750; }
.fund-return.positive { color: #f5222d; }
.fund-return.negative { color: #389e0d; }
.fund-return.neutral { color: var(--text-muted); }
.fund-card-meta { display: flex; justify-content: space-between; padding-top: 11px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 9px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.metric-card {
  position: relative;
  min-height: 122px;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98));
  box-shadow: 0 8px 27px rgba(0, 0, 0, .14);
}
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--metric-color); }
.metric-card::after { content: ""; position: absolute; right: -25px; top: -36px; width: 90px; height: 90px; border-radius: 50%; background: var(--metric-color); opacity: .06; filter: blur(3px); }
.metric-card span { display: block; color: var(--text-soft); font-size: 11px; }
.metric-card strong { display: block; margin: 12px 0 7px; color: var(--text); font-size: clamp(25px, 2.4vw, 34px); line-height: 1; letter-spacing: -.03em; }
.metric-card small { color: var(--text-muted); font-size: 9px; }
.accent-blue { --metric-color: var(--primary); }
.accent-cyan { --metric-color: #13a8a8; }
.accent-violet { --metric-color: var(--violet); }
.accent-green { --metric-color: var(--green); }
.accent-orange { --metric-color: var(--orange); }
.accent-yellow { --metric-color: var(--yellow); }
.accent-pink { --metric-color: var(--pink); }
.accent-red { --metric-color: var(--red); }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98)); box-shadow: 0 12px 35px rgba(0, 0, 0, .15); }
.panel > header { display: flex; align-items: start; justify-content: space-between; min-height: 65px; padding: 15px 17px 10px; border-bottom: 1px solid rgba(220, 230, 241, .6); }
.panel header p { margin-bottom: 0; color: var(--text-muted); font-size: 9px; }
.panel-tag { padding: 3px 7px; border: 1px solid rgba(22, 119, 255, .2); border-radius: 5px; color: var(--primary); font-size: 9px; }
.chart { width: 100%; height: 310px; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--text-muted); font-size: 12px; }

.product-heading { align-items: center; }
.heading-actions { gap: 8px; }
.mobile-filter-button { display: none; }
.export-menu { position: relative; }
.menu { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: 145px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 9px; background: #ffffff; box-shadow: var(--shadow); }
.menu button { width: 100%; padding: 10px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; font-size: 12px; }
.menu button:hover { background: rgba(22, 119, 255, .06); }

.product-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; gap: 14px; }
.filter-panel {
  position: sticky;
  top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98));
}
.filter-panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.filter-panel-heading h3 { margin: 0; }
#filterForm { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 9px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field-full, .range-field, .filter-actions { grid-column: 1 / -1; }
.field > span { color: var(--text-muted); font-size: 10px; }
input, select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, .85);
  font-size: 11px;
}
input::placeholder { color: #b0bec5; }
select { padding-right: 4px; }
.range-field > div { display: flex; align-items: center; gap: 5px; }
.range-field b { color: var(--text-muted); font-weight: 400; }
.filter-actions { gap: 7px; margin-top: 4px; }
.filter-actions .button { flex: 1; }
.mobile-only { display: none; }

.products-main { min-width: 0; }
.quick-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.quick-filters button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(22, 119, 255, .04);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 10px;
}
.quick-filters button:hover, .quick-filters button.active { border-color: rgba(22, 119, 255, .5); background: rgba(22, 119, 255, .1); color: #1677ff; }

.result-toolbar { justify-content: space-between; min-height: 39px; margin-bottom: 7px; color: var(--text-muted); font-size: 10px; }
.result-toolbar p { margin: 0; }
.result-toolbar strong { color: var(--text); font-size: 12px; }
.result-toolbar label { display: flex; align-items: center; gap: 6px; }
.result-toolbar select { width: 62px; height: 30px; }

.table-wrap { position: relative; max-height: 670px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .95); }
.product-table, .quality-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.product-table th, .quality-table th { position: sticky; top: 0; z-index: 2; height: 44px; padding: 0 11px; border-bottom: 1px solid var(--line); background: #f5f8fc; color: var(--text-soft); text-align: left; font-weight: 650; white-space: nowrap; }
.product-table th[data-sort] { cursor: pointer; }
.product-table th[data-sort]::after { content: "↕"; margin-left: 5px; color: #58718d; }
.product-table th.sort-asc::after { content: "↑"; color: var(--primary); }
.product-table th.sort-desc::after { content: "↓"; color: var(--primary); }
.product-table td, .quality-table td { padding: 11px; border-bottom: 1px solid rgba(220, 230, 241, .5); color: var(--text-soft); vertical-align: top; }
.product-table tbody tr:hover, .quality-table tbody tr:hover { background: rgba(22, 119, 255, .04); }
.product-table tbody tr:last-child td, .quality-table tbody tr:last-child td { border-bottom: 0; }
.product-name-cell { min-width: 235px; max-width: 330px; }
.product-name-cell button { padding: 0; border: 0; background: none; color: #172b4d; cursor: pointer; text-align: left; line-height: 1.55; font-weight: 620; }
.product-name-cell small { display: block; margin-top: 4px; color: var(--text-muted); font-weight: 400; }
.cell-secondary { max-width: 180px; line-height: 1.45; }
.cell-nowrap { white-space: nowrap; }
.cell-benchmark { min-width: 130px; max-width: 210px; }
.cell-benchmark strong { display: block; color: #13a8a8; font-size: 13px; }
.cell-benchmark small { display: block; margin-top: 4px; color: var(--text-muted); line-height: 1.4; }
.select-column { width: 35px; }
.compare-checkbox { width: 16px; height: 16px; accent-color: var(--primary); }
.action-column { width: 100px; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.row-actions button, .row-actions a { padding: 0; border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 10px; text-decoration: none; white-space: nowrap; }
.loading-state, .empty-state { min-height: 140px; display: grid; place-items: center; padding: 24px; color: var(--text-muted); font-size: 12px; text-align: center; }
.product-card-list { display: none; }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border: 1px solid transparent; border-radius: 5px; font-size: 9px; font-weight: 650; white-space: nowrap; }
.badge-risk-R1, .badge-risk-R2, .badge-success, .badge-completed { border-color: rgba(82, 196, 26, .24); background: rgba(82, 196, 26, .06); color: #389e0d; }
.badge-risk-R3, .badge-no_data, .badge-never, .badge-queued { border-color: rgba(250, 173, 20, .24); background: rgba(250, 173, 20, .06); color: #d48806; }
.badge-risk-R4, .badge-risk-R5, .badge-failed, .badge-timeout, .badge-structure_changed { border-color: rgba(245, 34, 45, .24); background: rgba(245, 34, 45, .06); color: #cf1322; }
.badge-running { border-color: rgba(22, 119, 255, .3); background: rgba(22, 119, 255, .06); color: #1677ff; }
.badge-unsupported, .badge-needs_login, .badge-medium { border-color: rgba(114, 46, 209, .2); background: rgba(114, 46, 209, .05); color: #531dab; }
.badge-high { border-color: rgba(82, 196, 26, .24); background: rgba(82, 196, 26, .06); color: #389e0d; }
.badge-low { border-color: rgba(250, 140, 22, .24); background: rgba(250, 140, 22, .06); color: #d87d16; }

.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.pagination button { min-width: 34px; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .9); color: var(--text-soft); cursor: pointer; font-size: 10px; }
.pagination button.active { border-color: var(--primary); background: rgba(22, 119, 255, .1); color: #1677ff; }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }

.quality-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.quality-stat { padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .95); }
.quality-stat span { display: block; color: var(--text-muted); font-size: 9px; }
.quality-stat strong { display: block; margin-top: 8px; font-size: 23px; }
.quality-panel { overflow: hidden; }
.quality-table-wrap { max-height: 720px; overflow: auto; }
.quality-table td { max-width: 270px; line-height: 1.45; }
.quality-table .error-cell { color: #a3b4c7; font-size: 9px; }
.source-name { align-items: flex-start; gap: 9px; min-width: 190px; }
.source-name > div { display: grid; gap: 3px; }
.source-name strong { color: var(--text); font-size: 10px; }
.source-name small { color: var(--text-muted); font-size: 8px; }
.source-refresh { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(245, 248, 252, .9); cursor: pointer; font-size: 9px; white-space: nowrap; }
.source-card-list { display: none; }

.history-list { display: grid; gap: 10px; }
.history-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .96); }
.history-top { justify-content: space-between; gap: 14px; padding: 15px 17px; }
.history-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.history-title strong { font-size: 12px; }
.history-title code { color: var(--text-muted); font-size: 9px; }
.history-time { display: grid; gap: 3px; color: var(--text-muted); font-size: 9px; text-align: right; }
.history-metrics { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.history-metrics div { padding: 11px 14px; border-right: 1px solid var(--line); }
.history-metrics div:last-child { border-right: 0; }
.history-metrics span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 8px; }
.history-metrics strong { font-size: 13px; }
.history-errors { padding: 10px 17px; border-top: 1px solid var(--line); color: #a0a0a0; font-size: 9px; line-height: 1.55; }
.history-actions { display: flex; gap: 10px; padding: 0 17px 13px; }
.history-actions a, .history-actions button { padding: 0; border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 9px; text-decoration: none; }

.compare-bar {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 30px));
  justify-content: space-between;
  gap: 16px;
  padding: 11px 13px 11px 17px;
  border: 1px solid rgba(22, 119, 255, .3);
  border-radius: 13px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .12);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}
.compare-bar > div { display: flex; align-items: center; gap: 13px; }
.compare-bar strong { font-size: 12px; }
.compare-bar span { color: var(--text-muted); font-size: 10px; }

.modal { width: min(1120px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 1px solid var(--line-strong); border-radius: 15px; color: var(--text); background: #ffffff; box-shadow: 0 30px 100px rgba(0, 0, 0, .12); }
.modal::backdrop { background: rgba(0, 0, 0, .35); backdrop-filter: blur(5px); }
.modal-shell > header { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 75px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .97); }
.modal-shell > header h2 { font-size: 18px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: rgba(22, 119, 255, .04); color: var(--text-soft); cursor: pointer; font-size: 23px; line-height: 1; }
.modal-content { max-height: calc(100vh - 108px); overflow: auto; padding: 20px; }
.modal-shell.compact { max-width: 520px; margin: auto; }
.detail-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(110px, .45fr)); gap: 10px; margin-bottom: 14px; }
.detail-hero > div { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(248, 250, 252, .9); }
.detail-hero .detail-name { padding: 16px; }
.detail-hero span { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: 9px; }
.detail-hero strong { font-size: 15px; line-height: 1.5; }
.detail-hero .detail-name strong { font-size: 17px; }
.detail-section { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: rgba(248, 250, 252, .9); }
.detail-section h3 { margin-bottom: 13px; color: #172b4d; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 17px; }
.detail-field { min-width: 0; }
.detail-field span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 9px; }
.detail-field strong, .detail-field a { color: var(--text-soft); font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.detail-field.full { grid-column: 1 / -1; }
.detail-note { padding: 10px 12px; border-left: 2px solid var(--yellow); background: rgba(250, 173, 20, .06); color: #ad6800; font-size: 10px; line-height: 1.6; }
.reason-list, .snapshot-list, .source-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.reason-list li, .snapshot-list li, .source-list li { padding: 9px 11px; border-radius: 7px; background: rgba(245, 248, 252, .8); color: var(--text-soft); font-size: 9px; line-height: 1.5; }
.source-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.source-list a { overflow-wrap: anywhere; }
details.raw-details { margin-top: 12px; }
details.raw-details summary { cursor: pointer; color: var(--text-muted); font-size: 9px; }
details.raw-details pre { max-height: 350px; overflow: auto; padding: 12px; border-radius: 8px; background: #f5f7fa; color: #52677d; font-size: 9px; white-space: pre-wrap; overflow-wrap: anywhere; }

.compare-table-wrap { overflow: auto; }
.compare-table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 10px; }
.compare-table th, .compare-table td { min-width: 155px; padding: 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.55; }
.compare-table th { position: sticky; top: 0; background: #f5f8fc; color: var(--text); }
.compare-table th:first-child, .compare-table td:first-child { position: sticky; left: 0; z-index: 2; min-width: 120px; background: #fafbfd; color: var(--text-muted); }
.compare-disclaimer { margin-top: 14px; color: #ad6800; font-size: 10px; line-height: 1.6; }
.column-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.column-options label { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text-soft); font-size: 10px; }
.column-options input { width: 15px; height: 15px; }

.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(255, 255, 255, .97); box-shadow: var(--shadow); color: var(--text-soft); font-size: 11px; line-height: 1.5; animation: toast-in .2s ease; }
.toast.error { border-color: rgba(255, 105, 120, .4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.noscript { position: fixed; inset: auto 10px 10px; z-index: 200; padding: 15px; border-radius: 8px; background: #9e2835; color: white; text-align: center; }
.drawer-scrim { display: none; }

@media (min-width: 1280px) {
  .chart-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chart-panel.wide { grid-column: span 2; }
  .chart { height: 285px; }
}

@media (max-width: 1050px) {
  .task-strip { grid-template-columns: minmax(230px, 1fr) minmax(260px, 1.2fr); gap: 20px; }
  .task-counters { grid-column: 1 / -1; justify-content: flex-end; margin-top: -6px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-layout { grid-template-columns: 235px minmax(0, 1fr); }
  .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .history-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fund-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .history-metrics div { border-bottom: 1px solid var(--line); }
}

@media (max-width: 768px) {
  :root { --header-height: auto; }
  .topbar { align-items: flex-start; padding: 15px; }
  .brand-mark { width: 38px; height: 38px; padding: 8px; }
  h1 { max-width: 210px; font-size: 17px; white-space: normal; line-height: 1.3; }
  .last-refresh { display: none; }
  .refresh-button { min-width: 106px; min-height: 44px; padding: 0 12px; }
  .main-nav { height: 48px; gap: 0; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-tab { min-width: 76px; min-height: 44px; padding: 0 8px; font-size: 12px; }
  .nav-meta { display: none; }
  main { padding: 14px 12px 80px; }
  .task-strip { grid-template-columns: 1fr; gap: 16px; padding: 15px; }
  .task-counters { grid-column: auto; justify-content: space-between; margin: 0; }
  .task-source-panel { grid-column: auto; }
  .task-source-grid { grid-template-columns: 1fr; }
  .disclaimer { align-items: flex-start; margin-bottom: 22px; }
  .section-heading { align-items: center; }
  .section-heading h2 { font-size: 20px; }
  .data-scope { display: none; }
  .strategy-section { padding: 14px; }
  .strategy-heading { align-items: stretch; flex-direction: column; }
  .strategy-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strategy-filters select { width: 100%; min-width: 0; }
  .strategy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-height: 110px; padding: 14px; }
  .metric-card strong { font-size: 25px; }
  .chart-grid { grid-template-columns: 1fr; gap: 10px; }
  .chart-panel.wide { grid-column: auto; }
  .chart { height: 290px; }
  .panel > header { min-height: 61px; }
  .fund-toolbar { align-items: stretch; flex-direction: column; }
  .fund-search { width: 100%; }
  .period-switch { width: 100%; margin-left: 0; overflow-x: auto; }
  .period-switch button { min-width: 82px; flex: 1 0 auto; min-height: 42px; }
  .fund-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .fund-card { min-height: 185px; padding: 13px; touch-action: manipulation; }

  .mobile-filter-button, .mobile-only { display: inline-flex; }
  .product-heading { gap: 10px; }
  .heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .heading-actions .button { min-height: 38px; padding: 0 11px; }
  .product-layout { display: block; }
  .filter-panel {
    position: fixed;
    z-index: 80;
    inset: 0 0 0 auto;
    width: min(360px, 92vw);
    max-height: 100vh;
    overflow: auto;
    padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
    border-radius: 0;
    transform: translateX(105%);
    transition: transform .25s ease;
  }
  .filter-panel.open { transform: translateX(0); }
  .drawer-scrim:not([hidden]) { position: fixed; z-index: 70; inset: 0; display: block; background: rgba(0, 0, 0, .35); }
  #filterForm { gap: 13px 9px; }
  input, select { min-height: 44px; font-size: 12px; }
  .filter-actions .button { min-height: 46px; }
  .quick-filters { flex-wrap: nowrap; margin-right: -12px; padding-right: 12px; overflow-x: auto; scrollbar-width: none; }
  .quick-filters::-webkit-scrollbar { display: none; }
  .quick-filters button { flex: 0 0 auto; min-height: 36px; padding: 0 12px; }
  .table-wrap { display: none; }
  .product-card-list { display: grid; gap: 9px; }
  .product-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98)); }
  .product-card-top { display: flex; align-items: flex-start; gap: 11px; }
  .product-card-title { min-width: 0; flex: 1; }
  .product-card-title button { padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; text-align: left; font-size: 13px; font-weight: 650; line-height: 1.55; }
  .product-card-title small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 9px; overflow-wrap: anywhere; }
  .product-card-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 12px 0; }
  .product-card-metrics div { padding: 9px; border-radius: 7px; background: rgba(245, 248, 252, .7); }
  .product-card-metrics span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 8px; }
  .product-card-metrics strong { color: var(--text-soft); font-size: 11px; line-height: 1.35; }
  .product-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
  .product-card-bottom .row-actions { gap: 14px; }
  .product-card-bottom .row-actions button, .product-card-bottom .row-actions a { min-height: 34px; display: inline-flex; align-items: center; font-size: 11px; }
  .result-toolbar { min-height: 44px; }
  .result-toolbar select { min-height: 34px; }
  .pagination button { min-width: 40px; min-height: 40px; }

  .quality-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quality-table-wrap { display: none; }
  .source-card-list { display: grid; gap: 8px; padding: 10px; }
  .source-card { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .9); }
  .source-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .source-card h3 { margin: 0 0 4px; font-size: 12px; }
  .source-card p { margin: 0; color: var(--text-muted); font-size: 9px; }
  .source-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 11px; }
  .source-card-grid span { display: block; color: var(--text-muted); font-size: 8px; }
  .source-card-grid strong { display: block; margin-top: 5px; color: var(--text-soft); font-size: 10px; }
  .source-card-error { margin-top: 10px; color: #a0a0a0; font-size: 9px; line-height: 1.5; }
  .source-card-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

  .history-top { align-items: flex-start; }
  .history-time { min-width: 90px; }
  .history-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-metrics div { border-right: 1px solid var(--line); }
  .history-metrics div:nth-child(2n) { border-right: 0; }

  .modal { width: 100vw; max-width: none; max-height: 100dvh; margin: 0; border-radius: 0; }
  .modal-shell > header { min-height: 69px; padding: 13px 14px; }
  .modal-content { max-height: calc(100dvh - 69px); padding: 14px; }
  .detail-hero { grid-template-columns: repeat(3, 1fr); }
  .detail-hero .detail-name { grid-column: 1 / -1; }
  .detail-hero > div { padding: 11px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .source-list li { align-items: flex-start; flex-direction: column; }
  .toast-region { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
}

@media (max-width: 420px) {
  .topbar { gap: 8px; }
  .brand-group { gap: 9px; }
  .brand-group .eyebrow { display: none; }
  h1 { max-width: 170px; font-size: 15px; }
  .refresh-button { min-width: 98px; }
  .refresh-button span { font-size: 12px; }
  .metric-card { min-height: 104px; padding: 13px 12px; }
  .metric-card span { font-size: 10px; }
  .metric-card strong { font-size: 23px; }
  .metric-card small { font-size: 8px; }
  .product-heading { align-items: flex-start; }
  .product-heading .eyebrow { display: none; }
  .heading-actions { gap: 5px; }
  .heading-actions .button { padding: 0 9px; font-size: 11px; }
  .product-card-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-field.full { grid-column: auto; }
  .column-options { grid-template-columns: 1fr; }
  .compare-bar { padding: 10px; }
  .compare-bar > div { gap: 7px; }
  .fund-grid { grid-template-columns: 1fr; }
  .strategy-grid { grid-template-columns: 1fr; }
  .compare-bar .button { min-height: 38px; padding: 0 10px; }
}

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