/* ===================== Variables ===================== */
:root {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --bg3:       #1c2128;
  --red:       #f85149;
  --green:     #3fb950;
  --blue:      #58a6ff;
  --yellow:    #e3b341;
  --orange:    #db6d28;
  --text:      #e6edf3;
  --text2:     #8b949e;
  --border:    #30363d;
  --hover:     #21262d;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 4px 16px rgba(0,0,0,.4);
}

/* ===================== Reset ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; line-height: 1.6; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ===================== Layout ===================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.layout {
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 32px;
  align-items: start;
}

/* ===================== Header ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 13px;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link.active { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--blue); }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.search-box { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.search-input { background: none; border: none; outline: none; padding: 6px 10px; color: var(--text); width: 160px; }
.search-btn { padding: 6px 10px; background: none; color: var(--text2); }
.menu-toggle { display: none; font-size: 20px; color: var(--text2); padding: 6px; }
.mobile-nav { display: none; flex-direction: column; padding: 8px 16px 12px; gap: 4px; background: var(--bg2); border-top: 1px solid var(--border); }
.mobile-nav .nav-link { padding: 8px 12px; }

/* ===================== Buttons ===================== */
.btn {
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: opacity .2s, background .2s;
  white-space: nowrap;
}
.btn:hover { opacity: .85; }
.btn-primary { background: var(--red); color: #fff; }
.btn-outline { border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { background: var(--hover); color: var(--text); }
.btn-block { width: 100%; padding: 10px; margin-top: 8px; }

/* ===================== Ticker ===================== */
.ticker {
  background: linear-gradient(90deg, #1a0000, var(--bg2));
  border-bottom: 1px solid #3a1010;
  padding: 6px 0;
  overflow: hidden;
}
.ticker-inner { display: flex; align-items: center; gap: 12px; }
.ticker-label {
  flex-shrink: 0;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.ticker-track { flex: 1; overflow: hidden; }
.ticker-content { display: inline-block; white-space: nowrap; color: var(--text2); font-size: 13px; animation: ticker-scroll 30s linear infinite; }
@keyframes ticker-scroll { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }

/* ===================== Card ===================== */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.date-badge { font-size: 12px; color: var(--text2); background: var(--bg3); padding: 3px 10px; border-radius: 20px; }

/* ===================== Sidebar Left ===================== */
.sidebar { position: sticky; top: 72px; }
.league-list { display: flex; flex-direction: column; gap: 2px; }
.league-item {
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.league-item:hover { background: var(--hover); color: var(--text); }
.league-item.active { background: rgba(88,166,255,.12); color: var(--blue); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .15s;
}
.tag:hover { background: rgba(88,166,255,.15); border-color: var(--blue); color: var(--blue); }
.notice-card .notice-body { display: flex; flex-direction: column; gap: 8px; }
.notice-body p { font-size: 13px; color: var(--text2); }

/* ===================== Matches ===================== */
.matches-card { padding-bottom: 12px; }
.matches-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.match-card {
  flex-shrink: 0;
  width: 200px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.match-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.match-league { font-size: 11px; color: var(--text2); margin-bottom: 8px; }
.match-teams { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.match-team { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-vs { font-size: 11px; color: var(--text2); flex-shrink: 0; }
.match-score { font-size: 18px; font-weight: 700; text-align: center; }
.match-score.live { color: var(--red); }
.match-score.ns { font-size: 13px; color: var(--text2); }
.match-time { font-size: 11px; color: var(--text2); text-align: center; margin-top: 4px; }
.match-status-live { display: inline-block; font-size: 10px; background: var(--red); color: #fff; padding: 1px 5px; border-radius: 3px; margin-left: 4px; animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.skeleton-match {
  flex-shrink: 0;
  width: 200px;
  height: 96px;
  background: var(--bg3);
  border-radius: var(--radius);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ===================== Post Controls ===================== */
.post-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.filter-tabs { display: flex; gap: 4px; }
.tab {
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text2);
  transition: background .15s, color .15s;
  border: 1px solid transparent;
}
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active { background: rgba(248,81,73,.12); color: var(--red); border-color: rgba(248,81,73,.3); }

/* ===================== Posts ===================== */
.posts-list { display: flex; flex-direction: column; gap: 8px; }
.post-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.post-item:hover { border-color: var(--blue); background: var(--hover); }
.post-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.post-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.badge-league { background: rgba(88,166,255,.15); color: var(--blue); }
.badge-hot { background: rgba(248,81,73,.15); color: var(--red); }
.badge-new { background: rgba(63,185,80,.15); color: var(--green); }
.badge-rec { background: rgba(227,179,65,.15); color: var(--yellow); }
.post-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}
.post-title:hover { color: var(--blue); }
.post-meta-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.post-prediction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(63,185,80,.1);
  border: 1px solid rgba(63,185,80,.3);
  color: var(--green);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
}
.post-analysis {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.post-author { display: flex; align-items: center; gap: 6px; }
.author-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.author-name { font-size: 12px; color: var(--text2); }
.post-time { font-size: 12px; color: var(--text2); }
.post-stats { display: flex; gap: 14px; }
.stat { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2); }
.stat-icon { font-size: 13px; }
.no-results { text-align: center; padding: 48px; color: var(--text2); font-size: 15px; }
.hidden { display: none !important; }

/* ===================== Right Sidebar ===================== */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-item { text-align: center; padding: 10px; background: var(--bg3); border-radius: var(--radius); }
.stat-num { font-size: 20px; font-weight: 700; color: var(--blue); }
.stat-label { font-size: 11px; color: var(--text2); margin-top: 2px; }
.ranking-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rank-item:last-child { border-bottom: none; }
.rank-num { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.rank-num.gold { background: var(--yellow); color: #000; }
.rank-num.silver { background: #8b949e; color: #000; }
.rank-num.bronze { background: var(--orange); color: #fff; }
.rank-num.other { background: var(--bg3); color: var(--text2); }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 13px; color: var(--text); }
.rank-rate { font-size: 11px; color: var(--green); }
.rank-count { font-size: 11px; color: var(--text2); }
.hot-topics { display: flex; flex-direction: column; gap: 4px; }
.hot-topic {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.hot-topic:hover { background: var(--hover); }
.hot-num { width: 20px; font-size: 11px; font-weight: 700; text-align: center; flex-shrink: 0; }
.hot-num.n1 { color: var(--red); }
.hot-num.n2 { color: var(--orange); }
.hot-num.n3 { color: var(--yellow); }
.hot-num.other { color: var(--text2); }
.hot-text { font-size: 12px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-count { font-size: 11px; color: var(--text2); flex-shrink: 0; }

/* ===================== Footer ===================== */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 32px 0 0; margin-top: 16px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-bottom: 24px; }
.footer h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.footer p, .footer li { font-size: 13px; color: var(--text2); line-height: 2; }
.footer-links ul { display: flex; flex-direction: column; }
.footer-links a { color: var(--text2); }
.footer-links a:hover { color: var(--blue); }
.social-links { display: flex; gap: 8px; margin-top: 10px; }
.social-btn { padding: 5px 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text2); font-size: 12px; }
.social-btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--border); padding: 14px 0; text-align: center; color: var(--text2); font-size: 12px; }

/* ===================== Modals ===================== */
.modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.modal {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-sm { max-width: 400px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 16px; }
.modal-close { font-size: 16px; color: var(--text2); padding: 4px 8px; border-radius: 4px; }
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: var(--text2); font-weight: 500; }
.form-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.form-input:focus { border-color: var(--blue); }
.form-textarea { resize: vertical; min-height: 96px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); }
.float-right { margin-left: auto; }
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
select.form-input option { background: var(--bg3); }

/* ===================== Toast ===================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  background: var(--bg2);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

/* ===================== Responsive ===================== */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 180px 1fr; }
  .sidebar-right { display: none; }
}
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar-left { display: none; }
  .nav { display: none; }
  .search-box { display: none; }
  .header-right .btn { display: none; }
  .menu-toggle { display: block; }
  .mobile-nav.open { display: flex; }
  .post-controls { flex-direction: column; align-items: stretch; }
  .filter-tabs { flex-wrap: wrap; }
  .footer-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .match-card { width: 160px; }
  .post-stats { gap: 8px; }
}
