:root {
  --bg: #07111f;
  --panel: rgba(17, 35, 58, 0.76);
  --panel-hover: rgba(24, 52, 84, 0.95);
  --text: #eef6ff;
  --muted: #8fa9c6;
  --accent: #5ee7c4;
  --line: rgba(151, 181, 214, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(38, 115, 139, 0.24), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(26, 77, 124, 0.20), transparent 34%),
    var(--bg);
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 88px 0 72px;
}

.hero {
  margin-bottom: 48px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.24em;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

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

.nav-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 28px;
  align-items: center;
  min-width: 0;
  min-height: 112px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
  backdrop-filter: blur(12px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-card:hover,
.nav-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(94, 231, 196, 0.5);
  background: var(--panel-hover);
}

.index {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.title {
  min-width: 0;
  font-size: 21px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.arrow {
  justify-self: end;
  color: var(--accent);
  font-size: 24px;
  transition: transform 160ms ease;
}

.nav-card:hover .arrow,
.nav-card:focus-visible .arrow {
  transform: translateX(4px);
}

/* 二级列表页与因子展示页 */
.inner-shell {
  padding-top: 48px;
}

.back-link,
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
}

.back-link:hover,
.back-link:focus-visible,
.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  text-decoration: underline;
}

.compact-hero {
  margin-top: 44px;
  margin-bottom: 32px;
}

.compact-hero h1 {
  font-size: clamp(36px, 6vw, 60px);
}

.factor-list {
  display: grid;
  gap: 14px;
}

.factor-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 20px;
  min-width: 0;
  min-height: 84px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.factor-card:hover,
.factor-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(94, 231, 196, 0.5);
  background: var(--panel-hover);
}

.factor-card:hover .arrow,
.factor-card:focus-visible .arrow {
  transform: translateX(4px);
}

.factor-name {
  min-width: 0;
  font-size: 19px;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.factor-meta {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.detail-title {
  max-width: 900px;
}

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

.report-panel {
  min-width: 0;
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow-x: auto;
}

.report-panel h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.report-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

table {
  max-width: 100%;
}

.table-scroll,
.chart-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 平板 */
@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 32px, 760px);
    padding-top: 64px;
  }

  .nav-grid {
    gap: 14px;
  }

  .nav-card {
    grid-template-columns: 46px minmax(0, 1fr) 24px;
    min-height: 100px;
    padding: 18px 18px;
  }

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

/* 手机 */
@media (max-width: 700px) {
  .page-shell {
    width: calc(100% - 28px);
    padding: 42px 0 44px;
  }

  .inner-shell {
    padding-top: 24px;
  }

  .hero {
    margin-bottom: 30px;
  }

  .compact-hero {
    margin-top: 28px;
    margin-bottom: 24px;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 11px;
    line-height: 1.6;
    letter-spacing: 0.17em;
  }

  h1 {
    font-size: clamp(34px, 11vw, 48px);
    line-height: 1.12;
  }

  .compact-hero h1 {
    font-size: clamp(31px, 10vw, 44px);
  }

  .subtitle {
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.7;
  }

  .nav-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nav-card {
    grid-template-columns: 42px minmax(0, 1fr) 22px;
    min-height: 80px;
    padding: 15px 16px;
    border-radius: 13px;
  }

  .index {
    font-size: 12px;
  }

  .title {
    font-size: 18px;
    line-height: 1.35;
  }

  .arrow {
    font-size: 21px;
  }

  .breadcrumb {
    gap: 6px;
    font-size: 13px;
  }

  .factor-card {
    grid-template-columns: minmax(0, 1fr) 22px;
    gap: 6px 10px;
    min-height: 76px;
    padding: 15px 16px;
    border-radius: 12px;
  }

  .factor-name {
    grid-column: 1;
    grid-row: 1;
    font-size: 17px;
    line-height: 1.45;
  }

  .factor-meta {
    grid-column: 1;
    grid-row: 2;
    font-size: 13px;
  }

  .factor-card .arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .report-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .report-panel {
    min-height: 150px;
    padding: 17px;
    border-radius: 13px;
  }

  .report-panel h2 {
    font-size: 18px;
  }
}

/* 极窄屏幕 */
@media (max-width: 380px) {
  .page-shell {
    width: calc(100% - 20px);
  }

  .nav-card {
    grid-template-columns: 36px minmax(0, 1fr) 18px;
    padding: 14px 13px;
  }

  .title {
    font-size: 17px;
  }
}


/* =========================================================
   全站统一顶部工具栏：二级页、三级页、股票组合页
   ========================================================= */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.site-mark-badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(94, 231, 196, 0.72);
  border-radius: 50%;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  background: rgba(94, 231, 196, 0.06);
}

.site-mark-text {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.14em;
  overflow-wrap: anywhere;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.home-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid rgba(94, 231, 196, 0.44);
  border-radius: 999px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  background: rgba(94, 231, 196, 0.07);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.secondary-button {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(17, 35, 58, 0.45);
}

.home-button:hover,
.home-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(94, 231, 196, 0.75);
  background: rgba(94, 231, 196, 0.14);
  color: var(--accent);
}

.content-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.empty-state {
  color: var(--muted);
  line-height: 1.8;
}

/* Plotly 图表页：保留首页视觉风格，同时允许图表使用浅色画布 */
.plotly-page-shell {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 48px;
}

.plotly-title-block {
  margin: 26px 0 20px;
}

.plotly-title-block h1 {
  font-size: clamp(32px, 5vw, 54px);
}

.plotly-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.plotly-card > div {
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 700px) {
  .page-toolbar {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 18px;
  }

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

  .home-button,
  .secondary-button {
    min-height: 38px;
    padding: 9px 13px;
    font-size: 13px;
  }

  .site-mark-text {
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  .plotly-page-shell {
    width: calc(100% - 20px);
    padding: 20px 0 28px;
  }

  .plotly-title-block {
    margin: 20px 0 14px;
  }

  .plotly-card {
    border-radius: 12px;
  }
}


/* =========================================================
   字体层级优化：中文为主，英文缩写仅用于技术名称
   ========================================================= */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Noto Sans CJK SC", Arial, sans-serif;
  --font-size-body: 16px;
  --font-size-note: 14px;
  --font-size-card: 19px;
  --font-size-section: 22px;
  --font-size-page-title: 42px;
  --font-size-home-title: 50px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  line-height: 1.7;
  letter-spacing: 0;
}

.hero {
  margin-bottom: 40px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

h1,
.compact-hero h1,
.plotly-title-block h1 {
  margin: 0;
  max-width: 100%;
  font-size: var(--font-size-page-title);
  font-weight: 720;
  line-height: 1.24;
  letter-spacing: -0.025em;
}

.home-hero h1 {
  font-size: var(--font-size-home-title);
}

.subtitle {
  margin-top: 14px;
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0;
}

.title {
  font-size: var(--font-size-card);
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.factor-name {
  font-size: var(--font-size-card);
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.factor-meta,
.breadcrumb,
.empty-state {
  font-size: var(--font-size-note);
  line-height: 1.75;
}

.index {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.report-panel h2 {
  margin-bottom: 12px;
  font-size: var(--font-size-section);
  font-weight: 680;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.report-panel p,
.content-card p {
  font-size: 16px;
  line-height: 1.85;
}

.site-mark-text {
  color: var(--text);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.4;
  letter-spacing: 0;
}

.site-mark-badge {
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0;
}

.home-button,
.secondary-button {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}

.compact-hero {
  margin-top: 34px;
  margin-bottom: 28px;
}

.plotly-title-block {
  margin: 28px 0 20px;
}

@media (max-width: 900px) {
  :root {
    --font-size-page-title: 38px;
    --font-size-home-title: 44px;
  }
}

@media (max-width: 700px) {
  :root {
    --font-size-body: 15px;
    --font-size-note: 13px;
    --font-size-card: 17px;
    --font-size-section: 19px;
    --font-size-page-title: 31px;
    --font-size-home-title: 36px;
  }

  .hero {
    margin-bottom: 28px;
  }

  .eyebrow {
    margin-bottom: 9px;
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  h1,
  .compact-hero h1,
  .plotly-title-block h1,
  .home-hero h1 {
    line-height: 1.28;
  }

  .subtitle {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.75;
  }

  .site-mark-text {
    font-size: 14px;
  }

  .site-mark-badge {
    font-size: 14px;
  }

  .home-button,
  .secondary-button {
    font-size: 13px;
  }

  .compact-hero,
  .plotly-title-block {
    margin-top: 24px;
    margin-bottom: 20px;
  }

  .report-panel p,
  .content-card p {
    font-size: 15px;
  }
}


/* =========================================================
   最终标题层级：主标题优先，其余文字逐级缩小
   ========================================================= */

/* 内容区不再展示主标题之前的小标签 */
.eyebrow {
  display: none !important;
}

/* 一级：每个页面的主标题 */
h1,
.compact-hero h1,
.plotly-title-block h1,
.home-hero h1 {
  margin: 0;
  max-width: 100%;
  font-size: 46px;
  font-weight: 720;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

/* 首页主标题仅略高一级，不再夸张放大 */
.home-hero h1 {
  font-size: 52px;
}

/* 二级：主标题下方说明 */
.subtitle {
  margin-top: 14px;
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.78;
  letter-spacing: 0;
}

/* 三级：首页导航卡片、因子列表标题 */
.title,
.factor-name {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* 四级：详情页内容区标题 */
.report-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 680;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

/* 五级：正文 */
.report-panel p,
.content-card p,
.empty-state {
  font-size: 16px;
  line-height: 1.85;
}

/* 六级：辅助信息 */
.factor-meta,
.breadcrumb,
.index,
.home-button,
.secondary-button {
  font-size: 14px;
}

/* 统一页面主标题与内容区距离 */
.hero,
.compact-hero,
.plotly-title-block {
  margin-top: 30px;
  margin-bottom: 28px;
}

/* 首页没有工具栏，顶部留白略多 */
.home-hero {
  margin-top: 0;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  h1,
  .compact-hero h1,
  .plotly-title-block h1,
  .home-hero h1 {
    font-size: 40px;
  }

  .home-hero h1 {
    font-size: 44px;
  }
}

@media (max-width: 700px) {
  h1,
  .compact-hero h1,
  .plotly-title-block h1,
  .home-hero h1 {
    font-size: 30px;
    line-height: 1.3;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .subtitle {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.75;
  }

  .title,
  .factor-name {
    font-size: 17px;
  }

  .report-panel h2 {
    font-size: 18px;
  }

  .report-panel p,
  .content-card p,
  .empty-state {
    font-size: 15px;
  }

  .factor-meta,
  .breadcrumb,
  .index,
  .home-button,
  .secondary-button {
    font-size: 13px;
  }

  .hero,
  .compact-hero,
  .plotly-title-block {
    margin-top: 22px;
    margin-bottom: 20px;
  }

  .home-hero {
    margin-top: 0;
    margin-bottom: 28px;
  }
}


/* =========================================================
   精简版层级：减少重复标题，整体字号收敛
   ========================================================= */

/* 顶部站点名称保持轻量，不与页面主标题争夺视觉焦点 */
.site-mark-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.35;
  letter-spacing: 0;
}

.site-mark-badge {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  font-size: 13px;
  font-weight: 700;
}

/* 首页主标题 */
.home-hero h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.22;
}

/* 二级、三级页面主标题统一缩小 */
h1,
.compact-hero h1,
.plotly-title-block h1 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.26;
  letter-spacing: -0.02em;
}

/* 删除副标题后，主标题和正文区域保持更紧凑的距离 */
.hero,
.compact-hero,
.plotly-title-block {
  margin-top: 24px;
  margin-bottom: 22px;
}

/* 首页标题和导航卡片之间略留更多呼吸感 */
.home-hero {
  margin-top: 0;
  margin-bottom: 34px;
}

/* 卡片标题和内容标题进一步收敛 */
.title,
.factor-name {
  font-size: 18px;
  font-weight: 640;
  line-height: 1.45;
}

.report-panel h2 {
  font-size: 19px;
  font-weight: 660;
  line-height: 1.45;
}

.home-button,
.secondary-button {
  font-size: 13px;
  font-weight: 620;
}

/* 面包屑已从三级页面移除，保留规则以兼容未来页面 */
.breadcrumb {
  font-size: 13px;
}

@media (max-width: 900px) {
  .home-hero h1 {
    font-size: 40px;
  }

  h1,
  .compact-hero h1,
  .plotly-title-block h1 {
    font-size: 32px;
  }
}

@media (max-width: 700px) {
  .site-mark-text {
    font-size: 12px;
  }

  .site-mark-badge {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 12px;
  }

  .home-hero h1 {
    font-size: 31px;
  }

  h1,
  .compact-hero h1,
  .plotly-title-block h1 {
    font-size: 27px;
    line-height: 1.3;
  }

  .title,
  .factor-name {
    font-size: 16px;
  }

  .report-panel h2 {
    font-size: 17px;
  }

  .hero,
  .compact-hero,
  .plotly-title-block {
    margin-top: 18px;
    margin-bottom: 18px;
  }

  .home-hero {
    margin-top: 0;
    margin-bottom: 24px;
  }
}
