*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #22263a;
  --accent: #4f8ef7;
  --accent2: #2ecc71;
  --text: #dde1f0;
  --text-muted: #8892b0;
  --border: #2a2f45;
  --new-bg: #1a2a1a;
  --new-border: #2ecc71;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

h1 .subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.last-refresh {
  color: var(--text-muted);
  font-size: 12px;
}

.badge-new-count {
  background: var(--accent2);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.btn-refresh {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.btn-refresh:hover { opacity: 0.85; }

.btn-logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: color 0.15s;
  white-space: nowrap;
}
.btn-logout:hover { color: var(--text); }

/* Search */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-wrap input[type="search"] {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 7px 36px 7px 14px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.search-wrap input[type="search"]:focus {
  border-color: var(--accent);
}

.search-wrap input[type="search"]::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

.search-header {
  margin-bottom: 14px;
}

mark {
  background: #3a3000;
  color: #ffd700;
  border-radius: 2px;
  padding: 0 1px;
}

.col-section { width: 10%; }

/* Main */
main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn .count {
  background: var(--bg3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.tab-btn.active .count {
  background: var(--accent);
  color: #fff;
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-panel h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Table */
.topics-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.topics-table thead tr {
  background: var(--bg3);
}

.topics-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.topics-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.topics-table tbody tr:last-child td { border-bottom: none; }

.topics-table tbody tr:hover { background: var(--bg3); }

.topics-table tbody tr.row-new {
  background: var(--new-bg);
  border-left: 3px solid var(--new-border);
}

.topics-table tbody tr.row-new:hover { background: #1e341e; }

/* Column widths */
.col-title { width: 55%; }
.col-author { width: 15%; color: var(--text-muted); }
.col-replies { width: 8%; text-align: center; color: var(--text-muted); }
.col-date { width: 22%; color: var(--text-muted); font-size: 12px; }

.col-title a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.col-title a:hover { color: var(--accent); text-decoration: underline; }

.badge-new {
  display: inline-block;
  background: var(--accent2);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 48px 0;
  font-size: 15px;
}

/* Responsive */
@media (max-width: 640px) {
  .col-author, .col-replies { display: none; }
  .col-title { width: 70%; }
  .col-date { width: 30%; }
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
}
