* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6fa; color: #222; line-height: 1.6;
  max-width: 900px; margin: 0 auto; padding: 16px;
}
header { text-align: center; padding: 18px 0 8px; }
header h1 { font-size: 24px; }
header .sub { color: #888; font-size: 13px; }

.tabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tab {
  flex: 1; min-width: 80px; padding: 10px 6px; border: 1px solid #ddd;
  background: #fff; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.tab.active { background: #4a6cf7; color: #fff; border-color: #4a6cf7; }

.panel { display: none; background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.panel.active { display: block; }

.mode-switch { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; font-size: 14px; }
.radio { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

.search-box { display: flex; gap: 8px; }
.search-box input {
  flex: 1; padding: 12px 14px; border: 1px solid #ccc; border-radius: 10px; font-size: 15px;
}
.search-box button, .chat-input button {
  padding: 0 22px; border: none; background: #4a6cf7; color: #fff;
  border-radius: 10px; font-size: 15px; cursor: pointer;
}
.status, .hint { color: #888; font-size: 13px; margin: 10px 0; }

.results { margin-top: 14px; }
.result-card {
  border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
}
.result-card h3 { font-size: 15px; color: #4a6cf7; }
.result-card a { color: #4a6cf7; font-size: 12px; word-break: break-all; }
.result-card p { font-size: 13px; color: #444; margin-top: 6px; }

/* chat */
.key-box.hidden { display: none; }
.key-box { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.key-box input, .key-box select {
  flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 13px;
}
.chat {
  height: 380px; overflow-y: auto; border: 1px solid #eee; border-radius: 10px;
  padding: 14px; background: #fafbfd; margin-bottom: 12px;
}
.msg { margin-bottom: 12px; max-width: 85%; }
.msg.user { margin-left: auto; }
.bubble { padding: 10px 14px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.user .bubble { background: #4a6cf7; color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: #fff; border: 1px solid #e5e5e5; border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; padding: 12px 14px; border: 1px solid #ccc; border-radius: 10px; font-size: 15px; }

/* tools */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.tool-card {
  border: 1px solid #eee; border-radius: 12px; padding: 14px; cursor: pointer;
  transition: .15s; background: #fff;
}
.tool-card:hover { border-color: #4a6cf7; transform: translateY(-2px); }
.tool-card .icon { font-size: 26px; }
.tool-card .name { font-weight: 600; margin: 6px 0 2px; font-size: 14px; }
.tool-card .desc { font-size: 12px; color: #888; }
.tool-output {
  margin-top: 14px; padding: 14px; border-radius: 10px; background: #fafbfd;
  border: 1px solid #eee; font-size: 14px; white-space: pre-wrap; word-break: break-word; display: none;
}
.tool-output.show { display: block; }
.tool-output img { max-width: 100%; border-radius: 8px; margin-top: 8px; }

/* test */
.test-list { margin: 10px 0; }
.test-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid #eee; border-radius: 8px; margin-bottom: 8px; font-size: 13px;
}
.test-item .dot { width: 10px; height: 10px; border-radius: 50%; background: #ccc; flex-shrink: 0; }
.test-item.ok .dot { background: #2ecc71; }
.test-item.fail .dot { background: #e74c3c; }
.test-item .tname { font-weight: 600; min-width: 120px; }
.test-item .turl { color: #999; font-size: 11px; word-break: break-all; flex: 1; }
.test-item .tstate { font-size: 12px; }
.test-item.ok .tstate { color: #2ecc71; }
.test-item.fail .tstate { color: #e74c3c; }
.retest {
  margin-top: 8px; padding: 10px 20px; border: none; background: #4a6cf7;
  color: #fff; border-radius: 10px; cursor: pointer; font-size: 14px;
}

footer { text-align: center; color: #aaa; font-size: 12px; padding: 18px 0; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #ccc; border-top-color: #4a6cf7; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
