/* dl 地利 · query.css — 三步分组查询工作台（s6 重构）。
 * 深色玻璃系；侧栏 340 sticky + 右侧结果/报告；三档响应式零横向溢出。
 * 仅布局/样式，不含脚本。 */

:root {
  --bg: #0b1220;
  --bg2: #0e1626;
  --panel: rgba(20, 30, 50, 0.72);
  --panel-solid: #121c30;
  --line: rgba(120, 150, 200, 0.16);
  --line-strong: rgba(120, 150, 200, 0.30);
  --txt: #e7eefc;
  --txt-dim: #9fb0cc;
  --txt-mute: #6b7c99;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --up: #34d399;
  --down: #fb7185;
  --warn: #fbbf24;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(79, 140, 255, 0.10), transparent 60%),
    var(--bg);
  color: var(--txt);
  font: 14px/1.55 -apple-system, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
h2 { margin: 0; }

#dl-work { min-height: 100vh; }

/* ── 顶栏 ─────────────────────────────────────────────── */
.qw-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 22px;
  background: rgba(11, 18, 32, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.qw-brand { font-weight: 700; letter-spacing: 0.2px; }
.qw-nav { display: flex; gap: 4px; }
.qw-nav a {
  color: var(--txt-dim); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
}
.qw-nav a:hover { color: var(--txt); background: rgba(255, 255, 255, 0.05); }
.qw-nav a.active { color: var(--txt); background: var(--accent-soft); }

/* ── 主框架：aside + main ─────────────────────────────── */
.qw-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px;
  align-items: start;
}
.qw-aside { position: sticky; top: 78px; }
.qw-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

/* ── 筛选面板 ─────────────────────────────────────────── */
.qw-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.qw-panel-title {
  font-size: 13px; color: var(--txt-dim); font-weight: 600;
  padding: 14px 16px 6px;
}

/* 步骤手风琴 */
.qw-step { border-top: 1px solid var(--line); }
.qw-step-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer; list-style: none;
  user-select: none;
}
.qw-step-head::-webkit-details-marker { display: none; }
.qw-step-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, 0.07); color: var(--txt-dim);
}
.qw-step.is-active .qw-step-num,
.qw-step[open] .qw-step-num { background: var(--accent); color: #fff; }
.qw-step-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.qw-step-title { font-weight: 600; font-size: 14px; }
.qw-step-tag { font-size: 11px; color: var(--txt-mute); }
.qw-step-badge {
  flex: none; font-size: 11px; color: var(--accent);
  background: var(--accent-soft); padding: 2px 9px; border-radius: 999px;
}
.qw-step-body { padding: 2px 16px 14px; display: flex; flex-direction: column; gap: 14px; }

/* 单个维度 */
.dlf-label { font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--txt); }
.dlf-searchwrap { margin-bottom: 8px; }
.dlf-search {
  width: 100%; padding: 7px 11px; font-size: 13px;
  color: var(--txt); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  outline: none;
}
.dlf-search:focus { border-color: var(--accent); }

.dlf-options {
  display: grid; grid-template-columns: 1fr; gap: 4px;
  max-height: 230px; overflow-y: auto; padding-right: 2px;
}
/* 球队维度给更高视野 */
#f-team .dlf-options { max-height: 340px; }
.dlf-options-compact { grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.dlf-option {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--txt-dim); min-width: 0;
}
.dlf-option:hover { background: rgba(255, 255, 255, 0.05); color: var(--txt); }
.dlf-option input { margin: 0; flex: none; accent-color: var(--accent); }
.dlf-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlf-option:has(input:checked) { color: var(--txt); background: var(--accent-soft); }

/* 赛季范围 */
.dlf-range { display: flex; align-items: center; gap: 8px; }
.dlf-year {
  width: 100%; min-width: 0; padding: 7px 9px; font-size: 13px;
  color: var(--txt); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none;
}
.dlf-year:focus { border-color: var(--accent); }
.dlf-range-sep { color: var(--txt-mute); }

/* ── 就绪检查 ─────────────────────────────────────────── */
.qw-ready {
  margin: 4px 16px 0; padding: 10px 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 5px;
}
.qw-ready-row { font-size: 12px; color: var(--txt-mute); }
.qw-ready-row.is-missing { color: var(--txt-dim); }
.qw-ready-row.is-ok { color: var(--up); }
.qw-ready.is-ready { border-style: solid; border-color: rgba(52, 211, 153, 0.35); }

/* ── 操作条 ───────────────────────────────────────────── */
.qw-actions {
  display: flex; gap: 10px; padding: 14px 16px 16px;
}
.qw-run {
  flex: 1; padding: 10px 14px; font-weight: 700; color: #fff;
  background: var(--accent); border: none; border-radius: var(--radius-sm);
  transition: transform 0.12s ease, background 0.2s ease;
}
.qw-run:hover:not(:disabled) { background: #3d7bf0; }
.qw-run:active:not(:disabled) { transform: scale(0.98); }
.qw-run:disabled { background: rgba(120, 140, 170, 0.3); color: var(--txt-mute); cursor: not-allowed; }
.qw-reset {
  padding: 10px 14px; color: var(--txt-dim);
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.qw-reset:hover { color: var(--txt); border-color: var(--txt-dim); }

/* ── 已选 chips ───────────────────────────────────────── */
.qw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qw-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 8px 6px 12px; font-size: 12px;
  color: var(--txt); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.qw-chip:hover { border-color: var(--accent); }
.qw-chip-x { color: var(--txt-mute); font-size: 14px; line-height: 1; }
.qw-chip:hover .qw-chip-x { color: var(--down); }

/* ── 欢迎卡 / 引导 ────────────────────────────────────── */
.qw-welcome {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
}
.qw-welcome h2 { margin: 0 0 10px; font-size: 22px; }
.qw-welcome p { margin: 6px 0; color: var(--txt-dim); }
.qw-welcome b { color: var(--txt); }
.qw-welcome-hint { color: var(--accent) !important; font-size: 13px; }

/* ── 结果卡 ───────────────────────────────────────────── */
.dlr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 16px; align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.dlr-hero-label { font-size: 12px; color: var(--txt-mute); }
.dlr-hero-num { font-size: 40px; font-weight: 800; letter-spacing: -0.5px; }
.dlr-hero-num.muted { color: var(--txt-mute); }
.dlr-hero-num-sm { font-size: 26px; font-weight: 700; }
.dlr-hero-sub { font-size: 12px; color: var(--txt-dim); margin-top: 2px; }
.dlr-hero-verdict { display: flex; flex-direction: column; gap: 4px; }
.dlr-verdict-tag {
  align-self: flex-start; font-size: 13px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
}
.dlr-hero-verdict.up .dlr-verdict-tag { color: var(--up); background: rgba(52, 211, 153, 0.13); }
.dlr-hero-verdict.down .dlr-verdict-tag { color: var(--down); background: rgba(251, 113, 133, 0.13); }
.dlr-hero-verdict.flat .dlr-verdict-tag { color: var(--txt-dim); background: rgba(255, 255, 255, 0.06); }
.dlr-hero-verdict.muted .dlr-verdict-tag { color: var(--txt-mute); background: rgba(255, 255, 255, 0.05); }
.dlr-lift { font-size: 13px; color: var(--accent); font-weight: 600; }
.dlr-delta { font-size: 12px; color: var(--txt-dim); }

.dlr-banner {
  margin-top: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; border: 1px solid transparent;
}
.dlr-banner.error { color: var(--down); background: rgba(251, 113, 133, 0.10); border-color: rgba(251, 113, 133, 0.3); }
.dlr-banner.warn { color: var(--warn); background: rgba(251, 191, 36, 0.10); border-color: rgba(251, 191, 36, 0.3); }
.dlr-banner.muted { color: var(--txt-dim); background: rgba(255, 255, 255, 0.04); }

.dlr-tablewrap {
  margin-top: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: auto; box-shadow: var(--shadow);
}
.dlr-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.dlr-table th, .dlr-table td { padding: 10px 14px; text-align: right; font-size: 13px; }
.dlr-table th:first-child, .dlr-table td:first-child { text-align: left; }
.dlr-table thead th { color: var(--txt-mute); font-weight: 600; border-bottom: 1px solid var(--line); }
.dlr-table tbody tr + tr td { border-top: 1px solid var(--line); }

.dlr-note {
  margin-top: 12px; font-size: 12px; color: var(--txt-dim);
  background: rgba(255, 255, 255, 0.03); border-radius: var(--radius-sm); padding: 10px 14px;
}
.dlr-empty { text-align: center; padding: 48px 20px; color: var(--txt-mute); }
.dlr-empty-text { font-size: 16px; color: var(--txt-dim); margin-top: 8px; }
.dlr-empty-sub { font-size: 13px; margin-top: 4px; }

.dlr-matches { margin-top: 14px; font-size: 13px; color: var(--txt-dim); }
.dlr-matches summary { cursor: pointer; color: var(--txt-dim); }
.dlr-matchlist { margin: 10px 0 0; padding-left: 20px; }
.dlr-more { color: var(--txt-mute); }

/* ── 报告槽 ───────────────────────────────────────────── */
.qw-report-host { min-width: 0; }

/* ═══ 响应式 ════════════════════════════════════════════ */
/* 平板：两栏收窄，侧栏降为 300 */
@media (max-width: 1080px) {
  .qw-shell {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px; padding: 16px;
  }
}

/* 移动 / 窄屏：单列；筛选 steps 手风琴。布局断点 720（iPad 竖屏 768 仍两栏）。 */
@media (max-width: 720px) {
  .qw-shell { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .qw-aside { position: static; order: 2; }   /* 结果优先，筛选靠下或用手风琴 */
  .qw-main { order: 1; }

  /* 默认仅展开第①步；②③ 折叠，靠手风琴进入 */
  .qw-step:not([open]) .qw-step-body { display: none; }

  .qw-welcome { padding: 22px 18px; }

  /* 底部 sticky 操作条（含运行/重置），保持可达 */
  .qw-actions {
    position: sticky; bottom: 0; z-index: 20;
    padding: 12px 14px; margin: 0;
    background: rgba(11, 18, 32, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
}

/* 结果 hero 三栏在窄平板/手机堆叠（独立于布局断点） */
@media (max-width: 860px) {
  .dlr-hero { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .dlr-hero-num { font-size: 34px; }
}

@media (max-width: 420px) {
  .qw-nav a { padding: 5px 9px; font-size: 12px; }
  .dlf-options-compact { grid-template-columns: 1fr; }
  .qw-shell { padding: 10px; }
}

/* 尊重「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}



