:root {
  --bg: #0f172a;
  --sidebar: #111827;
  --panel: #182236;
  --panel2: #202b42;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --faint: #64748b;
  --border: #334155;
  --high: #fca5a5;
  --medium: #fde68a;
  --low: #86efac;
  --link: #93c5fd;
}

* { box-sizing: border-box; }
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  max-width: 100%;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  max-width: 100%;
}
.brand {
  font-size: 22px;
  font-weight: 850;
}
.small { font-size: 13px; }
.muted { color: var(--muted); }
.side-section {
  margin-top: 22px;
}
.side-title {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 5px;
}
select, button, .button {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
button { cursor: pointer; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check input { width: auto; }
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}
.main {
  padding: 26px 28px 40px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
  max-width: 100%;
}
h1 {
  margin: 0;
  font-size: 28px;
}
p {
  margin: 6px 0 0;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 10px;
  min-width: 320px;
}
.actions button, .actions .button {
  width: auto;
}
.secondary {
  background: transparent;
}
.notice {
  background: rgba(32, 43, 66, .85);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--muted);
  margin-bottom: 16px;
}
.hidden { display: none; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  max-width: 100%;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  color: var(--faint);
  font-size: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(51, 65, 85, .7);
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
.ticker {
  font-weight: 850;
  color: #bfdbfe;
}
.title-cell {
  min-width: 360px;
}
.title-cell small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.badge.high { color: var(--high); border-color: rgba(252,165,165,.35); }
.badge.medium { color: var(--medium); border-color: rgba(253,230,138,.35); }
.badge.low { color: var(--low); border-color: rgba(134,239,172,.35); }
a { color: var(--link); text-decoration: none; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px;
}
.mobile-list {
  display: none;
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .main { padding: 18px 14px 28px; }
  .topbar {
    flex-direction: column;
  }
  .actions {
    width: 100%;
    min-width: 0;
    flex-direction: column;
  }
  .actions button, .actions .button {
    width: 100%;
  }
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }
  .app,
  .sidebar,
  .main,
  .topbar,
  .panel,
  .mobile-list,
  .mobile-card {
    max-width: 100%;
  }
  .sidebar {
    padding: 14px 12px 12px;
  }
  .brand {
    font-size: 19px;
  }
  .small {
    font-size: 12px;
  }
  .side-section {
    margin-top: 12px;
  }
  .side-title {
    margin-bottom: 7px;
  }
  label {
    margin: 7px 0 4px;
  }
  select, button, .button {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 13px;
  }
  .check {
    margin-top: 9px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-card {
    border-radius: 10px;
    padding: 9px 10px;
  }
  .stat-card strong {
    margin-top: 2px;
    font-size: 20px;
  }
  .main {
    padding: 14px 10px 0;
  }
  .topbar {
    gap: 12px;
    margin-bottom: 12px;
  }
  h1 {
    font-size: 22px;
  }
  p {
    font-size: 13px;
    line-height: 1.45;
  }
  .actions {
    gap: 8px;
  }
  .notice {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
  }
  .panel {
    border-radius: 12px;
  }
  .panel-head {
    padding: 12px;
  }
  .table-wrap {
    display: none;
  }
  .mobile-list {
    display: grid;
    gap: 10px;
    padding: 10px;
    overflow-x: hidden;
  }
  .mobile-card {
    background: rgba(32, 43, 66, .72);
    border: 1px solid rgba(51, 65, 85, .85);
    border-radius: 12px;
    padding: 12px;
    overflow-wrap: anywhere;
  }
  .mobile-card-head,
  .mobile-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .mobile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 12px;
  }
  .mobile-meta span,
  .mobile-source {
    min-width: 0;
  }
  .mobile-meta span {
    border: 1px solid rgba(51, 65, 85, .8);
    border-radius: 999px;
    padding: 3px 7px;
    background: rgba(15, 23, 42, .32);
  }
  .mobile-card h2 {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 750;
  }
  .mobile-source {
    margin-top: 8px;
    color: var(--faint);
    font-size: 12px;
  }
  .mobile-card p {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.45;
  }
  .mobile-card-foot {
    margin-top: 12px;
  }
  .mobile-card time {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
  }
  .source-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(147, 197, 253, .35);
    border-radius: 9px;
    background: rgba(147, 197, 253, .12);
    color: var(--link);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }
  .empty {
    padding: 22px 12px;
    font-size: 13px;
  }
}
