/* ==========================================================================
   QDII 场外 · 版面样式
   通栏无框：用细线、留白与字级组织版面，不用独立面板。
   ========================================================================== */

:root {
  --bg: #f3f0e8;
  --paper: #faf8f2;
  --ink: #203d35;
  --muted: #616c62;
  --faint: #7d837a;
  --line: #dcded2;
  --line-soft: #e7e8dc;
  --rule: #9aab9a;
  --terra: #ad563b;
  --terra-soft: #f7e9e3;
  --sage: #32745b;
  --sage-soft: #e7f0e9;
  --amber: #8a6320;
  --amber-soft: #f5eeda;
  --serif: Georgia, 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', SimSun, serif;
  --sans: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1680px; margin: 0 auto; padding: 0 44px 72px; }

/* ---------- 顶部 ---------- */

.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 20px 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; letter-spacing: .04em; color: var(--muted);
}
.topbar .brand { font-family: var(--serif); font-size: 15px; letter-spacing: .02em; color: var(--ink); }
.topbar .brand em { font-style: italic; color: var(--terra); }
.topbar .stamp b { font-weight: 500; color: var(--ink); }

/* ---------- 主视觉 ---------- */

.hero { padding: 40px 0 30px; border-bottom: 1px solid var(--rule); }
.hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.08; letter-spacing: .01em;
}
.hero h1 em { font-style: italic; color: var(--terra); }
.hero .sub { margin: 0; max-width: 820px; font-size: 13.5px; line-height: 1.95; color: var(--muted); }

/* ---------- 区块与工具条 ---------- */

.band { padding: 26px 0 0; }

.tools {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0 0 16px; border-bottom: 1px solid var(--line);
}
.tools .meta { margin-left: auto; font-size: 11px; letter-spacing: .04em; color: var(--faint); }

input[type="text"], select {
  border: 1px solid var(--line); border-radius: 3px;
  background: var(--paper); color: var(--ink);
  min-height: 38px; padding: 0 13px;
  font: inherit; font-size: 13px; transition: all .16s;
}
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23616c62' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input:focus, select:focus, a:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-color: var(--sage); }

/* ---------- 通栏表格 ---------- */

.board { width: 100%; }
.board-scroll { overflow-x: auto; }
.board table { width: 100%; border-collapse: collapse; font-size: 13px; }
.board th {
  position: sticky; top: 0; z-index: 2;
  background: #e8ede3; color: #455a4d;
  font-size: 11px; font-weight: 500; letter-spacing: .06em; text-align: left;
  padding: 14px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--rule);
}
.board td {
  padding: 14px 12px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; font-variant-numeric: tabular-nums;
}
.board tbody tr:hover { background: #edf1e5; }
.board .symbol { font-size: 12px; font-weight: 600; color: #466757; letter-spacing: .04em; }
.board .name { display: block; line-height: 1.6; max-width: 300px; }
.board td.num, .board th.num { text-align: right; }
.board .empty { padding: 54px 12px; text-align: center; color: var(--faint); font-size: 13px; }

/* 状态标记 */
.pstat, .tag {
  display: inline-block; font-size: 11px; line-height: 1.5;
  padding: 3px 8px; border: 1px solid transparent; border-radius: 3px; white-space: nowrap;
}
.pstat.open { background: var(--sage-soft); border-color: #c9dccf; color: var(--sage); }
.pstat.limit { background: var(--amber-soft); border-color: #e3d5a8; color: var(--amber); }
.pstat.halt { background: var(--terra-soft); border-color: #ebcdc1; color: var(--terra); }
.tag { background: #eef0e6; border-color: var(--line); color: var(--muted); }

/* 业绩单元格 */
.perf { line-height: 1.5; }
.perf .main { font-weight: 600; font-size: 13px; }
.perf .ex { font-size: 10.5px; color: var(--faint); }
.perf .ex.good { color: var(--sage); }
.perf .ex.bad { color: var(--terra); }

.src { font-size: 11.5px; }
.src.ok { color: var(--sage); }
.src.partial { color: var(--amber); }
.src.error { color: var(--terra); }

.mobile-only { display: none; }

/* 日限额并入名称列，仅在窄屏启用（宽屏有独立列） */
.inline-limit { display: none; }
.board .name-row { display: flex; align-items: flex-start; gap: 8px; }
.board .name-row .name { flex: 1 1 auto; min-width: 0; }

/* ---------- 说明与页脚 ---------- */

.notes { margin-top: 38px; font-size: 12px; line-height: 1.95; color: var(--muted); }
.notes summary { cursor: pointer; color: var(--ink); font-size: 13px; padding: 8px 0; }
.notes p { margin: 10px 0 0; max-width: 1000px; }

.foot {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 11px; line-height: 2; color: var(--faint);
}
.foot p { margin: 0 0 6px; }

#alert {
  display: none; margin: 22px 0 0; padding: 15px 18px;
  background: var(--terra-soft); border-left: 3px solid var(--terra);
  font-size: 12.5px; color: var(--terra);
}

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

@media (max-width: 1180px) {
  .wrap { padding: 0 30px 56px; }
}

@media (max-width: 820px) {
  .wrap { padding: 0 18px 44px; }
  .hero { padding: 28px 0 22px; }
  .tools { gap: 9px; }
  .tools input, .tools select { min-width: 0; flex: 1 1 132px; font-size: 12.5px; }
  .tools .meta { margin-left: 0; width: 100%; }

  /* ---- 窄屏：表格重排为「每只基金一段」 ----
     名称独占整行，不被其他列挤压；指标下移一行。
     段与段之间只用一条细分隔线，不做卡片。 */
  .board-scroll { overflow-x: visible; }
  .board table, .board tbody, .board tr, .board td { display: block; width: auto; }
  .board thead { display: none; }
  .board tr { padding: 15px 0 13px; border-bottom: 1px solid var(--line-soft); }
  .board tbody tr:hover { background: transparent; }
  .board td { padding: 0; border: 0; }

  /* 第1行：代码 */
  .board td:nth-child(1) {
    font-size: 12px; font-weight: 600; color: #466757; letter-spacing: .05em;
  }

  /* 第2行：名称（整行）+ 限额标签 */
  .board td:nth-child(2) { margin: 5px 0 9px; }
  .board td:nth-child(2) .name-row { display: block; }
  .board td:nth-child(2) .name {
    display: inline; font-size: 13.5px; line-height: 1.62; max-width: none;
  }
  .board .inline-limit {
    display: inline-block;
    vertical-align: 1px;
    margin-left: 7px;
    font-size: 11px;
    color: var(--amber);
    background: var(--amber-soft);
    border: 1px solid #e3d5a8;
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .board .inline-limit.halt {
    color: var(--terra);
    background: var(--terra-soft);
    border-color: #ebcdc1;
  }

  /* 第3行：净值 / 申购状态 / 3Y / YTD */
  .board td:nth-child(5),
  .board td:nth-child(7),
  .board td:nth-child(9),
  .board td:nth-child(12) {
    display: inline-block;
    margin-right: 15px;
    font-size: 12px;
    line-height: 1.9;
  }
  .board td:nth-child(5)::before { content: '净值 '; color: var(--faint); font-size: 11px; }
  .board td:nth-child(9)::before { content: '3Y '; color: var(--faint); font-size: 11px; }
  .board td:nth-child(12)::before { content: 'YTD '; color: var(--faint); font-size: 11px; }

  /* 其余列收起：类型3 标签4 净值日6 日限额8 前年10 去年11 累计净值日13 基准14 数据15 */
  .board td:nth-child(3), .board td:nth-child(4), .board td:nth-child(6),
  .board td:nth-child(8), .board td:nth-child(10), .board td:nth-child(11),
  .board td:nth-child(13), .board td:nth-child(14), .board td:nth-child(15) { display: none; }

  /* 空状态 / 加载态 */
  .board td.empty {
    display: block !important; padding: 44px 0; text-align: center;
    font-size: 13px; color: var(--faint);
  }

  .notes { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
