/* ============================================
   查询页公共样式（baidu-index/ranking/xiongzhang/wayback 共用）
   火焰橙营销风 · 所有 class 名为 JS 契约，不可改名
   由各查询页 CSS 通过 @import 引入
   ============================================ */

/* 页面容器（居中，与全局 container 一致） */
.page-wrap { padding-top: 36px; padding-bottom: 48px; }
.page-wrap.container { max-width: 1240px; margin-left: auto; margin-right: auto; }

/* ===== 查询/进度/结果卡片（统一卡片风格） ===== */
.query-card,
.progress-card,
.result-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 30px 26px; margin-bottom: 20px;
  border: 1px solid var(--line);
}
.query-card { display: flex; flex-direction: column; min-height: 380px; }
.progress-card, .result-card { animation: fadeUp .35s ease-out; }

/* 标题行 */
.card-title {
  display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.card-title svg {
  width: 22px; height: 22px; color: var(--or-d); flex-shrink: 0;
  background: var(--surf-2); padding: 5px; border-radius: 10px; box-sizing: content-box;
  border: 1px solid rgba(255,107,26,.1);
}
.card-title span { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -.2px; }

/* SVG 图标尺寸 */
.icon, .icon-progress { width: 20px; height: 20px; flex-shrink: 0; }
.act svg, .ract svg { width: 15px; height: 15px; flex-shrink: 0; }
.query-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== 文本域 ===== */
.query-input {
  width: 100%; height: 280px; min-height: 180px; max-height: 500px;
  padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 14px; color: var(--ink); resize: vertical; line-height: 1.75;
  transition: border-color .2s, box-shadow .2s;
  font-family: "JetBrains Mono", "Consolas", "Menlo", monospace; box-sizing: border-box;
  background: var(--cream);
}
.query-input:focus { outline: none; border-color: rgba(255,107,26,.4); background: #fff; box-shadow: 0 0 0 4px rgba(255,107,26,.1); }
.query-input::placeholder { color: var(--ink-4); }

/* ===== 底部操作区 ===== */
.query-footer { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.query-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.act {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; transition: color .2s;
  white-space: nowrap; font-weight: 600;
}
.act svg { width: 16px; height: 16px; }
.act:hover { color: var(--or-d); }

.domain-count { font-size: 13px; color: var(--ink-3); margin-left: 4px; font-weight: 600; }

/* 查询按钮 + 提取域名按钮 */
.query-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 30px; background: var(--grad-flame); color: #fff; font-size: 15px; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer;
  transition: transform .2s, box-shadow .25s;
  box-shadow: 0 6px 20px rgba(255,77,46,.32), inset 0 1px 0 rgba(255,255,255,.25);
}
.query-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,77,46,.4), inset 0 1px 0 rgba(255,255,255,.3); }
.query-btn:active { transform: translateY(0); }
.query-actions-right { display: flex; align-items: center; gap: 10px; }
.query-btn.extract-btn { background: var(--ink); box-shadow: 0 6px 20px rgba(26,15,10,.2); }
.query-btn.extract-btn:hover { background: #000; box-shadow: 0 10px 28px rgba(26,15,10,.3); }

/* ===== 进度区 ===== */
.progress-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.icon-progress { transition: all .3s; }
.progress-pct { font-size: 24px; font-weight: 900; color: var(--or-d); font-family: "JetBrains Mono", monospace; letter-spacing: -.5px; }
.progress-left { display: flex; align-items: center; gap: 12px; }
.progress-left span { font-size: 15px; font-weight: 700; color: var(--ink); }
.progress-left svg { color: var(--or-d); }
.progress-bar { height: 8px; background: var(--cream-2); border-radius: 100px; overflow: hidden; margin-bottom: 24px; }
.progress-fill { height: 100%; background: var(--grad-flame); border-radius: 100px; transition: width .4s ease; box-shadow: 0 0 12px rgba(255,107,26,.3); }

/* ===== 统计网格 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }
.stat-item { text-align: center; padding: 16px 8px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); transition: transform .2s; }
.stat-item:hover { transform: translateY(-2px); }
.stat-item .stat-num { font-size: 28px; font-weight: 900; margin-bottom: 4px; font-family: "JetBrains Mono", monospace; letter-spacing: -.5px; line-height: 1; }
.stat-item .stat-num.blue { color: var(--gold); }
.stat-item .stat-num.green { color: var(--green); }
.stat-item .stat-num.red { color: #ef4444; }
.stat-item .stat-num.orange { color: var(--or-d); }
.stat-item .stat-num.purple { color: var(--flame); }
.stat-lbl { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

/* ===== 结果区 ===== */
.result-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.result-left { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.result-left .icon { color: var(--or-d); background: var(--surf-2); padding: 5px; border-radius: 10px; box-sizing: content-box; border: 1px solid rgba(255,107,26,.1); }
.result-left > span:nth-of-type(1) { font-size: 17px; font-weight: 800; color: var(--ink); }
.result-count { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.result-actions { display: flex; gap: 6px; }
.ract {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; border-radius: 8px;
  transition: background .15s, color .15s; font-weight: 600; border: 1px solid transparent;
}
.ract:hover { background: var(--surf); color: var(--or-d); }
.ract.clear-result:hover { color: #ef4444; background: rgba(239,68,68,.06); }
.ract.export-csv:hover { color: var(--green); background: rgba(22,163,74,.06); }
.ract.copy-indexed:hover { color: #059669; background: rgba(5,150,105,.06); }
.ract.copy-not-indexed:hover { color: #dc2626; background: rgba(220,38,38,.06); }
.ract.copy-ranked:hover { color: #d97706; background: rgba(217,119,6,.06); }
.ract.copy-has-xz:hover { color: #059669; background: rgba(5,150,105,.06); }
.ract.copy-no-xz:hover { color: #dc2626; background: rgba(220,38,38,.06); }

/* ===== 结果表格（JS 契约：.result-table / .badge / .re-link 等） ===== */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.result-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.result-table th {
  text-align: left; padding: 13px 14px; font-size: 12.5px; font-weight: 800;
  color: var(--ink-3); border-bottom: 1px solid var(--line); background: var(--cream-2);
  white-space: nowrap; text-transform: uppercase; letter-spacing: .5px;
}
.sort-arrow { display: inline-flex; flex-direction: column; line-height: 1; font-size: 7px; color: var(--ink-4); margin-left: 3px; vertical-align: middle; margin-top: -3px; transition: color .15s; }
.sort-arrow .arrow-up,
.sort-arrow .arrow-down { display: block; line-height: 1; height: 6px; font-size: 7px; }
.sort-arrow .active { color: var(--or-d); }
.result-table thead th:hover .sort-arrow { color: var(--ink-3); }
.result-table thead th:hover .sort-arrow .active { color: var(--or-d); }
.result-table td {
  padding: 13px 14px; font-size: 13.5px; color: var(--ink);
  border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-table tbody tr { transition: background .15s; }
.result-table tbody tr:hover { background: var(--surf); }

/* 状态徽章（JS innerHTML 硬编码） */
.badge { display: inline-block; padding: 3px 11px; border-radius: 100px; font-size: 12px; font-weight: 700; }
.badge-green { background: rgba(22,163,74,.1); color: #059669; }
.badge-gray { background: var(--cream-2); color: var(--ink-3); }
.badge-red { background: rgba(239,68,68,.1); color: #dc2626; }
.badge-blue { background: var(--surf-2); color: var(--or-d); }
.badge-sky { background: rgba(255,159,28,.1); color: var(--gold); }
.badge-orange { background: var(--surf-2); color: var(--or-d); }
.badge-purple { background: rgba(230,57,70,.1); color: var(--flame); }

/* 列内链接 */
.baidu-link, .ranking-link, .rank-link { color: var(--or-d); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; }
.baidu-link:hover, .ranking-link:hover, .rank-link:hover { color: var(--flame); text-decoration: underline; }
.title-col, .title-cell { color: var(--ink); }
.coverage-col { color: var(--ink-2); }

/* 重新查询链接（JS 契约：.re-link） */
.re-link {
  color: var(--or-d); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  transition: color .15s; font-weight: 700;
}
.re-link:hover { color: var(--flame); }
.re-link svg { width: 14px; height: 14px; }

/* ===== Toast 提示（JS 动态创建，契约：.toast-msg / .show / .warn / .info） ===== */
.toast-msg {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  background: var(--card); color: var(--ink); padding: 16px 30px; border-radius: 12px;
  font-size: 15px; font-weight: 700; z-index: 10000;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast-msg.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast-msg.warn { color: #dc2626; border-color: rgba(239,68,68,.2); }
.toast-msg.info { color: var(--ink-2); }

/* ===== 回到顶部（JS 契约：.back-top / .show） ===== */
.back-top {
  position: fixed; right: 28px; bottom: 60px; z-index: 999;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--card); color: var(--or-d); border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .25s, transform .25s, box-shadow .25s;
  opacity: 0; pointer-events: none; transform: translateY(12px);
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.back-top svg { width: 22px; height: 22px; }

/* 动画 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .result-table { table-layout: auto; }
  .result-table th, .result-table td { white-space: nowrap; }
}

@media (max-width: 768px) {
  .page-wrap { padding-top: 24px; padding-bottom: 32px; }
  .query-card, .progress-card, .result-card { padding: 20px 16px; }
  .query-card { min-height: auto; }
  .card-title { margin-bottom: 16px; padding-bottom: 12px; }
  .card-title span { font-size: 15px; }
  .query-footer { flex-direction: column; align-items: stretch; gap: 12px; }
  .query-actions { gap: 12px; }
  .query-actions-right { flex-direction: column; gap: 8px; }
  .query-actions-right .query-btn { width: 100%; justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-item { padding: 12px 6px; }
  .stat-item .stat-num { font-size: 22px; }
  .result-top { flex-direction: column; align-items: flex-start; }
  .result-actions { width: 100%; justify-content: flex-start; }
  .progress-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .result-table th, .result-table td { padding: 10px 10px; font-size: 12px; white-space: nowrap; }
  .back-top { right: 16px; bottom: 40px; width: 40px; height: 40px; }
  .toast-msg { max-width: 85vw; padding: 14px 20px; font-size: 14px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .stat-item .stat-num { font-size: 18px; }
  .stat-lbl { font-size: 11px; }
  .query-input { height: 200px; min-height: 140px; padding: 12px 14px; font-size: 13px; }
  .act { font-size: 12px; }
  .query-btn { padding: 10px 20px; font-size: 14px; }
  .result-table th, .result-table td { padding: 8px 6px; font-size: 11px; }
  .result-left > span:nth-of-type(1) { font-size: 15px; }
}
