/* 日常用语专题：句式/话题双视图 + 「看中文选英文」练习。 */

/* ── hero：蓝系渐变卡（紧凑：统计数据与侧栏重复，不再展示） ──────────── */
.phrase-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  padding: 14px 24px;
  margin: 14px 0 16px;
  background:
    radial-gradient(ellipse at 92% 8%, #ffe9c2, transparent 60%),
    linear-gradient(120deg, #edf4fc, #e6f0fa);
  border: 1px solid #d2e3f2;
  border-radius: 20px;
}
.phrase-hero-copy { flex: 1 1 320px; min-width: 0; }
.phrase-hero h1 { margin: 2px 0 0; font-size: clamp(26px, 2.6vw, 36px); }
.phrase-hero .eyebrow { margin-bottom: 2px; }
.phrase-hero-demo { display: grid; gap: 6px; justify-items: end; }
.phrase-demo-line { padding: 5px 14px; border-radius: 14px 14px 14px 4px; background: #fff; border: 1px solid #dce6f5; color: #234b38; font-size: 17px; font-weight: 750; box-shadow: 0 3px 0 #cddff0; }
.phrase-demo-line.small { border-radius: 14px 14px 4px 14px; background: var(--soft); border-color: #c9ddc5; color: var(--green); font-size: 14px; transform: translateX(-26px) rotate(-2deg); box-shadow: 0 3px 0 #c9ddc5; }
.phrase-demo-line:nth-child(3) { background: var(--card-tint); border-color: #ecd9c5; color: var(--card-accent); transform: rotate(2deg); box-shadow: 0 3px 0 #ecd9c5; }

/* 朗读按钮：本页样式自足（浅紫药丸，同其他专题页）。 */
.say-chip { padding: 4px 13px; border: 1.5px solid #ddd3ef; border-radius: 999px; background: #f4edfd; color: #5d5484; font-size: 15px; font-weight: 700; cursor: pointer; transition: border-color .14s ease; }
.say-chip:hover { border-color: #b9a8e2; }

/* ── 左右工作区：左 sticky（练习 + 全部控制），右纯词卡流 ─────────────── */
.phrase-workspace { display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 22px; align-items: start; margin: 6px 0 30px; }
.phrase-side { position: sticky; top: 16px; display: grid; gap: 14px; }
.phrase-main { min-width: 0; }

/* ── 练一练：可折叠（默认展开），蓝虚线卡；词卡分组区浅底分带 ──────────── */
.phrase-practice-details { border: 2px dashed #b9d3e8; border-radius: 22px; background: #f4f9fd; scroll-margin-top: 24px; margin: 0 0 24px; }
.phrase-practice-details summary { display: flex; align-items: center; gap: 12px; padding: 13px 20px; cursor: pointer; list-style: none; }
.phrase-practice-details summary::-webkit-details-marker { display: none; }
.phrase-practice-details summary::marker { content: ""; }
.phrase-practice-summary-title { flex: 1; color: var(--green); font-size: 17px; font-weight: 800; }
.phrase-practice-summary-meta { color: var(--muted); font-size: 14px; }
.phrase-practice-summary-meta b { color: var(--green); }
.phrase-practice-arrow { color: var(--muted); font-size: 13px; transition: transform .14s ease; }
.phrase-practice-details[open] .phrase-practice-arrow { transform: rotate(180deg); }
.phrase-practice-details[open] summary { border-bottom: 1px dashed #cddcee; }
.phrase-practice-details .phrase-practice { margin: 0; border: 0; background: none; padding: 14px 20px 18px; }
/* 词卡分组区：浅底分带，与蓝虚线练习卡形成功能色区分 */
#phrase-groups { padding: 20px 24px 24px; border: 1px solid var(--line); border-radius: 22px; background: #fbfdf9; }
#phrase-groups .phrase-group:last-child { margin-bottom: 0; }
.phrase-practice-title { margin: 0 0 10px; color: var(--muted); font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.phrase-prompt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 0; font-size: 26px; font-weight: 800; }
.phrase-prompt span { font-size: 18px; font-weight: 700; color: var(--muted); }
.phrase-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.phrase-option { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--white); font-size: 17px; font-weight: 700; text-align: left; cursor: pointer; transition: transform .14s ease, border-color .14s ease, background .14s ease; }
.phrase-option:hover:enabled { border-color: #4d96ff; background: #eef4fb; transform: translateY(-2px); }
.phrase-option:active:enabled { transform: translateY(0); }
.phrase-option:disabled { cursor: default; opacity: .68; }
.phrase-option-key { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--white); color: var(--muted); font-size: 13px; font-style: normal; font-weight: 750; transition: border-color .14s ease, color .14s ease; }
.phrase-option:hover:enabled .phrase-option-key { border-color: #9cc2ec; color: #31627e; }
.phrase-option.right { border-color: #2c7a4b; background: #e2f0dc; opacity: 1; }
.phrase-option.right .phrase-option-key { border-color: #2c7a4b; background: #2c7a4b; color: #fff; }
.phrase-option.right::after { content: "✓"; margin-left: auto; color: #2c7a4b; font-size: 19px; font-weight: 900; }
.phrase-option.wrong { border-color: #b4483a; background: #fde8e4; }
.phrase-option.wrong span { text-decoration: line-through; }
.phrase-option.wrong .phrase-option-key { border-color: #d9a49d; color: #8f3a2f; }
.phrase-feedback { margin: 14px 0 0; font-size: 16px; font-weight: 700; line-height: 1.7; }
.phrase-feedback:empty { display: none; }
.phrase-feedback.ok { color: #2c7a4b; }
.phrase-feedback.bad { color: #b4483a; }
.phrase-feedback .say-chip { margin-inline: 2px; }
.phrase-score-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #cddcee; flex-wrap: wrap; }
.phrase-score { margin: 0; color: var(--muted); font-size: 15px; }
.phrase-score b { color: var(--green); font-size: 20px; }
.phrase-actions { margin: 0; }
/* 答完一题，「换一题」升为主行动引导继续。 */
.phrase-practice.done .phrase-actions .button { border-color: #2c7a4b; background: #2c7a4b; color: #fff; }
.phrase-practice.done .phrase-actions .button:hover { background: #235f3b; border-color: #235f3b; color: #fff; }

/* ── 侧栏：全部筛选（视图 + 搜索 + 计数 + 分组 chips） ────────────────── */
.phrase-side-tools { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.phrase-side-tools .phrase-views { display: flex; }
.phrase-side-tools .phrase-view { flex: 1; padding: 9px 12px; }
.phrase-side-tools .phrase-search { width: 100%; }
.phrase-side-tools .phrase-count { text-align: center; }
/* 分组筛选收进侧栏：一行一个，名称左、数量右。 */
.phrase-side .phrase-chip-row { display: flex; flex-direction: column; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.phrase-side .phrase-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 12px; border: 1.5px solid transparent; border-radius: 10px; background: none; color: var(--ink); font-size: 14px; font-weight: 650; text-align: left; cursor: pointer; transition: background .14s ease, border-color .14s ease; }
.phrase-side .phrase-chip i { color: var(--muted); font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; }
.phrase-side .phrase-chip:hover { background: var(--soft); }
.phrase-side .phrase-chip.on { border-color: var(--green); background: var(--green); color: #fff; font-weight: 750; }
.phrase-side .phrase-chip.on i { color: #ffffffb0; }

/* ── 浏览：视图切换 + chips + 分组 ────────────────────────────────────── */
.phrase-shell { min-width: 0; }
.phrase-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.phrase-views { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--soft); }
.phrase-view { padding: 8px 20px; border: 0; border-radius: 999px; background: none; font-size: 16px; font-weight: 750; color: var(--muted); cursor: pointer; }
.phrase-view.on { background: var(--white); color: var(--green); box-shadow: 0 2px 6px #233e3712; }
.phrase-search { flex: 1 1 240px; max-width: 360px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.phrase-count { color: var(--muted); font-size: 15px; }
.phrase-count b { color: var(--green); font-size: 19px; }

.phrase-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.phrase-chip-row[hidden] { display: none; }
.phrase-chip { padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 15px; font-weight: 700; cursor: pointer; }
.phrase-chip i { margin-left: 6px; color: var(--muted); font-style: normal; font-variant-numeric: tabular-nums; }
.phrase-chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.phrase-chip.on i { color: #ffffffb0; }

.phrase-group { margin-bottom: 30px; }
.phrase-words-link { color: #2c7a4b; font-weight: 750; font-size: 16px; white-space: nowrap; }
.phrase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.phrase-card { position: relative; padding: 14px 18px; border: 1px solid var(--line); border-top: 4px solid #9b5de5; border-radius: 16px; background: var(--white); box-shadow: 0 3px 0 #233e3704; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.phrase-card:hover, .phrase-card:focus-within { transform: translateY(-3px); border-color: #e2d5f4; box-shadow: 0 6px 14px #233e3714; }
.phrase-card.collocation { border-top-color: #d9c89e; }
.phrase-card.collocation:hover, .phrase-card.collocation:focus-within { border-color: #e8dfc8; }
.phrase-tier { position: absolute; top: 10px; right: 12px; padding: 1px 10px; border-radius: 999px; background: #f0e4c3; color: #655638; font-size: 12px; font-weight: 800; }
.phrase-en { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 22px; font-weight: 750; line-height: 1.55; overflow-wrap: anywhere; }
.phrase-zh { margin: 5px 0 0; color: #465765; font-size: 18px; line-height: 1.7; }
.phrase-empty { padding: 26px; border-radius: 16px; background: var(--soft); color: var(--muted); }
.phrase-note-foot { margin-top: 12px; color: var(--muted); font-size: 15px; }

@media (max-width: 860px) {
  .phrase-workspace { grid-template-columns: minmax(0, 1fr); }
  .phrase-side { position: static; }
  .phrase-practice { max-width: 760px; }
  .phrase-options { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 720px) {
  .phrase-hero { flex-direction: column; align-items: flex-start; }
  .phrase-hero-demo { display: none; }
  .phrase-prompt { font-size: 24px; }
}
@media print {
  .phrase-practice, .phrase-toolbar, .phrase-chip-row, .say-chip, .phrase-actions { display: none !important; }
  .phrase-card { break-inside: avoid; box-shadow: none; }
}
