:root {
  --bg: #f4efe6;
  --bg-soft: rgba(255, 250, 242, 0.88);
  --paper: rgba(255, 255, 255, 0.84);
  --text: #1d1b18;
  --muted: #655b4f;
  --line: rgba(74, 56, 33, 0.12);
  --accent: #b55322;
  --accent-strong: #8c3f19;
  --accent-soft: rgba(181, 83, 34, 0.12);
  --blue: #135f7a;
  --blue-soft: rgba(19, 95, 122, 0.12);
  --shadow: 0 18px 45px rgba(65, 46, 26, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 28%),
    radial-gradient(circle at bottom right, rgba(226, 194, 145, 0.22), transparent 26%),
    linear-gradient(180deg, #eadbc4 0%, var(--bg) 30%, #efe8dd 100%);
}

a,
button,
input {
  font: inherit;
}

a,
button {
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

a:hover,
button:hover {
  transform: translateY(-1px);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.hero,
.card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.04;
}

.subtitle {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.search-panel {
  margin-top: 28px;
}

.search-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.search-row {
  display: flex;
  gap: 12px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(74, 56, 33, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
}

.search-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.primary-btn,
.ghost-btn,
.text-btn,
.chip,
.history-item {
  border: none;
  cursor: pointer;
}

.primary-btn {
  height: 58px;
  padding: 0 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, #c56a2f, #9a441b);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(154, 68, 27, 0.22);
}

.ghost-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border: 1px solid rgba(74, 56, 33, 0.1);
}

.text-btn {
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 700;
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.status-bar {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(74, 56, 33, 0.08);
}

.status-bar p {
  margin: 0;
  color: var(--muted);
}

.grid.secondary,
.results-layout,
.engine-grid {
  display: grid;
  gap: 18px;
}

.grid.secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.results-layout {
  grid-template-columns: 1.2fr 1fr 1fr;
  margin-top: 18px;
}

.results-layout.compact {
  align-items: stretch;
}

.card {
  padding: 22px;
}

.section-head,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.chip-list,
.list-block {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.chip,
.history-item {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(74, 56, 33, 0.1);
  color: var(--text);
}

.history-item {
  text-align: left;
}

.site-tag {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

h2,
h3 {
  margin: 0;
}

.query-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid rgba(74, 56, 33, 0.08);
  line-height: 1.7;
  word-break: break-word;
}

.helper-text,
.placeholder,
.tips li,
.engine-desc {
  color: var(--muted);
  line-height: 1.75;
}

.launch-link,
.engine-tile {
  text-decoration: none;
}

.launch-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.launch-link.disabled,
.engine-tile.disabled {
  opacity: 0.52;
  pointer-events: none;
}

.engines-card {
  margin-top: 18px;
}

.engine-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.engine-tile {
  display: block;
  padding: 18px;
  border-radius: 22px;
  background: var(--paper);
  border: 1px solid rgba(74, 56, 33, 0.08);
}

.engine-name {
  display: block;
  font-weight: 700;
  color: var(--text);
}

.engine-desc {
  display: block;
  margin-top: 8px;
}

.wide-panel {
  background:
    linear-gradient(180deg, rgba(181, 83, 34, 0.05), rgba(255, 250, 242, 0.88)),
    var(--bg-soft);
}

.tips {
  margin-top: 18px;
}

.tips ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

@media (max-width: 1080px) {
  .grid.secondary,
  .results-layout,
  .engine-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero,
  .card {
    padding: 18px;
    border-radius: 20px;
  }

  .search-row,
  .section-head,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-btn {
    width: 100%;
  }
}
