/* zs.css - 知识清单听写专属样式，基于 styles.css 扩展 */

.view {
  display: none !important;
}

.view.active {
  display: block !important;
}

/* 顶部导航返回与外部链接 */
.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  color: var(--navy);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  height: 44px;
  border-radius: 14px;
  padding: 0 16px;
  transition: all .2s;
}

.nav-link-btn:hover {
  background: white;
  border-color: var(--navy);
  transform: translateY(-1px);
}

/* 过滤器与类型切换栏 */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px clamp(16px, 3vw, 48px);
  padding: 14px 20px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

.type-filter-group {
  display: inline-flex;
  gap: 8px;
  background: #edf3f3;
  padding: 4px;
  border-radius: 14px;
}

.type-filter-btn {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition: all .2s;
}

.type-filter-btn.active {
  background: white;
  color: var(--navy);
  box-shadow: 0 3px 10px rgba(23, 59, 87, .12);
}

.scope-stats {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.scope-stats strong {
  color: var(--orange);
  font-size: 17px;
  margin: 0 3px;
}

/* 听写卡片句型特殊适配：中文和英文可能较长 */
.zs-dictation-prompt span {
  font-weight: 900;
  font-size: clamp(22px, 4.2vw, 42px) !important;
  line-height: 1.45 !important;
  text-align: center;
  max-width: 90%;
  margin: auto;
  word-break: break-word;
}

.dictation-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 12px;
  letter-spacing: .5px;
}

.badge-phrase {
  background: #e1f5fe;
  color: #0277bd;
  border: 1px solid #b3e5fc;
}

.badge-sentence {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

.zs-answer-text {
  font: 700 clamp(20px, 3.8vw, 32px)/1.35 Georgia, serif !important;
  text-align: center;
  max-width: 92%;
  margin: 4px auto 12px;
  word-break: break-word;
}

/* 屏幕默写/打字模式 (Typing Mode) */
.typing-box {
  margin: 20px auto;
  max-width: 600px;
  text-align: left;
}

.typing-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 6px 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .04);
  transition: border-color .2s, box-shadow .2s;
}

.typing-input-wrapper:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(23, 59, 87, .12);
}

.typing-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 18px;
  font-family: inherit;
  color: var(--ink);
  padding: 8px 6px;
  outline: none;
}

.typing-submit-btn {
  border: none;
  background: var(--navy);
  color: white;
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
}

.typing-submit-btn:hover {
  opacity: .9;
}

.typing-result {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  display: none;
  animation: fadeIn .2s ease-in;
}

.typing-result.show {
  display: block;
}

.typing-result.correct {
  background: #e8f8f2;
  color: #1b6849;
  border: 1px solid #b7ebd5;
}

.typing-result.wrong {
  background: #fdf2f2;
  color: #a32727;
  border: 1px solid #f8c9c9;
}

.typing-result.info {
  background: #eaf3fd;
  color: #174b88;
  border: 1px solid #bfdcfb;
}

/* 知识清单表格与列表视图 */
.zs-list-view {
  margin: 0 clamp(16px, 3vw, 48px) 48px;
}

.zs-table-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.zs-unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #edf3f3;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.zs-unit-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.zs-unit-header span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.zs-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.zs-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #fafcfb;
  border: 1px solid #e7eeec;
  border-radius: 14px;
  padding: 12px 14px;
  transition: all .18s ease;
}

.zs-item-row:hover {
  background: #f2f8f6;
  border-color: #cedcd7;
  transform: translateY(-1px);
}

.zs-item-content {
  flex: 1;
}

.zs-item-en {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 4px;
}

.zs-item-zh {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.zs-item-actions {
  display: flex;
  gap: 6px;
}

.zs-btn-mini {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  transition: background .15s;
}

.zs-btn-mini:hover {
  background: #f0f4f5;
  color: var(--navy);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media(max-width: 620px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .type-filter-group {
    width: 100%;
    justify-content: center;
  }
  .scope-stats {
    text-align: center;
  }
  .zs-items-grid {
    grid-template-columns: 1fr;
  }
}
