:root {
  color-scheme: dark;
  --bg: #111614;
  --panel: #1a211f;
  --panel-strong: #252f2c;
  --input: #141a18;
  --control: #283632;
  --control-hover: #344640;
  --ink: #edf4f1;
  --muted: #a5b5b0;
  --line: #36443f;
  --accent: #42b892;
  --accent-strong: #70d2b2;
  --button-ink: #07130f;
  --warn: #f0a35b;
  --danger: #ff858c;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

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

.app-locked .shell {
  visibility: hidden;
}

.pin-gate {
  align-items: center;
  background: var(--bg);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 1000;
}

.app-locked .pin-gate {
  display: flex;
}

.app-cloud .local-only {
  display: none;
}

.setup-dialog {
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 20px;
  width: min(100%, 420px);
}

.setup-dialog::backdrop {
  background: rgba(3, 8, 7, 0.78);
}

.setup-dialog__content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  padding: 24px;
}

.setup-dialog__content h2 {
  font-size: 24px;
}

.setup-dialog__content > p:not(.eyebrow) {
  color: var(--muted);
}

.setup-dialog__actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.pin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  max-width: 380px;
  padding: 28px;
  width: 100%;
}

.pin-panel h1 {
  font-size: 28px;
  line-height: 1.15;
}

.pin-panel__hint,
.pin-message {
  color: var(--muted);
  font-size: 14px;
}

.pin-field {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.pin-field input {
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 24px;
  height: 48px;
  letter-spacing: 0;
  padding: 0 12px;
  text-align: center;
}

.pin-message {
  color: var(--warn);
  min-height: 21px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--button-ink);
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary-button {
  background: var(--control);
  color: var(--accent-strong);
}

button.secondary-button:hover {
  background: var(--control-hover);
}

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

button.pause-button {
  background: #47545d;
  color: #fff;
}

button.pause-button:hover {
  background: #596872;
}

button.pause-button.is-paused {
  background: #287254;
}

button.pause-button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.toolbar {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

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

h1 {
  font-size: 42px;
  letter-spacing: 0;
  line-height: 1.08;
}

h2 {
  font-size: 16px;
}

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

.title-block {
  flex: 0 0 360px;
}

.shared-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-height: 40px;
  align-items: center;
  display: inline-flex;
}

.shared-status.is-synced {
  color: var(--accent);
}

.sort-control {
  background: var(--control);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 2px;
  padding: 3px;
}

.sort-button {
  background: transparent;
  color: var(--accent-strong);
  min-height: 34px;
  padding: 0 12px;
}

.sort-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sort-button.is-active {
  background: var(--panel);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

.startup-toggle {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  min-height: 40px;
}

.startup-toggle input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.startup-toggle__track {
  background: #43514d;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 24px;
  padding: 3px;
  transition: background 0.18s ease;
  width: 44px;
}

.startup-toggle__track::after {
  background: #e9f1ee;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  content: "";
  height: 18px;
  transition: transform 0.18s ease;
  width: 18px;
}

.startup-toggle input:checked + .startup-toggle__track {
  background: var(--accent);
}

.startup-toggle input:checked + .startup-toggle__track::after {
  transform: translateX(20px);
}

.startup-toggle input:disabled + .startup-toggle__track {
  opacity: 0.55;
}

.search {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.search input {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  height: 40px;
  min-width: 260px;
  padding: 0 12px;
}

.url-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  padding: 16px;
}

.url-panel__head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.add-url-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.add-url-row input {
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  height: 40px;
  min-width: 0;
  padding: 0 12px;
}

.url-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  max-height: 280px;
  overflow: auto;
}

.url-list__empty {
  color: var(--muted);
  font-size: 13px;
  padding: 18px 12px;
  text-align: center;
}

.url-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 36px;
  min-height: 42px;
  padding: 6px 8px 6px 12px;
}

.url-row + .url-row {
  border-top: 1px solid var(--line);
}

.url-row__link {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-row__link:hover {
  color: var(--accent-strong);
}

.icon-button {
  background: var(--control);
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 800;
  height: 32px;
  min-height: 32px;
  padding: 0;
  width: 32px;
}

.danger-button {
  color: var(--danger);
}

.icon-button:hover {
  background: var(--control-hover);
}

.batch-editor {
  margin-top: 12px;
}

.batch-editor summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.url-panel textarea {
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  min-height: 112px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.summary {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  gap: 12px;
  justify-content: space-between;
  margin: 16px 2px;
}

.creator-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.creator-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  min-height: 278px;
  overflow: hidden;
  padding: 14px;
}

.creator-card.is-loading {
  background: linear-gradient(110deg, var(--panel) 0%, var(--panel-strong) 45%, var(--panel) 90%);
}

.creator-card.has-error {
  border-color: rgba(173, 91, 29, 0.4);
}

.creator-card__top {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 58px minmax(0, 1fr) 40px;
  margin-bottom: 14px;
}

.avatar-link,
.avatar {
  border-radius: 50%;
  display: block;
  height: 58px;
  width: 58px;
}

.avatar {
  background: var(--panel-strong);
  object-fit: cover;
}

.creator-meta {
  min-width: 0;
}

.creator-meta__line {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.creator-meta h3 {
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-dot {
  background: #d91f2d;
  border: 2px solid var(--panel);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(217, 31, 45, 0.18);
  display: none;
  flex: 0 0 auto;
  height: 10px;
  width: 10px;
}

.has-today-update .today-dot {
  display: inline-block;
}

.post-count {
  background: var(--panel-strong);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  padding: 4px 8px;
}

.source-link,
.latest-time,
.refresh-time {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.refresh-time {
  color: var(--muted);
  font-size: 12px;
}

.is-stale .refresh-time {
  color: var(--warn);
}

.refresh-button {
  background: var(--control);
  color: var(--accent-strong);
  font-size: 20px;
  height: 40px;
  padding: 0;
  width: 40px;
}

.refresh-button:hover {
  background: var(--control-hover);
}

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

.cover {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  min-height: 160px;
  overflow: hidden;
  position: relative;
  text-decoration: none;
}

.cover img {
  aspect-ratio: 4 / 5;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.cover span {
  align-self: end;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  bottom: 0;
  color: #fff;
  display: -webkit-box;
  font-size: 12px;
  left: 0;
  line-height: 1.35;
  overflow: hidden;
  padding: 34px 8px 8px;
  position: absolute;
  right: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cover--empty {
  align-items: center;
  display: flex;
  font-size: 13px;
  justify-content: center;
  padding: 12px;
  text-align: center;
}

.card-message {
  color: var(--warn);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

@media (max-width: 760px) {
  h1 {
    font-size: 32px;
  }

  .title-block {
    flex-basis: auto;
  }

  .shell {
    width: min(100% - 20px, 680px);
    padding-top: 18px;
  }

  .toolbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search input {
    min-width: 0;
    width: 100%;
  }

  .add-url-row {
    grid-template-columns: 1fr;
  }

  .setup-dialog__actions {
    grid-template-columns: 1fr;
  }

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

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

  .cover img {
    aspect-ratio: 16 / 10;
  }
}
