/* ============================================
   Wayback 域名建站历史查询页样式（橙色营销风）
   公共查询页样式见 query-common.css
   本文件叠加 wayback 专属：详情弹框 / 时间线 / 快照表
   所有 .wb-* / .tl-* / .snap-title-link 为 JS 契约，不可改名
   ============================================ */

@import url("query-common.css");

/* 建站历史页：16 列宽表，留出两边空白做广告位，表格 fixed 布局严格按列宽%适配不滑动 */
.page-wrap, .page-wrap.container { max-width: 70% !important; margin: 0 auto; padding: 36px 16px 48px; }
/* 进度卡/结果卡内边距收紧，给表格更多空间 */
#progressArea, #resultsArea { padding: 22px 16px; }
/* 表头允许换行，长表头（内容统一度/近5年统一度等）两行显示 */
.result-table thead th { white-space: normal !important; word-break: keep-all; line-height: 1.45; padding: 14px 8px; font-size: 12px; }

/* 进度区统计网格：wayback 有 7 个 stat，覆盖为 7 列 */
.stat-grid { grid-template-columns: repeat(7, 1fr); }

/* progressIcon 旋转动画（JS 通过 setAttribute('class','icon-progress') 触发） */
.icon-progress { animation: wb-spin 1s linear infinite; }
@keyframes wb-spin { to { transform: rotate(360deg); } }

/* ===== 结果表格：wayback 16 列，fixed 布局严格按列宽%分配，绝不横向滑动 ===== */
.result-table { table-layout: fixed; width: 100%; }
.result-table td { white-space: normal; word-break: break-all; overflow: hidden; padding: 11px 8px; font-size: 13px; vertical-align: middle; }
/* 网站标题列允许换行（内容长） */
.result-table td.title-cell { white-space: normal !important; word-break: break-all; line-height: 1.5; }
.result-table tbody tr:last-child td { border-bottom: none; }

/* 域名行可点击（JS 契约：.wb-domain-cell） */
.wb-domain-cell { color: var(--or-d); cursor: pointer; font-weight: 700; }
.wb-domain-cell:hover { text-decoration: underline; color: var(--flame); }

/* 标题列换行规则已在上方 td.title-cell 定义，此处保留文字颜色 */
.title-cell { color: var(--ink); }

/* 操作列：允许按钮换行，不溢出覆盖相邻列，给足最小宽度 */
.result-table td.action-cell { white-space: normal !important; overflow: visible !important; max-width: none !important; min-width: 170px; padding: 11px 8px; vertical-align: middle; }
.action-cell .wb-link { vertical-align: middle; margin: 2px 4px 2px 0; }
.action-cell .wb-requery-btn { margin-left: 0 !important; } /* 覆盖 JS 内联 margin，让按钮紧凑并排 */
.history-cell, .status-cell { color: var(--ink-2); white-space: nowrap; }
.result-table td.history-cell, .result-table td.status-cell { white-space: nowrap !important; max-width: none !important; min-width: 72px; }

/* 操作链接（JS 契约：.wb-link / .wb-detail-btn / .wb-requery-btn / .disabled） */
.wb-link {
  color: var(--or-d); cursor: pointer; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px; transition: color .2s;
}
.wb-link svg { width: 14px; height: 14px; }
.wb-link:hover { color: var(--flame); }
.wb-link.disabled { color: var(--ink-4); cursor: not-allowed; }

/* ===== 详情时间线柱状图（JS 契约：.wb-timeline-wrap / .tl-*） ===== */
.wb-timeline-wrap {
  padding: 14px 0 8px; overflow-x: auto; overflow-y: hidden;
  border-bottom: 1px solid var(--line); margin-bottom: 10px;
  position: relative;
}
.wb-timeline { display: inline-flex; flex-direction: column; min-width: 100%; padding: 0 4px; }
.tl-chart { display: inline-flex; flex-direction: column; min-width: max-content; }
.tl-bars {
  display: flex; align-items: flex-end; gap: 1px;
  height: 88px; padding: 0 2px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(to bottom, transparent 0%, transparent 90%, var(--cream-2) 100%);
}
.tl-bar-col {
  flex: 1 1 0; min-width: 12px; max-width: 26px;
  display: flex; flex-direction: column; align-items: stretch;
  height: 100%; justify-content: flex-end;
}
/* 柱子：暖墨色实心，hover 变橙 */
.tl-bar-fill {
  width: 100%; min-height: 0;
  background: var(--ink);
  cursor: pointer;
  transition: background .12s;
  border-radius: 2px 2px 0 0;
}
.tl-bar-fill:hover { background: var(--or-d); }
.tl-bar-fill.empty { background: var(--line-2); min-height: 2px; cursor: default; border-radius: 0; }
.tl-bar-fill.empty:hover { background: var(--line-2); }
.tl-years { display: flex; gap: 1px; padding: 4px 2px 0; user-select: none; }
.tl-years .tl-year {
  flex: 1 1 0; min-width: 12px; max-width: 26px;
  font-size: 9px; font-weight: 600; color: var(--ink-3);
  text-align: center; white-space: nowrap; transition: color .12s;
}
.tl-years .tl-year:hover { color: var(--or-d); }

/* ===== 详情弹框模板内部（JS 读取 #detailTpl innerHTML 渲染） ===== */
.wb-modal-body { padding: 18px 20px 20px; background: var(--cream); min-height: 260px; }
.wb-detail-tip {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 56px 20px; color: var(--ink-3); font-size: 14px; font-weight: 600;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.wb-spinner {
  width: 18px; height: 18px; border: 2px solid var(--or); border-top-color: transparent;
  border-radius: 50%; animation: wb-spin .7s linear infinite; display: inline-block;
}
.wb-detail-card {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 16px 18px; animation: wb-fade-up .35s ease-out; border: 1px solid var(--line);
}
@keyframes wb-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.wb-detail-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink); font-weight: 600;
}
.wb-detail-top b { color: var(--or-d); font-family: "JetBrains Mono", monospace; }
.wb-detail-summary { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.wb-detail-bottom-tip {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; color: var(--ink-3); font-size: 12.5px; font-weight: 600;
}

.wb-snap-table-wrap { overflow: auto; max-height: 420px; border-radius: 10px; border: 1px solid var(--line); }
.wb-snap-table td { font-size: 12.5px; padding: 10px 12px; }
.wb-snap-table .snap-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
.wb-snap-table .snap-title-link {
  color: var(--ink); font-size: 12.5px; text-decoration: none; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: inline-block; max-width: 100%; transition: color .15s;
}
.wb-snap-table .snap-title-link:hover { color: var(--or-d); text-decoration: underline; }
.wb-snap-table .snap-title-link.has-local { color: var(--green); }
.wb-snap-table .snap-title-link.disabled { color: var(--ink-4); cursor: default; pointer-events: none; }
.wb-snap-table .local-badge { display: inline-block; margin-left: 6px; font-size: 14px; color: var(--amber); cursor: default; vertical-align: middle; }
.wb-snap-table .archive-link { color: var(--ink-3); font-size: 12.5px; text-decoration: none; margin-left: 10px; }
.wb-snap-table .archive-link:hover { color: var(--or-d); }

/* ===== Toast（JS 契约：.wb-toast / .show / .warn） ===== */
.wb-toast {
  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;
}
.wb-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wb-toast.warn { color: #dc2626; border-color: rgba(239,68,68,.2); }

/* ===== 详情弹框（JS 动态创建：.wb-overlay / .wb-dialog*） ===== */
.wb-overlay {
  position: fixed; inset: 0;
  background: rgba(26,15,10,.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: wb-fade-in .2s ease-out;
}
@keyframes wb-fade-in { from { opacity: 0; } to { opacity: 1; } }
.wb-dialog {
  background: var(--card); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(26,15,10,.2), 0 8px 24px rgba(255,107,26,.1);
  width: 1100px; max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; overflow: hidden;
  animation: wb-pop-in .22s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes wb-pop-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.wb-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.wb-dialog-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.2px;
}
.wb-dialog-title svg { width: 20px; height: 20px; color: var(--or-d); flex-shrink: 0; }
.wb-dialog-close {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--ink-3);
  cursor: pointer; border-radius: 8px; transition: background .2s, color .2s;
}
.wb-dialog-close:hover { background: var(--surf); color: var(--or-d); }
.wb-dialog-close svg { width: 18px; height: 18px; }
.wb-dialog-body { overflow: auto; flex: 1; }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .page-wrap, .page-wrap.container { max-width: 95% !important; }
  .wb-dialog { width: calc(100vw - 24px); }
}

@media (max-width: 768px) {
  .page-wrap, .page-wrap.container { max-width: 100% !important; padding: 24px 12px 32px !important; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .query-footer { flex-direction: column; align-items: stretch; }
  .wb-dialog { width: calc(100vw - 24px); }
  #progressArea, #resultsArea { padding: 16px 12px; }
  .result-table thead th { font-size: 11px; padding: 10px 6px; }
  .result-table td { font-size: 12px; padding: 8px 6px; }
  .action-cell .wb-link { font-size: 12px; }
  .result-table td.action-cell { min-width: 140px; }
  .wb-modal-body { padding: 14px 14px 16px; }
  .wb-dialog-head { padding: 12px 16px; }
  .wb-dialog-title { font-size: 14px; }
}

@media (max-width: 480px) {
  .page-wrap, .page-wrap.container { padding: 16px 8px 24px !important; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .stat-item { padding: 10px 4px; }
  .stat-item .stat-num { font-size: 18px; }
  .stat-lbl { font-size: 11px; }
}
