/* ============================================
   Practice Card（刷题）：左热力图 | 右上每日一题 | 右下词云 | 底部近期题库
   ============================================ */

.practice-body {
  padding: 10px 12px 12px !important;
}

/*
 * card-block.css 里 .cb-card-body 默认 overflow:hidden，会把收藏夹筛选下拉
 *（绝对定位且可能宽于触发器）横向裁掉；刷题卡片需允许浮层溢出卡片主体。
 */
.cb-card.practice-card > .cb-card-body {
  overflow: visible;
}

/* 刷题首页块：单一根节点，避免双 section 破坏首页主栏/侧栏栅格；与下方区块留白 */
.practice-home-section {
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.practice-group-tip-banner {
  position: relative;
  overflow: hidden;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f89ff 0%, #1e6fe0 100%);
}

.practice-group-tip-banner__blob {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.practice-group-tip-banner__blob--1 {
  right: -20px;
  top: -20px;
  width: 80px;
  height: 80px;
}

.practice-group-tip-banner__blob--2 {
  right: 30px;
  bottom: -30px;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.08);
}

.practice-group-tip-banner__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.practice-group-tip-banner__icon {
  flex-shrink: 0;
  margin-top: 2px;
  animation: practice-group-tip-pulse 2s infinite;
}

@keyframes practice-group-tip-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.practice-group-tip-banner__text {
  flex: 1;
  min-width: 0;
}

.practice-group-tip-banner__title {
  font-size: 15px;
  color: #fff;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 4px;
}

.practice-group-tip-banner__sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.practice-group-tip-banner__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}

.practice-group-tip-banner__dismiss {
  cursor: pointer;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}

.practice-group-tip-banner__dismiss:hover {
  color: #fff;
}

.practice-guest {
  max-width: 520px;
}

.practice-guest-hint {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: #5c6b86;
}

.practice-guest-hint a {
  font-weight: 600;
  color: #1677ff;
  text-decoration: none;
}

.practice-guest-hint a:hover {
  text-decoration: underline;
}

.practice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.practice-panel-stack {
  width: 100%;
}

.practice-panel[hidden] {
  display: none !important;
}

.practice-view-switch {
  --switch-index: 0;
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  padding: 4px;
  min-width: 212px;
  border-radius: 999px;
  background: #eef2f7;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.practice-view-switch::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  transform: translateX(calc(var(--switch-index) * 100%));
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.practice-view-switch[data-active-view='favorites'] {
  --switch-index: 1;
}

.practice-view-switch-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #5c6b86;
  cursor: pointer;
  transition: color 0.18s ease;
}

.practice-view-switch-btn:hover,
.practice-view-switch-btn:focus-visible {
  color: #24324d;
  outline: none;
}

.practice-view-switch-btn--active {
  color: #1677ff;
}

/* ─── 主栅格：左占两行，右上每日，右下词云，底通栏 ─── */
.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 34%);
  grid-template-rows: auto minmax(156px, 1fr) auto auto;
  gap: 8px 10px;
  align-items: stretch;
  min-height: 264px;
}

.practice-cell--heatmap {
  grid-column: 1;
  grid-row: 1 / 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.practice-cell--daily {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.practice-cell--wordcloud {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.practice-cell--favorites {
  grid-column: 1 / -1;
  grid-row: 3;
  min-width: 0;
}

.practice-cell--recent {
  grid-column: 1 / -1;
  grid-row: 4;
}

.practice-section--heatmap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.practice-section--heatmap .practice-heatmap-wrap {
  flex: 1;
  min-height: 0;
}

.practice-section--wordcloud {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.practice-wordcloud-outer {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.practice-wordcloud-help {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: #5c6b86;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.practice-wordcloud-help:hover,
.practice-wordcloud-help:focus-visible {
  color: #24324d;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  outline: none;
}

@media (max-width: 640px) {
  .practice-card-header {
    align-items: stretch;
  }

  .practice-view-switch {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .practice-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }

  .practice-cell--heatmap {
    grid-column: 1;
    grid-row: auto;
  }

  .practice-cell--daily {
    grid-column: 1;
    grid-row: auto;
  }

  .practice-cell--wordcloud {
    grid-column: 1;
    grid-row: auto;
  }

  .practice-cell--favorites {
    grid-column: 1;
    grid-row: auto;
  }

  .practice-cell--recent {
    grid-column: 1;
    grid-row: auto;
  }

  .practice-wordcloud-outer .practice-wordcloud {
    min-height: 148px;
  }
}

/* ─── 小节标题（加大、加深，层次更清晰） ─── */
.practice-section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #24324d;
  margin-bottom: 8px;
  user-select: none;
}

.practice-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  color: #24324d;
  flex-shrink: 0;
}

.practice-label-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── 每日一题（参考浅灰底 + 蓝标题 + 黑正文；表头内标签与公司胶囊平级，题库链不与题目链嵌套） ─── */
.practice-daily-card {
  display: flex;
  flex-direction: column;
  background: #f7f8fa;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  padding: 14px 16px;
  color: inherit;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  height: 100%;
  box-sizing: border-box;
}

.practice-daily-card:hover {
  border-color: #d0d7e0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.practice-daily-card-main {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  text-decoration: none !important;
  color: inherit;
}

.practice-daily-card-main:hover {
  text-decoration: none !important;
}

/* 图标 +「每日 1 题」与右侧公司胶囊平级，避免与题库链 a 嵌套 */
.practice-daily-card-label-hit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
  text-decoration: none !important;
  color: inherit;
}

.practice-daily-card-label-hit:hover {
  text-decoration: none !important;
}

.practice-daily-card-ring-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 4px;
  text-decoration: none !important;
  color: inherit;
}

.practice-daily-card-ring-link:hover {
  text-decoration: none !important;
}

/* 与题目详情页 problem__tag-item--company 同系紫粉胶囊，尺寸缩小；跟在标签右侧 */
.practice-daily-company-pill,
.practice-daily-company-pill.practice-daily-company-pill--static {
  display: inline-flex;
  align-items: center;
  max-width: min(168px, 46%);
  flex-shrink: 1;
  min-width: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  background: #f9f0ff;
  color: #531dab;
  border: 1px solid rgba(83, 29, 171, 0.12);
  text-decoration: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.practice-daily-company-pill {
  color: #391085;
}

a.practice-daily-company-pill:hover {
  background: #f3e8ff;
  border-color: rgba(83, 29, 171, 0.22);
  text-decoration: none !important;
}

.practice-daily-card--empty {
  cursor: default;
}

.practice-daily-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.practice-daily-card-head-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
  flex: 1;
}

.practice-daily-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  color: #1677ff;
  flex-shrink: 0;
}

.practice-daily-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.practice-daily-card-label {
  font-size: 14px;
  font-weight: 700;
  color: #1677ff;
  letter-spacing: 0.02em;
}

.practice-daily-card-ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #e4e6eb;
  flex-shrink: 0;
  box-sizing: border-box;
}

.practice-daily-card-body {
  min-width: 0;
}

.practice-daily-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f1f1f;
  line-height: 1.35;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.practice-daily-card-title--muted {
  color: #8b95a8;
  font-weight: 500;
}

/* 已通过：仅圆环打勾，卡片底色与未通过一致 */
.practice-daily-card-ring--passed {
  border-color: #22c55e;
  background: #22c55e;
  position: relative;
}

.practice-daily-card-ring--passed::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
  box-sizing: border-box;
}

/* ─── 热力图 ─── */
.practice-heatmap-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.practice-heatmap {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.heatmap-months {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-bottom: 2px;
}

.heatmap-month-label {
  font-size: 11px;
  font-weight: 600;
  color: #5c6b86;
  text-align: center;
  user-select: none;
  /* 该月只占 1 周时盒子很窄，默认会换行成「12」+「月」两行 */
  white-space: nowrap;
  line-height: 1.15;
  overflow: visible;
  flex-shrink: 0;
}

.heatmap-grid {
  display: grid;
  /* 与 practice.page.ts 一致：先按行（周日…周六）再按列（周），须用 row 填充；gap 由脚本覆盖 */
  grid-auto-flow: row;
  grid-template-rows: repeat(7, auto);
  gap: 3px;
}

.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 6px;
  background: #ebedf0;
  transition: background 0.15s ease;
  position: relative;
}

.heatmap-cell:hover {
  outline: 1px solid #959da5;
  outline-offset: -1px;
}

.heatmap-cell[data-count="0"] { background: #ebedf0; }
.heatmap-cell.level-1 { background: #9be9a8; }
.heatmap-cell.level-2 { background: #40c463; }
.heatmap-cell.level-3 { background: #30a14e; }
.heatmap-cell.level-4 { background: #216e39; }

.heatmap-cell[title] {
  cursor: default;
}

/* ─── 词云容器（与每日一题同系灰底，避免单独一块色温） ─── */
.practice-wordcloud-outer .practice-wordcloud {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 152px;
  overflow: hidden;
  border-radius: 8px;
  background: #f7f8fa;
  border: 1px solid #e8eaed;
}

.wordcloud-word {
  position: absolute;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.1;
  cursor: default;
  user-select: none;
  letter-spacing: 0.02em;
}

.wordcloud-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #9aa7bd;
  padding: 12px;
  text-align: center;
}

/* ─── 题目收藏夹（紧凑列表 + 筛选） ─── */
.practice-section--favorites {
  border-radius: 12px;
  padding: 1px 2px 2px;
  min-width: 0;
}

.practice-section--favorites-empty {
  padding-bottom: 12px;
}

.practice-favorites-page {
  min-height: 264px;
}

.practice-favorites-page .practice-section--favorites {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.practice-fav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.practice-fav-head-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.practice-section-label--fav {
  margin-bottom: 0;
  font-size: 13px;
}

.practice-fav-count {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid #d6e4ff;
  color: #1677ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.practice-fav-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.practice-fav-filter-field {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 2px 4px 2px 10px;
  min-height: 30px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e6ebf2;
}

.practice-fav-filter-label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #7a879d;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.practice-fav-dd {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 148px;
}

.practice-fav-dd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 24px;
  padding: 2px 22px 2px 0;
  margin: 0;
  border: none;
  border-radius: 999px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6b86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: #24324d;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.practice-fav-dd-trigger:hover,
.practice-fav-dd-trigger:focus-visible {
  color: #1677ff;
}

.practice-fav-dd-trigger--open {
  color: #1677ff;
}

.practice-fav-dd-panel {
  position: absolute;
  z-index: 200;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: max(100%, 148px);
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  margin: 0;
  list-style: none;
  border-radius: 12px;
  border: 1px solid #e0e6ef;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.practice-fav-dd-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #24324d;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.practice-fav-dd-option:hover,
.practice-fav-dd-option:focus-visible {
  outline: none;
  background: #f0f7ff;
  color: #1677ff;
}

.practice-fav-dd-option--active {
  background: #e8f3ff;
  color: #0958d9;
}

.practice-fav-select-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.practice-fav-scroll {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
  border: 1px solid #eceef2;
  padding: 10px 10px 12px;
}

.practice-favorites-page .practice-fav-scroll {
  flex: 1;
  max-height: 420px;
}

.practice-fav-filter-empty {
  font-size: 12px;
  color: #8b95a8;
  text-align: center;
  padding: 16px 12px;
}

.practice-fav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.practice-fav-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px 16px;
  padding: 14px 16px 16px;
  border: 1px solid #edf1f6;
  border-radius: 12px;
  background: #fbfcfe;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.practice-fav-row:hover {
  background: #fff;
  border-color: #dbe4f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.practice-fav-title-area {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-fav-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 8px;
  max-width: min(56%, 360px);
  flex-shrink: 0;
}

.practice-fav-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f1f1f;
  text-decoration: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.practice-fav-title:hover {
  color: #1677ff;
}

.practice-fav-record {
  flex-shrink: 0;
  line-height: 0;
  opacity: 0.78;
}

.practice-fav-record:hover {
  opacity: 1;
}

.practice-fav-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #3d4f6f;
  border: 1px solid #dce3ed;
  line-height: 1.35;
}

.practice-fav-chip--user {
  background: #e6f4ff;
  color: #0958d9;
  border-color: #91caff;
}

/* 算法标签：青绿系，与公司标签紫粉系区分 */
.practice-fav-chip--alg {
  background: #e6fffb;
  color: #006d75;
  border: 1px solid #87e8de;
}

.practice-fav-company {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  max-width: 100%;
}

.practice-fav-co-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f9f0ff;
  color: #531dab;
  text-decoration: none !important;
  border: 1px solid rgba(83, 29, 171, 0.12);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-fav-co-chip:hover {
  background: #f3e8ff;
}

.practice-fav-diff {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  flex-shrink: 0;
}

.practice-fav-diff--easy { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.practice-fav-diff--medium { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.practice-fav-diff--hard { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }

.practice-fav-empty-hint {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: #8b95a8;
}

.practice-fav-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eceef2;
}

.practice-fav-page-btn {
  border: 1px solid #d9dee8;
  background: #fff;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #24324d;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.practice-fav-page-btn:hover:not(:disabled) {
  border-color: #1677ff;
  color: #1677ff;
  background: #f0f7ff;
}

.practice-fav-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.practice-fav-page-indicator {
  font-size: 12px;
  font-weight: 600;
  color: #5c6b86;
  user-select: none;
}

@media (max-width: 640px) {
  .practice-fav-head {
    align-items: stretch;
  }

  .practice-fav-head-main {
    justify-content: space-between;
    width: 100%;
  }

  .practice-fav-filters {
    width: 100%;
  }

  .practice-fav-filter-field {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    justify-content: space-between;
  }

  .practice-fav-dd {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .practice-fav-dd-panel {
    left: 0;
    right: auto;
    min-width: min(100vw - 32px, 280px);
  }

  .practice-fav-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .practice-fav-right {
    max-width: none;
    justify-content: flex-start;
  }
}

/* ─── 底部近期题库（大按钮、通栏网格） ─── */
.practice-section--recent .practice-section-label {
  margin-bottom: 6px;
}

.practice-section--recent .practice-ps-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.practice-section--recent .practice-ps-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 16px;
  min-height: 48px;
  background: #f7f8fa;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #24324d !important;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.practice-section--recent .practice-ps-chip:hover {
  background: #f0f2f5;
  border-color: #d0d7e0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.practice-section--recent .practice-ps-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* 无封面时使用统一「题库」占位图标（与区块 slate 色调一致） */
.practice-ps-icon--default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #eceff3, #e2e6ec);
  color: #5c6b86;
}

.practice-ps-icon--default svg {
  display: block;
}

.practice-section--recent .practice-ps-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ─── 深色模式 ─── */
.theme--dark .practice-daily-card {
  background: #252a34;
  border-color: #353d4d;
}

.theme--dark .practice-daily-card:hover {
  border-color: #455066;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.theme--dark .practice-daily-card-label {
  color: #38bdf8;
}

.theme--dark .practice-daily-card-title {
  color: #e8edf5;
}

.theme--dark .practice-daily-card-title--muted {
  color: #7c8aa4;
}

.theme--dark .practice-daily-card-ring {
  border-color: #3d4758;
}

.theme--dark .practice-daily-card-ring--passed {
  border-color: #22c55e;
  background: #22c55e;
}

.theme--dark .practice-daily-company-pill,
.theme--dark .practice-daily-company-pill.practice-daily-company-pill--static {
  background: #1f1533;
  color: #d3adf7;
  border-color: rgba(211, 173, 247, 0.18);
}

.theme--dark a.practice-daily-company-pill {
  color: #efdbff;
}

.theme--dark a.practice-daily-company-pill:hover {
  background: #2a1f42;
  border-color: rgba(239, 219, 255, 0.28);
}

.theme--dark .practice-section-label {
  color: #d1dae8;
}

.theme--dark .heatmap-month-label {
  color: #9aa8c4;
}

.theme--dark .practice-ps-icon--default {
  background: linear-gradient(145deg, #323845, #2a303a);
  color: #9aa8c4;
}

.theme--dark .practice-wordcloud-outer .practice-wordcloud {
  background: #252a34;
  border-color: #353d4d;
}

.theme--dark .practice-wordcloud-help {
  color: #9aa8c4;
  background: rgba(37, 42, 52, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.theme--dark .practice-wordcloud-help:hover,
.theme--dark .practice-wordcloud-help:focus-visible {
  color: #e8edf5;
  background: #2c3340;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 10px rgba(0, 0, 0, 0.25);
}

.theme--dark .wordcloud-empty {
  color: #7c8aa4;
}

.theme--dark .heatmap-cell[data-count="0"],
.theme--dark .heatmap-cell { background: #2d333b; }
.theme--dark .heatmap-cell.level-1 { background: #0e4429; }
.theme--dark .heatmap-cell.level-2 { background: #006d32; }
.theme--dark .heatmap-cell.level-3 { background: #26a641; }
.theme--dark .heatmap-cell.level-4 { background: #39d353; }

.theme--dark .practice-section--recent .practice-ps-chip {
  background: #323334;
  border-color: #395348;
  color: #d1dae8 !important;
}

.theme--dark .practice-section--recent .practice-ps-chip:hover {
  background: #323334;
  border-color: #395348;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.theme--dark .practice-fav-count {
  background: rgba(22, 119, 255, 0.12);
  border-color: rgba(105, 177, 255, 0.2);
  color: #7cc4ff;
}

.theme--dark .practice-fav-filter-field {
  background: #1c212b;
  border-color: #353d4d;
}

.theme--dark .practice-fav-filter-label {
  color: #9aa8c4;
}

.theme--dark .practice-fav-pagination {
  border-top-color: #353d4d;
}

.theme--dark .practice-fav-page-btn {
  background: #1c212b;
  border-color: #3d4758;
  color: #d1dae8;
}

.theme--dark .practice-fav-page-btn:hover:not(:disabled) {
  border-color: #69b1ff;
  color: #7cc4ff;
  background: #111d2c;
}

.theme--dark .practice-fav-page-indicator {
  color: #9aa8c4;
}

.theme--dark .practice-view-switch {
  background: #1c212b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.theme--dark .practice-view-switch::before {
  background: #2c3340;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.26);
}

.theme--dark .practice-view-switch-btn {
  color: #9aa8c4;
}

.theme--dark .practice-view-switch-btn:hover,
.theme--dark .practice-view-switch-btn:focus-visible {
  color: #e8edf5;
}

.theme--dark .practice-view-switch-btn--active {
  color: #7cc4ff;
}

.theme--dark .practice-fav-dd-trigger {
  color: #d1dae8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa8c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.theme--dark .practice-fav-dd-trigger:hover,
.theme--dark .practice-fav-dd-trigger:focus-visible,
.theme--dark .practice-fav-dd-trigger--open {
  color: #7cc4ff;
}

.theme--dark .practice-fav-dd-panel {
  background: #1c212b;
  border-color: #3d4758;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.theme--dark .practice-fav-dd-option {
  color: #d1dae8;
}

.theme--dark .practice-fav-dd-option:hover,
.theme--dark .practice-fav-dd-option:focus-visible {
  background: #243047;
  color: #7cc4ff;
}

.theme--dark .practice-fav-dd-option--active {
  background: #111d2c;
  color: #69b1ff;
}

.theme--dark .practice-fav-scroll {
  background: linear-gradient(180deg, #171819 0%, #242625 100%);
  border-color: #353d4d;
}

.theme--dark .practice-fav-row {
  background: #323334;
  border-color: #395348;
}

.theme--dark .practice-fav-row:hover {
  background: #323334;
  border-color: #43506a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

.theme--dark .practice-fav-title {
  color: #e8edf5;
}

.theme--dark .practice-fav-chip {
  background: #2d333b;
  color: #c5cedd;
  border-color: #3d4758;
}

.theme--dark .practice-fav-chip--user {
  background: #111d2c;
  color: #69b1ff;
  border-color: #15395b;
}

.theme--dark .practice-fav-chip--alg {
  background: #002329;
  color: #5cdbd3;
  border-color: #006d75;
}

.theme--dark .practice-fav-co-chip {
  background: #1f1533;
  color: #d3adf7;
  border-color: rgba(211, 173, 247, 0.18);
}

.theme--dark .practice-fav-filter-empty,
.theme--dark .practice-fav-empty-hint {
  color: #7c8aa4;
}
