:root {
  color-scheme: dark;
  --bg: #070a0f;
  --bg-soft: #0b111a;
  --surface: #101720;
  --surface-strong: #151f2c;
  --surface-hover: #182334;
  --text: #e7edf5;
  --muted: #8b98aa;
  --muted-strong: #aeb8c7;
  --border: #243244;
  --border-strong: #35506b;
  --blue: #4ea1ff;
  --blue-strong: #2f7ff6;
  --cyan: #2dd4bf;
  --green: #22c55e;
  --red: #ef5350;
  --amber: #f59e0b;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  --glow: 0 0 0 1px rgba(78, 161, 255, 0.18), 0 18px 48px rgba(25, 118, 210, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(78, 161, 255, 0.18), transparent 32rem),
    radial-gradient(circle at 75% 10%, rgba(45, 212, 191, 0.12), transparent 28rem),
    linear-gradient(180deg, #08101a 0%, var(--bg) 42%, #05070a 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.link-button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(16, 23, 32, 0.9);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

button:hover,
.link-button:hover {
  border-color: var(--blue);
  background: var(--surface-hover);
}

button:active {
  transform: translateY(1px);
}

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

button.primary {
  border-color: rgba(78, 161, 255, 0.55);
  background: linear-gradient(180deg, #2f7ff6 0%, #1d5ed8 100%);
  color: #fff;
  box-shadow: 0 0 22px rgba(47, 127, 246, 0.24);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 30px 16px;
  background: rgba(7, 10, 15, 0.72);
  border-bottom: 1px solid rgba(53, 80, 107, 0.5);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  letter-spacing: 0;
}

.topbar h1 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar h1::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.9);
}

.topbar p,
.view-head p,
.panel p {
  color: var(--muted);
  margin-top: 5px;
}

.actions,
.filters,
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 30px 0;
  background: rgba(7, 10, 15, 0.58);
  border-bottom: 1px solid rgba(53, 80, 107, 0.42);
  overflow-x: auto;
  backdrop-filter: blur(18px);
}

.tab {
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted-strong);
  min-width: 92px;
  height: 44px;
}

.tab:hover {
  border-color: rgba(78, 161, 255, 0.22);
}

.tab.active {
  border-color: rgba(78, 161, 255, 0.36);
  border-bottom-color: var(--blue);
  background: rgba(78, 161, 255, 0.1);
  color: var(--text);
  font-weight: 700;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(7, 10, 15, 0.72);
  color: var(--text);
  padding: 9px 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: rgba(11, 17, 26, 0.96);
  box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.13);
}

input::placeholder,
textarea::placeholder {
  color: #657386;
}

textarea {
  resize: vertical;
}

.filters input,
.filters select {
  width: 190px;
}

.status {
  border: 1px solid rgba(78, 161, 255, 0.32);
  border-radius: 8px;
  background: rgba(16, 23, 32, 0.78);
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.status.error {
  border-color: rgba(239, 83, 80, 0.6);
  color: #ffaaa8;
}

.fetch-progress {
  border: 1px solid rgba(78, 161, 255, 0.32);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 31, 48, 0.92), rgba(12, 19, 29, 0.92));
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: var(--glow);
}

.progress-head,
.progress-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #c8d8ec;
  font-size: 14px;
}

.progress-detail {
  color: var(--muted);
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(53, 80, 107, 0.72);
  margin: 10px 0;
}

.progress-bar div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.4);
  transition: width 0.25s ease;
}

.item-list {
  display: grid;
  gap: 0;
  border: 1px solid rgba(36, 50, 68, 0.92);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(8, 12, 18, 0.78);
  box-shadow: var(--shadow);
}

.item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 18px;
  padding: 16px 18px 17px;
  border-bottom: 1px solid rgba(36, 50, 68, 0.86);
  background: rgba(10, 15, 23, 0.72);
  transition: background 0.18s ease;
}

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

.item:hover {
  background: rgba(15, 24, 36, 0.92);
}

.item-time {
  color: var(--muted);
  display: grid;
  align-content: start;
  gap: 3px;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.item-day {
  color: #c9d4e3;
  font-size: 13px;
}

.item-clock {
  color: #778599;
  font-size: 20px;
  line-height: 1.05;
  font-weight: 760;
}

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

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

.source-name {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.3;
}

.item-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 720;
  line-height: 1.36;
  font-size: 18px;
}

.item-title:hover {
  color: #91c6ff;
}

.original-title {
  color: #748297;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
}

.summary {
  margin-top: 8px;
  color: #bdc8d7;
  line-height: 1.58;
  font-size: 14px;
}

.meta,
.badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.score {
  min-width: 68px;
  height: 26px;
  border: 1px solid rgba(34, 197, 94, 0.46);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 760;
  color: #eafff1;
  background: rgba(34, 197, 94, 0.16);
  box-shadow: inset 0 0 18px rgba(34, 197, 94, 0.08);
  white-space: nowrap;
}

.score.high {
  border-color: rgba(239, 83, 80, 0.58);
  color: #ffe7e7;
  background: rgba(239, 83, 80, 0.18);
}

.badge {
  border: 1px solid rgba(53, 80, 107, 0.72);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(21, 31, 44, 0.72);
  color: #c4d0df;
}

.recommendation {
  border-top: 1px solid rgba(36, 50, 68, 0.72);
  margin-top: 12px;
  padding-top: 11px;
  color: #c9d4e3;
  font-size: 14px;
  line-height: 1.55;
}

.expert-box {
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.055);
  margin-top: 12px;
  padding: 12px;
}

.expert-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #d9f6f2;
  font-size: 14px;
}

.expert-head span {
  color: var(--cyan);
  font-weight: 760;
  white-space: nowrap;
}

.expert-box p {
  color: #b9c7d6;
  line-height: 1.58;
  margin-top: 7px;
  font-size: 14px;
}

.dimensions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.dimension-pill {
  border: 1px solid rgba(53, 80, 107, 0.72);
  border-radius: 999px;
  background: rgba(7, 10, 15, 0.42);
  color: #b7c7d8;
  font-size: 12px;
  padding: 2px 8px;
}

.daily {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 23, 32, 0.96), rgba(10, 15, 23, 0.96));
  padding: 18px;
  box-shadow: var(--shadow);
}

.daily-lead {
  padding: 12px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 6px 6px 0;
  background: rgba(45, 212, 191, 0.08);
  color: #d9f6f2;
  margin: 12px 0 18px;
  line-height: 1.6;
}

.daily-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.daily-item {
  margin-top: 10px;
  line-height: 1.58;
}

.daily-item a {
  color: #91c6ff;
  font-weight: 700;
  text-decoration: none;
}

.daily-item p {
  color: #bdc8d7;
  margin-top: 4px;
}

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

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 23, 32, 0.95), rgba(10, 15, 23, 0.95));
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel.wide {
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #c5cfdd;
  font-weight: 650;
  margin-top: 12px;
}

form button {
  margin-top: 14px;
}

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

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.config-cell {
  border: 1px solid rgba(53, 80, 107, 0.72);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.42);
  padding: 11px;
  min-width: 0;
}

.config-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.config-cell strong {
  color: var(--text);
  word-break: break-all;
}

.setup-steps {
  margin-top: 14px;
  color: #c5cfdd;
  line-height: 1.65;
}

.setup-steps ol {
  margin: 8px 0 0;
  padding-left: 20px;
}

code {
  border: 1px solid rgba(53, 80, 107, 0.72);
  border-radius: 5px;
  background: rgba(7, 10, 15, 0.64);
  color: #dbeafe;
  padding: 1px 5px;
}

.llm-form {
  border-top: 1px solid rgba(36, 50, 68, 0.72);
  margin-top: 14px;
  padding-top: 4px;
}

.checkbox-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.source-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.source-row small {
  color: var(--muted);
  word-break: break-all;
  display: block;
  margin-top: 3px;
}

@media (max-width: 760px) {
  .topbar,
  .view-head,
  .item,
  .source-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    position: static;
    padding: 18px 16px 14px;
  }

  .tabs {
    padding: 8px 16px 0;
  }

  .filters,
  .actions,
  .progress-head,
  .progress-detail {
    width: 100%;
  }

  .filters input,
  .filters select,
  .actions button {
    width: 100%;
  }

  .split,
  .form-grid,
  .config-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 16px;
  }
}
