@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:        #f0f5fa;
  --bg-1:      #ffffff;
  --bg-2:      #f4f8fc;
  --bg-3:      #e8f0f8;
  --border:    #d0dce8;
  --border-2:  #b8cce0;

  --accent:    #2563eb;
  --accent-dim:rgba(37,99,235,0.08);
  --accent-2:  #0ea5e9;
  --red:       #ef4444;
  --green:     #10b981;

  --text:      #0f172a;
  --text-2:    #475569;
  --text-3:    #94a3b8;

  --header-h:  58px;
  --max-w:     680px;
  --radius:    12px;
  --radius-sm: 8px;
  --ease:      0.15s ease;
  --font:      'Inter', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --shadow:    0 1px 3px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14.5px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; transition: opacity var(--ease); }
a:hover { opacity: 0.8; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; }

/* ── HEADER ── */
.Header {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  box-shadow: 0 1px 4px rgba(37,99,235,0.08);
}
.Header-inner { max-width: calc(var(--max-w) + 320px + 48px); margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.Header-logo { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; letter-spacing: -0.3px; flex-shrink: 0; color: var(--text); }
.Header-logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }
.Header-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.Header-nav a { padding: 5px 12px; font-size: 13px; font-weight: 500; color: var(--text-2); border-radius: 99px; transition: all var(--ease); }
.Header-nav a:hover { color: var(--text); background: var(--bg-2); opacity: 1; }
.Header-nav a.active { color: var(--accent); background: var(--accent-dim); }
.Header-btn { background: var(--accent); color: #fff !important; font-weight: 700; padding: 6px 14px !important; border-radius: 99px; }
.Header-btn:hover { opacity: 0.88; }
.Header-hamburger { display: none; background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer; margin-left: auto; }

/* ── MOBILE MENU ── */
#mobileMenu { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg-1); z-index: 199; padding: 12px; overflow-y: auto; border-top: 1px solid var(--border); }
#mobileMenu a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 13.5px; color: var(--text-2); border-radius: var(--radius-sm); margin-bottom: 2px; }
#mobileMenu a:hover { background: var(--bg-2); color: var(--text); opacity: 1; }

/* ── LAYOUT ── */
.Layout { max-width: calc(var(--max-w) + 320px + 48px); margin: 0 auto; padding: 24px 20px 48px; display: grid; grid-template-columns: var(--max-w) 1fr; gap: 24px; align-items: start; }
.Main { min-width: 0; }
.Sidebar { position: sticky; top: calc(var(--header-h) + 16px); }

/* ── FEED HEADER ── */
.FeedHeader { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.FeedHeader-title { font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--mono); display: flex; align-items: center; gap: 8px; }
.FeedHeader-live { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent); font-family: var(--mono); font-weight: 600; }
.FeedHeader-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: block; animation: blink 1.5s infinite; }

/* ── TREND CARD ── */
.TrendCard { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; transition: all var(--ease); box-shadow: var(--shadow); }
.TrendCard:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.TrendCard-inner { display: flex; gap: 14px; padding: 16px; }
.TrendCard-image { width: 90px; height: 68px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: var(--bg-2); }
.TrendCard-image-ph { width: 90px; height: 68px; border-radius: var(--radius-sm); background: var(--accent-dim); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--accent); border: 1px solid var(--border); }
.TrendCard-body { flex: 1; min-width: 0; }
.TrendCard-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.TrendCard-source { font-size: 11.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.TrendCard-source img { width: 14px; height: 14px; border-radius: 3px; }
.TrendCard-time { font-size: 11px; color: var(--text-3); font-family: var(--mono); margin-left: auto; }
.TrendCard-title { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 6px; }
.TrendCard:hover .TrendCard-title { color: var(--accent); }
.TrendCard-summary { font-size: 12.5px; color: var(--text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.TrendCard-footer { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg-2); flex-wrap: wrap; }
.TrendCard-tag { font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--bg-1); padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border); font-family: var(--mono); transition: all var(--ease); }
.TrendCard-tag:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); opacity: 1; }
.TrendCard-traffic { margin-left: auto; font-size: 11px; color: var(--accent); font-family: var(--mono); font-weight: 700; }
.TrendCard-ext { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.TrendCard-ext:hover { color: var(--accent); opacity: 1; }

/* ── SIDEBAR WIDGETS ── */
.Widget { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); }
.Widget-head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); font-family: var(--mono); display: flex; align-items: center; gap: 7px; background: var(--bg-2); }
.Widget-head i { color: var(--accent); }
.Widget-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); transition: background var(--ease); }
.Widget-item:last-child { border-bottom: none; }
.Widget-item:hover { background: var(--bg-2); }
.Widget-item-num { font-size: 12px; font-weight: 700; color: var(--text-3); font-family: var(--mono); width: 20px; flex-shrink: 0; }
.Widget-item-title { font-size: 12.5px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.Widget-item-traffic { font-size: 10.5px; color: var(--accent); font-family: var(--mono); flex-shrink: 0; font-weight: 700; }

/* ── TREND DETAIL ── */
.TrendDetail { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.TrendDetail-hero { width: 100%; max-height: 320px; object-fit: cover; }
.TrendDetail-body { padding: 24px; }
.TrendDetail-title { font-size: 22px; font-weight: 800; line-height: 1.3; margin-bottom: 12px; letter-spacing: -0.3px; }
.TrendDetail-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.TrendDetail-source { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.TrendDetail-time { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.TrendDetail-traffic { font-size: 12px; color: var(--accent); font-family: var(--mono); font-weight: 700; }
.TrendDetail-content { font-size: 14px; color: var(--text-2); line-height: 1.8; margin-bottom: 20px; }
.TrendDetail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.TrendDetail-source-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 20px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; border-radius: var(--radius-sm); transition: opacity var(--ease); }
.TrendDetail-source-btn:hover { opacity: 0.88; color: #fff; }

/* ── FORMS ── */
.FormGroup { margin-bottom: 16px; }
.FormLabel { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.FormControl { width: 100%; height: 42px; padding: 0 14px; background: var(--bg-1); border: 1.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13.5px; outline: none; transition: all var(--ease); }
.FormControl:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.FormControl::placeholder { color: var(--text-3); }
textarea.FormControl { height: auto; padding: 12px 14px; resize: vertical; }

/* ── BUTTONS ── */
.Btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; border: none; transition: all var(--ease); white-space: nowrap; }
.Btn--primary { background: var(--accent); color: #fff; }
.Btn--primary:hover { opacity: 0.88; color: #fff; }
.Btn--ghost { background: var(--bg-1); color: var(--text-2); border: 1.5px solid var(--border); }
.Btn--ghost:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.Btn--danger { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.Btn--sm { padding: 4px 10px; font-size: 11.5px; }

/* ── ALERTS ── */
.Alert { padding: 12px 16px; font-size: 13px; border-radius: var(--radius-sm); margin-bottom: 14px; border-left: 3px solid; }
.Alert--success { background: #f0fdf4; border-color: var(--green); color: #166534; }
.Alert--error   { background: #fef2f2; border-color: var(--red); color: #991b1b; }

/* ── PAGINATION ── */
.Pagination { display: flex; gap: 4px; justify-content: center; padding: 24px 0; flex-wrap: wrap; }
.Pag-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--bg-1); border: 1.5px solid var(--border); border-radius: var(--radius-sm); transition: all var(--ease); }
.Pag-btn:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.Pag-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── EMPTY ── */
.Empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.Empty i { font-size: 36px; display: block; margin-bottom: 14px; opacity: 0.2; }
.Empty p { font-size: 14px; }

/* ── FOOTER ── */
.Footer { background: var(--bg-1); border-top: 1px solid var(--border); padding: 28px 20px; }
.Footer-inner { max-width: calc(var(--max-w) + 320px + 48px); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.Footer-logo { font-size: 14px; font-weight: 800; color: var(--text-2); }
.Footer-links { display: flex; gap: 16px; }
.Footer-links a { font-size: 12.5px; color: var(--text-3); }
.Footer-links a:hover { color: var(--accent); opacity: 1; }
.Footer-copy { font-size: 12px; color: var(--text-3); font-family: var(--mono); }

/* ── RESPONSIVE ── */
@media(max-width:1024px) {
  .Layout { grid-template-columns: 1fr; max-width: 720px; }
  .Sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media(max-width:768px) {
  :root { --header-h: 54px; }
  .Header-inner { padding: 0 14px; }
  .Header-nav { display: none; }
  .Header-hamburger { display: flex; align-items: center; }
  .Layout { padding: 14px 12px 32px; gap: 16px; }
  .Sidebar { grid-template-columns: 1fr; }
  .TrendCard-inner { gap: 10px; padding: 13px; }
  .TrendCard-image, .TrendCard-image-ph { width: 72px; height: 56px; }
  .TrendCard-title { font-size: 13.5px; }
  .TrendDetail-title { font-size: 18px; }
  .TrendDetail-body { padding: 18px; }
}
@media(max-width:480px) {
  .TrendCard-image, .TrendCard-image-ph { display: none; }
  .Footer-inner { flex-direction: column; align-items: flex-start; }
}