:root {
  --primary: #197afc;
  --primary-dark: #1d4ed8;
  --gray-50: #F9FAFB;
  --gray-200: #E5E7EB;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --text: #334155;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--gray-50);
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.05); z-index: 50;
}
.header-content {
  display: flex; justify-content: space-between; align-items: center;
  height: 64px; max-width: 1280px; margin: 0 auto; padding: 0 20px;
}
.logo { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo a {
  font-weight: 700; font-size: 1.35rem; color: var(--primary);
  text-decoration: none; flex-shrink: 0; line-height: 1.2;
}
.logo a .logo-reg {
  font-size: 0.6em;
  vertical-align: super;
  margin-left: 2px;
}
.logo-tagline {
  display: flex; flex-direction: column; gap: 2px;
  padding-left: 16px; border-left: 1px solid var(--gray-200);
}
.logo-tagline-line { font-size: .75rem; font-weight: 500; color: var(--gray-600); line-height: 1.2; }

.main-nav-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.main-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}

.main-nav-group {
  display: flex;
  gap: 18px;
  align-items: center;
}

.main-nav-divider {
  width: 1px;
  height: 16px;
  background: var(--gray-200);
  flex-shrink: 0;
}

.main-nav a {
  color: var(--gray-700);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
}

.main-nav a:hover { color: var(--primary); }

.main-nav-ext--hot {
  font-weight: 600;
  color: var(--gray-900);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  font-size: .8125rem;
  font-weight: 600;
  color: #fff !important;
  background: var(--primary);
  border-radius: 6px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.btn-nav:hover {
  background: var(--primary-dark);
  color: #fff !important;
}

.main-nav a.active:not(.btn-nav) {
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px;
}

.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px;
  font-weight: 600; text-decoration: none; border: none; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.site-footer {
  background: #111827; color: #fff; margin-top: 0;
}
.footer-modern { padding: 3rem 0 2rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px; margin-bottom: 32px;
}
.footer-logo { color: #fff; font-weight: 700; font-size: 1.125rem; text-decoration: none; line-height: 1.2; }
.footer-logo .logo-reg {
  font-size: 0.6em;
  vertical-align: super;
  margin-left: 2px;
}
.footer-desc { margin-top: 12px; font-size: .875rem; color: #9CA3AF; line-height: 1.7; }
.footer-title { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #D1D5DB; text-decoration: none; font-size: .875rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { padding-top: 24px; border-top: 1px solid #374151; text-align: center; }
.footer-bottom p { font-size: .8125rem; color: #9CA3AF; }
.footer-bottom a { color: #93C5FD; }

/* Admin 简易表单 */
.zq-form label { display: block; margin-bottom: 12px; }
.zq-form input, .zq-form select { margin-left: 8px; padding: 6px 8px; }
.zq-form button { padding: 8px 16px; background: var(--primary); color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
.zq-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 16px; }
.zq-table th, .zq-table td { border: 1px solid var(--gray-200); padding: 8px; text-align: left; }
.zq-error { color: #b91c1c; }
.zq-ok { color: #047857; }
.zq-section { margin-top: 28px; }
.zq-muted { color: #6B7280; font-size: 14px; }
.zq-admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.zq-table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--gray-200); border-radius: 8px; }
.zq-kw-cell { max-width: 280px; font-size: 13px; line-height: 1.5; }
.zq-row-active { background: #EFF6FF; }
.zq-prompt-box {
  background: #111827; color: #E5E7EB; padding: 16px; border-radius: 8px;
  overflow: auto; max-height: 480px; font-size: 13px; line-height: 1.6; white-space: pre-wrap;
}
.zq-prompt-box--sm { max-height: 320px; font-size: 12px; }
.zq-prompt-meta { background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; padding: 16px; margin: 16px 0; }
.zq-prompt-meta p { margin: 0 0 8px; font-size: 14px; }
.zq-details { margin-top: 8px; font-size: 14px; }
.zq-test-kw-list { margin: 8px 0 0 20px; font-size: 13px; }
.zq-test-kw-list li { margin-bottom: 10px; }
.zq-log-item { margin-bottom: 12px; border: 1px solid var(--gray-200); border-radius: 8px; padding: 8px 12px; background: #fff; }
.zq-log-item summary { cursor: pointer; font-size: 14px; }
.zq-form-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

@media (max-width: 768px) {
  .header-content { height: 56px; padding: 0 12px; gap: 8px; }
  .logo-tagline { display: none; }
  .logo a { font-size: 1.15rem; }
  .main-nav {
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: calc(100vw - 120px);
    padding-bottom: 2px;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav-group { gap: 12px; }
  .main-nav a { font-size: .8125rem; }
  .main-nav-group--categories .main-nav-ext:nth-child(n+3) { display: none; }
  .btn-nav { padding: 6px 10px; font-size: .75rem; }
}
