:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e0e8;
  --accent: #0b7a75;
  --danger: #b42318;
  --warning: #b54708;
  --low: #475467;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 2;
}

.topbar > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 700;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

#status {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 980px;
  overflow-wrap: anywhere;
}

button {
  border: 1px solid #08655f;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.secondary-btn {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.28);
  transition: transform 0.18s ease;
}

.switch-control input:checked + .switch-track {
  background: var(--accent);
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch-control:has(input:focus-visible) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, 0.12);
}

.switch-control:has(input:disabled) {
  opacity: 0.65;
  cursor: not-allowed;
}

.switch-text {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  padding: 14px 18px 24px;
}

.stream,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stream {
  min-height: calc(100vh - 118px);
}

.section-title,
.panel h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-title > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 140px 140px;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.side-filters {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 0;
  background: #fff;
}

.side-filters input,
.side-filters select {
  width: 100%;
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 9px 10px;
  outline: none;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.items {
  display: grid;
}

.hotspots {
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.hotspot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.hotspot-head span {
  color: var(--muted);
  font-size: 12px;
}

.hotspot-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.hotspot-toolbar select {
  width: 130px;
  padding: 7px 9px;
}

.coverage-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  overflow-x: auto;
}

.coverage-summary span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.coverage-summary button {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.coverage-summary button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.daily-brief {
  display: grid;
  gap: 7px;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.brief-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.brief-title strong {
  font-size: 13px;
}

.brief-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.brief-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.premarket-brief {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.brief-group {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #e5ebf2;
  border-radius: 6px;
  background: #fff;
}

.brief-group > b {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #475467;
  font-size: 11px;
  font-weight: 900;
  line-height: 14px;
}

.brief-group > b span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-group > b i {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef6ff;
  color: #155eef;
  font-style: normal;
  text-align: center;
}

.brief-group.top-ten {
  grid-column: 1 / -1;
  gap: 5px;
}

.brief-top-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 6px;
}

.brief-empty {
  min-height: 26px;
  padding: 6px 8px;
  border: 1px dashed #e5e7eb;
  border-radius: 6px;
  color: #c9ced6;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
}

.brief-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  grid-template-rows: 15px 13px;
  column-gap: 6px;
  row-gap: 1px;
  align-items: center;
  min-width: 0;
  min-height: 31px;
  padding: 3px 6px;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.brief-item:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.brief-item strong,
.brief-item em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-item strong {
  color: var(--text);
  font-size: 12px;
  line-height: 15px;
}

.brief-item em {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 13px;
}

.brief-score {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  justify-self: end;
  min-width: 30px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 12px;
  font-weight: 900;
  line-height: 15px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .brief-top-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .brief-list,
  .premarket-brief {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brief-top-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .brief-list,
  .premarket-brief {
    grid-template-columns: minmax(0, 1fr);
  }

  .brief-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.cache-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.cache-title {
  gap: 8px;
}

.cache-details {
  display: grid;
  gap: 8px;
}

.cache-details.collapsed {
  display: none;
}

.cache-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.cache-summary span {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cache-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.cache-policy-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(11, 122, 117, 0.18);
  border-radius: 6px;
  background: #f0fdfa;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.cache-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cache-actions button {
  width: 100%;
  padding: 8px 10px;
}

.hotspot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.hotspot-section {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hotspot-section:nth-child(4n),
.hotspot-section:last-child {
  border-right: 0;
}

.breaking-section {
  grid-column: 1 / -1;
  background: #fff7f7;
}

.breaking-section .hotspot-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: 168px;
}

.market-title {
  margin-bottom: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.hotspot-list {
  display: grid;
  gap: 6px;
  grid-auto-rows: 150px;
}

.hotspot-item {
  display: grid;
  grid-template-rows: 34px 16px 16px 22px 18px 14px;
  align-content: start;
  gap: 3px;
  height: 150px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-left: 3px solid #98a2b3;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
}

.hotspot-item.high {
  border-left-color: var(--danger);
}

.hotspot-item:has(.breaking-badge) {
  border-color: rgba(220, 38, 38, 0.35);
  background: #fffafa;
}

.hotspot-item.medium {
  border-left-color: var(--warning);
}

.hotspot-item strong {
  font-size: 13px;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 4px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #f8fafc;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 900;
  line-height: 14px;
  vertical-align: 1px;
}

.source-badge.official {
  border-color: rgba(22, 163, 74, 0.28);
  background: #ecfdf3;
  color: #067647;
}

.source-badge.multi {
  border-color: rgba(37, 99, 235, 0.25);
  background: #eff6ff;
  color: #175cd3;
}

.source-badge.fast {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fff8eb;
  color: #b45309;
}

.source-badge.signal {
  border-color: rgba(220, 38, 38, 0.25);
  background: #fff1f0;
  color: #b42318;
}

.source-badge.global,
.source-badge.watch {
  border-color: #d0d5dd;
  background: #f8fafc;
  color: #667085;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  padding: 1px 5px;
  border: 1px solid #facc15;
  border-radius: 5px;
  background: #fefce8;
  color: #854d0e;
  font-size: 11px;
  font-weight: 900;
  line-height: 14px;
  vertical-align: 1px;
}

.hotspot-item.pinned {
  border-color: #facc15;
  background: linear-gradient(180deg, #fffef5 0%, #fff 100%);
}

.hotspot-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  min-width: 0;
  align-items: start;
}

.hotspot-score {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 42px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  line-height: 1;
  flex-shrink: 0;
}

.hotspot-score span {
  color: inherit;
  font-size: 17px;
  font-weight: 900;
}

.hotspot-score small {
  margin-left: 1px;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
}

.hotspot-score.high {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff1f0;
  color: var(--danger);
}

.hotspot-score.medium {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fff8eb;
  color: #b45309;
}

.hotspot-score.low {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #175cd3;
}

.hotspot-title-translation {
  width: 100%;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  cursor: default;
}

.hotspot-title-translation:not(:empty) {
  color: #175cd3;
}

.hotspot-title-translation.error {
  color: var(--danger);
}

.breaking-section .hotspot-item {
  grid-template-rows: 50px 16px 16px 22px 18px 14px;
  height: 168px;
}

.breaking-section .hotspot-item strong {
  -webkit-line-clamp: 3;
}

.hotspot-item em {
  color: #0f766e;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breaking-badge {
  display: inline-block;
  margin-right: 6px;
  vertical-align: 1px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
}

.trend-badge {
  display: inline-block;
  margin-right: 6px;
  vertical-align: 1px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  line-height: 1.4;
}

.trend-hot {
  background: #fee4e2;
  color: var(--danger);
}

.trend-new {
  background: #dcfae6;
  color: #05603a;
}

.trend-cooling {
  background: #eef2f6;
  color: var(--low);
}

.gap-badge {
  display: inline-block;
  margin-right: 6px;
  vertical-align: 1px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #fef0c7;
  color: #93370d;
  font-size: 11px;
  line-height: 1.4;
}

.hotspot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  height: 22px;
  overflow: hidden;
}

.hotspot-tags.empty-tags::before {
  content: "";
  display: block;
  height: 22px;
}

.hotspot-tags i {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 999px;
  background: #eef6ff;
  color: #155e75;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.hotspot-item > span,
.hotspot-empty,
.hotspot-explain {
  color: var(--muted);
  font-size: 12px;
}

.monitor-empty {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px dashed #e5e7eb;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.025), rgba(148, 163, 184, 0.018)),
    #fbfcfd;
  color: #d0d5dd;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  animation: monitorPulse 2.2s ease-in-out infinite;
}

.hotspot-list .monitor-empty {
  min-height: 148px;
  flex-direction: column;
  line-height: 1.45;
}

.monitor-empty i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d0d5dd;
  opacity: 0.45;
  animation: monitorDots 1.2s ease-in-out infinite;
}

.monitor-empty i:nth-of-type(2) {
  animation-delay: 0.16s;
}

.monitor-empty i:nth-of-type(3) {
  animation-delay: 0.32s;
}

.empty-section {
  grid-column: 1 / -1;
}

@keyframes monitorPulse {
  0%,
  100% {
    border-color: #e5e7eb;
    box-shadow: inset 0 0 0 rgba(46, 144, 250, 0);
  }
  50% {
    border-color: #e2e8f0;
    box-shadow: inset 0 0 12px rgba(148, 163, 184, 0.045);
  }
}

@keyframes monitorDots {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.hotspot-explain {
  color: #475467;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotspot-item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 40, 0.42);
}

.modal-backdrop.hidden {
  display: none;
}

.hotspot-modal {
  width: min(860px, 96vw);
  max-height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.28);
  overflow: hidden;
}

.admin-modal {
  width: min(980px, 96vw);
  max-height: min(820px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.28);
  overflow: hidden;
}

.admin-login,
.admin-settings {
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow: auto;
}

.admin-login {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.admin-login .hint {
  grid-column: 1 / -1;
}

.admin-settings.hidden,
.admin-panel {
  display: none;
}

.admin-panel.active {
  display: grid;
  gap: 10px;
}

.admin-toolbar,
.admin-section-head,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, 0.08);
}

.admin-section-head h3,
.admin-panel h3 {
  margin: 0;
  font-size: 14px;
}

.admin-rows {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: 42px 92px minmax(130px, 1fr) 74px 94px minmax(90px, 0.8fr) minmax(90px, 0.8fr) 70px 34px;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.admin-row.feishu-row {
  grid-template-columns: 42px minmax(90px, 0.7fr) minmax(220px, 1.4fr) minmax(140px, 1fr) 78px 78px 62px 54px 34px;
}

.admin-row-test {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding-top: 7px;
  border-top: 1px solid rgba(16, 24, 40, 0.06);
}

.admin-test-status {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-test-status.running {
  border-color: rgba(46, 144, 250, 0.24);
  background: #eff8ff;
  color: #175cd3;
}

.admin-test-status.ok {
  border-color: rgba(18, 183, 106, 0.24);
  background: #ecfdf3;
  color: #027a48;
}

.admin-test-status.error {
  border-color: rgba(240, 68, 56, 0.24);
  background: #fff5f5;
  color: var(--danger);
}

.admin-row input,
.admin-row select,
.admin-grid input {
  min-width: 0;
}

.admin-row label,
.admin-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-row .icon-btn {
  min-width: 32px;
  min-height: 32px;
}

.admin-grid {
  display: grid;
  gap: 8px;
}

.admin-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-cache-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-cache-card {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.admin-cache-card strong {
  font-size: 18px;
  line-height: 1.2;
  color: var(--text);
}

.admin-cache-card span {
  font-size: 12px;
  font-weight: 800;
}

.admin-cache-card small,
.admin-cache-policy {
  color: var(--muted);
  font-size: 11px;
}

.admin-cache-card.warn {
  border-color: rgba(183, 110, 0, 0.3);
  background: #fffaf0;
}

.admin-cache-card.bad {
  border-color: rgba(176, 48, 48, 0.3);
  background: #fff5f5;
}

.admin-cache-card.ok strong {
  color: var(--accent);
}

.admin-cache-policy,
.admin-cache-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-cache-policy span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

@media (max-width: 900px) {
  .admin-row,
  .admin-row.feishu-row,
  .admin-grid.four,
  .admin-cache-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.modal-head h2 {
  font-size: 16px;
  line-height: 1.35;
}

.modal-head p,
.detail-muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  overflow: auto;
}

.detail-kpis,
.detail-tags,
.detail-sources,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-kpis span,
.detail-tags i,
.detail-sources span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.detail-section {
  display: grid;
  gap: 8px;
}

.title-translation-section {
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  background: #f8fbff;
}

.detail-section h3 {
  font-size: 13px;
}

.detail-section p {
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}

.detail-full-title {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 800;
  line-height: 1.6 !important;
  white-space: normal;
  overflow-wrap: anywhere;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.impact-grid div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.impact-grid strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
}

.impact-grid span {
  color: #344054;
  font-size: 12px;
  line-height: 1.45;
}

.trigger-box,
.detail-list-block {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  background: #f8fbff;
}

.trigger-box strong,
.detail-list-block strong {
  color: var(--text);
  font-size: 12px;
}

.trigger-box span,
.trigger-box em,
.detail-list-block p {
  margin: 0;
  color: #344054;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.trigger-box em {
  color: var(--muted);
  font-style: normal;
}

.detail-translation {
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-translation.error {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.25);
  background: #fffafa;
}

.article-section {
  padding: 10px;
  border: 1px solid #d1fae5;
  border-radius: 6px;
  background: #fbfffd;
}

.article-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.article-head h3 {
  margin: 0;
}

.article-source-hint {
  margin: -2px 0 8px !important;
  color: #98a2b3 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

.article-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.article-actions select {
  width: min(280px, 100%);
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.article-actions button {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.article-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.article-content {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.article-content h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.article-content small,
.article-status {
  color: var(--muted);
  font-size: 12px;
}

.article-content p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.article-content .article-desc {
  padding: 8px;
  border-left: 3px solid var(--accent);
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
}

.article-translation {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
}

.article-translation strong {
  color: #175cd3;
  font-size: 13px;
}

.article-translate-error {
  color: var(--danger);
  font-weight: 800;
}

.article-content.error {
  border-color: rgba(220, 38, 38, 0.25);
  background: #fffafa;
}

.article-content.error .article-status {
  color: var(--danger);
}

.timeline-list {
  display: grid;
  gap: 6px;
}

.timeline-list a {
  display: grid;
  grid-template-columns: 100px 120px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.timeline-list span,
.timeline-list strong,
.timeline-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.timeline-list span {
  color: var(--muted);
}

.timeline-list em {
  color: #344054;
  font-style: normal;
}

.detail-actions a,
.detail-actions button {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.detail-actions button:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: wait;
}

.feed-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: calc(100vh - 230px);
}

.feed-pane {
  min-width: 0;
}

.feed-pane:first-child {
  border-right: 1px solid var(--line);
}

.feed-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 76px;
  z-index: 1;
}

.feed-title h2 {
  font-size: 14px;
}

.feed-title span {
  color: var(--muted);
  font-size: 12px;
}

.item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.item:last-child {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.high {
  background: #fee4e2;
  color: var(--danger);
}

.medium {
  background: #fef0c7;
  color: var(--warning);
}

.low {
  background: #eef2f6;
  color: var(--low);
}

.item-title {
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  text-decoration: none;
  font-weight: 700;
}

.item-title:hover {
  color: var(--accent);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.summary {
  margin-top: 8px;
  color: #344054;
  font-size: 13px;
  line-height: 1.5;
}

.translation {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f0fdfa;
  color: #1d2939;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.translation-error {
  border-left-color: var(--danger);
  background: #fff1f3;
  color: var(--danger);
}

.side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  overflow: hidden;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats div {
  min-width: 0;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.stats div:last-child {
  border-right: 0;
}

.stats span {
  display: block;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.sources,
.alerts,
.health-list,
.api-quota-list,
.quality-list,
.self-check-list,
.readability-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.self-check-list {
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 16px;
}

.panel-title-row h2 {
  margin: 0;
}

.panel-title-row button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}

.quota-row,
.quality-row,
.self-check-row,
.readability-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  overflow: hidden;
}

.quota-row div,
.quality-row div {
  min-width: 0;
}

.quota-row strong,
.quality-row strong,
.self-check-row strong,
.readability-row strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quota-row small,
.quality-row small,
.self-check-row small,
.readability-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quota-row > span,
.quality-row > span,
.self-check-row > span,
.readability-row > span {
  align-self: start;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef6ff;
  color: #155eef;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.self-check-row.ok > span,
.readability-row.ok > span {
  background: #ecfdf3;
  color: #067647;
}

.self-check-row.running > span,
.readability-row.warn > span {
  background: #fff8eb;
  color: #b45309;
}

.self-check-row.error > span,
.readability-row.error > span {
  background: #fff1f0;
  color: #b42318;
}

.quota-row i {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2e90fa var(--quota), #eef2f6 var(--quota));
}

.quota-row em {
  position: absolute;
  right: 10px;
  bottom: 16px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.quota-row.protected > span {
  background: #fef0c7;
  color: var(--warning);
}

.quota-boost {
  padding: 7px 9px;
  border: 1px solid #fec84b;
  border-radius: 6px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}

.quality-row.good > span {
  background: #dcfae6;
  color: #05603a;
}

.quality-row.mid > span {
  background: #eef6ff;
  color: #175cd3;
}

.quality-row.watch > span {
  background: #fef0c7;
  color: var(--warning);
}

.health-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.health-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  text-align: center;
}

.health-summary b {
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.health-summary em {
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.health-summary .ok {
  background: #f0fdf4;
  border-color: rgba(18, 183, 106, 0.2);
}

.health-summary .running {
  background: #eff6ff;
  border-color: rgba(46, 144, 250, 0.22);
}

.health-summary .cooldown {
  background: #fffbeb;
  border-color: rgba(247, 144, 9, 0.22);
}

.health-summary .error {
  background: #fff5f5;
  border-color: rgba(240, 68, 56, 0.22);
}

.proxy-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.proxy-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.proxy-title span {
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.proxy-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 8px;
}

.proxy-summary .icon-btn {
  justify-self: end;
}

.proxy-enable {
  justify-content: flex-start;
  width: 100%;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.state-pill.off {
  background: #eef2f6;
  color: #475467;
}

.state-pill.on {
  background: #ecfdf3;
  color: #027a48;
}

.state-pill.ok {
  background: #dcfae6;
  color: #05603a;
}

.state-pill.warn {
  background: #fef0c7;
  color: var(--warning);
}

.state-pill.error {
  background: #fee4e2;
  color: var(--danger);
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.proxy-details {
  display: grid;
  gap: 10px;
}

.proxy-details.collapsed {
  display: none;
}

.proxy-grid {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 58px;
  gap: 8px;
}

.proxy-grid input:nth-of-type(3),
.proxy-grid input:nth-of-type(4) {
  grid-column: span 3;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.check-row input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.proxy-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.proxy-actions #testProxy {
  min-width: 112px;
}

.source-row,
.alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #344054;
  font-size: 13px;
}

.source-row strong,
.alert-row strong {
  color: var(--text);
}

.health-rows {
  display: grid;
  gap: 7px;
  max-height: 520px;
  padding-right: 2px;
  overflow: auto;
}

.health-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
}

.health-row.running {
  border-color: rgba(46, 144, 250, 0.24);
  background: #fbfdff;
}

.health-row.error {
  border-color: rgba(240, 68, 56, 0.22);
  background: #fffafa;
}

.health-row.cooldown {
  border-color: rgba(247, 144, 9, 0.24);
  background: #fffdf7;
}

.health-main {
  min-width: 0;
}

.health-main strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-side {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 74px;
  max-width: 104px;
}

.health-side em {
  max-width: 104px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: #475467;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.health-pill.ok {
  background: #dcfae6;
  color: #05603a;
}

.health-pill.running {
  background: #d1e9ff;
  color: #175cd3;
}

.health-pill.error,
.health-pill.failed {
  background: #fee4e2;
  color: var(--danger);
}

.health-pill.cooldown {
  background: #fef0c7;
  color: var(--warning);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98a2b3;
}

.health-dot.ok {
  background: #12b76a;
}

.health-dot.running {
  background: #2e90fa;
  box-shadow: 0 0 0 4px rgba(46, 144, 250, 0.12);
}

.health-dot.error,
.health-dot.failed {
  background: #f04438;
}

.health-dot.cooldown {
  background: #f79009;
}

.dot {
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border-radius: 50%;
  background: #98a2b3;
  flex: 0 0 auto;
}

.dot.ok {
  background: #12b76a;
}

.dot.running {
  background: #2e90fa;
}

.dot.error {
  background: #f04438;
}

.dot.cooldown {
  background: #f79009;
}

.empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.toast {
  animation: flash 1.2s ease-out;
}

@keyframes flash {
  from {
    background: #e6fffb;
  }
  to {
    background: transparent;
  }
}

@media (max-width: 860px) {
  .topbar {
    padding: 14px 16px;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 14px 16px 22px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .hotspot-toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hotspot-grid {
    grid-template-columns: 1fr;
  }

  .hotspot-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .feed-columns {
    grid-template-columns: 1fr;
  }

  .feed-pane:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .feed-title {
    position: static;
  }

  .item {
    grid-template-columns: 1fr;
  }

  .badge {
    width: max-content;
    padding: 0 12px;
  }
}
