/* =========================
   Base Reset
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;

  background-image: url("bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  color: #111;
  font-size: 16px;
  line-height: 1.6;
}

/* 背景遮罩（提高可读性） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: -1;
}

/* =========================
   Layout
========================= */
.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 0;
}

.container {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  padding: 26px;
}

.hero {
  padding: 30px;
}

/* =========================
   Typography
========================= */
.title {
  margin: 0 0 8px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  font-size: clamp(30px, 4.5vw, 48px);
}

.subtitle {
  margin: 0 0 18px;
  color: rgba(0, 0, 0, 0.65);
  font-size: clamp(14px, 2.2vw, 16px);
}

/* =========================
   Engine Switch
========================= */
.engine-wrap {
  margin-top: 6px;
}

.engine-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.8);
  margin: 8px 0 18px;
}

.seg label {
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.7);
  transition: background 150ms ease, color 150ms ease;
}

.seg label:hover {
  background: rgba(0, 0, 0, 0.05);
}

#e-baidu:checked ~ .seg label[for="e-baidu"],
#e-google:checked ~ .seg label[for="e-google"],
#e-bing:checked  ~ .seg label[for="e-bing"] {
  background: #111;
  color: #fff;
}

/* =========================
   Forms Switch
========================= */
.forms {
  margin-top: 6px;
}

.search {
  display: none;
  gap: 12px;
}

#e-baidu:checked ~ .forms .search-baidu { display: grid; }
#e-google:checked ~ .forms .search-google { display: grid; }
#e-bing:checked  ~ .forms .search-bing  { display: grid; }

/* =========================
   Search Input
========================= */
.search-input {
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;

  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.98);

  font: inherit;
  font-size: 16px;
  outline: none;

  transition: border 150ms ease, box-shadow 150ms ease;
}

.search-input:focus {
  border-color: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

/* 桌面端横向排列 */
@media (min-width: 768px) {
  .search {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* =========================
   Modern Capsule Button
========================= */
.btn {
  appearance: none;
  -webkit-appearance: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 14px 32px;
  min-height: 56px;

  border-radius: 999px;
  border: none;

  font-weight: 700;
  font-size: clamp(16px, 2vw, 20px);
  letter-spacing: 0.5px;

  cursor: pointer;
  user-select: none;

  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    filter 150ms ease;
}

/* 主按钮风格 */
.btn.primary {
  color: #fff;

  background: linear-gradient(
    135deg,
    #111 0%,
    #222 40%,
    #000 100%
  );

  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    inset 0 -4px 8px rgba(255, 255, 255, 0.08);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.35),
    inset 0 -4px 8px rgba(255, 255, 255, 0.1);
}

.btn.primary:active {
  transform: translateY(0);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.25),
    inset 0 3px 6px rgba(0, 0, 0, 0.35);
  filter: brightness(0.95);
}

/* =========================
   Footer
========================= */
.footer {
  margin-top: 18px;
  text-align: center;
}

.icp {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(0, 0, 0, 0.65);
  text-decoration: none;
  font-size: 14px;
}

.icp:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.85);
}

/* =========================
   Helpers
========================= */
.muted {
  color: rgba(0, 0, 0, 0.65);
}

.hint {
  margin-top: 16px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.6);
}

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.04);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 小屏优化 */
@media (max-width: 360px) {
  .container { width: calc(100% - 24px); }
  .hero { padding: 20px; }
  .seg { width: 100%; }
  .seg label { flex: 1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
