/* ============================================================================
 * 冲击波英语成长研究中心 · 课程中心（首页 / 学院页 / 课程目录页）
 * ============================================================================
 * 两件事：
 *   ① 中英对照小字 .i18n-en —— 与各课 lesson.css 里的定义保持同一套口径
 *      （这些页面用的是 assets/styles.css，本身不含 .i18n-en）
 *   ② 学生登录 + 「我的课程」区块的样式
 *
 * 口径：中文为主（原字号），英文为辅（正下方小字，清晰可读）
 * ==========================================================================*/

/* ==== ① 中英对照小字 ==== */
.i18n-en {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: 0.01em;
  line-height: 1.42;
  text-transform: none;
}

h1 .i18n-en {
  margin-top: 14px;
  font-size: clamp(1rem, 1.25vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.015em;
}

h2 .i18n-en {
  margin-top: 8px;
  font-size: clamp(0.95rem, 1.05vw, 1.15rem);
  font-weight: 800;
}

h3 .i18n-en {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 750;
}

.hero-lead .i18n-en,
.section-heading p .i18n-en {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.6;
}

/* 顶栏菜单：英文横排跟在中文后面，避免把顶栏撑高 */
.nav-links a .i18n-en {
  display: inline;
  margin: 0 0 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #5d6f66;
}

/* 按钮 / 胶囊里的小字跟随前景色 */
.home-pill .i18n-en,
.member-pill .i18n-en,
button .i18n-en,
.primary-action .i18n-en,
.secondary-action .i18n-en {
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: inherit;
  opacity: 0.8;
}

/* 分类筛选按钮：英文横排，保持一行 */
.filter .i18n-en {
  display: inline;
  margin: 0 0 0 5px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  opacity: 0.72;
}

.badge .i18n-en {
  display: inline;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: inherit;
  opacity: 0.72;
}

.card-footer .i18n-en,
.route-grid .i18n-en,
.record-cards .i18n-en {
  margin-top: 4px;
  font-size: 0.76rem;
  font-weight: 700;
}

.site-footer .i18n-en {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* 深色底上的小字要够亮 */
.hero-card .i18n-en,
.hero-card h2 .i18n-en,
.hero-card .signal .i18n-en,
.academy-card.available .i18n-en,
.academy-card.available h3 .i18n-en,
.feature-board .i18n-en,
.feature-board h2 .i18n-en,
.record-cards article .i18n-en {
  color: rgba(255, 255, 255, 0.8);
}

/* ==== ② 学生登录 / 我的课程 ==== */
.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 26px;
  align-items: start;
}

.portal-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 240, 0.88));
  padding: clamp(22px, 2.6vw, 34px);
}

.portal-panel h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.portal-panel .portal-note {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.7;
}

/* 登录表单 */
.portal-form {
  display: grid;
  gap: 14px;
}

.portal-field {
  display: grid;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 900;
  color: #2d4a3e;
}

.portal-field input[type="text"],
.portal-field input[type="email"],
.portal-field input[type="password"] {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.portal-field input:focus {
  outline: 2px solid rgba(29, 92, 70, 0.45);
  outline-offset: 1px;
}

.portal-remember {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #32443d;
}

.portal-remember input {
  width: 18px;
  height: 18px;
  accent-color: #1d5c46;
}

.portal-remember .i18n-en {
  display: inline;
  margin: 0;
  font-size: 0.74rem;
  opacity: 0.75;
}

.portal-submit {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 15px 26px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(20, 33, 28, 0.2);
}

.portal-submit:hover {
  transform: translateY(-2px);
}

.portal-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.portal-msg {
  border-radius: 16px;
  padding: 13px 16px;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.6;
}

.portal-msg.err {
  background: rgba(224, 110, 90, 0.16);
  color: #a63b2c;
}

.portal-msg.ok {
  background: rgba(93, 196, 140, 0.2);
  color: #15693c;
}

.portal-links {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
  line-height: 1.8;
}

.portal-links a {
  color: var(--orange);
  font-weight: 950;
}

/* 已登录的问候条 */
.portal-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 22px;
  background: rgba(207, 238, 218, 0.55);
  padding: 16px 20px;
  margin-bottom: 22px;
}

.portal-who strong {
  font-size: 1.08rem;
  font-weight: 950;
}

.portal-who .portal-count {
  display: block;
  margin-top: 4px;
  color: #2f5245;
  font-size: 0.86rem;
  font-weight: 800;
}

.portal-who .portal-count .i18n-en {
  display: inline;
  margin: 0 0 0 6px;
  font-size: 0.76rem;
  opacity: 0.8;
}

.portal-out {
  border: 1px solid rgba(20, 33, 28, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 18px;
  font-size: 0.86rem;
  font-weight: 900;
  color: var(--ink);
}

/* 课程卡 */
.portal-course {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fffffb;
  padding: clamp(18px, 2vw, 26px);
  margin-bottom: 18px;
}

.portal-course > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.portal-course h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.portal-course .portal-academy {
  margin: 0 0 14px;
  color: var(--orange);
  font-size: 0.86rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.portal-progress {
  border-radius: 999px;
  background: #fff1cf;
  color: #8d5c00;
  padding: 7px 13px;
  font-size: 0.8rem;
  font-weight: 950;
  white-space: nowrap;
}

/* 课次卡 */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(258px, 100%), 1fr));
  gap: 14px;
}

.lesson-card {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 240, 0.9));
  padding: 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.lesson-card.on:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 107, 66, 0.7);
  box-shadow: 0 18px 40px rgba(20, 33, 28, 0.13);
}

.lesson-card.off {
  background: repeating-linear-gradient(135deg, rgba(20, 33, 28, 0.028) 0 6px, transparent 6px 14px), #fbfbf8;
}

.lesson-card .lesson-badge {
  display: inline-block;
  border-radius: 999px;
  background: rgba(20, 33, 28, 0.08);
  color: #4d6155;
  padding: 6px 11px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lesson-card.on .lesson-badge {
  background: rgba(248, 196, 93, 0.4);
  color: #7a5000;
}

.lesson-card h5 {
  margin: 14px 0 4px;
  font-size: 1.04rem;
  font-weight: 950;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.lesson-card .lesson-en {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;
}

.lesson-card .lesson-desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.6;
}

.lesson-card .lesson-cta {
  display: inline-block;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 950;
}

.lesson-card.off .lesson-cta {
  background: rgba(20, 33, 28, 0.08);
  color: #6b7d74;
}

.lesson-card .lesson-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lesson-card .lesson-cta .i18n-en {
  display: inline;
  margin: 0 0 0 6px;
  font-size: 0.7rem;
  font-weight: 750;
  opacity: 0.8;
}

/* 资料小标签 */
.mats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.mats li {
  border: 1px solid rgba(20, 33, 28, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #4d6155;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.mats li.notready {
  opacity: 0.55;
  text-decoration: line-through;
}

.portal-loading {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 12px 0;
}

.portal-empty {
  border-radius: 20px;
  background: rgba(248, 196, 93, 0.22);
  color: #8a5a12;
  padding: 16px 18px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.7;
}

@media (max-width: 1180px) {
  .portal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .portal-panel {
    border-radius: 24px;
  }

  .lesson-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-progress {
    white-space: normal;
  }

  .mats li {
    white-space: normal;
  }
}

/* ============================================================================
 * ③ 手机端横向溢出防护（2026-09-16）
 * ----------------------------------------------------------------------------
 * 症状：手机上「学生登录」面板整体偏左、右侧内容被切掉（家长常用手机看）。
 * 根因：网格列写 `1fr` 时最小值不是 0 而是 min-content。只要内部有
 *       「宽度由浏览器默认值决定」的元素，整列就会被顶得比屏幕还宽：
 *         · <input> 默认宽度 = size(20) × 字宽 —— 安卓字体回退后该值明显变大
 *         · 课次网格 minmax(258px, 1fr) 的 258px 下限
 *       外层 .academy-shell 又是 overflow:hidden，于是「右侧被切掉且划不出来」。
 * 对策：① 列一律 minmax(0,1fr)；② 网格项 min-width:0；
 *       ③ 输入框/按钮按容器宽度；④ 长串可断行（anywhere 同时降低 min-content）。
 * ==========================================================================*/

/* ①② 网格项允许收缩得比自身内容更窄 */
.portal-grid > *,
.portal-panel,
.portal-form,
.portal-field,
.portal-course,
.portal-course > header,
.portal-who,
.portal-who > *,
.lesson-card {
  min-width: 0;
}

/* ③ 输入框不再使用浏览器默认宽度 —— 这是「面板被顶宽」的直接解药 */
.portal-field input[type="text"],
.portal-field input[type="email"],
.portal-field input[type="password"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.portal-submit {
  width: 100%;
  min-width: 0;
}

/* ④ 长串兜底：中英混排时不会因为一个长单词把面板顶宽 */
.portal-panel,
.portal-course,
.lesson-card,
.portal-who,
.portal-empty,
.portal-msg {
  overflow-wrap: anywhere;
}

.mats li {
  max-width: 100%;
}

/* 手机端收窄留白，把横向空间还给内容 */
@media (max-width: 640px) {
  .section {
    padding: 20px 18px;
  }

  .portal-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .portal-course,
  .lesson-card {
    padding: 16px;
    border-radius: 18px;
  }

  .portal-who,
  .portal-empty {
    padding: 14px 16px;
  }
}
