:root{
  --brand1:#2F6BFF;
  --brand2:#4C5DFF;
  --brand3:#7B61FF;
  --ink:#0B2B6A;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial;
  color:#0f172a;
}
a{color:inherit;text-decoration:none}

/* =======================
   前台首页：全屏背景 + 居中
======================= */
body.frontPage{
  background:
    radial-gradient(1200px 600px at 20% 20%,rgba(255,255,255,.14),transparent 55%),
    linear-gradient(135deg,var(--brand1),var(--brand2) 45%,var(--brand3));
}
.hero{
  min-height:100vh;
  display:flex;
  align-items:center;
  color:#fff;
}
.hero-inner{
  width:100%;
  max-width:1200px;
  margin:0 auto;
  padding:0 20px;
}

/* 兼容 index.php 的 center 类 */
.hero-inner.center{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  transform:translateY(-40px);
}
.hero-text.center{max-width:860px;width:100%}
.hero-text.center h1{
  font-size:56px;
  margin:0 0 14px;
  font-weight:900;
}
.hero-text.center p{
  font-size:16px;
  line-height:1.8;
  opacity:.92;
  margin:10px auto 18px;
}

/* 首页搜索卡片 */
.search-card{
  margin-top:18px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.22);
  border-radius:22px;
  padding:18px;
  position:relative;
  width:100%;
  max-width:920px;
}
.search-row{
  display:flex;
  gap:12px;
  align-items:center;
}
.search-input{
  flex:1;
  border:0;
  border-radius:16px;
  padding:18px 18px;
  font-size:16px;
  outline:none;
}
.search-btn{
  border:0;
  border-radius:16px;
  height:52px;
  padding:0 26px;
  font-weight:900;
  cursor:pointer;
  color:#fff;
  background:linear-gradient(90deg,#FF6A00,#FF2EA6);
  box-shadow:0 12px 26px rgba(255,46,166,.32);
}
.suggest-box{
  position:absolute;
  left:18px;
  right:18px;
  top:66px;
  background:#fff;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 18px 50px rgba(15,23,42,.18);
  overflow:hidden;
  display:none;
  z-index:5;
}
.suggest-box.open{display:block}
.suggest-item{
  padding:12px 14px;
  font-weight:800;
  color:#0f172a;
  cursor:pointer;
}
.suggest-item:hover{background:#f3f6ff}

.hotdocs{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
}
.hotdoc{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.20);
  max-width:100%;
}
.hotdoc:hover{background:rgba(255,255,255,.20)}
.hotdoc-badge{
  min-width:34px;height:34px;border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  font-weight:900;background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.22)
}
.hotdoc-title{
  font-weight:900;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:360px;
}

/* =======================
   搜索页 / 文档页：无 logo 顶栏，居中搜索框
======================= */
.topbar{
  height:64px;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(15,23,42,.06);
}
.topbarInner{
  max-width:1200px;
  margin:0 auto;
  padding:0 18px;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.topSearch{
  width:min(920px, 100%);
  display:flex;
  align-items:center;
  gap:10px;
}
.topSearch input{
  flex:1;
  height:48px;
  border-radius:999px;
  border:1px solid rgba(2,6,23,.10);
  padding:0 18px;
  font-size:16px;
  outline:none;
  background:#fff;
}
.topSearch button{
  width:48px;height:48px;border-radius:999px;border:none;
  cursor:pointer;
  background:linear-gradient(135deg,#ff7a18,#ff2ad1);
  color:#fff;
  font-size:18px;
  box-shadow:0 14px 30px rgba(255,42,209,.20);
}

/* =======================
   结果页内容
======================= */
.resultPage{background:#f8fafc}
.resultWrap{max-width:980px;margin:18px auto 70px;padding:0 18px}
.resultMeta{margin:14px 0 10px;color:rgba(15,23,42,.75);font-weight:700}
.resultList{display:flex;flex-direction:column;gap:12px}
.resultItem{
  display:block;background:#fff;border:1px solid rgba(15,23,42,.08);
  border-radius:14px;padding:14px 16px;color:#0f172a;
  box-shadow:0 12px 30px rgba(2,6,23,.06)
}
.resultItem:hover{
  border-color:rgba(37,99,235,.35);
  box-shadow:0 16px 40px rgba(2,6,23,.10);
  transform:translateY(-1px);
}
.resultTitle{font-weight:1000;font-size:16px;line-height:1.35;margin-bottom:6px;color:#0b2b6a}
.resultSnippet{font-size:13px;line-height:1.7;color:#334155}
.resultTags{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap}
.pill{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;font-size:12px;font-weight:900;
  background:rgba(37,99,235,.10);color:#1d4ed8}
.pill2{background:rgba(124,58,237,.10);color:#6d28d9}
.emptyTip{
  background:rgba(255,255,255,.80);
  border:1px solid rgba(15,23,42,.08);
  color:#0f172a;
  padding:12px 14px;border-radius:16px;font-weight:800;
}

/* =======================
   文档页内容
======================= */
.docPage{background:#f8fafc;min-height:100vh}
.docWrap{max-width:980px;margin:22px auto 70px;padding:0 18px}
.docCard{
  background:#fff;border:1px solid rgba(2,6,23,.06);
  border-radius:18px;box-shadow:0 18px 50px rgba(2,6,23,.06);
  padding:22px 22px
}
.docTitle{font-size:28px;font-weight:1000;margin:0 0 10px}
.docMeta{display:flex;flex-wrap:wrap;gap:12px;color:rgba(15,23,42,.65);font-weight:700;margin-bottom:16px}
.docTags{background:rgba(2,6,23,.05);padding:6px 10px;border-radius:999px}
.docBody{line-height:1.75;color:#0f172a}
.docBody img{max-width:100%;height:auto;border-radius:12px}
.docBody pre{overflow:auto;background:#0b1220;color:#e2e8f0;padding:14px;border-radius:14px}
.docBody code{background:rgba(2,6,23,.06);padding:2px 6px;border-radius:8px}

/* 高亮 */
.hl{color:#d33;background:#ffecec;font-weight:900;padding:0 2px;border-radius:4px}
mark{background:rgba(255,199,0,.35);padding:0 4px;border-radius:6px}

/* 响应式 */
@media (max-width:960px){
  .hero-text.center h1{font-size:40px}
  .hero-inner.center{transform:none}
}
@media (max-width:640px){
  .search-row{flex-direction:column;align-items:stretch}
  .search-btn{width:100%}
  .topbar{height:auto;padding:12px 0}
  .topbarInner{height:auto}
  .topSearch input{height:44px}
  .topSearch button{width:44px;height:44px}
}


/* =======================
   自动联想（Google 风格）
======================= */
.searchBoxWrap{position:relative}
.suggestBox{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 10px);
  background:#fff;
  border-radius:18px;
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 22px 50px rgba(0,0,0,.16);
  overflow:hidden;
  z-index:999;
}
.suggestHeader{
  padding:10px 14px;
  background:rgba(15,23,42,.04);
  color:#64748b;
  font-weight:900;
  font-size:12px;
}
.suggestItem{
  padding:12px 14px;
  display:flex;
  flex-direction:column;
  gap:4px;
  cursor:pointer;
}
.suggestItem:hover,.suggestItem.active{background:rgba(37,99,235,.08)}
.suggestTitle{font-weight:900;color:#0b2b6a}
.suggestSnippet{font-size:12px;color:#334155;opacity:.9;line-height:1.55}
.suggestMeta{margin-top:8px;display:flex;gap:8px;flex-wrap:wrap}

/* ===== feedback modal ===== */
.fbBtn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 14px;border-radius:999px;font-weight:900;
  border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.18);
  color:#fff;cursor:pointer;
}
.fbBtn:hover{background:rgba(255,255,255,.24)}
.fbHint{margin-top:10px;opacity:.9;font-weight:800}

.fbMask{
  position:fixed;inset:0;background:rgba(0,0,0,.35);
  display:none;align-items:center;justify-content:center;z-index:9999;
  padding:18px;
}
.fbMask.open{display:flex}
.fbModal{
  width:100%;max-width:520px;background:#fff;border-radius:18px;
  box-shadow:0 25px 70px rgba(0,0,0,.25);
  border:1px solid rgba(15,23,42,.10);
  overflow:hidden;
}
.fbHead{padding:14px 16px;display:flex;align-items:center;gap:12px;border-bottom:1px solid rgba(15,23,42,.06)}
.fbHead b{font-size:16px;color:#0b2b6a}
.fbClose{margin-left:auto;border:0;background:transparent;font-size:22px;cursor:pointer;color:#64748b}
.fbBody{padding:16px}
.fbLabel{font-weight:900;margin:10px 0 6px;color:#0f172a}
.fbInput,.fbTextarea{
  width:100%;border:1px solid rgba(15,23,42,.14);border-radius:14px;
  padding:12px 12px;font-size:14px;outline:none;
}
.fbTextarea{min-height:110px;resize:vertical;line-height:1.6}
.fbActions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}
.fbPrimary{
  border:0;border-radius:14px;height:42px;padding:0 16px;font-weight:900;cursor:pointer;
  color:#fff;background:linear-gradient(90deg,#2563eb,#7c3aed);
  box-shadow:0 14px 30px rgba(37,99,235,.20)
}
.fbGhost{
  border:1px solid rgba(15,23,42,.14);border-radius:14px;height:42px;padding:0 16px;
  font-weight:900;cursor:pointer;background:#fff;color:#0f172a;
}
.fbToast{
  margin-top:10px;font-weight:900;color:#0f172a;
}
