/* Extracted from index.html */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, .06);
  --accent: #2563eb;
  --accent-weak: rgba(37, 99, 235, .10);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(37, 99, 235, .10), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(99, 102, 241, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(246, 247, 251, .75);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 14px 0;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .20);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
}

.pill.is-hidden {
  display: none;
}

.more {
  position: relative;
  display: none;
  flex: 0 0 auto;
}

.more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none !important;
  z-index: 20;
  min-width: 200px;
}

.more-menu.open {
  display: grid !important;
  gap: 6px;
}

.more-item {
  appearance: none;
  border: none;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}

.more-item:hover {
  border-color: rgba(37, 99, 235, .22);
  background: rgba(37, 99, 235, .06);
}

.more-item.active {
  border-color: rgba(37, 99, 235, .28);
  background: rgba(37, 99, 235, .10);
  color: var(--accent);
}

.pill {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: .15s ease;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.pill:hover {
  background: rgba(255, 255, 255, .75);
  border-color: var(--border);
  color: var(--text);
}

.pill.active {
  background: var(--accent-weak);
  border-color: rgba(37, 99, 235, .22);
  color: var(--accent);
  font-weight: 800;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.nav-action {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: .15s ease;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .04);
}

.nav-action:hover {
  background: rgba(15, 23, 42, .03);
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lang-select #langLabel {
  display: none;
}

.lang-select select {
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  padding-right: 2px;
}

/* Main */
.main {
  padding: 28px 0 40px;
}

footer {
  margin-top: auto;
}

.hero {
  margin-bottom: 16px;
}

.title {
  font-size: 28px;
  font-weight: 900;
  margin: 0;
  letter-spacing: .2px;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}

.left-stack {
  display: grid;
  gap: 16px;
}

.right-stack {
  display: grid;
  gap: 0px;
}

.grid>* {
  min-width: 0;
}

/* 防止右侧溢出 */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.seo {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.seo-details {
  border: none;
}

.seo-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  transition: background .15s ease;
}

.seo-summary::-webkit-details-marker {
  display: none;
}

.seo-summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  font-size: 16px;
  transition: transform .15s ease;
}

.seo-summary:hover {
  background: rgba(255, 255, 255, .9);
}

.seo-details[open] .seo-summary {
  background: #fff;
}

.seo-details .card-body {
  padding: 12px 16px 16px;
}

.seo-details[open] .seo-summary::after {
  transform: rotate(180deg);
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.seo-text {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.seo-stack {
  display: grid;
  gap: 14px;
}

.seo-sub {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.seo-list {
  margin: 0 0 0 18px;
  color: var(--muted);
  padding: 0;
  font-size: 14px;
}

.seo-list li {
  margin: 6px 0;
}

.faq {
  display: grid;
  gap: 12px;
}

.faq-wide {
  margin-top: 16px;
}

.faq-item h3,
.faq-item h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 800px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }
}

.lang-select {
  padding: 6px 8px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  font-weight: 700;
  color: var(--muted);
}

/* brand text visibility handled in the mobile media query */
/* style mobile country select to match pills */
.country-select {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 800;
  appearance: none;
}

.country-select:focus {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
  border-color: rgba(37, 99, 235, .18);
}

.country-select {
  display: none;
}

@media (max-width: 740px) {
  .nav-inner {
    gap: 8px;
  }

  .nav-links {
    display: none;
  }

  .country-select {
    display: inline-block;
    margin-left: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-weight: 800;
    appearance: none;
    text-align: center;
  }

  .lang-select {
    padding: 6px 8px;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    font-weight: 700;
    color: var(--muted);
  }

  .brand {
    gap: 8px;
  }

  .logo {
    width: 44px;
    height: 44px;
  }

  /* hide brand text and the language label on small screens */
  #brandName,
  #brandTag,
  #langLabel {
    display: none;
  }

  /* prevent mobile browsers from zooming inputs (ensure readable sizes) */
  html,
  body {
    -webkit-text-size-adjust: 100%;
  }

  .input,
  .lang-select select,
  .country-select,
  .region-clear,
  .btn,
  .btn-ghost {
    font-size: 16px;
  }

  .nav-action {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .country-select:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
    border-color: rgba(37, 99, 235, .18);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card-body {
  padding: 16px;
}

.field {
  margin-bottom: 12px;
}

.hot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  transition: .15s ease;
}

.hot-item small {
  color: var(--muted);
  font-weight: 700;
}

.hot-item:hover {
  border-color: rgba(37, 99, 235, .28);
  box-shadow: 0 10px 20px rgba(15, 23, 42, .08);
}

.label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 800;
}

.input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  outline: none;
  font-size: 14px;
  transition: .15s ease;
}

.input:focus {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.feedback-fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(37, 99, 235, .25);
  user-select: none;
}

.feedback-panel {
  position: fixed;
  right: 18px;
  bottom: 80px;
  width: min(360px, calc(100vw - 36px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .15);
  z-index: 40;
  padding: 14px;
  display: none;
}

.feedback-panel.open {
  display: block;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.feedback-title {
  font-weight: 900;
  font-size: 15px;
}

.feedback-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.feedback-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

.feedback-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .35);
}

.modal-panel {
  position: relative;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, .22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-weight: 900;
  font-size: 16px;
}

.modal-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

.modal-body {
  padding: 16px;
  overflow: auto;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.history-main {
  min-width: 0;
}

.history-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.history-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.mini.danger {
  border-color: rgba(239, 68, 68, .25);
  background: rgba(239, 68, 68, .08);
  color: #dc2626;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 16px 0;
}

/* region clear button next to input */
.region-clear {
  padding: 6px 10px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.region-clear:hover {
  background: rgba(15, 23, 42, .03);
}

.btn {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  font-weight: 900;
  letter-spacing: .2px;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .22);
  transition: .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
  transition: .15s ease;
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, .03);
}

.guide-link {
  display: block;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.15;
}

/* Result form */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 740px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}

.kv {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 12px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.kv .k {
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  margin-bottom: 4px;
}

.kv .v {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  max-width: 100%;
}

.kv .left {
  min-width: 0;
}

.mini {
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  font-weight: 900;
  transition: .15s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.mini svg {
  width: 14px;
  height: 14px;
}

.mini:hover {
  background: rgba(15, 23, 42, .03);
}

.mini.primary {
  border-color: rgba(37, 99, 235, .25);
  background: rgba(37, 99, 235, .08);
  color: var(--accent);
}

.full {
  grid-column: 1 / -1;
}

/* Map */
.map {
  width: 100%;
  height: 340px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #eef2ff;
  margin-top: 14px;
}

.modal-map {
  height: 260px;
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

.mapbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.mapbar .left {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 22px 0 34px;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer-badge-row {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-badge-row > a {
  display: inline-flex;
  align-items: center;
  height: 44px;
}

.ph-badge img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 100%;
}

.tooldirs-badge img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 100%;
}

.toolfame-badge img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 100%;
}

.turbo0-badge img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 100%;
}

.fazier-badge img {
  display: block;
  width: auto;
  height: 40px;
  max-width: 100%;
}

.productbaker-badge {
  gap: 8px;
  padding: 0 10px;
  height: 44px;
  border: 1px solid #86efac;
  border-radius: 10px;
  background: #ffffff;
  color: #16a34a;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
}

.productbaker-badge img {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.footer-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 760px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, .92);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .18);
}
