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

.question-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

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

.directory-card {
  padding: 14px 12px;
  align-self: start;
  position: sticky;
  top: calc(var(--subject-nav-offset) + 10px);
}

.directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f8;
}

.directory-stage-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.directory-stage-btn {
  min-width: 56px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #c9d6eb;
  border-radius: 16px;
  background: #f7fbff;
  color: #3a4a62;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.directory-stage-btn:hover {
  border-color: #8fb8eb;
  background: #ecf5ff;
  color: #1d5da8;
}

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

.directory-card h2,
.question-filter-card h2,
.question-results-card h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1d2a3f;
}

.chapter-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-right: 4px;
}

.chapter-all-btn {
  width: 100%;
  border: 1px solid #d5e2f4;
  background: #f7fbff;
  color: #2f4057;
  border-radius: 6px;
  text-align: left;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 2px;
}

.chapter-all-btn:hover {
  border-color: #8fb8eb;
  background: #ecf5ff;
  color: #1a73c9;
}

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

/* Chapter group wrapper */
.chapter-group {
  display: flex;
  flex-direction: column;
}

/* Chapter-level button */
.chapter-btn {
  width: 100%;
  border: 1px solid #d5e2f4;
  background: #f7fbff;
  color: #2f4057;
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.chapter-btn:hover {
  border-color: #8fb8eb;
  background: #ecf5ff;
  color: #1a73c9;
}

.chapter-btn.is-active {
  border-color: #1a73c9;
  background: #eaf3ff;
  color: #1a73c9;
  font-weight: 700;
}

.chapter-btn-label {
  flex: 1;
  word-break: break-all;
  white-space: normal;
  line-height: 1.5;
}

.chapter-arrow {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  color: #8fa8c8;
  transition: transform 0.2s;
  margin-left: 4px;
}

/* Rotate arrow when section list is open */
.chapter-group:has(.section-list.is-open) .chapter-arrow {
  transform: rotate(90deg);
}

/* Section list */
.section-list {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  padding-left: 6px;
}

.section-list.is-open {
  display: flex;
}

/* Section-level button */
.section-btn {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #526681;
  border-radius: 4px;
  text-align: left;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
}

.section-btn:hover {
  border-color: #c3d9f5;
  background: #f0f7ff;
  color: #1a73c9;
}

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

.question-main-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-filter-card {
  padding: 14px 16px 12px;
}

.question-filter-card .filter-body {
  overflow: hidden;
}

.question-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;
}

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

.question-count-inline {
  color: #6b7a8d;
  font-size: 14px;
}

.question-count-inline span {
  color: #f25f3a;
  font-weight: 700;
}

.filter-rows {
  display: flex;
  flex-direction: column;
}

.filter-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px dashed #edf1f8;
}

.filter-row: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;
}

.filter-chip {
  height: 30px;
  border: 1px solid #d0dced;
  background: #f7fbff;
  color: #42556f;
  border-radius: 15px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 14px;
}

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

.filter-chip.is-active {
  border-color: #1a73c9;
  background: #eaf3ff;
  color: #1a73c9;
  font-weight: 700;
}

/* 考试地区筛选样式 */
.filter-region-options {
  flex-direction: column;
  gap: 10px;
}

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

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

.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;
}

.knowledge-dropdown {
  position: relative;
  width: 100%;
}

.knowledge-dropdown-trigger {
  min-height: 30px;
  height: auto;
  width: 100%;
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.knowledge-dropdown-label {
  flex: 1;
  line-height: 1.5;
  white-space: normal;
  word-break: break-all;
}

.knowledge-dropdown-arrow {
  flex-shrink: 0;
  font-size: 12px;
  color: #6e87a8;
  transition: transform 0.2s ease;
  margin-top: 3px;
}

.knowledge-dropdown-trigger.is-open .knowledge-dropdown-arrow {
  transform: rotate(180deg);
}

.knowledge-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 12;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #cfe0f5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(17, 54, 96, 0.12);
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.knowledge-search-wrap {
  width: 100%;
  flex-shrink: 0;
  margin-bottom: 4px;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
  padding-top: 2px;
  padding-bottom: 4px;
}

.knowledge-search-input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #c9d6eb;
  border-radius: 8px;
  background: #f7fbff;
  color: #2f4057;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

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

.knowledge-search-count-tip {
  width: 100%;
  flex-shrink: 0;
  font-size: 12px;
  color: #6b7a8d;
  padding: 2px 4px;
}

.knowledge-dropdown-panel.is-open {
  display: flex;
}

.knowledge-option-chip {
  height: auto;
  min-height: 30px;
  border-radius: 8px;
  padding: 6px 10px;
  white-space: normal;
  word-break: break-all;
  line-height: 1.45;
  text-align: left;
}

.filter-footer-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #edf1f8;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #526681;
  font-size: 14px;
}

.filter-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

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

.question-action-btn {
  height: 36px;
  min-width: 72px;
  padding: 0 16px;
  border: 1px solid #c9d6eb;
  border-radius: 18px;
  background: #f7fbff;
  color: #2f4057;
  cursor: pointer;
}

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

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

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

.question-action-btn.is-active:hover {
  background: #0e5ea9;
  border-color: #0e5ea9;
  color: #ffffff;
}

.question-action-btn-outlined {
  border-color: #1a73c9;
  color: #1a73c9;
  background: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.question-action-btn-outlined:hover {
  background: #ecf5ff;
}

.question-results-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 760px;
}

.question-results-card .card-header-row {
  margin: 0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.question-results-card .card-header-row h2 {
  white-space: nowrap;
  line-height: 1;
}

.question-header-tools {
  margin-left: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-select-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.question-select-toggle-btn {
  height: 32px;
  min-width: 64px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 16px;
}

.question-header-filter-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.question-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.question-header-tools .knowledge-dropdown {
  width: min(420px, 100%);
  min-width: 0;
}

.question-header-tools .knowledge-dropdown-trigger {
  min-height: 36px;
  border-radius: 18px;
  padding: 7px 12px;
}

.question-header-tools .knowledge-dropdown-panel {
  left: 0;
  right: auto;
  min-width: 420px;
}

.question-header-actions .question-action-btn:disabled {
  border-color: #d8e2f0;
  color: #9aa9bc;
  background: #f6f9fc;
  cursor: not-allowed;
}

.question-result-list {
  border-top: 1px solid #edf1f8;
  background: #ffffff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
}

.question-result-list .question-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid #dfe6f2;
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 16px 12px;
  box-shadow: 0 8px 22px rgba(16, 52, 92, 0.06);
}

.question-result-list .question-card:first-child {
  border-top: 1px solid #dfe6f2;
}

.question-result-list .question-kp-line {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.question-result-list .question-kp-name {
  color: #1f1f1f;
  font-family: "SimHei", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
}

.question-result-list .question-title-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px;
}

.question-result-list .question-no {
  font-size: 16px;
  line-height: 1.72;
  color: #2a2a2a;
  font-family: "Times New Roman", "SimSun", serif;
  font-weight: 400;
  margin-right: 2px;
}

.question-result-list .question-type-inline {
  color: #2a2a2a;
  font-size: 16px;
  line-height: 1.72;
  font-family: "Times New Roman", "SimSun", serif;
  white-space: nowrap;
}

.question-result-list .question-title-text {
  color: #2a2a2a;
  font-size: 16px;
  line-height: 1.72;
  font-family: "Times New Roman", "SimSun", serif;
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
  text-align: left;
  text-decoration: none;
}

.question-result-list .question-title-text:hover,
.question-result-list .question-title-text:focus {
  text-decoration: none;
}

.question-result-list .question-select-checkbox {
  margin-top: 6px;
  width: 16px;
  height: 16px;
  accent-color: #1a73c9;
  cursor: pointer;
}

.question-result-list .question-content,
.question-result-list .answer,
.question-result-list .analysis {
  font-size: 18px;
  color: #2a2a2a;
  line-height: 1.72;
  font-family: "Times New Roman", "SimSun", serif;
}

.question-result-list .question-content {
  margin-top: 8px;
}

.question-result-list .question-image {
  display: block;
  width: auto;
  max-width: min(100%, 320px);
  height: auto;
  margin: 12px 0;
  padding: 4px;
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(26, 115, 201, 0.06);
}

.question-result-list .question-content p + p .question-image,
.question-result-list .analysis p + p .question-image,
.question-result-list .answer p + p .question-image {
  margin-top: 6px;
}

.question-result-list .question-content .question-image + .question-image,
.question-result-list .analysis .question-image + .question-image,
.question-result-list .answer .question-image + .question-image {
  margin-top: 10px;
}

.question-result-list .question-table-wrap .question-image {
  max-width: min(100%, 220px);
  margin: 8px auto;
}

.question-result-list .question-bottom-left-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.question-result-list .question-bottom-tag {
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #d4dfef;
  background: #f8fbff;
  color: #5b6d85;
  font-size: 13px;
  line-height: 1.4;
}

.question-result-list .question-kp-chip {
  color: #405a7a;
}

.question-result-list .question-paper-line {
  margin-top: 8px;
  font-size: 13px;
  color: #6b7a8d;
  text-align: right;
}

.question-result-list .question-card-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.question-result-list .question-card-action-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #c9d6eb;
  border-radius: 15px;
  background: #f7fbff;
  color: #2f4057;
  cursor: pointer;
  font-size: 13px;
}

.question-result-list .question-card-action-btn:hover {
  border-color: #1a73c9;
  background: #ecf5ff;
  color: #1a73c9;
}

.question-result-list .question-card-action-btn.is-in-basket {
  border-color: #a8d4a8;
  background: #f2fbf2;
  color: #3a8a3a;
  cursor: default;
  opacity: 0.85;
}

.question-result-list .question-card-action-btn:disabled {
  cursor: default;
}

.question-result-list .fold summary {
  font-size: 17px;
}

.question-result-list .fold:not([open]) summary::before {
  content: "▲ ";
}

.question-result-list .answer strong,
.question-result-list .analysis strong {
  font-family: "Times New Roman", "SimSun", serif;
}

.empty-state {
  color: #6b7a8d;
  font-size: 14px;
  padding: 10px 2px;
}

.question-list-status {
  padding: 10px 4px 4px;
  color: #6b7a8d;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 980px) {
  .question-layout {
    grid-template-columns: 1fr;
  }

  .directory-card {
    position: static;
  }
}

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

  .filter-footer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-footer-right {
    width: 100%;
  }

  .question-search-input {
    min-width: 0;
    flex: 1;
  }

  .question-result-list .question-card {
    padding: 12px 10px;
  }

  .question-result-list .question-content,
  .question-result-list .answer,
  .question-result-list .analysis {
    font-size: 15px;
  }

  .question-result-list .question-title-text {
    font-size: 15px;
    min-width: 0;
  }

  .question-result-list .question-type-inline {
    font-size: 15px;
  }

  .question-result-list .question-no {
    font-size: 15px;
  }

  .question-results-card .card-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .question-header-tools {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .question-select-tools,
  .question-header-filter-wrap,
  .question-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .question-header-tools .knowledge-dropdown-panel {
    left: 0;
    right: 0;
    min-width: 0;
  }
}
