:root {
  --bg: #ffffff;
  --soft-bg: #f8fafd;
  --card: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --line: #dfe1e5;
  --line-soft: #edf0f3;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #eef4ff;
  --brand-blue: #2563eb;
  --brand-red: #ef4444;
  --brand-yellow: #f59e0b;
  --brand-green: #16a34a;
  --danger-bg: #fef2f2;
  --danger: #b91c1c;
  --ok-bg: #ecfdf5;
  --ok: #047857;
  --shadow: 0 1px 6px rgba(32, 33, 36, .16);
  --shadow-soft: 0 8px 24px rgba(60, 64, 67, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.search-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 32px;
}
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}
.brand { font-weight: 700; letter-spacing: -.02em; }
.brand-text { display: inline-flex; align-items: baseline; }
.brand-c-blue { color: var(--brand-blue); }
.brand-c-red { color: var(--brand-red); }
.brand-c-yellow { color: var(--brand-yellow); }
.brand-c-green { color: var(--brand-green); }
.topbar nav { display: flex; align-items: center; gap: 8px; }
.topbar nav a { color: var(--muted); padding: 6px 10px; border-radius: 999px; }
.topbar nav a:hover { color: var(--text); background: #f1f3f4; }
.home-body { background: #fff; }
.search-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0 76px;
}
.hero { width: min(640px, 100%); margin: 0 auto; text-align: center; }
.wordmark, .mark {
  margin: 0 0 18px;
  font-size: clamp(48px, 8vw, 78px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.055em;
}
.mark { font-size: 42px; }
.hero p, .center-card p { margin: 0 0 24px; color: var(--muted); }
.search-box {
  width: min(584px, 100%);
  min-height: 50px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0;
  padding: 0 8px 0 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.search-box:hover, .search-box:focus-within { border-color: transparent; box-shadow: var(--shadow); }
.search-box input {
  min-width: 0;
  height: 48px;
  border: 0;
  outline: 0;
  padding: 0 10px 0 0;
  font-size: 17px;
  background: transparent;
  color: var(--text);
}
.search-box button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--primary);
  display: inline-grid;
  place-items: center;
}
.search-box button:hover { background: var(--primary-soft); color: var(--primary-strong); }
button, .button {
  border: 0;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover, .button:hover { background: var(--primary-strong); }
button.secondary, .button.secondary { background: #f1f3f4; color: var(--text); }
button.secondary:hover, .button.secondary:hover { background: #e8eaed; }
button:disabled { opacity: .45; cursor: not-allowed; }
.state { max-width: 680px; margin: 18px 0; color: var(--muted); }

.result-body { background: #fff; }
.result-topbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 640px) 1fr;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f3f4;
}
.result-logo {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.result-search-box {
  width: min(640px, 100%);
  min-height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.result-search-box:hover, .result-search-box:focus-within { border-color: transparent; box-shadow: var(--shadow); }
.result-search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 11px 4px 11px 18px;
  font-size: 15px;
  background: transparent;
}
.result-search-box input:focus { box-shadow: none; }
.result-search-box button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--primary);
  display: inline-grid;
  place-items: center;
}
.result-search-box button:hover { background: var(--primary-soft); color: var(--primary-strong); }
.result-nav { display: flex; justify-content: flex-end; gap: 8px; font-size: 13px; }
.result-nav a { color: var(--muted); padding: 6px 10px; border-radius: 999px; }
.result-nav a:hover { background: #f1f3f4; color: var(--text); }
.result-tabs {
  height: 50px;
  display: flex;
  align-items: flex-end;
  gap: 28px;
  padding: 0 0 0 clamp(88px, 7vw, 132px);
  border-bottom: 1px solid #e8eaed;
  color: var(--muted);
  font-size: 14px;
}
.result-tabs a, .result-tabs span { padding: 0 0 12px; white-space: nowrap; }
.result-tabs .active { color: var(--text); border-bottom: 3px solid var(--text); }
.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(320px, 420px);
  gap: clamp(48px, 5vw, 86px);
  align-items: start;
  margin: 34px 0 0 0;
  padding: 0 0 64px;
}
.result-main {
  width: 100%;
  margin: 0;
  padding: 0;
}
.result-count { color: #70757a; font-size: 14px; margin: 0 0 20px; line-height: 1.4; }
.results { width: 100%; margin: 0; display: block; }
.result-card { padding: 0 0 26px; margin: 0; border: 0; background: transparent; }
.result-title { color: var(--primary); font-size: 20px; font-weight: 400; line-height: 1.3; display: block; margin-bottom: 3px; }
.result-title:visited { color: #6f42c1; }
.result-title:hover { text-decoration: underline; }
.result-url { color: #188038; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; margin-bottom: 4px; font-style: normal; }
.result-card p { color: #4d5156; font-size: 14px; line-height: 1.58; margin: 0; }
.pager-cd-bar { text-align: center; margin-top: 8px; font-size: 12px; color: #70757a; }
.pager-cd-bar strong { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.result-main .pager { display: flex; gap: 2px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.result-main .pager a.button,
.result-main .pager a.button.secondary,
.page-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 6px;
  border-radius: 50%;
  font-weight: 500;
  font-size: 13px;
  background: transparent;
  color: var(--primary);
}
.result-main .pager a.button:hover { background: #f1f3f4; text-decoration: none; }
.page-current { background: var(--primary-soft); color: var(--text); font-weight: 700; }
.pager-link.disabled { opacity: .35; pointer-events: none; }

.center-card {
  width: min(440px, 100%);
  margin: 10vh auto 0;
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
.center-card.wide { width: min(760px, 100%); }
h1, h2 { margin: 0 0 18px; letter-spacing: -.03em; color: var(--text); }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 20px; line-height: 1.25; }
.stack-form, .settings-form { display: grid; gap: 12px; }
label { display: grid; gap: 7px; color: #303134; font-weight: 620; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #a8c7fa; box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
.alert { margin: 12px 0; padding: 12px 14px; border-radius: 14px; font-weight: 620; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.muted { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.form-section-title {
  margin-top: 8px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}
.form-section-title strong { display: block; margin-bottom: 4px; font-size: 15px; }
.form-section-title small { color: var(--muted); font-weight: 500; }
.actions { display: flex; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; }

.ad-slot { max-width: 760px; margin: 16px auto; text-align: center; }
.ad-slot:empty { display: none; }
.ad-img-link { display: inline-block; max-width: 100%; }
.ad-img-link img { max-width: 100%; max-height: 180px; width: auto; height: auto; object-fit: contain; border-radius: 12px; }
.hero .ad-slot { max-width: 584px; margin-top: 22px; }
.result-main .ad-slot { width: 100%; max-width: 680px; margin: 14px 0 28px; text-align: left; }
.result-main .ad-slot .ad-img-link { display: block; width: 100%; }
.result-main .ad-slot .ad-img-link img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 10px; }
.result-side {
  min-height: 520px;
  border-left: 1px solid #dadce0;
  padding-left: 32px;
}
.side-ad-card {
  position: sticky;
  top: 20px;
  max-width: 420px;
}
.side-ad-title {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.03em;
}
.result-side .ad-slot { max-width: 100%; margin: 0; text-align: left; }
.result-side .ad-img-link { display: block; width: 100%; }
.result-side .ad-img-link img { width: 100%; max-height: 360px; object-fit: cover; border-radius: 18px; }
.site-footer { text-align: center; padding: 24px 16px 40px; color: var(--muted); font-size: 13px; max-width: 760px; margin: 0 auto; }

.blocked-page {
  max-width: 560px;
  margin: 36px auto 0;
  padding: 34px 28px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.blocked-icon { font-size: 30px; margin-bottom: 12px; opacity: .72; filter: grayscale(1); }
.blocked-page h2 { margin-bottom: 8px; }
.blocked-msg { color: var(--muted); font-weight: 620; margin: 0 0 20px; }

.redirect-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 0 76px; }
.redirect-card {
  width: min(580px, 100%);
  margin: 0 auto;
  padding: 32px 28px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.redirect-badge { display: inline-block; padding: 4px 14px; background: #f1f3f4; color: var(--muted); border-radius: 999px; font-size: 13px; font-weight: 650; margin-bottom: 16px; }
.redirect-card h1 { font-size: 24px; margin-bottom: 14px; }
.redirect-dest { color: var(--muted); margin: 0 0 8px; word-break: break-all; }
.redirect-dest code { font-size: 13px; color: var(--primary); background: var(--primary-soft); padding: 3px 8px; border-radius: 8px; }
.redirect-src { color: var(--muted); margin: 0 0 24px; }
.redirect-countdown { margin: 20px 0 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cd-circle { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; border: 2px solid var(--line); color: var(--primary); font-size: 30px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cd-label { color: var(--muted); font-size: 14px; }
.redirect-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.redirect-actions a { border-radius: 999px; min-height: 40px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; font-weight: 650; }
.continue-btn { background: var(--primary); color: #fff; }
.continue-btn:hover { background: var(--primary-strong); }
.continue-btn.disabled { opacity: .40; pointer-events: none; cursor: not-allowed; }
.back-btn { background: #f1f3f4; color: var(--text); }
.back-btn:hover { background: #e8eaed; }

.ad-manager { display: grid; gap: 16px; }
.pool-count { color: var(--muted); font-size: 12.5px; font-weight: 600; background: #f1f3f4; padding: 3px 10px; border-radius: 999px; }
.route-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.route-badge.direct { background: #ecfdf5; color: #047857; }
.route-badge.proxy { background: #eef4ff; color: var(--primary); }
.ad-noimg { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: #f1f3f4; border-radius: 8px; font-size: 10px; color: var(--muted); font-weight: 600; }
.ad-item { display: grid; grid-template-columns: 48px 1fr 72px 40px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.ad-item:last-child { border-bottom: 0; margin-bottom: 6px; }
.ad-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-soft); }
.ad-item .ad-info { min-width: 0; }
.ad-item .ad-info div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ad-item .ad-info .ad-url { color: var(--muted); font-size: 11.5px; font-weight: 400; margin-top: 1px; }
.ad-item small { color: var(--muted); font-size: 11.5px; text-align: center; }
.ad-item button { min-height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 999px; }
.ad-add-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
.ad-add-form input[type="text"] { min-height: 34px; font-size: 13px; }
.ad-add-form input[type="file"] { font-size: 12px; grid-column: 1 / -1; }
.ad-add-form .ad-add-actions { display: flex; gap: 8px; align-items: center; grid-column: 1 / -1; }
.ad-add-form .ad-add-actions input { width: 80px; flex-shrink: 0; }
.ad-add-form .ad-add-actions button { flex: 1; }
.ad-code-embed { max-width: 100%; overflow: hidden; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; }
.admin-tab { min-height: 34px; padding: 0 14px; background: #f1f3f4; color: var(--muted); border-radius: 999px; font-size: 13px; }
.admin-tab.active, .admin-tab:hover { background: var(--primary-soft); color: var(--primary); }
.admin-tab-panel { display: none; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.admin-tab-panel.active { display: block; }
.ad-item-wide { grid-template-columns: 48px minmax(0, 1fr) 72px 44px; }
.ad-type-badge { display: inline-flex; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 11px; }
.ad-tab-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-tab-form textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.stats-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.stats-panels .panel:first-child { grid-column: 1 / -1; }
.mini-bars { height: 190px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end; padding-top: 12px; }
.mini-bar-item { height: 100%; display: grid; grid-template-rows: 1fr auto auto; gap: 6px; text-align: center; color: var(--muted); font-size: 11px; }
.mini-bar { align-self: end; width: 100%; min-height: 8px; border-radius: 10px 10px 3px 3px; background: linear-gradient(180deg, var(--primary), #93c5fd); }
.mini-bar-item strong { color: var(--text); font-size: 12px; }
.stat-switch { display: inline-flex; gap: 4px; padding: 3px; background: #f1f3f4; border-radius: 999px; }
.stat-switch button { min-height: 28px; padding: 0 10px; background: transparent; color: var(--muted); font-size: 12px; border-radius: 999px; }
.stat-switch button.active, .stat-switch button:hover { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(60,64,67,.14); }
.bar-list { display: grid; gap: 10px; }
.keyword-list { display: none; }
.keyword-list.active { display: grid; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 42px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.bar-row b { text-align: right; font-size: 12px; }

.admin-body { background: var(--soft-bg); }
.hamburger { display: none; position: fixed; top: 14px; left: 14px; z-index: 30; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; padding: 0; box-shadow: 0 2px 8px rgba(60,64,67,.12); }
.hamburger span, .hamburger::before, .hamburger::after { content: ''; display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--muted); position: absolute; left: 9px; transition: all .2s; }
.hamburger::before { top: 11px; }
.hamburger::after  { top: 23px; }
.hamburger span { top: 17px; }
.hamburger.open::before { top: 17px; transform: rotate(45deg); }
.hamburger.open span { opacity: 0; }
.hamburger.open::after { top: 17px; transform: rotate(-45deg); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(32,33,36,.28); z-index: 18; backdrop-filter: blur(2px); }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
  background: #fff;
  color: var(--text);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  flex-shrink: 0;
}
.admin-logo { display: flex; align-items: center; gap: 10px; padding: 4px 6px; color: var(--text); }
.admin-logo span { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: -.02em; }
.admin-logo strong { font-size: 15px; font-weight: 680; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a, .logout-link { color: var(--muted); padding: 9px 12px; border-radius: 999px; font-weight: 600; font-size: 13.5px; transition: all .15s; }
.side-nav a:hover, .side-nav a.active { color: var(--primary); background: var(--primary-soft); }
.logout-link { margin-top: auto; }
.logout-link:hover { background: #fce8e6; color: #c5221f; }
.admin-content { padding: 28px 32px; display: grid; gap: 20px; align-content: start; }
.admin-content .panel, .admin-content .form-grid { max-width: none; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 4px; }
.admin-header h1 { margin: 0; font-size: 24px; letter-spacing: -.025em; font-weight: 650; }
.admin-user { padding: 5px 12px; border: 1px solid var(--line-soft); background: #fff; border-radius: 999px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.admin-page { display: none; }
.admin-page.active { display: block; animation: fadeSlideIn .2s ease; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px 20px; box-shadow: none; transition: box-shadow .2s, border-color .2s; }
.metric-card:hover { border-color: var(--line); box-shadow: var(--shadow-soft); }
.metric-card span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.metric-card strong { font-size: 18px; font-weight: 720; }
.panel { background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; padding: 20px 24px; box-shadow: none; }
.panel-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.panel-foot { display: flex; justify-content: flex-end; padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--line-soft); }
.panel-foot button { font-size: 14px; min-height: 38px; padding: 0 20px; }
.switches { display: flex; gap: 12px; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; font-size: 13px; font-weight: 600; }
.switch input { display: none; }
.switch span { width: 36px; height: 20px; border-radius: 999px; background: #dadce0; position: relative; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; width: 16px; height: 16px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
label small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 3px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tools-item { display: flex; gap: 8px; align-items: center; }
.tools-item input { min-width: 0; }
.admin-shell { padding: 1px 0 48px; }

@media (max-width: 900px) {
  .hamburger { display: block; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; top: 0; left: 0; width: 260px; height: 100vh; transform: translateX(-100%); transition: transform .25s ease; z-index: 20; box-shadow: 4px 0 24px rgba(60,64,67,.18); }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .admin-content { padding: 18px 16px 18px 58px; gap: 14px; }
  .admin-header h1 { font-size: 20px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1120px); }
  .search-shell { width: 100%; padding: 0 16px; }
  .search-main { align-items: flex-start; padding-top: 12vh; }
  .wordmark { font-size: clamp(42px, 15vw, 62px); }
  .search-box { grid-template-columns: 1fr auto; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .center-card { border-radius: 18px; padding: 22px; }
  .topbar { height: 56px; }
  .result-topbar { grid-template-columns: 1fr; gap: 10px; padding: 12px 0; }
  .result-nav { justify-content: flex-start; }
  .result-layout { display: block; margin: 18px 0 0; padding-bottom: 56px; }
  .result-main { width: 100%; margin: 0; }
  .result-side { display: none; }
  .result-main .ad-slot { text-align: center; }
  .redirect-main { align-items: flex-start; padding-top: 8vh; }
  .redirect-card { padding: 24px 18px; }
  .redirect-actions { flex-direction: column; }
  .redirect-actions a { width: 100%; }
  .ad-add-form, .ad-tab-form { grid-template-columns: 1fr; }
  .stats-panels { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .admin-content { padding: 14px 12px 14px 52px; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .panel { padding: 14px 16px; }
  .tools-grid { grid-template-columns: 1fr; }
  .ad-item { grid-template-columns: 44px 1fr; }
  .ad-item small, .ad-item form { grid-column: auto; }
}
