/* ===== Reset & Base ===== */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif; background:#F8F6F3; color:#1A1A2E; line-height:1.6; }
a { color:#2563EB; text-decoration:none; }
a:hover { color:#1D4ED8; }

/* ===== Nav ===== */
.nav { display:flex; align-items:center; padding:0 24px; height:60px; background:#fff; border-bottom:1px solid #E8E4DE; position:sticky; top:0; z-index:100; }
.nav-logo { font-size:16px; font-weight:700; color:#1A1A2E; margin-right:32px; }
.nav-logo span { color:#2563EB; }
.nav-links { display:flex; gap:20px; }
.nav-links a { color:#6B6560; font-size:13px; padding:4px 0; border-bottom:2px solid transparent; transition:all .15s; }
.nav-links a:hover, .nav-links a.active { color:#1A1A2E; border-bottom-color:#2563EB; }
.nav-right { margin-left:auto; display:flex; align-items:center; gap:12px; }
.nav-user { font-size:13px; color:#6B6560; }
.nav-badge { font-size:11px; background:#DCFCE7; color:#16A34A; padding:2px 8px; border-radius:4px; font-weight:600; }
.nav-btn { padding:6px 16px; border-radius:6px; font-size:13px; font-weight:500; background:#F0EEEA; color:#1A1A2E; cursor:pointer; border:none; }
.nav-btn:hover { background:#E5E0DA; }

/* ===== Hero ===== */
.hero { text-align:center; padding:60px 24px 32px; max-width:720px; margin:0 auto; }
.hero h1 { font-size:34px; font-weight:800; letter-spacing:-.5px; margin-bottom:10px; }
.hero h1 span { color:#2563EB; }
.hero .subtitle { font-size:16px; color:#6B6560; margin-bottom:28px; }
.search-box { max-width:480px; margin:0 auto; }
.search-input { width:100%; padding:12px 16px; border:2px solid #E0DCD8; border-radius:10px; font-size:15px; outline:none; background:#fff; transition:border-color .2s; }
.search-input:focus { border-color:#2563EB; }
.search-btn { margin-top:10px; padding:10px 32px; border-radius:8px; background:#2563EB; color:#fff; font-size:14px; font-weight:600; border:none; cursor:pointer; }
.search-btn:hover { background:#1D4ED8; }

/* ===== Brands ===== */
.brands-section { max-width:960px; margin:0 auto; padding:32px 24px; }
.brands-section h2 { font-size:18px; font-weight:700; margin-bottom:14px; }
.brand-grid { display:flex; flex-wrap:wrap; gap:8px; }
.brand-card { display:flex; align-items:center; gap:8px; padding:12px 20px; background:#fff; border:1px solid #E8E4DE; border-radius:10px; transition:all .2s; }
.brand-card:hover { border-color:#2563EB; box-shadow:0 4px 12px rgba(37,99,235,.08); transform:translateY(-2px); }
.brand-name { font-size:14px; font-weight:600; color:#1A1A2E; }
.brand-count { font-size:12px; color:#8B8580; }

/* ===== Sensor Grid ===== */
.popular-section { max-width:960px; margin:0 auto; padding:32px 24px; }
.popular-section h2 { font-size:18px; font-weight:700; margin-bottom:4px; }
.section-sub { font-size:13px; color:#8B8580; margin-bottom:16px; }
.sensor-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px; }
.sensor-card { display:block; background:#fff; border:1px solid #E8E4DE; border-radius:10px; padding:18px 16px; text-decoration:none; transition:all .2s; position:relative; }
.sensor-card:hover { border-color:#2563EB; box-shadow:0 4px 16px rgba(37,99,235,.08); transform:translateY(-3px); }
.sensor-brand { font-size:11px; color:#8B8580; font-weight:500; text-transform:uppercase; letter-spacing:.5px; margin-bottom:2px; }
.sensor-model { font-size:17px; font-weight:700; color:#1A1A2E; margin-bottom:6px; }
.sensor-specs { display:flex; gap:8px; flex-wrap:wrap; font-size:11px; color:#6B6560; }
.sensor-specs span { background:#F0EEEA; padding:2px 8px; border-radius:4px; }
.sensor-interface { margin-top:6px; font-size:11px; color:#2563EB; font-weight:500; }
.sensor-lock { position:absolute; top:8px; right:8px; font-size:14px; opacity:.5; }

/* ===== CTA Section ===== */
.cta-section { max-width:960px; margin:0 auto; padding:40px 24px; }
.cta-card { background:linear-gradient(135deg,#1A1A2E,#2D2A5E); border-radius:16px; padding:40px 24px; text-align:center; color:#fff; }
.cta-card h2 { font-size:24px; font-weight:700; margin-bottom:8px; }
.cta-card p { font-size:14px; color:rgba(255,255,255,.65); margin-bottom:16px; }
.price-tag { font-size:36px; font-weight:800; color:#FCD34D; margin-bottom:20px; }
.price-tag small { font-size:14px; color:rgba(255,255,255,.5); font-weight:400; }
.cta-btn { display:inline-block; padding:14px 40px; border-radius:10px; background:#2563EB; color:#fff; font-size:16px; font-weight:700; transition:all .2s; }
.cta-btn:hover { background:#1D4ED8; transform:translateY(-2px); color:#fff; }
.cta-btn-green { background:#16A34A; }
.cta-btn-green:hover { background:#15803D; }

/* ===== Footer ===== */
.footer { border-top:1px solid #E8E4DE; padding:20px; text-align:center; font-size:12px; color:#9C9690; margin-top:40px; }

/* ===== List Page ===== */
.list-layout { display:flex; max-width:1200px; margin:0 auto; min-height:60vh; gap:0; }

/* Filter Sidebar */
.filter-sidebar { width:240px; flex-shrink:0; padding:20px; border-right:1px solid #E8E4DE; background:#fff; }
.filter-sidebar h3 { font-size:15px; font-weight:600; margin-bottom:16px; color:#1A1A2E; }
.filter-group { margin-bottom:14px; }
.filter-group label { display:block; font-size:12px; font-weight:600; color:#6B6560; margin-bottom:4px; }
.filter-group input[type=text], .filter-group input[type=number], .filter-group select { width:100%; padding:8px 10px; border:1px solid #D0CCC8; border-radius:6px; font-size:13px; outline:none; background:#F8F6F3; }
.filter-group input:focus, .filter-group select:focus { border-color:#2563EB; background:#fff; }
.range-inputs { display:flex; align-items:center; gap:6px; }
.range-inputs input { width:100%; padding:8px 10px; border:1px solid #D0CCC8; border-radius:6px; font-size:13px; outline:none; background:#F8F6F3; }
.range-inputs input:focus { border-color:#2563EB; background:#fff; }
.range-inputs span { color:#8B8580; font-size:13px; }
.filter-btn { width:100%; padding:8px; border-radius:6px; background:#2563EB; color:#fff; font-size:13px; font-weight:600; border:none; cursor:pointer; margin-top:4px; }
.filter-btn:hover { background:#1D4ED8; }
.filter-reset { display:block; text-align:center; font-size:12px; color:#8B8580; margin-top:8px; }
.filter-upsell { margin-top:20px; padding:12px; background:#F8F6F3; border-radius:8px; text-align:center; font-size:12px; }
.filter-upsell p { color:#6B6560; margin-bottom:8px; }
.upsell-btn { display:inline-block; padding:6px 20px; background:#F59E0B; color:#fff; border-radius:6px; font-size:13px; font-weight:600; }
.upsell-btn:hover { background:#D97706; color:#fff; }

/* List Main */
.list-main { flex:1; padding:20px; min-width:0; }
.list-header { display:flex; justify-content:space-between; font-size:13px; color:#6B6560; margin-bottom:16px; }
.list-grid { grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); }
.empty-state { text-align:center; padding:60px 20px; color:#8B8580; font-size:15px; }
.alert { padding:12px 16px; border-radius:8px; font-size:13px; margin-bottom:16px; }
.alert-warning { background:#FEF3C7; color:#92400E; border:1px solid #FCD34D; }
.alert-warning a { font-weight:600; color:#2563EB; }

/* Pagination */
.pagination { display:flex; gap:6px; justify-content:center; margin-top:24px; }
.page-link { padding:8px 14px; border-radius:6px; font-size:13px; background:#fff; border:1px solid #E0DCD8; color:#6B6560; }
.page-link.active { background:#2563EB; color:#fff; border-color:#2563EB; }
.page-link:hover { border-color:#2563EB; }

/* ===== Detail Page ===== */
.detail-layout { max-width:800px; margin:0 auto; padding:24px; }
.detail-breadcrumb { font-size:13px; color:#8B8580; margin-bottom:8px; }
.detail-breadcrumb a { color:#6B6560; }
.detail-breadcrumb .sep { margin:0 6px; }
.detail-title { font-size:28px; font-weight:800; color:#1A1A2E; }
.detail-subtitle { font-size:15px; color:#6B6560; margin-top:4px; margin-bottom:24px; }
.specs-section { background:#fff; border:1px solid #E8E4DE; border-radius:12px; padding:20px; margin-bottom:16px; }
.specs-section h2 { font-size:16px; font-weight:600; color:#1A1A2E; margin-bottom:12px; }
.specs-table { width:100%; border-collapse:collapse; font-size:14px; }
.specs-table tr td { padding:8px 0; border-bottom:1px solid #F0EEEA; }
.specs-table tr td:first-child { color:#6B6560; width:140px; font-weight:500; }
.specs-table tr:last-child td { border-bottom:none; }
.datasheet-link { display:inline-block; margin-top:12px; font-size:13px; font-weight:600; color:#2563EB; }

/* Paywall */
.paywall { background:#fff; border:2px dashed #D0CCC8; border-radius:12px; padding:36px 24px; text-align:center; }
.paywall-icon { font-size:48px; margin-bottom:12px; }
.paywall h3 { font-size:22px; font-weight:700; color:#1A1A2E; margin-bottom:12px; }
.paywall-benefits { list-style:none; margin-bottom:20px; font-size:14px; color:#6B6560; line-height:2; }
.paywall-btn { display:inline-block; padding:14px 40px; border-radius:10px; background:#F59E0B; color:#fff; font-size:16px; font-weight:700; }
.paywall-btn:hover { background:#D97706; color:#fff; }
.paywall-hint { font-size:12px; color:#8B8580; margin-top:10px; }
.detail-actions { margin-top:16px; }
.btn-primary { display:inline-block; padding:10px 24px; border-radius:8px; background:#2563EB; color:#fff; font-size:14px; font-weight:600; }
.btn-primary:hover { background:#1D4ED8; color:#fff; }

/* ===== Compare Page ===== */
.page-upsell { text-align:center; padding:12px; background:#FEF3C7; font-size:13px; border-bottom:1px solid #FCD34D; }
.page-upsell a { font-weight:600; color:#2563EB; }
.compare-layout { max-width:1200px; margin:0 auto; padding:24px; }
.compare-header { margin-bottom:20px; }
.compare-header h1 { font-size:22px; font-weight:700; }
.compare-header p { font-size:13px; color:#6B6560; }
.compare-search { position:relative; margin-bottom:16px; }
.compare-search input { width:100%; padding:10px 14px; border:1px solid #D0CCC8; border-radius:8px; font-size:14px; outline:none; background:#fff; }
.compare-search input:focus { border-color:#2563EB; }
.search-results { display:none; position:absolute; top:100%; left:0; right:0; background:#fff; border:1px solid #E0DCD8; border-radius:8px; z-index:50; max-height:240px; overflow-y:auto; box-shadow:0 4px 12px rgba(0,0,0,.06); }
.search-results.show { display:block; }
.search-result-item { padding:10px 14px; cursor:pointer; font-size:13px; border-bottom:1px solid #F0EEEA; }
.search-result-item:hover { background:#F0F4FF; }
.sr-brand { color:#8B8580; margin-right:4px; }
.sr-model { font-weight:600; color:#1A1A2E; }

/* Chips */
.selected-chips { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; min-height:32px; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; background:#E0E7FF; border-radius:6px; font-size:13px; color:#1A1A2E; }
.chip button { border:none; background:none; cursor:pointer; font-size:14px; color:#6B6560; padding:0; line-height:1; }
.chip button:hover { color:#DC2626; }

/* Compare Table */
.compare-table-wrap { overflow-x:auto; }
.compare-table { width:100%; border-collapse:collapse; font-size:13px; background:#fff; border:1px solid #E8E4DE; border-radius:10px; overflow:hidden; }
.compare-table th, .compare-table td { padding:10px 14px; border:1px solid #F0EEEA; text-align:center; min-width:120px; }
.compare-table th { background:#F8F6F3; font-weight:600; color:#1A1A2E; }
.compare-table .param-name { text-align:left; font-weight:500; color:#6B6560; background:#F8F6F3; min-width:100px; }
.compare-table td.diff { background:#FEF3C7; font-weight:500; }
.cmp-col-header { display:flex; flex-direction:column; align-items:center; gap:2px; }
.cmp-brand { font-size:11px; color:#8B8580; }
.cmp-model { font-size:15px; font-weight:700; color:#1A1A2E; }
.cmp-remove { border:none; background:none; cursor:pointer; font-size:12px; color:#9C9690; margin-top:2px; }
.cmp-remove:hover { color:#DC2626; }
.compare-empty { text-align:center; padding:60px 20px; color:#8B8580; font-size:15px; }

/* ===== Selector Page ===== */
.selector-layout { max-width:800px; margin:0 auto; padding:24px; }
.selector-header { margin-bottom:24px; }
.selector-header h1 { font-size:22px; font-weight:700; }
.selector-header p { font-size:13px; color:#6B6560; }
.selector-form { background:#fff; border:1px solid #E8E4DE; border-radius:12px; padding:24px; margin-bottom:24px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:14px; }
.form-group label { display:block; font-size:12px; font-weight:600; color:#6B6560; margin-bottom:4px; }
.form-group select { width:100%; padding:8px 10px; border:1px solid #D0CCC8; border-radius:6px; font-size:14px; outline:none; background:#F8F6F3; }
.form-group select:focus { border-color:#2563EB; }
.selector-btn { width:100%; padding:12px; border-radius:8px; background:#2563EB; color:#fff; font-size:15px; font-weight:600; border:none; cursor:pointer; margin-top:4px; }
.selector-btn:hover { background:#1D4ED8; }
.selector-btn:disabled { background:#9CA3AF; cursor:not-allowed; }

/* Results */
.selector-results { }
.selector-placeholder, .selector-empty { text-align:center; padding:40px; background:#fff; border:1px solid #E8E4DE; border-radius:10px; color:#8B8580; font-size:14px; }
.result-list { display:flex; flex-direction:column; gap:8px; }
.result-card { display:flex; align-items:center; gap:12px; padding:16px 20px; background:#fff; border:1px solid #E8E4DE; border-radius:10px; text-decoration:none; transition:all .2s; }
.result-card:hover { border-color:#2563EB; box-shadow:0 2px 8px rgba(37,99,235,.06); }
.result-rank { font-size:22px; width:36px; text-align:center; }
.result-info { flex-shrink:0; min-width:120px; }
.result-brand { display:block; font-size:11px; color:#8B8580; }
.result-model { display:block; font-size:16px; font-weight:700; color:#1A1A2E; }
.result-score { flex:1; display:flex; align-items:center; gap:8px; min-width:100px; }
.score-bar { flex:1; height:8px; background:#F0EEEA; border-radius:4px; overflow:hidden; }
.score-fill { height:100%; background:linear-gradient(90deg,#2563EB,#2563EB); border-radius:4px; transition:width .5s; }
.score-num { font-size:14px; font-weight:700; color:#2563EB; min-width:40px; }
.result-specs { display:flex; gap:6px; font-size:11px; color:#6B6560; flex-shrink:0; }
.result-specs span { background:#F0EEEA; padding:2px 8px; border-radius:4px; }

/* ===== Login ===== */
.login-page { max-width:400px; margin:60px auto; padding:0 20px; }
.login-box { background:#fff; border:1px solid #E8E4DE; border-radius:12px; padding:36px 28px 28px; }
.login-box h2 { font-size:20px; margin-bottom:4px; text-align:center; color:#1A1A2E; }
.login-sub { font-size:13px; color:#8B8580; text-align:center; margin-bottom:20px; }
.tab-bar { display:flex; margin-bottom:16px; border-bottom:1px solid #E8E4DE; }
.tab-btn { flex:1; padding:8px; border:none; background:none; font-size:14px; cursor:pointer; color:#8B8580; border-bottom:2px solid transparent; }
.tab-btn.active { color:#2563EB; border-bottom-color:#2563EB; font-weight:600; }
.login-box input[type=text], .login-box input[type=password] { width:100%; padding:10px 14px; background:#F8F6F3; border:1px solid #D0CCC8; border-radius:8px; font-size:14px; margin-bottom:12px; outline:none; }
.login-box input:focus { border-color:#2563EB; background:#fff; }
.login-box button { width:100%; padding:10px; border-radius:8px; background:#2563EB; color:#fff; font-size:14px; font-weight:600; cursor:pointer; border:none; }
.login-box button:hover { background:#1D4ED8; }
.login-extra { text-align:center; font-size:12px; color:#8B8580; margin-top:16px; }
.err { color:#DC2626; font-size:13px; padding:8px 12px; background:#FEF2F2; border-radius:6px; margin-bottom:12px; display:none; }
.err.show { display:block; }

/* ===== Responsive ===== */
@media (max-width:768px) {
  .hero h1 { font-size:26px; }
  .nav-links { gap:12px; }
  .nav-links a { font-size:12px; }
  .list-layout { flex-direction:column; }
  .filter-sidebar { width:100%; border-right:none; border-bottom:1px solid #E8E4DE; }
  .form-row { grid-template-columns:1fr; }
  .sensor-grid { grid-template-columns:repeat(2,1fr); }
  .detail-title { font-size:22px; }
  .compare-table th, .compare-table td { min-width:90px; font-size:12px; padding:8px; }
  .admin-stats { grid-template-columns:1fr; }
}
@media (max-width:480px) {
  .sensor-grid { grid-template-columns:1fr; }
  .nav { padding:0 12px; }
  .hero { padding:40px 16px 24px; }
}
