* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  font-family: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  color: #17212b;
  background:
    radial-gradient(circle at top left, rgba(255, 222, 173, 0.65), transparent 28%),
    radial-gradient(circle at top right, rgba(147, 197, 253, 0.35), transparent 24%),
    linear-gradient(180deg, #f8f4ed 0%, #eef3f8 100%);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card,
.card,
.task-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(23, 33, 43, 0.08);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(23, 33, 43, 0.08);
  backdrop-filter: blur(12px);
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
}

.page-header,
.card,
.task-card {
  padding: 20px 22px;
}

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

.header-actions,
.task-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  align-items: center;
}

.card {
  margin-bottom: 18px;
}

.create-panel[hidden] {
  display: none;
}

.task-list {
  display: grid;
  gap: 18px;
}

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

.task-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1580px;
}

.task-table th,
.task-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(23, 33, 43, 0.08);
  vertical-align: top;
  text-align: left;
}

.task-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 250, 252, 0.98);
  font-size: 12px;
  color: #64748b;
  letter-spacing: 0.02em;
}

.task-row {
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.task-row.selected {
  background: rgba(219, 234, 254, 0.45);
  box-shadow: inset 4px 0 0 #1d4ed8;
}

.task-row:hover {
  background: rgba(255, 255, 255, 0.7);
}

.select-cell {
  width: 64px;
}

.task-main {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.task-subtext {
  font-size: 13px;
  color: #566272;
}

.rss-proxy-meta {
  margin-top: 8px;
}

.rss-proxy-meta a {
  color: #0f766e;
  text-decoration: none;
  word-break: break-all;
}

.rss-proxy-meta a:hover {
  text-decoration: underline;
}

.task-card.enabled {
  border-left: 6px solid #0f766e;
}

.task-card.disabled {
  border-left: 6px solid #9ca3af;
}

.task-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.section-hint {
  margin-bottom: 14px;
  color: #566272;
}

h1 {
  font-size: 28px;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.muted {
  color: #566272;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-chip.pending {
  background: #fff1bf;
  color: #92400e;
}

.status-chip.synced {
  background: #d9f7eb;
  color: #0e5a41;
}

.status-chip.warn {
  background: #fde8e8;
  color: #9b1c1c;
}

.status-chip.running {
  background: #dbeafe;
  color: #1d4ed8;
}

.field-button {
  width: 100%;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #cdd6df;
  background: #f8fafc;
  color: #17212b;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-button.short-field {
  max-width: 160px;
}

.inline-input {
  min-width: 120px;
}

.interval-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.interval-input {
  width: 88px;
}

.error-cell {
  max-width: 260px;
  color: #9b1c1c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-cell {
  min-width: 190px;
  font-weight: 600;
  color: #1f2937;
}

.create-grid,
.task-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  color: #314050;
}

input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid #cdd6df;
  background: #fff;
  color: #17212b;
}

input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: #0f766e;
}

button {
  padding: 11px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e 0%, #0b5f64 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: #e7edf3;
  color: #203040;
}

.form-end {
  display: flex;
  align-items: end;
}

.meta-grid {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
}

.meta-grid div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f7fb;
}

dt {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

dd {
  margin: 0;
  font-size: 14px;
  word-break: break-word;
}

.mono {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 12px;
}

.flash-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
}

.flash.success {
  background: #d9f7eb;
  color: #0e5a41;
}

.flash.info {
  background: #e0f2fe;
  color: #0c4a6e;
}

.flash.error,
.error-text {
  color: #9b1c1c;
}

.flash.error {
  background: #fde8e8;
}

.field-dialog {
  width: min(720px, calc(100vw - 24px));
  border: none;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.field-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.field-dialog-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.field-dialog-form textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #cdd6df;
  font: inherit;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 900px) {
  body {
    padding: 14px;
  }

  .page-header,
  .task-card-header {
    flex-direction: column;
  }

  .field-button {
    max-width: 160px;
  }
}
