:root {
  --blue: #1a73e8;
  --blue-hover: #1765cc;
  --gblue: #4285f4;
  --red: #ea4335;
  --yellow: #fbbc05;
  --green: #34a853;
  --gray: #5f6368;
  --light-gray: #f8f9fa;
  --border: #dfe1e5;
  --text: #202124;
  --snippet: #4d5156;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Roboto, "Google Sans", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ---------- 顶栏 ---------- */
.topbar { border-bottom: 1px solid #ebebeb; }
.topbar-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
}
.logo { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.logo-mark {
  font-size: 26px; font-weight: 700; color: var(--gblue); letter-spacing: -1px;
}
.logo-text { font-size: 19px; color: var(--gray); font-weight: 500; }

.searchbar {
  flex: 1; display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: 24px;
  padding: 4px 8px 4px 16px; background: #fff;
  transition: box-shadow .18s, border-color .18s;
}
.searchbar:hover, .searchbar:focus-within {
  box-shadow: 0 1px 6px rgba(32,33,36,.18);
  border-color: transparent;
}
.s-icon { color: var(--gray); flex-shrink: 0; }
.s-input {
  flex: 1; border: none; outline: none; font-size: 16px;
  padding: 8px 10px; background: transparent; color: var(--text);
}
.s-mic {
  border: none; background: none; color: var(--gblue); cursor: pointer;
  display: flex; align-items: center; padding: 4px 6px; flex-shrink: 0;
}
.s-clear { border: none; background: none; color: var(--gray); cursor: pointer; font-size: 16px; padding: 4px; }
.s-btn {
  border: none; background: var(--blue); color: #fff;
  border-radius: 999px; padding: 8px 20px; font-size: 15px; cursor: pointer;
  margin-left: 4px; transition: background .15s, box-shadow .15s;
}
.s-btn:hover { background: var(--blue-hover); box-shadow: 0 1px 3px rgba(0,0,0,.25); }

.topbar-stats { white-space: nowrap; color: var(--gray); font-size: 14px; text-align: right; }
.stat-num { font-weight: 700; color: var(--text); }
.stat-label { margin-left: 2px; }

.back-home { color: var(--gray); font-size: 14px; white-space: nowrap; }
.back-home:hover { color: var(--blue); }

/* ---------- 首页（纯搜索框） ---------- */
.home-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; min-height: 78vh;
}
.home-logo {
  font-size: clamp(48px, 8vw, 72px); font-weight: 600; letter-spacing: 4px;
  margin-bottom: 32px; line-height: 1;
}
.home-logo .c1 { color: var(--gblue); }
.home-logo .c2 { color: var(--red); }
.home-logo .c3 { color: var(--yellow); }
.home-logo .c4 { color: var(--green); }
.searchbar-lg { max-width: 600px; width: 100%; margin: 0 auto; flex: none; padding: 6px 8px 6px 20px; }
.searchbar-lg .s-input { font-size: 17px; padding: 10px 8px; }
.home-btns { margin-top: 28px; display: flex; gap: 12px; }
.gbtn {
  background: var(--light-gray); border: 1px solid var(--light-gray); color: #3c4043;
  border-radius: 4px; padding: 10px 22px; font-size: 14.5px; cursor: pointer;
  transition: all .15s; display: inline-block; line-height: 1.2;
}
.gbtn:hover { border-color: #dadce0; box-shadow: 0 1px 2px rgba(0,0,0,.12); background: #f8f9fa; }
.home-tip { margin-top: 30px; color: var(--gray); font-size: 13.5px; }
.home-tip b { color: var(--gblue); font-weight: 600; }

/* ---------- 分类 chips ---------- */
.cats {
  max-width: 720px; margin: 18px auto 0; padding: 0 20px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px;
  background: var(--light-gray); color: var(--gray); border: 1px solid transparent;
  transition: all .15s;
}
.chip:hover { background: #eef1f4; }
.chip.active { background: #e8f0fe; color: var(--blue); border-color: #d2e3fc; }

/* ---------- 结果 ---------- */
.results { max-width: 720px; margin: 0 auto; padding: 12px 20px 40px; flex: 1; width: 100%; }
.result-count { color: var(--gray); font-size: 13px; margin: 8px 0 16px; }

.result { margin-bottom: 28px; }
.r-head { display: flex; align-items: baseline; gap: 8px; }
.r-title { font-size: 19px; color: var(--blue); line-height: 1.35; }
.r-title:hover { text-decoration: underline; }
.r-badges { margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.r-cat {
  display: inline-block; font-size: 12px; color: var(--green);
  background: #e6f4ea; padding: 2px 8px; border-radius: 4px; margin-right: 8px;
}
.r-snippet { color: var(--snippet); font-size: 14px; line-height: 1.6; margin-top: 4px; }
.r-meta { margin-top: 6px; font-size: 13px; color: var(--gray); display: flex; align-items: center; gap: 12px; }
.r-time { color: #9aa0a6; }
.r-link { color: var(--blue); }

/* ---------- 徽标（网盘类型） ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 4px;
  background: #f1f3f4; color: #3c4043;
}
.badge-baidu   { background: #e8f0fe; color: #1a73e8; }
.badge-quark   { background: #e0f2f1; color: #00796b; }
.badge-aliyun  { background: #fff3e0; color: #e65100; }
.badge-xunlei  { background: #e3f2fd; color: #0277bd; }
.badge-pan123  { background: #f3e5f5; color: #8e24aa; }
.badge-lanzou  { background: #e8f5e9; color: #2e7d32; }
.badge-tianyi  { background: #e1f5fe; color: #0288d1; }
.badge-magnet  { background: #eceff1; color: #546e7a; }
.badge-weiyun  { background: #e3f2fd; color: #01579b; }

/* xshui 商品标记 */
.badge-xshui {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 4px;
  background: #0b8043; color: #fff; text-transform: lowercase;
}
.result-xshui { background: #f7fcf9; border-left: 3px solid #0b8043; padding: 8px 12px; border-radius: 4px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty p { font-size: 16px; }
.empty-sub { font-size: 14px; color: #9aa0a6; margin-top: 8px; }

/* ---------- 分页 ---------- */
.pager {
  max-width: 720px; margin: 0 auto; padding: 0 20px 48px;
  display: flex; justify-content: center; align-items: center; gap: 16px;
}
.pg { color: var(--blue); padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; }
.pg:hover { background: #f8f9fa; }
.pg-cur { color: var(--gray); font-size: 14px; }

/* ---------- 详情页 ---------- */
.detail { max-width: 760px; margin: 0 auto; padding: 24px 20px 48px; flex: 1; width: 100%; }
.detail-card { background: #fff; }
.d-title { font-size: 26px; line-height: 1.4; font-weight: 500; margin-bottom: 12px; }
.d-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.d-time { color: #9aa0a6; font-size: 13px; }
.d-src { color: var(--blue); font-size: 13px; }
.d-src:hover { text-decoration: underline; }
.d-cover { margin-bottom: 20px; text-align: center; }
.d-cover img { max-width: 100%; max-height: 360px; border-radius: 8px; border: 1px solid #eee; }

.d-section { margin-top: 24px; }
.d-section h2 {
  font-size: 17px; font-weight: 500; margin-bottom: 12px;
  padding-left: 10px; border-left: 4px solid var(--blue);
}
.d-excerpt { font-size: 15px; line-height: 1.8; color: #3c4043; white-space: pre-wrap; }

.res-box {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; background: #fafafa;
}
.res-head { margin-bottom: 10px; }
.res-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.res-row:last-child { margin-bottom: 0; }
.res-label { flex-shrink: 0; width: 62px; color: var(--gray); font-size: 13.5px; padding-top: 4px; }
.res-val { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.res-url {
  color: var(--blue); font-size: 14.5px; word-break: break-all; flex: 1;
}
.res-url:hover { text-decoration: underline; }
.res-code {
  font-size: 20px; font-weight: 700; letter-spacing: 3px; color: var(--red);
  background: #fff; border: 1px dashed #dadce0; border-radius: 6px;
  padding: 6px 16px; font-family: ui-monospace, Consolas, monospace;
}
.copy-btn {
  flex-shrink: 0; border: 1px solid var(--border); background: #fff; color: var(--blue);
  border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { background: #e8f0fe; border-color: #d2e3fc; }
.copy-btn.copied { background: #e6f4ea; color: var(--green); border-color: #ceead6; }
.d-tip { color: #9aa0a6; font-size: 13px; margin-top: 12px; line-height: 1.6; }

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid #ebebeb; text-align: center;
  color: #70757a; font-size: 13px; padding: 16px 20px; background: #f8f9fa;
}
.foot a { color: #70757a; }
.foot a:hover { text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
  .topbar-stats { display: none; }
  .topbar-inner { gap: 10px; padding: 10px 14px; }
  .logo-text { display: none; }
  .home-wrap { padding: 16px; }
  .s-btn { padding: 8px 14px; }
  .d-title { font-size: 21px; }
}
