:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text2: #8b949e;
  --accent: #f78166;
  --accent2: #58a6ff;
  --critical: #ff4444;
  --high: #ff8c00;
  --medium: #ffc107;
  --low: #28a745;
  --green: #3fb950;
  --radius: 8px;
  --max: 1200px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.7; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 14px 0; position: sticky; top: 0; z-index: 100; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; color: var(--accent2); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--text2); padding: 5px 10px; border-radius: var(--radius); font-size: 0.9rem; }
.site-nav a:hover { background: var(--bg3); color: var(--text); text-decoration: none; }

/* Main */
main.wrap { padding: 28px 20px; }

/* Severity badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-critical { background: var(--critical); color: #fff; }
.badge-high { background: var(--high); color: #000; }
.badge-medium { background: var(--medium); color: #000; }
.badge-low { background: var(--low); color: #fff; }
.badge-cat { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }

/* CVE Card */
.cve-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 20px; }
.cve-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: border-color .2s; }
.cve-card:hover { border-color: var(--accent2); }
.cve-card .card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cve-card .cve-id { font-family: monospace; font-size: 0.85rem; color: var(--accent2); font-weight: 700; }
.cve-card .cvss { font-size: 0.8rem; color: var(--text2); }
.cve-card h3 { font-size: 0.97rem; margin-bottom: 8px; line-height: 1.4; }
.cve-card h3 a { color: var(--text); }
.cve-card h3 a:hover { color: var(--accent2); text-decoration: none; }
.cve-card .summary { font-size: 0.88rem; color: var(--text2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cve-card .card-foot { margin-top: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cve-card .date { font-size: 0.78rem; color: var(--text2); margin-left: auto; }

/* CVE detail page */
.cve-detail h1 { font-size: 1.5rem; margin: 16px 0 8px; line-height: 1.4; }
.cve-detail .meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; color: var(--text2); font-size: 0.88rem; }
.cve-detail .meta .cve-id-big { font-family: monospace; font-size: 1rem; color: var(--accent2); font-weight: 700; }
.cve-detail section { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.cve-detail section h2 { font-size: 1.05rem; margin-bottom: 12px; color: var(--accent2); display: flex; align-items: center; gap: 6px; }
.cve-detail section p, .cve-detail section li { font-size: 0.95rem; color: var(--text2); }
.cve-detail .fix-steps { padding-left: 0; list-style: none; }
.cve-detail .fix-steps li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.cve-detail .fix-steps li:last-child { border-bottom: none; }
.cve-detail .fix-steps li::before { content: "→ "; color: var(--green); }
.cve-detail .refs a { display: block; font-size: 0.85rem; color: var(--accent2); word-break: break-all; }

/* Urgency box */
.urgency-box { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; font-weight: 600; }
.urgency-critical { background: rgba(255,68,68,.15); border: 1px solid var(--critical); color: var(--critical); }
.urgency-high { background: rgba(255,140,0,.15); border: 1px solid var(--high); color: var(--high); }
.urgency-medium { background: rgba(255,193,7,.12); border: 1px solid var(--medium); color: var(--medium); }

/* Hero / page header */
.page-hero { margin-bottom: 24px; display:flex; align-items:center; gap:24px; flex-wrap:wrap; }
.hero-left { flex:1; min-width:0; }
.page-hero h1 { font-size: 1.6rem; margin-bottom: 6px; }
.page-hero p { color: var(--text2); }

/* Hero search — right side */
.hero-search { display:flex; flex-direction:column; gap:6px; flex-shrink:0; width:320px; }
.hero-search-wrap { position:relative; display:flex; align-items:center; background:var(--bg2); border:1px solid var(--border); border-radius:8px; transition:border-color .2s; }
.hero-search-wrap:focus-within { border-color:var(--accent2); }
.hero-search-icon { padding:0 10px; color:var(--text2); font-size:14px; pointer-events:none; }
.hero-search-input { flex:1; background:transparent; border:none; outline:none; padding:10px 6px; color:var(--text); font-size:14px; }
.hero-search-input::placeholder { color:var(--text2); }
.hero-search-clear { padding:0 10px; color:var(--text2); font-size:13px; text-decoration:none; line-height:1; }
.hero-search-clear:hover { color:var(--text); text-decoration:none; }
.hero-search-btn { padding:9px 16px; background:var(--accent2); color:#000; border:none; border-radius:6px; font-weight:700; font-size:13px; cursor:pointer; text-align:center; }
.hero-search-btn:hover { opacity:.85; }
@media(max-width:700px) { .hero-search { width:100%; } }

/* Sidebar layout */
.layout-2col { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
@media(max-width:860px) { .layout-2col { grid-template-columns: 1fr; } }
.sidebar { }
.sidebar .widget { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.sidebar .widget h3 { font-size: 0.95rem; margin-bottom: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar .widget ul { list-style: none; }
.sidebar .widget ul li { padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.sidebar .widget ul li:last-child { border-bottom: none; }
.sidebar .widget ul li a { color: var(--text); }

/* Search */
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar input { flex: 1; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--text); font-size: 0.95rem; }
.search-bar input:focus { outline: none; border-color: var(--accent2); }
.btn { background: var(--accent2); color: #000; border: none; padding: 10px 18px; border-radius: var(--radius); cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.btn:hover { opacity: .85; }

/* Stats bar */
.stats-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-pill { background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 0.85rem; color: var(--text2); }
.stat-pill strong { color: var(--text); }

/* Filter tabs */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-tab { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); color: var(--text2); font-size: 0.85rem; cursor: pointer; background: none; }
.filter-tab:hover, .filter-tab.active { background: var(--accent2); color: #000; border-color: var(--accent2); }

/* Pagination */
.pagination { display: flex; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }
.pagination a:hover { border-color: var(--accent2); text-decoration: none; }
.pagination .current { background: var(--accent2); color: #000; border-color: var(--accent2); }

/* Footer */
.site-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 28px 0; margin-top: 48px; color: var(--text2); font-size: 0.88rem; text-align: center; }
.site-footer a { color: var(--text2); }
.site-footer p { margin-bottom: 6px; }

/* Responsive */
@media(max-width:600px) {
  .cve-grid { grid-template-columns: 1fr; }
  .site-header .wrap { gap: 12px; }
}
