/* ═══════════════════════════════════════════════════
   s.t72p.com 搜索引擎 — 主样式
   风格：现代感 · 渐变 · 卡片 · 精致细节
═══════════════════════════════════════════════════ */

/* ── CSS变量 ───────────────────────────────────── */
:root {
  --primary:      #4f6ef7;
  --primary-dark: #3451d1;
  --accent:       #7c3aed;
  --grad:         linear-gradient(135deg, #4f6ef7, #7c3aed);
  --bg:           #f0f4ff;
  --bg2:          #eef2ff;
  --card:         #ffffff;
  --border:       #e4eaf8;
  --text:         #0f172a;
  --text2:        #475569;
  --muted:        #94a3b8;
  --green:        #16a34a;
  --red:          #dc2626;
  --shadow-sm:    0 1px 4px rgba(79,110,247,.08);
  --shadow:       0 4px 20px rgba(79,110,247,.11);
  --shadow-lg:    0 8px 36px rgba(79,110,247,.18);
  --radius:       18px;
  --radius-sm:    10px;
  --font:         'Noto Sans SC', -apple-system, 'PingFang SC', sans-serif;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a    { color: inherit; text-decoration: none; }
strong { font-weight: 700; }

/* ═══════════════════════════════════════════════════
   首页
═══════════════════════════════════════════════════ */
.page-home {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(79,110,247,.14) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(124,58,237,.10) 0%, transparent 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.home-wrap {
  width: 100%;
  max-width: 660px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* Logo */
.home-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.logo-icon {
  font-size: 2.4rem;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(79,110,247,.3));
}

.logo-text {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-tagline {
  font-size: .95rem;
  color: var(--text2);
  text-align: center;
  margin-top: -20px;
  letter-spacing: .02em;
}

/* 搜索区块 */
.search-block { width: 100%; position: relative; }

.home-stats {
  font-size: .84rem;
  color: var(--muted);
  letter-spacing: .02em;
}
.home-stats strong { color: var(--primary); }

/* ═══════════════════════════════════════════════════
   搜索框（通用）
═══════════════════════════════════════════════════ */
.search-row { position: relative; }

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 50px;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
  overflow: hidden;
}

.search-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,110,247,.13), var(--shadow);
}

.search-icon {
  flex-shrink: 0;
  padding: 0 6px 0 18px;
  display: flex;
  align-items: center;
  color: var(--muted);
}

.search-icon svg { width: 20px; height: 20px; }

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 16px 10px;
  font-size: 1.05rem;
  font-family: var(--font);
  color: var(--text);
  caret-color: var(--primary);
}

.search-input-wrap.compact input { padding: 11px 8px; font-size: .95rem; }

.search-btn {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: .92rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad);
  padding: 0 22px;
  height: 100%;
  min-height: 46px;
  border-radius: 0 48px 48px 0;
  transition: opacity .2s, transform .15s;
  letter-spacing: .03em;
}

.search-input-wrap.compact .search-btn { min-height: 38px; padding: 0 18px; font-size: .85rem; }
.search-btn:hover { opacity: .88; transform: translateX(1px); }

/* ── 搜索建议下拉 ─────────────────────────────── */
.suggest-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  display: none;
  animation: fadeDown .15s ease;
}

.suggest-dropdown.open { display: block; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  font-size: .92rem;
  cursor: pointer;
  color: var(--text);
  transition: background .12s;
  border-bottom: 1px solid var(--border);
}

.suggest-item:last-child { border-bottom: none; }

.suggest-item::before {
  content: '🔍';
  font-size: .78rem;
  opacity: .45;
  flex-shrink: 0;
}

.suggest-item:hover,
.suggest-item.hi { background: var(--bg2); color: var(--primary); }

.suggest-item strong { color: var(--primary); font-weight: 700; }

/* ═══════════════════════════════════════════════════
   结果页 Header
═══════════════════════════════════════════════════ */
.result-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}

.header-logo .logo-icon { font-size: 1.5rem; }
.header-logo .logo-name {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -.5px;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-search-form { flex: 1; max-width: 620px; position: relative; }

/* ═══════════════════════════════════════════════════
   结果主体
═══════════════════════════════════════════════════ */
.result-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 80px;
}

/* 双栏布局容器 */
.result-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
}

/* 左侧结果列 */
.result-col-main {}

/* 右侧信息栏 */
.result-col-side {
  position: sticky;
  top: 72px;  /* header高度 */
}

/* 右侧卡片 */
.side-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.side-card-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* 相关搜索（右侧版） */
.side-related-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-related-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: .875rem;
  color: var(--text);
  text-decoration: none;
  transition: background .15s, color .15s;
  line-height: 1.4;
}

.side-related-item::before {
  content: '↗';
  font-size: .7rem;
  color: var(--muted);
  flex-shrink: 0;
}

.side-related-item:hover {
  background: var(--bg2);
  color: var(--primary);
}

.side-related-item:hover::before { color: var(--primary); }

/* 搜索技巧（右侧） */
.side-tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-tip {
  font-size: .8rem;
  color: var(--text2);
  line-height: 1.6;
}

.side-tip code {
  background: var(--bg2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .76rem;
  color: var(--primary);
  font-family: monospace;
}

/* 热词云（右侧） */
.side-hot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.side-hot-item {
  font-size: .78rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg2);
  color: var(--text2);
  text-decoration: none;
  transition: .15s;
  border: 1px solid transparent;
}

.side-hot-item:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 统计条 */
.result-bar {
  margin-bottom: 18px;
  font-size: .85rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-bar .result-count strong { color: var(--text); font-weight: 700; }
.result-bar .result-time { color: var(--muted); }

/* ── 结果卡片 ─────────────────────────────────── */
.result-list { display: flex; flex-direction: column; gap: 12px; }

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--grad);
  opacity: 0;
  transition: opacity .2s;
  border-radius: 3px 0 0 3px;
}

.result-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(79,110,247,.25);
}

.result-card:hover::before { opacity: 1; }

.card-domain {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .76rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.domain-globe { font-size: .78rem; }
.domain-name  { font-weight: 500; }

.card-title {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 4px;
}

.card-title a { transition: color .15s; }
.card-title a:hover { color: var(--primary); }

/* 高亮关键词 */
.card-title em,
.card-snippet em {
  color: var(--primary);
  font-style: normal;
  font-weight: 700;
  background: rgba(79,110,247,.09);
  padding: 0 2px;
  border-radius: 3px;
}

.card-url {
  font-size: .75rem;
  color: var(--green);
  margin-bottom: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-snippet {
  font-size: .9rem;
  color: #374151;
  line-height: 1.7;
}

.card-meta {
  margin-top: 10px;
  font-size: .76rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── 无结果 ───────────────────────────────────── */
.no-result {
  text-align: center;
  padding: 80px 24px;
  color: var(--text2);
}

.no-result-icon { font-size: 3.5rem; margin-bottom: 20px; }

.no-result h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.no-result h2 strong { color: var(--primary); }
.no-result p { font-size: .9rem; color: var(--muted); line-height: 1.8; }

/* ── 消息盒子 ─────────────────────────────────── */
.msg-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.msg-box .msg-icon { font-size: 2rem; flex-shrink: 0; }
.msg-box strong    { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.msg-box p         { font-size: .9rem; color: var(--text2); }
.msg-warn          { border-color: #fde68a; background: #fffbeb; }

/* ── 分页 ─────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 44px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text2);
  font-size: .88rem;
  font-family: var(--font);
  transition: all .18s;
  cursor: pointer;
}

.page-btn:hover      { border-color: var(--primary); color: var(--primary); background: var(--bg2); }
.page-btn.active     { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 3px 12px rgba(79,110,247,.35); font-weight: 700; }
.page-btn.prev,
.page-btn.next       { font-size: .82rem; }

/* ── Footer ──────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: .8rem;
  color: var(--muted);
}

.site-footer a { color: var(--muted); transition: color .2s; }
.site-footer a:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════
   响应式
═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .result-layout {
    grid-template-columns: 1fr 220px;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  /* 小屏单栏，侧栏移到底部 */
  .result-layout {
    grid-template-columns: 1fr;
  }
  .result-col-side {
    position: static;
  }
  .side-card { display: none; } /* 手机隐藏侧栏，保持简洁 */
}

@media (max-width: 680px) {
  .logo-text      { font-size: 2rem; }
  .result-header  { padding: 8px 14px; gap: 12px; }
  .header-logo .logo-name { font-size: 1.05rem; }
  .result-main    { padding: 16px 14px 60px; }
  .result-card    { padding: 16px 16px 14px; }
  .card-title     { font-size: 1rem; }
  .pagination     { gap: 5px; }
  .page-btn       { min-width: 34px; height: 34px; font-size: .8rem; }
}
