:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #d9e0ea;
  --text: #172033;
  --muted: #667085;
  --brand: #1f6feb;
  --brand-dark: #174ea6;
  --green: #138a5b;
  --amber: #a56200;
  --red: #c2413b;
  --shadow: 0 18px 45px rgba(20, 33, 61, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial,
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  color: #e8eef8;
  background: #172033;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #2d7df0;
  font-weight: 800;
}

.brand-name {
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 3px;
  color: #aeb9c9;
  font-size: 12px;
}

.nav-list,
.sidebar-section {
  display: grid;
  gap: 8px;
}

.section-title {
  margin: 10px 10px 4px;
  color: #9ca8ba;
  font-size: 12px;
}

.nav-item,
.quick-filter {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.quick-filter:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active,
.quick-filter.active {
  color: #ffffff;
  background: rgba(45, 125, 240, 0.25);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.primary-action {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--brand);
  border-radius: 7px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 600;
}

.primary-action:hover {
  background: var(--brand-dark);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-label,
.metric-note {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 28px;
}

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

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, 128px) 138px 158px;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: var(--text);
  background: #ffffff;
}

input:focus,
select:focus {
  outline: 2px solid rgba(31, 111, 235, 0.18);
  border-color: var(--brand);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: #475467;
  background: #fbfcfe;
  font-size: 12px;
  font-weight: 700;
}

tbody tr:hover {
  background: #f7fbff;
}

.title-cell {
  max-width: 380px;
  font-weight: 650;
  line-height: 1.45;
}

.source-cell,
.time-cell {
  color: #475467;
  white-space: nowrap;
}

.region-pill,
.category-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.region-pill {
  color: #314366;
  background: #e8eef8;
}

.category-pill.talk {
  color: #8f2f28;
  background: #ffe3df;
}

.category-pill.penalty {
  color: #7a2e0e;
  background: #ffe8d6;
}

.category-pill.launch {
  color: #174ea6;
  background: #e0edff;
}

.category-pill.bid {
  color: #7a4a00;
  background: #fff0c9;
}

.category-pill.notice {
  color: #164b35;
  background: #dff3e9;
}

.category-pill.other {
  color: #475467;
  background: #eef2f7;
}

.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.view-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #b7c5d8;
  border-radius: 7px;
  color: #1d3557;
  background: #ffffff;
  white-space: nowrap;
}

.view-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.empty-state {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 54px 20px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}


.source-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.42);
}

.source-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.source-modal-card {
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.modal-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
}

.modal-open {
  overflow: hidden;
}

.import-modal-card {
  width: min(1080px, 100%);
}

.import-modal-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.import-file-state,
.import-result {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
  white-space: pre-line;
}

.import-preview-wrap {
  max-height: 320px;
  overflow: auto;
}

.import-preview-table {
  min-width: 980px;
}

.import-preview-table th,
.import-preview-table td {
  font-size: 12px;
}

.import-modal-actions {
  padding-top: 2px;
}

.crawl-result-modal-card {
  width: min(920px, 100%);
}

.crawl-result-body {
  display: grid;
  gap: 14px;
  max-height: min(580px, calc(100vh - 210px));
  overflow: auto;
  padding: 16px 18px;
  user-select: text;
}

.crawl-result-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 12px;
}

.crawl-result-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.crawl-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.crawl-result-metric {
  display: grid;
  gap: 4px;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
}

.crawl-result-metric span {
  color: var(--muted);
  font-size: 12px;
}

.crawl-result-metric strong {
  color: var(--text);
  font-size: 20px;
}

.crawl-result-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crawl-result-item {
  display: grid;
  gap: 5px;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #ffffff;
  padding: 9px 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.crawl-result-item code,
.crawl-result-link {
  color: #174ea6;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.crawl-result-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.crawl-result-actions {
  padding: 0 18px 18px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.38);
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(640px, 100vw);
  height: 100vh;
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 180ms ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.drawer-header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}

.icon-button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #344054;
  background: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.drawer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid #edf1f6;
}

.status-pill {
  color: #475467;
  background: #f1f5f9;
}

.drawer-body {
  overflow-y: auto;
  padding: 22px 24px 42px;
  line-height: 1.8;
}

.drawer-body p {
  margin: 0 0 14px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 8px;
  padding: 0 12px;
  border: 1px solid #b7c5d8;
  border-radius: 7px;
  color: #174ea6;
  background: #f7fbff;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.source-link:hover {
  border-color: var(--brand);
  background: #eef6ff;
}

.drawer-body h3 {
  margin: 22px 0 10px;
  font-size: 16px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px;
  }

  .nav-list,
  .sidebar-section {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
  }

  .workspace {
    padding: 18px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .source-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-controls {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .topbar,
  .drawer-header {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action {
    width: 100%;
  }

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

  .metric {
    min-height: 96px;
  }
}



.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 18px;
}

.panel-title-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.source-view {
  display: grid;
  gap: 18px;
}

.source-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.source-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.source-form .wide-field {
  grid-column: span 2;
}

.source-form .full-field {
  grid-column: 1 / -1;
}

.source-form textarea {
  min-height: 112px;
  resize: vertical;
  border: 1px solid #c8d4e6;
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
}

.news-edit-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-form button {
  align-self: end;
}

.source-toolbar {
  grid-template-columns: minmax(260px, 1fr) 150px 170px;
}

.source-table {
  min-width: 1280px;
}

.source-url {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  color: #174ea6;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.source-url:hover {
  text-decoration: underline;
}

.source-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-controls select {
  min-width: 86px;
  height: 32px;
  border: 1px solid #c8d4e6;
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
}

.pagination-current {
  min-width: 58px;
  text-align: center;
  color: var(--text);
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.source-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.secondary-action,
.danger-action {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  background: #ffffff;
  font-size: 13px;
}

.secondary-action {
  border: 1px solid #b7c5d8;
  color: #1d3557;
}

.secondary-action:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.danger-action {
  border: 1px solid #f0b5ae;
  color: var(--red);
}

.danger-action:hover {
  background: #fff5f3;
}

.status-pill.normal {
  color: #164b35;
  background: #dff3e9;
}

.status-pill.warning {
  color: #7a4a00;
  background: #fff0c9;
}

.status-pill.off {
  color: #667085;
  background: #eef2f7;
}

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

  .source-form .wide-field {
    grid-column: span 2;
  }

  .source-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .source-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-controls {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .source-form,
  .source-toolbar {
    grid-template-columns: 1fr;
  }

  .source-form .wide-field {
    grid-column: auto;
  }
}

[hidden] {
  display: none !important;
}


.status-pill.error {
  color: #8f2f28;
  background: #ffe3df;
}

.content-count {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}


.news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
}

.input-with-unit input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  font: inherit;
  background: transparent;
}

.input-with-unit span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.panel-heading p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.account-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
}

.account-form input {
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
}

.account-form button {
  height: 38px;
}

@media (max-width: 900px) {
  .account-form {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
.compact-modal-card {
  max-width: 560px;
}

.compact-modal-card .source-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .compact-modal-card .source-form {
    grid-template-columns: 1fr;
  }
}
