:root {
  color: #1f2430;
  background: #f6f7fb;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

* { box-sizing: border-box; }

body { margin: 0; }

button, input { font: inherit; }

.page {
  width: min(48rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.heading h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.25;
}

.heading p {
  margin: 0.4rem 0 0;
  color: #667085;
  font-size: 0.875rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tool {
  height: 2.25rem;
  border: 1px solid #e6e8ee;
  border-radius: 0.75rem;
  background: #fff;
  color: #344054;
  padding: 0 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.tool:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #fef3f2;
  color: #b42318;
  font-size: 0.875rem;
}

.search {
  position: relative;
  display: block;
  margin-top: 1.5rem;
}

.search span {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #98a2b3;
}

.search input {
  width: 100%;
  height: 3rem;
  border: 1px solid #e6e8ee;
  border-radius: 1rem;
  background: #fff;
  padding: 0 1rem 0 2.5rem;
  outline: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.filters button {
  height: 2.25rem;
  border: 1px solid #e6e8ee;
  border-radius: 999px;
  background: #fff;
  color: #475467;
  padding: 0 1rem;
  cursor: pointer;
}

.filters button.is-on {
  border-color: #1f2430;
  background: #1f2430;
  color: #fff;
  font-weight: 600;
}

.count {
  margin: 1rem 0 0;
  color: #98a2b3;
  font-size: 0.875rem;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.empty {
  border: 1px dashed #e6e8ee;
  border-radius: 1rem;
  background: #fff;
  padding: 3rem 1.25rem;
  text-align: center;
  color: #98a2b3;
  font-size: 0.875rem;
}

.card {
  border: 1px solid #e6e8ee;
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  height: 1.75rem;
  margin-top: 0.125rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  background: #f2f4f7;
  color: #667085;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 700;
}

.card-meta {
  min-width: 0;
  flex: 1;
}

.card h2 {
  margin: 0.125rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}

.progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.4rem 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 1.4rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.pill-done {
  background: #079455;
  color: #fff;
}

.pill-airing {
  background: #dc6803;
  color: #fff;
}

.pill-episode {
  background: #f2f4f7;
  color: #344054;
}

.copy-all {
  height: 2rem;
  flex-shrink: 0;
  border: 0;
  border-radius: 0.5rem;
  background: #e8f3ff;
  color: #2f6fed;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-all:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pans {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pans button {
  height: 2.75rem;
  border: 0;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.pans button:disabled {
  background: #f4f5f7;
  color: #d0d5dd;
  cursor: not-allowed;
}

.pans .quark { background: #e8f3ff; color: #2f6fed; }
.pans .baidu { background: #e8f8ef; color: #128a45; }
.pans .xunlei { background: #fff6e5; color: #c56a00; }

.hint {
  margin: 0.75rem 0 0;
  text-align: right;
  color: #98a2b3;
  font-size: 0.75rem;
}

.toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  z-index: 40;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #12b76a;
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.16);
}

.modal[hidden] {
  display: none;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(44rem, 100%);
  max-height: min(80dvh, 36rem);
  overflow: auto;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid #e6e8ee;
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.18);
  padding: 1rem 1.1rem 1.25rem;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: #f2f4f7;
  color: #475467;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.today-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.today-empty {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: #98a2b3;
  font-size: 0.875rem;
}

.today-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid #eef0f4;
  border-radius: 0.85rem;
  background: #fff;
}

.today-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 14rem;
  margin-right: auto;
}

.today-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 1.6rem;
  padding: 0 0.45rem;
  border-radius: 0.45rem;
  background: #f2f4f7;
  color: #667085;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.today-title {
  min-width: 0;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2430;
  flex: 0 1 auto;
}

.today-change {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: 0.15rem;
}

.today-ep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.55rem;
  padding: 0 0.45rem;
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.today-ep-old {
  background: #f2f4f7;
  color: #667085;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.today-ep-new {
  background: #ecfdf3;
  color: #067647;
}

.today-arrow {
  color: #98a2b3;
  font-size: 0.85rem;
  font-weight: 700;
}

.today-new {
  display: inline-flex;
  align-items: center;
  height: 1.55rem;
  padding: 0 0.5rem;
  border-radius: 0.45rem;
  background: #eef4ff;
  color: #3538cd;
  font-size: 0.75rem;
  font-weight: 700;
}

.today-new-done {
  background: #079455;
  color: #fff;
}

.today-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .today-title {
    max-width: 9rem;
  }
}

.today-actions button {
  height: 1.85rem;
  border: 0;
  border-radius: 0.45rem;
  padding: 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.today-actions button:disabled {
  background: #f4f5f7;
  color: #d0d5dd;
  cursor: not-allowed;
}

.today-actions .baidu { background: #e8f8ef; color: #128a45; }
.today-actions .quark { background: #e8f3ff; color: #2f6fed; }
.today-actions .xunlei { background: #fff6e5; color: #c56a00; }
.today-actions .all { background: #eef2ff; color: #3538cd; }

@media (min-width: 640px) {
  .pans { grid-template-columns: repeat(3, 1fr); }
}
