/* ========= QQ 信息查询工具页 ========= */
* { box-sizing: border-box; }

.tool-body {
  margin: 0; min-height: 100vh;
  background: #f4f6fa;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  color: #2b3a52;
}

/* hidden 属性必须生效 */
.tool-body [hidden] { display: none !important; }

svg { display: inline-block; vertical-align: middle; }

/* ---- 进入工具加载层 ---- */
.tool-loading {
  position: fixed; inset: 0; z-index: 999;
  background: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  transition: opacity .35s ease;
}
.tool-loading.hide { opacity: 0; pointer-events: none; }
.tool-spinner {
  width: 42px; height: 42px;
  border: 4px solid #e3ecf8;
  border-top-color: #6FA8FF;
  border-radius: 50%;
  animation: qq-spin .8s linear infinite;
}
@keyframes qq-spin { to { transform: rotate(360deg); } }
.tool-loading-text { font-size: 14px; color: #98a1b3; letter-spacing: 1px; }

/* ---- 顶栏 ---- */
.tool-topbar {
  height: 56px; padding: 0 32px;
  background: #fff;
  border-bottom: 1px solid #e8edf5;
  display: flex; align-items: center; justify-content: space-between;
}
.tool-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: #5c6b84; text-decoration: none;
  transition: color .15s;
}
.tool-back:hover { color: #1e3a5f; }
.tool-back svg { width: 16px; height: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-brand {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #1e3a5f;
  background: #f0f4fa;
  padding: 4px 14px; border-radius: 20px;
  border: 1px solid #e2e9f2;
}
.topbar-brand svg { width: 13px; height: 13px; }
.tool-no { font-size: 13px; color: #98a1b3; }
.tool-no b { color: #1e3a5f; font-family: Consolas, monospace; }

/* ---- 主容器 ---- */
.tool-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 32px 40px;
}

/* ---- 头部 ---- */
.tool-head { text-align: center; margin-bottom: 28px; }
.tool-head h1 {
  margin: 0 0 8px;
  font-size: 26px; font-weight: 700; color: #1e3a5f;
  display: inline-flex; align-items: center; gap: 10px;
}
.tool-head h1 svg { width: 26px; height: 26px; color: #1e3a5f; }
.tool-head p { margin: 0; font-size: 14px; color: #6b7890; }

/* ---- 查询区卡片 ---- */
.upload-section {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(30, 58, 95, .05);
}
.query-row {
  display: flex; gap: 12px;
  align-items: stretch;
}
.qq-input-box {
  flex: 1;
  display: flex; align-items: center;
  height: 50px;
  border: 1.5px solid #d5deeb;
  border-radius: 10px;
  background: #fafbfd;
  padding: 0 14px;
  transition: border-color .2s, box-shadow .2s;
}
.qq-input-box:focus-within {
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, .08);
}
.qq-prefix {
  display: flex; align-items: center;
  color: #8aa3bc;
  padding-right: 10px;
  border-right: 1px solid #e8edf5;
  margin-right: 12px;
}
.qq-prefix svg { width: 20px; height: 20px; }
#qqInput {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 16px; color: #1e3a5f;
  font-family: Consolas, monospace;
  letter-spacing: .5px;
}
#qqInput::placeholder { color: #b6bfd0; font-family: inherit; letter-spacing: 0; }
.qq-clear {
  border: none; background: transparent;
  color: #b6bfd0; cursor: pointer;
  padding: 4px; display: flex;
  transition: color .15s;
}
.qq-clear:hover { color: #e35656; }
.qq-clear svg { width: 15px; height: 15px; }

/* 查询按钮(同 face_match 风格) */
.btn-compare {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  height: 50px; padding: 0 34px;
  border: none; border-radius: 10px;
  background: #1e3a5f; color: #fff;
  font-size: 16px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: .5px;
  box-shadow: 0 4px 16px rgba(30, 58, 95, .25);
  transition: background .2s, box-shadow .2s, transform .15s;
}
.btn-compare svg { width: 18px; height: 18px; }
.btn-compare:hover:not(:disabled) {
  background: #2a4f7a;
  box-shadow: 0 8px 28px rgba(30, 58, 95, .32);
  transform: translateY(-2px);
}
.btn-compare:active:not(:disabled) { transform: scale(.96); }
.btn-compare:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

/* 进度条 */
.compare-progress {
  height: 6px;
  background: #eef2f7;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 18px;
}
.compare-progress-fill {
  height: 100%; width: 0;
  background: #1e3a5f;
  border-radius: 3px;
  transition: width .2s ease;
}

.tool-footer-links {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px;
  font-size: 12px; color: #b6bfd0;
}
.tool-footer-links a {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: #98a1b3; text-decoration: none;
  transition: color .15s;
}
.tool-footer-links a:hover { color: #1e3a5f; }
.tool-footer-links svg { width: 14px; height: 14px; }

/* ---- 结果卡片 ---- */
.result-card {
  margin-top: 22px;
  padding: 24px 28px 16px;
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(30, 58, 95, .06);
  animation: qqFadeIn .4s ease;
}
@keyframes qqFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.qq-result {
  display: flex; gap: 22px;
  align-items: flex-start;
}
.qq-avatar-box {
  flex-shrink: 0;
  width: 96px; height: 96px;
  border-radius: 16px;
  background: #f0f4fa;
  border: 1px solid #e2e9f2;
  padding: 5px;
}
.qq-avatar {
  width: 100%; height: 100%;
  border-radius: 12px;
  object-fit: cover;
  background: #e8edf5;
}
.qq-info { flex: 1; min-width: 0; }
.qq-name-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.qq-nickname {
  font-size: 20px; font-weight: 700; color: #1e3a5f;
  word-break: break-all;
}
.qq-badge {
  font-size: 12px; color: #5c6b84;
  background: #f0f4fa;
  border: 1px solid #e2e9f2;
  padding: 2px 12px; border-radius: 20px;
  font-family: Consolas, monospace;
}
.vip-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600; color: #9a6b0a;
  background: linear-gradient(135deg, #fdf3d8, #fbe8b4);
  border: 1px solid #eed9a1;
  padding: 2px 12px; border-radius: 20px;
  letter-spacing: .5px;
}
.qq-sign {
  font-size: 13px; color: #6b7890;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qq-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.qq-meta {
  background: #fafbfd;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 10px 12px;
}
.meta-label {
  display: block;
  font-size: 11px; color: #98a1b3;
  margin-bottom: 3px;
}
.meta-value {
  font-size: 14px; font-weight: 600; color: #1e3a5f;
  word-break: normal;
  overflow-wrap: anywhere;
}

.result-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  font-size: 12px; color: #b6bfd0;
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.result-footer svg { width: 13px; height: 13px; }

/* ---- API 接入条 ---- */
.api-bar {
  margin-top: 22px;
  padding: 12px 20px;
  background: #f0f4fa;
  border: 1px solid #e2e9f2;
  border-left: 4px solid #1e3a5f;
  border-radius: 10px;
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 8px 16px;
}
.api-text {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; color: #6b7890;
}
.api-text svg { width: 16px; height: 16px; color: #1e3a5f; flex-shrink: 0; }
.api-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: #1e3a5f; font-weight: 500;
  background: #fff;
  padding: 5px 18px; border-radius: 20px;
  border: 1px solid #d5deeb;
  white-space: nowrap;
  transition: all .15s;
}
.api-link:hover { border-color: #1e3a5f; background: #f8fafc; }
.api-link svg { width: 13px; height: 13px; }

/* ---- 响应式 ---- */
@media (max-width: 640px) {
  .tool-topbar { padding: 0 16px; }
  .tool-wrap { padding: 20px 16px 32px; }
  .upload-section { padding: 18px 16px; }
  .query-row { flex-direction: column; }
  .btn-compare { width: 100%; justify-content: center; }
  .qq-result { flex-direction: column; align-items: center; text-align: center; }
  .qq-name-row { justify-content: center; }
  .qq-meta-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; width: 100%; }
  .qq-sign { margin-bottom: 10px; }
  .topbar-brand { display: none; }
  .tool-footer-links { flex-direction: column; gap: 8px; }
}
@media (max-width: 420px) {
  .tool-head h1 { font-size: 21px; }
  .qq-meta-grid { grid-template-columns: 1fr; }
  .qq-meta { display: flex; justify-content: space-between; align-items: center; }
  .meta-label { margin-bottom: 0; }
}
