/* =========================================================================
 * rc.css — Reading Comprehension 主页面样式
 * 设计体系与 ezspelling 完全一致：1rem = 1rpx（根字号由 index.html 设定）；
 * 主色渐变 #667eea → #764ba2；白色卡片、16~20rem 圆角、柔和阴影；
 * 辅助灰 #8892b0 / #aaa / #999。
 * ========================================================================= */

/* ---------- 页面外壳 ---------- */
.page-rc {
  min-height: calc(100vh - 88rem);
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
}

.page-rc .container {
  padding: 56rem 40rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-rc .header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 48rem;
  margin-top: 40rem;
}

.page-rc .logo-icon {
  font-size: 96rem;
  margin-bottom: 18rem;
}

.page-rc .title {
  font-size: 56rem;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 10rem;
  text-align: center;
}

.page-rc .subtitle {
  font-size: 28rem;
  color: #8892b0;
  text-align: center;
  line-height: 1.6;
}

.page-rc .author {
  font-size: 24rem;
  color: #aaa;
  margin-top: 10rem;
}

.page-rc .version {
  font-size: 22rem;
  color: #ccc;
  margin-top: 6rem;
}

/* ---------- 选择表单卡片 ---------- */
.rc-form-card {
  width: 85%;
  max-width: 620rem;
  background: #fff;
  border-radius: 20rem;
  padding: 36rem 32rem 44rem;
  box-shadow: 0 4rem 20rem rgba(0, 0, 0, 0.08);
}

.rc-form-item {
  margin-bottom: 32rem;
}
.rc-form-item:last-child {
  margin-bottom: 0;
}

.rc-form-label {
  display: block;
  font-size: 28rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 14rem;
}

/* ---------- 级联下拉组件 ---------- */
.rc-select {
  position: relative;
}

.rc-select__toggle {
  width: 100%;
  height: 90rem;
  padding: 0 24rem;
  background: #f8f8f8;
  border: 2rem solid transparent;
  border-radius: 12rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12rem;
  font-size: 30rem;
  color: #333;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.rc-select.is-open .rc-select__toggle {
  background: #fff;
  border-color: #667eea;
}

.rc-select.is-error .rc-select__toggle {
  background: #fff0f0;
  border-color: #ff6b6b;
}

.rc-select__value {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-select__toggle.is-empty .rc-select__value {
  color: #999;
}

.rc-select__caret {
  flex-shrink: 0;
  font-size: 22rem;
  color: #8892b0;
  transition: transform 0.2s ease;
}

.rc-select.is-open .rc-select__caret {
  transform: rotate(180deg);
}

.rc-select__panel {
  position: absolute;
  top: calc(100% + 10rem);
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border: 1rem solid rgba(30, 43, 79, 0.08);
  border-radius: 16rem;
  box-shadow: 0 14rem 34rem rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8rem);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.rc-select.is-open .rc-select__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.rc-select__view {
  max-height: 360rem;
  overflow-y: auto;
  padding: 8rem;
  -webkit-overflow-scrolling: touch;
}

.rc-select__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10rem;
  padding: 16rem 18rem;
  border-radius: 10rem;
  font-size: 28rem;
  color: #33415c;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.rc-select__item:hover {
  background: #f2f5ff;
}

.rc-select__item.is-selected {
  background: #e8f0ff;
  color: #667eea;
  font-weight: bold;
}

.rc-select__item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.35);
}

.rc-select__item.is-disabled:hover {
  background: transparent;
}

.rc-select__item-label {
  flex: 1;
  word-break: break-all;
}

.rc-select__item-arrow {
  flex-shrink: 0;
  font-size: 26rem;
  color: #aab;
}

.rc-select__ext {
  flex-shrink: 0;
  font-size: 20rem;
  font-weight: 700;
  color: #e67e22;
  background: #fff3e0;
  border: 1rem solid #ffe0b2;
  border-radius: 8rem;
  padding: 2rem 10rem;
  line-height: 1.5;
}

/* 二级子列表返回头 */
.rc-select__sub-header {
  display: flex;
  align-items: center;
  gap: 6rem;
  padding: 8rem 8rem 10rem;
  border-bottom: 1rem solid #f0f0f0;
  flex-shrink: 0;
}

.rc-select__back {
  width: 56rem;
  height: 56rem;
  border-radius: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34rem;
  font-weight: bold;
  color: #667eea;
  flex-shrink: 0;
}

.rc-select__back:hover {
  background: #f2f5ff;
}

.rc-select__sub-title {
  flex: 1;
  font-size: 26rem;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 生成按钮 ---------- */
.rc-btn-generate {
  width: 85%;
  max-width: 620rem;
  height: 96rem;
  margin-top: 32rem;
  border-radius: 50rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4rem 20rem rgba(102, 126, 234, 0.3);
  color: #fff;
  font-size: 34rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rc-btn-generate:active {
  transform: translateY(2rem);
  box-shadow: 0 2rem 12rem rgba(102, 126, 234, 0.3);
}

/* ---------- 返回主页按钮（Easy Spelling 页面 Home 键同款：蓝色渐变胶囊） ---------- */
.rc-btn-home {
  width: 85%;
  max-width: 620rem;
  height: 96rem;
  margin-top: 24rem;
  border-radius: 50rem;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 4rem 20rem rgba(79, 172, 254, 0.3);
  color: #fff;
  font-size: 34rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rc-btn-home:active {
  transform: translateY(2rem);
  box-shadow: 0 2rem 12rem rgba(79, 172, 254, 0.3);
}

/* ---------- 生成结果展示区（文章 + 题目 + 答案折叠） ---------- */
.rc-result {
  width: 85%;
  max-width: 620rem;
  margin-top: 32rem;
}

.rc-result-panel {
  background: #fff;
  border: 2rem solid #eef0f7;
  border-radius: 24rem;
  padding: 32rem;
  box-shadow: 0 4rem 16rem rgba(102, 126, 234, 0.06);
  text-align: left;
}

.rc-result-passage-title,
.rc-result-questions-title {
  font-size: 30rem;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 16rem;
}

.rc-result-passage p {
  font-size: 28rem;
  line-height: 1.8;
  color: #333;
  margin: 0;
}

.rc-result-questions {
  margin-top: 28rem;
}

.rc-result-q {
  background: #fafbfe;
  border-radius: 16rem;
  padding: 24rem;
  margin-bottom: 16rem;
}

.rc-result-q-head {
  display: flex;
  align-items: center;
  margin-bottom: 10rem;
}

.rc-result-q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  background: #667eea;
  color: #fff;
  font-size: 22rem;
  font-weight: bold;
  margin-right: 12rem;
  flex-shrink: 0;
}

.rc-result-q-type {
  font-size: 20rem;
  color: #667eea;
  border: 1rem solid #c9d2fb;
  border-radius: 8rem;
  padding: 2rem 10rem;
}

.rc-result-q-text {
  font-size: 26rem;
  color: #333;
  line-height: 1.6;
}

.rc-result-options {
  margin-top: 14rem;
}

.rc-result-opt {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10rem;
  font-size: 26rem;
  color: #444;
  line-height: 1.6;
}

.rc-result-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  background: #eef0f7;
  color: #667eea;
  font-size: 20rem;
  font-weight: bold;
  margin-right: 10rem;
  flex-shrink: 0;
}

.rc-result-answer {
  margin-top: 14rem;
}

.rc-result-answer-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 24rem;
  color: #667eea;
  cursor: pointer;
  text-align: left;
}

.rc-result-answer-body {
  margin-top: 10rem;
  font-size: 24rem;
  color: #2e7d32;
  background: #e8f5e9;
  border-radius: 10rem;
  padding: 14rem 18rem;
  line-height: 1.6;
}

/* ---------- 页脚（复用主页 footer 风格） ---------- */
.rc-footer {
  margin-top: auto;
  padding: 40rem 20rem calc(40rem + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 24rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #aaa;
}

/* ---------- 小屏字号保底（面向孩子，最小 14px） ---------- */
@media (max-width: 524px) {
  .page-rc .version,
  .page-rc .author,
  .rc-select__sub-title,
  .rc-footer {
    font-size: 14px;
  }
}

@media (max-width: 449px) {
  .page-rc .subtitle,
  .rc-form-label,
  .rc-select__item,
  .rc-btn-generate,
  .rc-btn-home,
  .rc-result-q-text,
  .rc-result-opt,
  .rc-result-answer-body {
    font-size: 14px;
  }
}
