/* 域名绑定扫描器 —— 全局样式（简洁中性色 + 品牌绿松石强调） */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --border: #e3e6ea;
  --text: #1c2733;
  --muted: #6b7684;
  --accent: #0e9f8a;
  --accent-dark: #0b8372;
  --danger: #d64545;
  --ok: #1a9c5b;
  --warn: #c98a1b;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand-mark { color: var(--accent); font-size: 20px; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.net-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eaf5f1;
  color: var(--accent-dark);
}

/* ---------- 主体 ---------- */
.page { max-width: 1280px; margin: 22px auto; padding: 0 22px; }
.page .card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.page h2 { margin: 0 0 4px; font-size: 18px; }
.page h3 { margin: 0; font-size: 15px; }
.page .desc { color: var(--muted); margin: 0 0 8px; font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-ico { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }

/* ---------- 中英切换（分段开关） ---------- */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.lang-switch button {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all .15s;
}
.lang-switch button + button { border-left: 1px solid var(--border); }
.lang-switch button:hover { color: var(--accent-dark); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---------- 工具条输入（搜索框 / 排序下拉） ---------- */
.input {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-search { width: 220px; }
.spacer { flex: 1; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: #fafbfc; }
td.mono, .mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; word-break: break-all; }
/* 操作列：两个网关按钮不换行；列宽不够时表格横向滚动，不挤压其他列 */
td.ops { white-space: nowrap; }
/* 处理器、到期时间这类短字段不折行（长内容留给域名/容器列换行） */
td.nowrap { white-space: nowrap; }
#table, #sitesTable { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 表格内跳链（如区块号 → BscScan） */
.link { color: var(--accent-dark); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- 状态徽标 ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef0f3;
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: #d9f0e5; color: var(--ok); }
.badge.warn { background: #fbf0da; color: var(--warn); }

/* ---------- 进度条 ---------- */
.progress { height: 8px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c2733;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- 面板切换（域名 / 站点两个扫描源） ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.tabs button:hover { border-color: var(--accent); color: var(--accent-dark); }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ---------- 站点名（每行的标识，字号与颜色都加重） ---------- */
td.site-name { font-size: 15px; font-weight: 700; color: var(--accent-dark); white-space: nowrap; }

/* ---------- 站点简介列（标题 + 描述，限宽避免挤压其他列） ---------- */
td.info { max-width: 340px; font-size: 12px; line-height: 1.45; }
td.info .sub { color: var(--muted); }

/* ---------- 文件路径浮窗（点按钮浮出，不改变列宽） ---------- */
/* 入口做成小胶囊，够大好点；末尾的 ▾ 提示可点开 */
.paths-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  color: var(--accent-dark);
  cursor: pointer;
  transition: all .15s;
}
.paths-btn::after { content: ' ▾'; font-size: 10px; opacity: .55; }
.paths-btn:hover { border-color: var(--accent); background: #eaf5f1; }
.pop {
  position: absolute;
  z-index: 50;
  max-width: min(360px, calc(100vw - 24px));
  max-height: 300px;
  overflow: auto;
  overscroll-behavior: contain;   /* 滚到尽头不要带动页面一起滚 */
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .16);
  font-size: 12px;
}
.pop ul { margin: 0; padding-left: 16px; }
.pop li { line-height: 1.6; word-break: break-all; }

/* ---------- 每日新增柱状图（零依赖，纯 CSS 柱子） ---------- */
.chart-title { margin: 18px 0 0; }
.chart { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; min-width: min-content; border-bottom: 1px solid var(--border); }
/* 每列：数值在上、柱体居中、日期在下；柱体高度由 JS 按最大值等比算出（像素） */
.chart-col { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; }
.chart-col i { display: block; width: 100%; max-width: 38px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; }
.chart-col:hover i { background: var(--accent-dark); }
.chart-val { font-size: 11px; font-weight: 600; color: var(--accent-dark); line-height: 1.4; }
.chart-x { font-size: 10px; color: var(--muted); line-height: 1.8; white-space: nowrap; }

/* ---------- 杂项 ---------- */
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--accent-dark); line-height: 1.2; }

/* ---------- 移动端适配 ---------- */
/* 平板：统计卡由 4 列变 2 列 */
@media (max-width: 820px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
}
/* 手机：收紧留白、顶栏允许折行、表格保持可读宽度并横向滚动 */
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .brand-sub { display: none; }              /* 副标题占宽，小屏省略（网络已由右侧徽标标明） */
  .page { margin: 14px auto; padding: 0 12px; }
  .page .card { padding: 14px; margin-bottom: 12px; }
  .page h2 { font-size: 16px; }
  .grid2 { gap: 10px; }
  .grid2 .card { padding: 12px; }
  .stat-num { font-size: 18px; }
  .tabs button { padding: 7px 12px; font-size: 13px; }
  .input-search { width: 100%; }
  th, td { padding: 8px; }
  td.info { max-width: 200px; }
  .pop { max-height: 200px; }
  .paths-btn { padding: 6px 14px; }   /* 手指点击区域再放大一点 */
  /* 列表列多，给个最小宽度保证列不被压扁，超出部分在卡片内横向滚动 */
  #table > table, #sitesTable > table { min-width: 720px; }
}
