:root {
  --brand: #ff5000;
  --brand-dark: #d94300;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f9fafb;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { font-size: 20px; font-weight: 700; color: var(--brand); text-decoration: none; white-space: nowrap; }
.header-search { display: flex; flex: 1; gap: 8px; max-width: 560px; }
.header-search input {
  flex: 1; min-width: 0; padding: 9px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 20px; outline: none;
}
.header-search input:focus { border-color: var(--brand); }
.header-search button {
  padding: 9px 20px; font-size: 14px; color: #fff; background: var(--brand);
  border: none; border-radius: 20px; cursor: pointer; white-space: nowrap;
}
.header-search button:hover { background: var(--brand-dark); }

.hero { text-align: center; padding: 80px 20px 48px; }
.hero h1 { font-size: 30px; margin-bottom: 12px; }
.hero-sub { color: var(--muted); margin-bottom: 32px; }
.hero-search { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.hero-search input {
  flex: 1; min-width: 0; padding: 14px 18px; font-size: 15px;
  border: 2px solid var(--brand); border-radius: 24px; outline: none;
}
.hero-search button {
  padding: 14px 32px; font-size: 15px; color: #fff; background: var(--brand);
  border: none; border-radius: 24px; cursor: pointer; white-space: nowrap;
}
.hot-queries { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }
.hot-queries a {
  display: inline-block; padding: 6px 14px; font-size: 13px; color: var(--muted);
  background: #fff; border: 1px solid var(--line); border-radius: 16px; text-decoration: none;
}
.hot-queries a:hover { color: var(--brand); border-color: var(--brand); }

.search-head { padding: 32px 0 8px; }
.search-head h1 { font-size: 24px; }
.muted { color: var(--muted); font-size: 13px; }
.notice { margin-top: 10px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.notice-warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }

.top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 20px 0 32px; }
.product-card {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column;
}
.rank-badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  padding: 3px 10px; font-size: 12px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: 12px;
}
.product-image { display: block; margin-bottom: 12px; }
.product-image img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #f3f4f6; }
.product-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.product-title a { text-decoration: none; }
.product-title a:hover { color: var(--brand); }
.product-price { margin-bottom: 4px; }
.price-now { font-size: 20px; font-weight: 700; color: var(--brand); }
.price-old { margin-left: 8px; font-size: 13px; color: var(--muted); }
.product-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.product-tag {
  display: inline-block; align-self: flex-start; padding: 2px 10px; font-size: 12px;
  color: var(--brand); background: #fff3ed; border-radius: 10px; margin-bottom: 8px;
}
.product-reason { font-size: 13px; color: #374151; flex: 1; margin-bottom: 12px; }
.buy-btn {
  display: block; text-align: center; padding: 10px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--brand); border-radius: 8px; text-decoration: none;
}
.buy-btn:hover { background: var(--brand-dark); }
.disclosure { margin-top: 8px; font-size: 11px; color: #9ca3af; text-align: center; }

.alternatives { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 40px; }
.alternatives summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.alternatives ul { list-style: none; margin-top: 12px; }
.alternatives li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.alternatives li:last-child { border-bottom: none; }
.alternatives a { text-decoration: none; }
.alternatives a:hover { color: var(--brand); }

.empty { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 20px; text-align: center; margin: 24px 0 48px; color: var(--muted); }

.site-footer { margin-top: 40px; padding: 24px 0; font-size: 12px; color: #9ca3af; border-top: 1px solid var(--line); background: #fff; }

@media (max-width: 900px) {
  .top3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .header-inner { height: 56px; gap: 12px; }
  .brand { font-size: 17px; }
  .header-search input { padding: 7px 12px; font-size: 13px; }
  .header-search button { padding: 7px 14px; font-size: 13px; }
  .hero { padding: 48px 14px 32px; }
  .hero h1 { font-size: 21px; }
  .hero-sub { font-size: 14px; margin-bottom: 22px; }
  .hero-search { flex-direction: column; }
  .hero-search input { border-radius: 10px; }
  .hero-search button { border-radius: 10px; }
  .top3 { grid-template-columns: 1fr; gap: 14px; }
  .search-head h1 { font-size: 19px; }
  .alternatives li { flex-direction: column; gap: 4px; }
}

.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 16px 0 0; font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

.summary { margin-top: 12px; padding: 12px 16px; font-size: 14px; color: #374151;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; }

.footer-links { margin-top: 6px; display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--brand); }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 48px 20px; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

.error-state { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; margin: 24px 0 48px; }
.error-state h2 { font-size: 18px; margin-bottom: 8px; }
.error-state p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.retry-btn { display: inline-block; padding: 9px 24px; font-size: 14px; color: #fff;
  background: var(--brand); border-radius: 20px; text-decoration: none; }
.retry-btn:hover { background: var(--brand-dark); }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { background: #f3f4f6; color: #374151; font-weight: 600; white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a { color: var(--brand); text-decoration: none; }
.admin-table a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}
