:root{
  --bg:#f7f8fa;
  --panel:#ffffff;
  --card:#ffffff;
  --text:#0f1a49;
  --muted:#5a6278;
  --line:#dde1e8;
  --accent:#1897dc;
  --accent2:#f1731d;
  --radius:16px;
  --shadow:0 2px 12px rgba(15,26,73,.08);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

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

.wrap{max-width:1080px;margin:0 auto;padding:0 18px}
.page{padding:28px 0 40px}

.site-header{
  position:sticky;top:0;z-index:10;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.header-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 0;
  gap:16px;
}
.brand{display:flex;align-items:center;gap:10px;font-weight:700}
.brand img{height:48px;width:auto;display:block;border-radius:6px}
.nav{display:flex;gap:8px;flex-wrap:wrap}
.nav a{
  color:var(--muted);
  padding:8px 12px;
  border-radius:999px;
  border:1px solid transparent;
  font-weight:500;
}
.nav a:hover{color:var(--text);text-decoration:none}
.nav a.active{
  color:var(--text);
  border-color:var(--line);
  background:rgba(15,26,73,.05);
}

h1{font-size:44px;line-height:1.05;margin:10px 0 10px;color:var(--text)}
.h2{font-size:20px;margin:0 0 10px;color:var(--text)}
.h3{font-size:18px;margin:0 0 8px;color:var(--text)}
.lead{font-size:18px;color:var(--muted);margin:0 0 18px}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}
.list{margin:10px 0 0;padding-left:18px}
.list li{margin:10px 0}

.grid-3{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  padding:18px 0;
}
.grid-2{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
  padding:14px 0;
}
@media (max-width:920px){
  .grid-3,.grid-2{grid-template-columns:1fr}
}

.search-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:12px;
  box-shadow:var(--shadow);
}
.search-input{
  width:100%;
  font-size:16px;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--bg);
  color:var(--text);
  outline:none;
}
.search-input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 4px rgba(24,151,220,.12);
}
.search-meta{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  margin-top:10px;
}
.results{padding:12px 0 0}
.result{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--card);
  margin:10px 0;
  box-shadow:var(--shadow);
}
.result .title{font-weight:700;color:var(--text)}
.result .desc{color:var(--muted)}
.badges{display:flex;gap:8px;flex-wrap:wrap}
.badge{
  font-size:12px;
  color:var(--muted);
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--bg);
}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  gap:10px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--accent);
  background:var(--accent);
  color:#fff;
  font-weight:700;
  cursor:pointer;
}
.btn:hover{filter:brightness(1.1);text-decoration:none}
.btn-ghost{
  border-color:var(--line);
  background:var(--card);
  color:var(--text);
}

.muted{color:var(--muted)}
.small{font-size:12px}
.link{color:var(--accent);font-weight:600}
.link:hover{color:var(--text)}
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);border:0;
}

.callout{padding:12px 0 34px}
.callout-inner{
  display:flex;align-items:center;justify-content:space-between;
  gap:14px;
  padding:16px;
  border-radius:var(--radius);
  border:1px solid var(--line);
  background:var(--card);
}

.site-footer{
  border-top:1px solid var(--line);
  padding:18px 0;
  margin-top:22px;
  background:var(--card);
}
.footer-row{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;
}
.footer-links{display:flex;gap:12px;flex-wrap:wrap}
.footer-links a{color:var(--muted)}
.footer-links a:hover{color:var(--accent)}

.prose ul,.prose ol{margin:10px 0 0;padding-left:18px}
.prose li{margin:10px 0}
.aff-box{
  margin-top:16px;
  border:1px solid rgba(24,151,220,.25);
  background:linear-gradient(135deg,rgba(24,151,220,.03),rgba(241,115,29,.03));
  border-radius:14px;
  padding:18px;
}
.aff-title{
  font-weight:800;
  margin-bottom:12px;
  color:var(--text);
  font-size:16px;
  display:flex;
  align-items:center;
  gap:8px;
}
.aff-title::before{
  content:"\1F6D2";
  font-size:18px;
}
.aff-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media (max-width:920px){
  .aff-grid{grid-template-columns:1fr}
}
.aff-item{
  border:1px solid var(--line);
  border-left:3px solid var(--accent);
  border-radius:10px;
  padding:12px;
  background:var(--card);
  color:var(--text);
  font-weight:600;
  font-size:14px;
  display:flex;
  flex-direction:column;
  gap:8px;
  transition:border-color .2s, box-shadow .2s, transform .15s;
  position:relative;
  overflow:hidden;
}
.aff-item-img{
  width:100%;
  aspect-ratio:4/3;
  object-fit:contain;
  border-radius:6px;
  background:#f5f6f8;
  display:block;
}
.aff-item-label{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.aff-item-name{
  font-weight:600;
  font-size:14px;
  color:var(--text);
  line-height:1.3;
}
.aff-item-cta{
  font-size:12px;
  font-weight:500;
  color:var(--accent);
  opacity:.7;
  transition:opacity .2s;
}
.aff-item:hover{
  border-color:var(--accent);
  border-left-color:var(--accent2);
  text-decoration:none;
  box-shadow:0 4px 14px rgba(24,151,220,.15);
  transform:translateY(-1px);
}
.aff-item:hover .aff-item-cta{
  opacity:1;
}
/* Category accent variants */
.aff-item[data-type="cable"]{border-left-color:#1897dc}
.aff-item[data-type="adapter"]{border-left-color:#f1731d}
.aff-item[data-type="tool"]{border-left-color:#2ecc71}
.aff-item[data-type="charger"]{border-left-color:#9b59b6}
.aff-item[data-type="hub"]{border-left-color:#e74c3c}

/* Gallery carousel */
.gallery{position:relative;overflow:hidden;border-radius:14px;background:#f0f1f4}
.gallery-track{
  display:flex;
  will-change:transform;
  cursor:grab;
}
.gallery-track.dragging{cursor:grabbing}
.gallery-slide{
  min-width:100%;
  padding:0 2px;
}
.gallery-slide img{
  width:100%;
  border-radius:12px;
  display:block;
  pointer-events:none;
  user-select:none;
}
.gallery-btn{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  z-index:5;
  width:44px;height:44px;
  border-radius:50%;
  border:1px solid var(--line);
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(6px);
  color:var(--text);
  font-size:20px;
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  opacity:0;
  transition:opacity .25s;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.gallery:hover .gallery-btn{opacity:1}
.gallery-btn:hover{background:var(--accent);color:#fff;border-color:var(--accent)}
.gallery-prev{left:10px}
.gallery-next{right:10px}
.gallery-dots{
  display:flex;
  justify-content:center;
  gap:8px;
  padding:12px 0 4px;
}
.gallery-dot{
  width:10px;height:10px;
  border-radius:50%;
  border:1px solid var(--line);
  background:rgba(15,26,73,.1);
  cursor:pointer;
  transition:background .2s, border-color .2s;
}
.gallery-dot.active{
  background:var(--accent);
  border-color:var(--accent);
}
.gallery-counter{
  text-align:center;
  color:var(--muted);
  font-size:13px;
  padding:6px 0 0;
}
.gallery-thumb-row{
  display:flex;
  gap:8px;
  padding:10px 0 0;
  overflow-x:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(15,26,73,.15) transparent;
}
.gallery-thumb{
  min-width:72px;
  height:52px;
  border-radius:8px;
  border:2px solid transparent;
  overflow:hidden;
  cursor:pointer;
  opacity:.5;
  transition:opacity .2s, border-color .2s;
}
.gallery-thumb.active{
  opacity:1;
  border-color:var(--accent);
}
.gallery-thumb:hover{opacity:.85}
.gallery-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  pointer-events:none;
}
/* Tap hint for mobile */
.gallery-tap-hint{
  position:absolute;
  bottom:14px;left:50%;
  transform:translateX(-50%);
  background:rgba(0,0,0,.7);
  color:#fff;
  font-size:12px;
  padding:6px 12px;
  border-radius:999px;
  pointer-events:none;
  opacity:0;
  transition:opacity .4s;
}
.gallery-tap-hint.show{opacity:1}

/* Lightbox */
.lightbox{
  display:none;
  position:fixed;
  inset:0;
  z-index:100;
  background:rgba(0,0,0,.92);
  align-items:center;
  justify-content:center;
  padding:20px;
  cursor:pointer;
}
.lightbox.open{display:flex}
.lightbox img{
  max-width:100%;
  max-height:90vh;
  border-radius:12px;
  object-fit:contain;
}

/* Legacy photo-grid fallback (no-JS) */
.photo-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}
.photo-grid img{
  width:100%;
  border-radius:12px;
  cursor:pointer;
  transition:opacity .2s;
}
.photo-grid img:hover{opacity:.85}

/* Device thumbnail cards */
.device-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  padding:18px 0;
}
.device-card{
  display:block;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  transition:border-color .2s, transform .15s, box-shadow .2s;
}
.device-card:hover{
  border-color:var(--accent);
  transform:translateY(-2px);
  text-decoration:none;
  box-shadow:0 6px 20px rgba(24,151,220,.12);
}
.device-thumb{
  width:100%;
  aspect-ratio:16/10;
  object-fit:cover;
  display:block;
  background:#eceef2;
}
.device-card-body{padding:12px 14px}
.device-card-body .h3{margin:0 0 4px}
.device-card-body .muted{margin:0;font-size:14px}
@media (max-width:920px){
  .device-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:480px){
  .device-grid{grid-template-columns:1fr}
}

/* Filter tabs */
.filter-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding:8px 0;
}
.filter-tab{
  color:var(--muted);
  padding:8px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--card);
  cursor:pointer;
  font-size:14px;
  font-family:inherit;
  font-weight:500;
  transition:color .2s, border-color .2s, background .2s;
}
.filter-tab:hover{color:var(--text);border-color:var(--accent)}
.filter-tab.active{
  color:#fff;
  border-color:var(--accent);
  background:var(--accent);
}

/* Homepage hero simplified */
.hero-simple{
  text-align:center;
  padding:36px 0 10px;
}
.hero-simple h1{font-size:36px;margin:0 0 8px}
.hero-simple .lead{margin:0 0 18px}
.hero-simple .search-card{
  max-width:520px;
  margin:0 auto;
}

/* Guide card enhancements */
.guide-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
  transition:border-color .2s, box-shadow .2s;
}
.guide-card:hover{
  border-color:var(--accent);
  box-shadow:0 4px 16px rgba(24,151,220,.1);
}
.guide-card .h3{margin:0 0 4px}
.guide-card .h3 .link{color:var(--text)}
.guide-card .h3 .link:hover{color:var(--accent)}
.guide-card .muted{margin:0;font-size:14px}
.guide-card .sub{font-size:13px;color:var(--accent2);margin-top:6px;font-weight:500}
