.paper-list-page {
  max-width: 1180px;
  margin: 12px auto 28px;
  padding: 0 12px;
}

.filter-card {
  background: #ffffff;
  border: 1px solid #dfe6f2;
  box-shadow: 0 8px 22px rgba(16, 52, 92, 0.06);
  padding: 18px 20px 20px;
}

.paper-content-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 2.1fr);
  gap: 16px;
  margin-top: 16px;
}

.paper-results-card,
.favorites-card {
  background: #ffffff;
  border: 1px solid #dfe6f2;
  box-shadow: 0 8px 22px rgba(16, 52, 92, 0.06);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  max-height: 760px;
}

.filter-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #edf1f8;
}

.filter-header-row h2 {
  margin: 0;
  font-size: 20px;
  color: #1d2a3f;
  flex-shrink: 0;
  white-space: nowrap;
}

.paper-header-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.paper-select-all-wrap {
  display: none;
}

.paper-action-btn-outlined {
  background: #ffffff;
  border: 1px solid #c9d6eb;
  color: #4a5d75;
}

.paper-action-btn-outlined:not(:disabled):hover {
  background: #ecf5ff;
  border-color: #1a73c9;
  color: #1a73c9;
}

.paper-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.paper-action-btn.is-active {
  background: #1a73c9;
  border-color: #1a73c9;
  color: #ffffff;
}

.paper-action-btn.is-active:not(:disabled):hover {
  background: #0e5ea9;
  border-color: #0e5ea9;
  color: #ffffff;
}

.list-search-input {
  height: 36px;
  min-width: 220px;
  border: 1px solid #c9d6eb;
  border-radius: 18px;
  padding: 0 12px;
  color: #2f4057;
  background: #f7fbff;
  font: inherit;
}

#favoriteSearchInput {
  min-width: calc(220px - 2ch);
}

.list-search-input:hover {
  border-color: #1a73c9;
  background: #ecf5ff;
  color: #1a73c9;
}

.list-search-input:focus {
  outline: none;
  border-color: #1a73c9;
  background: #ecf5ff;
  color: #1a73c9;
}

.list-search-input::placeholder {
  color: #8da0b7;
}

.filter-body {
  overflow: hidden;
}

.filter-card.is-collapsed .filter-body {
  display: none;
}

.filter-toggle-footer {
  width: 100%;
  height: 30px;
  margin-top: 10px;
  border: 1px dashed #c9d6eb;
  border-radius: 15px;
  background: #f7fbff;
  color: #5b6f87;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.filter-toggle-footer:hover {
  border-color: #8fb8eb;
  background: #ecf5ff;
  color: #1a73c9;
}

.toggle-arrow {
  font-size: 15px;
  line-height: 1;
}

.filter-group {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed #edf1f8;
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-label {
  color: #48607d;
  font-size: 14px;
  font-weight: 700;
  padding-top: 6px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.filter-options-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  height: 34px;
  padding: 0 13px;
  border: 1px solid #c9d6eb;
  background: #f7fbff;
  color: #3a4a62;
  border-radius: 17px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: #8fb8eb;
  background: #ecf5ff;
  color: #1d5da8;
}

.filter-chip.is-active {
  border-color: #1a73c9;
  background: #1a73c9;
  color: #ffffff;
}

.filter-region-options {
  flex-direction: column;
  gap: 10px;
}

.region-groups-panel {
  width: 100%;
  padding: 10px 12px 12px;
  border: 1px dashed #d9e6f7;
  background: #f9fbff;
  display: none;
  flex-direction: column;
  gap: 8px;
}

/* 当有任何子选项未隐藏时，显示父容器 */
.region-groups-panel:has(.nested-options:not(.is-hidden)) {
  display: flex;
}

/* 新高考卷标签样式 */
.filter-chip[data-switch="new1"],
.filter-chip[data-switch="new2"] {
  position: relative;
  padding-right: 20px;
}

.filter-chip[data-switch="new1"]::after,
.filter-chip[data-switch="new2"]::after {
  content: '▼';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  transition: transform 0.2s ease;
}

.filter-chip[data-switch="new1"].is-active::after,
.filter-chip[data-switch="new2"].is-active::after {
  transform: translateY(-50%) rotate(180deg);
}

.nested-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
}

.inline-sub-options {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
}

.inline-sub-options.is-hidden {
  display: none;
}

.filter-time-options {
  flex-direction: column;
  gap: 10px;
}

.time-year-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
}

#paperYearOptions {
  display: grid;
  grid-template-columns: repeat(10, max-content);
  gap: 8px;
  flex: 1 1 100%;
}

@media (max-width: 960px) {
  #paperYearOptions {
    grid-template-columns: repeat(5, max-content);
  }
}

.custom-time-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px dashed #d9e6f7;
  background: #f9fbff;
}

.custom-time-panel.is-hidden {
  display: none;
}

.time-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #48607d;
  font-size: 13px;
}

.time-field input {
  min-width: 164px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #c9d6eb;
  background: #ffffff;
  color: #2f4057;
}

.time-apply-btn {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 18px;
  background: #1a73c9;
  color: #ffffff;
  cursor: pointer;
}

.favorite-paper-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.favorite-paper-list.empty-state {
  color: #6b7a8d;
  font-size: 14px;
}

.favorite-paper-item {
  position: relative;
  padding: 10px 32px 10px 0;
  border-bottom: 1px dashed #edf1f8;
}

.favorite-paper-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.favorite-paper-remove {
  position: absolute;
  top: 6px;
  right: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #9aa6b8;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.favorite-paper-remove svg {
  width: 18px;
  height: 18px;
  display: block;
}

.favorite-paper-remove:hover,
.favorite-paper-remove:focus-visible {
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.08);
  outline: none;
}

.favorite-paper-remove[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 640px) {
  .favorite-paper-item {
    padding-right: 36px;
  }

  .favorite-paper-remove {
    top: 8px;
    width: 26px;
    height: 26px;
  }

  .favorite-paper-remove svg {
    width: 20px;
    height: 20px;
  }
}

.favorite-paper-link {
  display: block;
  color: #1a73c9;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.6;
  white-space: normal;
  word-break: break-all;
}

.favorite-paper-link:hover {
  color: #0e5ea9;
  text-decoration: underline;
}

.paper-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.paper-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px dashed #edf1f8;
}

.paper-result-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.paper-result-main {
  min-width: 0;
  flex: 1 1 auto;
}

.paper-result-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.paper-select-checkbox {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: #1a73c9;
  cursor: pointer;
}

.paper-result-title {
  display: inline-block;
  color: #1a73c9;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.paper-result-title:hover {
  color: #0e5ea9;
  text-decoration: underline;
}

.paper-result-time {
  margin-top: 6px;
  color: #6b7a8d;
  font-size: 13px;
}

.paper-result-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.paper-action-btn {
  height: 36px;
  min-width: 72px;
  padding: 0 16px;
  border: 1px solid #c9d6eb;
  border-radius: 18px;
  background: #f7fbff;
  color: #2f4057;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.paper-action-btn:hover {
  border-color: #1a73c9;
  background: #ecf5ff;
  color: #1a73c9;
}

.paper-action-btn:disabled {
  border-color: #d8e2f0;
  background: #f3f6fb;
  color: #9aa9bc;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .filter-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filter-label {
    padding-top: 0;
  }

  .paper-content-grid {
    grid-template-columns: 1fr;
  }

  .paper-result-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .paper-result-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .paper-header-tools {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .list-search-input {
    min-width: 180px;
    flex: 1 1 180px;
  }

  .filter-header-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .paper-results-header #favoriteSearchInput,
  .paper-results-header #paperSearchInput {
    flex: 1 1 auto;
    min-width: 0;
  }

  .paper-results-header.paper-results-header .paper-header-tools {
    flex-basis: 100%;
    justify-content: flex-end;
  }
}
