/* 学习模块：行测 / 申论 */

#view-learning.view-learning {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: linear-gradient(165deg, #f8faf8 0%, #eef4ee 45%, #f5f0eb 100%);
}

#main-app.learning-active #view-learning.view-learning:not(.hidden) {
  display: flex;
}

#main-app.learning-active > .silas-phone-top,
#main-app.learning-active > .app-header-stack {
  display: none !important;
}

.learning-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  position: relative;
}

.learning-top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.learning-hand-back,
.learning-menu-btn {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

.learning-menu-btn {
  margin-left: auto;
  font-weight: 700;
  letter-spacing: 1px;
}

.learning-menu-btn.hidden {
  display: none !important;
}

.learning-top-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.learning-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.learning-main {
  min-height: 100%;
}

.learning-empty {
  margin: 24px 16px;
  text-align: center;
  color: rgba(80, 80, 80, 0.9);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 主题色 */
.exam-half--theme-mint,
.exam-tile--theme-mint {
  --exam-accent: #6ecf8a;
  --exam-accent-soft: rgba(168, 230, 180, 0.55);
}
.exam-half--theme-sky,
.exam-tile--theme-sky {
  --exam-accent: #5eb8e8;
  --exam-accent-soft: rgba(150, 210, 245, 0.55);
}
.exam-half--theme-amber,
.exam-tile--theme-amber {
  --exam-accent: #e8b84a;
  --exam-accent-soft: rgba(245, 210, 140, 0.55);
}
.exam-half--theme-violet,
.exam-tile--theme-violet {
  --exam-accent: #a88ae8;
  --exam-accent-soft: rgba(200, 180, 245, 0.55);
}
.exam-half--theme-rose,
.exam-tile--theme-rose {
  --exam-accent: #e88a9a;
  --exam-accent-soft: rgba(245, 180, 195, 0.55);
}
.exam-half--theme-teal,
.exam-tile--theme-teal {
  --exam-accent: #4ec9b0;
  --exam-accent-soft: rgba(150, 230, 210, 0.55);
}
.exam-half--theme-peach,
.exam-tile--theme-peach {
  --exam-accent: #f0a878;
  --exam-accent-soft: rgba(245, 200, 165, 0.55);
}

/* 首页半屏 */
.exam-root-split {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 56px);
  min-height: calc(100vh - 56px);
  padding-bottom: 140px;
  position: relative;
  z-index: 1;
}

.exam-half {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  padding: 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.exam-half:active {
  transform: scale(0.985);
}

.exam-half--top {
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.exam-half-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, var(--exam-accent-soft), transparent 70%);
  pointer-events: none;
}

.exam-half-battery {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.exam-half-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--exam-accent-soft) 40%, var(--exam-accent) 100%);
  opacity: 0.75;
  transition: height 0.3s ease;
}

.exam-half--done .exam-half-fill {
  height: 100% !important;
  opacity: 0.35;
  background: rgba(200, 245, 210, 0.9);
}

.exam-half-icon {
  position: relative;
  z-index: 1;
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

.exam-half-label {
  position: relative;
  z-index: 1;
  font-size: 1.65rem;
  font-weight: 800;
  color: #2a3d32;
  letter-spacing: 0.04em;
}

/* 子模块网格 */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 16px;
  padding-bottom: 24px;
  align-content: start;
  position: relative;
  z-index: 1;
}

.exam-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  overflow: hidden;
  padding: 12px 10px 14px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.exam-tile:active {
  transform: scale(0.97);
}

.exam-tile--square {
  aspect-ratio: 1;
}

.exam-tile--tall {
  aspect-ratio: 3 / 4;
}

.exam-tile-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--exam-accent-soft), transparent 65%);
  pointer-events: none;
}

.exam-tile-battery {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.exam-tile-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--exam-accent-soft) 30%, var(--exam-accent) 100%);
  opacity: 0.7;
  transition: height 0.3s ease;
}

.exam-tile--done {
  background: linear-gradient(145deg, rgba(220, 248, 220, 0.98), rgba(190, 235, 200, 0.92));
  border-color: rgba(100, 180, 110, 0.35);
}

.exam-tile--done .exam-tile-fill {
  height: 100% !important;
  opacity: 0.25;
}

.exam-tile-icon {
  position: relative;
  z-index: 1;
  font-size: 1.65rem;
  line-height: 1;
}

.exam-tile-label {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: #2d3d32;
  max-width: 100%;
}

.exam-tile-pct {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  color: #2a5a3a;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 3px 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* 叶子页：卡片 + 发布 + 伴学气泡 */
.exam-detail-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 52px);
  min-height: calc(100vh - 52px);
}

.exam-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 0;
  padding-bottom: 28vh;
}

.exam-detail-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.exam-tab {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.exam-tab--active {
  background: linear-gradient(135deg, rgba(200, 240, 210, 0.95), rgba(170, 220, 185, 0.9));
  color: #1a4a28;
  box-shadow: 0 4px 12px rgba(100, 180, 120, 0.25);
}

.exam-detail-status {
  margin: 0 0 12px;
  font-size: 0.76rem;
  color: rgba(70, 85, 75, 0.95);
}

.exam-cards-empty {
  margin: 12px 0 20px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(90, 100, 95, 0.9);
}

.exam-day-group + .exam-day-group {
  margin-top: 18px;
}

.exam-day-title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(55, 75, 60, 0.95);
}

.exam-progress-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.exam-progress-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.exam-progress-card-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ui-accent-bar, #7ab88a);
}

.exam-progress-card-time {
  font-size: 0.72rem;
  color: rgba(100, 110, 105, 0.9);
}

.exam-progress-card-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #333;
  word-break: break-word;
}

.exam-compose {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.exam-compose-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.exam-detail-note {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.95);
  margin-bottom: 10px;
}

.exam-detail-save {
  width: 100%;
}

/* 首页 Silas 悬浮总结 */
.learning-silas-home {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  z-index: 20;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.learning-silas-home.hidden {
  display: none !important;
}

.learning-silas-home-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  background: var(--ui-accent-bar, #efbfd6);
}

.learning-silas-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.learning-silas-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
  color: #fff;
  font-size: 1.2rem;
}

.learning-silas-home-bubble {
  flex: 1;
  min-width: 0;
  max-height: 28vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px 16px 16px 6px;
  padding: 10px 12px 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.learning-silas-home-tag {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #5a8a6a;
  margin-bottom: 4px;
}

.learning-silas-home-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #333;
}

.learning-silas-home-text p {
  margin: 0 0 8px;
}

.learning-silas-home-text p:last-child {
  margin-bottom: 0;
}

/* 子模块页底部伴学气泡（约 1/4 屏高） */
.learning-silas-leaf-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  height: 26vh;
  max-height: 220px;
  min-height: 120px;
  display: flex;
  align-items: flex-end;
  padding: 0 14px calc(10px + env(safe-area-inset-bottom, 0));
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(248, 250, 248, 0.92) 35%);
}

.learning-silas-leaf-dock--empty .learning-silas-leaf-text {
  color: rgba(90, 100, 95, 0.85);
  font-style: italic;
}

.learning-silas-leaf-bubble {
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  padding: 12px 14px 14px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(200, 230, 205, 0.8);
  border-bottom: 3px solid var(--ui-accent-bar, #b8e0c8);
}

.learning-silas-leaf-tag {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5a8a6a;
  margin-bottom: 6px;
}

.learning-silas-leaf-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #2a3a30;
  font-weight: 500;
}

.learning-menu-sheet {
  position: absolute;
  top: 52px;
  right: 12px;
  z-index: 30;
  min-width: 140px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.learning-menu-sheet.hidden {
  display: none !important;
}

.exam-menu-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

.exam-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
