:root{
  --bg: #0b0f14;
  --panel: #101826;
  --card: #0f1724;
  --muted: #8ea0b8;
  --text: #e9f0ff;
  --accent: #2f7fff;
  --accent2: #23c3ff;
  --border: rgba(255,255,255,.08);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --radius2: 22px;
  --max: 1200px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

[data-theme="light"]{
  --bg: #f5f7fb;
  --panel: #ffffff;
  --card: #ffffff;
  --muted: #5c6a7d;
  --text: #0b1526;
  --accent: #1f63ff;
  --accent2: #00a2ff;
  --border: rgba(15, 30, 45, .10);
  --shadow: 0 10px 30px rgba(11, 21, 38, .10);
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 15% -10%, rgba(47,127,255,.25), transparent 60%),
              radial-gradient(900px 500px at 95% 10%, rgba(35,195,255,.18), transparent 55%),
              var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration: none; }
button, input, select, textarea{ font: inherit; color: inherit; }

.wrap{ width: min(var(--max), calc(100% - 28px)); margin: 0 auto; }

/* Header */
header{
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0));
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] header{
  background: linear-gradient(to bottom, rgba(245,247,251,.75), rgba(245,247,251,0));
}

.topbar{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 220px;
}
.logo{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: var(--shadow);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  letter-spacing: .5px;
}
.brand h1{
  font-size: 16px;
  margin: 0;
  line-height: 1.1;
}
.brand small{
  display:block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.search{
  flex: 1;
  display:flex;
  align-items:center;
  gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
}
[data-theme="light"] .search{ background: rgba(15,30,45,.04); }
.searchIcon{ color: var(--muted); font-weight: 900; }
.search input{
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  user-select: none;
  transition: transform .05s ease, background .2s ease;
  white-space: nowrap;
}
[data-theme="light"] .pill{ background: rgba(15,30,45,.03); }
.pill:active{ transform: scale(.98); }
.pill:hover{ background: rgba(255,255,255,.07); }
[data-theme="light"] .pill:hover{ background: rgba(15,30,45,.06); }
.pill strong{ font-size: 13px; }

nav{ border-top: 1px solid var(--border); }
.navrow{
  display:flex;
  gap: 10px;
  overflow:auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.navrow::-webkit-scrollbar{ display:none; }
.navlink{
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: .2s ease;
  font-size: 13px;
  white-space: nowrap;
}
.navlink.active{
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,.04);
}
[data-theme="light"] .navlink.active{ background: rgba(15,30,45,.04); }

/* Layout */
main{ padding: 18px 0 60px; }
.grid{
  display: grid;
  grid-template-columns: 1.65fr .85fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
  .brand{ min-width: auto; }
}

/* Hero */
.hero{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow:hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}
[data-theme="light"] .hero{
  background: linear-gradient(180deg, rgba(15,30,45,.04), rgba(15,30,45,.01));
}
.heroInner{ padding: 18px; display:grid; gap: 10px; }
.kicker{ display:flex; gap: 8px; flex-wrap: wrap; align-items:center; }
.tag{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
}
[data-theme="light"] .tag{ background: rgba(15,30,45,.03); }
.tag.dot::before{
  content:"";
  width: 7px; height: 7px;
  border-radius: 999px;
  margin-right: 8px;
  background: var(--accent2);
  display:inline-block;
}
.heroTitle{
  font-size: clamp(20px, 2.2vw, 28px);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.heroDesc{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.heroMeta{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.heroActions{ display:flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  transition: .2s ease;
  font-weight: 700;
  font-size: 13px;
}
.btn.primary{
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}
.btn:hover{ filter: brightness(1.05); }
.btn:active{ transform: scale(.98); }

/* Sections */
.section{
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.sectionHeader{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
}
.sectionHeader h2{
  font-size: 14px;
  margin: 0;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
}
.filters{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
}
.select{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
[data-theme="light"] .select{ background: rgba(15,30,45,.03); }

/* Cards */
.cards{ display:grid; gap: 12px; padding: 14px; }
.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow:hidden;
  transition: transform .08s ease, border-color .2s ease;
}
.card:hover{
  border-color: rgba(47,127,255,.35);
  transform: translateY(-1px);
}
.cardInner{ padding: 14px; display:grid; gap: 8px; }
.cardTitle{ font-size: 16px; margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.cardDesc{ margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.metaRow{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
  color: var(--muted);
  font-size: 12px;
}
.badge{
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  background: rgba(255,255,255,.04);
}
[data-theme="light"] .badge{ background: rgba(15,30,45,.03); }

/* Sidebar */
.side{
  position: sticky;
  top: 112px;
  display:grid;
  gap: 16px;
}
@media (max-width: 980px){
  .side{ position: static; }
}
.box{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.boxHead{
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
}
.boxHead h3{
  margin: 0;
  font-size: 14px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
}
.list{ display:grid; }
.list a{
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display:grid;
  gap: 6px;
  transition: background .2s ease;
}
.list a:hover{ background: rgba(255,255,255,.03); }
[data-theme="light"] .list a:hover{ background: rgba(15,30,45,.03); }
.list .t{ margin: 0; font-size: 13px; line-height: 1.25; font-weight: 800; }
.list .s{ margin: 0; color: var(--muted); font-size: 12px; }

.cta{ padding: 14px; display:grid; gap: 10px; }
.cta p{ margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.cta .row{ display:flex; gap: 10px; flex-wrap: wrap; }
.mini{ color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }

/* Reader */
.reader{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:none;
}
.reader.show{ display:block; }
.readerTop{
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display:flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items:center;
}
.readerTop .back{
  display:flex;
  gap: 10px;
  align-items:center;
  cursor:pointer;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.article{ padding: 18px; display:grid; gap: 10px; }
.article h1{
  margin: 0;
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.article .sub{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.article .body{
  margin-top: 6px;
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}
.article .body p{ margin: 0 0 14px 0; }
.article .body ul{ margin: 0 0 14px 18px; }
.article .body li{ margin: 6px 0; }

/* Footer */
footer{
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  padding: 20px 0 30px;
  border-top: 1px solid var(--border);
}
footer .row{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:center;
}
.links{ display:flex; gap: 10px; flex-wrap: wrap; }
.links a{
  color: var(--muted);
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 999px;
}
.links a:hover{ border-color: var(--border); color: var(--text); }
