:root{
  --xls-blue:#2563eb;
  --xls-blue2:#38bdf8;
  --xls-deep:#0f172a;
  --xls-muted:#64748b;
  --xls-border:rgba(148,163,184,.28);
  --xls-card:rgba(255,255,255,.92);
  --xls-shadow:0 18px 50px rgba(15,23,42,.10);
}
body.zsb-grammar-page,
body.zsb-grammar-live-page,
body.zsb-grammar-practice-page{
  margin:0;
  color:var(--xls-deep);
  background:
    radial-gradient(circle at 12% 6%, rgba(59,130,246,.14), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(56,189,248,.14), transparent 28%),
    linear-gradient(180deg,#f8fbff 0%,#eef6ff 42%,#f8fafc 100%);
  min-height:100vh;
}
.grammar-app{width:min(1160px,calc(100% - 36px));margin:0 auto;padding:28px 0 42px;}
.grammar-app .topbar{margin-bottom:22px;}
.grammar-hero{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(260px,.55fr);gap:18px;align-items:stretch;margin-bottom:18px;}
.grammar-hero-main,.grammar-hero-side,.grammar-card,.chapter-card,.practice-card,.grammar-result-card{
  background:var(--xls-card);border:1px solid var(--xls-border);border-radius:26px;box-shadow:var(--xls-shadow);backdrop-filter:blur(14px);
}
.grammar-hero-main{padding:28px;position:relative;overflow:hidden;}
.grammar-hero-main:after{content:"";position:absolute;right:-70px;top:-70px;width:190px;height:190px;border-radius:999px;background:linear-gradient(135deg,rgba(37,99,235,.16),rgba(56,189,248,.10));}
.grammar-eyebrow{display:inline-flex;align-items:center;gap:8px;padding:7px 11px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-size:13px;font-weight:800;}
.grammar-hero-main h1{margin:18px 0 12px;font-size:38px;line-height:1.14;letter-spacing:-.04em;}
.grammar-hero-main p{margin:0;color:var(--xls-muted);font-size:16px;line-height:1.85;max-width:720px;}
.grammar-hero-side{padding:22px;display:flex;flex-direction:column;justify-content:center;gap:12px;}
.grammar-hero-side strong{font-size:20px;}
.grammar-hero-side span{color:var(--xls-muted);line-height:1.7;font-size:14px;}
.grammar-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px;}
.grammar-card{padding:20px;display:flex;flex-direction:column;min-height:188px;text-decoration:none;color:inherit;transition:.18s ease;position:relative;overflow:hidden;}
.grammar-card:hover{transform:translateY(-3px);box-shadow:0 24px 60px rgba(37,99,235,.16);}
.grammar-card.featured{border-color:rgba(37,99,235,.34);background:linear-gradient(180deg,#ffffff,#eff6ff);}
.grammar-card-icon{width:46px;height:46px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb,#38bdf8);color:#fff;font-size:22px;box-shadow:0 12px 24px rgba(37,99,235,.20);}
.grammar-card h2{margin:16px 0 8px;font-size:20px;}
.grammar-card p{margin:0;color:var(--xls-muted);line-height:1.65;font-size:14px;flex:1;}
.grammar-status-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:16px;}
.grammar-status{display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;font-size:12px;font-weight:900;background:#e0f2fe;color:#0369a1;}
.grammar-status.pending{background:#f1f5f9;color:#64748b;}
.grammar-action{color:#2563eb;font-weight:900;font-size:13px;}
.grammar-live-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:18px;}
.grammar-live-head h1{margin:0 0 8px;font-size:34px;letter-spacing:-.035em;}
.grammar-live-head p{margin:0;color:var(--xls-muted);line-height:1.7;}
.chapter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.chapter-card{padding:18px;text-decoration:none;color:inherit;display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;transition:.18s ease;}
.chapter-card:hover{transform:translateY(-2px);border-color:rgba(37,99,235,.35);}
.chapter-no{min-width:72px;width:auto;height:46px;padding:0 12px;box-sizing:border-box;border-radius:16px;background:#eff6ff;color:#1d4ed8;display:inline-flex;align-items:center;justify-content:center;font-weight:900;white-space:nowrap;line-height:1;}
.chapter-title{font-size:17px;font-weight:900;margin-bottom:6px;}
.chapter-meta{display:flex;flex-wrap:wrap;gap:8px;color:var(--xls-muted);font-size:13px;}
.chapter-arrow{font-size:24px;color:#2563eb;font-weight:900;}
.practice-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px;align-items:start;}
.practice-card{padding:24px;}
.practice-top{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px;}
.practice-title h1{font-size:28px;margin:0 0 6px;}
.practice-title p{margin:0;color:var(--xls-muted);}
.progress-pill{padding:8px 12px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-weight:900;white-space:nowrap;}
.question-box{font-size:20px;line-height:1.72;font-weight:850;margin:16px 0 18px;}
.option-list{display:grid;gap:10px;margin:0 0 18px;}
.option-item{display:flex;align-items:center;gap:10px;padding:13px 14px;border:1px solid var(--xls-border);border-radius:16px;background:#fff;cursor:pointer;transition:.15s ease;}
.option-item:hover{border-color:#60a5fa;background:#f8fbff;}
.option-item input{width:18px;height:18px;accent-color:#2563eb;}
.fill-answer{width:100%;box-sizing:border-box;height:50px;border:1px solid var(--xls-border);border-radius:16px;padding:0 14px;font-size:16px;outline:none;}
.fill-answer:focus{border-color:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.10);}
.practice-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;}
.grammar-btn{border:0;border-radius:16px;height:48px;padding:0 18px;font-weight:900;cursor:pointer;transition:.15s ease;}
.grammar-btn.primary{background:linear-gradient(135deg,#2563eb,#38bdf8);color:#fff;box-shadow:0 12px 24px rgba(37,99,235,.22);}
.grammar-btn.secondary{background:#fff;color:#2563eb;border:1px solid rgba(37,99,235,.22);}
.grammar-btn:disabled{opacity:.55;cursor:not-allowed;}
.analysis-box{margin-top:16px;padding:14px;border-radius:18px;background:#f8fafc;border:1px solid var(--xls-border);display:none;}
.analysis-box.show{display:block;}
.analysis-box.correct{background:#ecfdf5;border-color:#86efac;}
.analysis-box.wrong{background:#fff7ed;border-color:#fdba74;}
.analysis-box strong{display:block;margin-bottom:8px;}
.practice-side{display:grid;gap:12px;}
.side-card{background:#fff;border:1px solid var(--xls-border);border-radius:22px;padding:18px;box-shadow:0 12px 30px rgba(15,23,42,.08);}
.side-card h3{margin:0 0 10px;font-size:16px;}
.side-card p{margin:0;color:var(--xls-muted);line-height:1.65;font-size:14px;}
.grammar-result-card{padding:22px;margin-top:18px;}
.result-score{font-size:42px;font-weight:950;color:#2563eb;margin:6px 0;}
.wrong-list{display:grid;gap:10px;margin-top:14px;}
.wrong-item{padding:12px;border-radius:16px;background:#fff7ed;border:1px solid #fed7aa;}
.loading-card{padding:24px;border-radius:24px;background:#fff;border:1px solid var(--xls-border);color:var(--xls-muted);}
@media (max-width: 820px){
  .grammar-app{width:min(100% - 24px,720px);padding:10px 0 96px;}
  .grammar-hero{grid-template-columns:1fr;}
  .grammar-hero-main{padding:22px;border-radius:24px;}
  .grammar-hero-main h1{font-size:28px;}
  .grammar-grid{grid-template-columns:1fr;gap:12px;}
  .grammar-card{min-height:auto;border-radius:22px;padding:16px;display:grid;grid-template-columns:auto 1fr;column-gap:14px;align-items:start;}
  .grammar-card-icon{grid-row:1 / span 3;width:42px;height:42px;border-radius:14px;}
  .grammar-card h2{margin:0 0 6px;font-size:17px;}
  .grammar-status-row{grid-column:2;margin-top:10px;}
  .grammar-live-head{display:block;}
  .grammar-live-head h1{font-size:26px;}
  .chapter-grid{grid-template-columns:1fr;gap:10px;}
  .chapter-card{border-radius:18px;padding:14px;}
  .chapter-no{min-width:66px;width:auto;height:42px;padding:0 10px;border-radius:14px;white-space:nowrap;}
  .practice-layout{grid-template-columns:1fr;}
  .practice-side{order:-1;}
  .practice-card{padding:18px;border-radius:22px;}
  .practice-top{align-items:flex-start;}
  .practice-title h1{font-size:23px;}
  .question-box{font-size:18px;}
  .grammar-btn{width:100%;}
  .practice-actions{display:grid;grid-template-columns:1fr;}
}


/* V4.56 grammar layout compact + empty chapter state */
@media (min-width: 821px){
  body.zsb-grammar-page .grammar-app,
  body.zsb-grammar-live-page .grammar-app,
  body.zsb-grammar-practice-page .grammar-app{
    padding-top:24px !important;
  }
  body.pc-layout-ready.zsb-grammar-page .grammar-app,
  body.pc-layout-ready.zsb-grammar-live-page .grammar-app,
  body.pc-layout-ready.zsb-grammar-practice-page .grammar-app{
    padding-top:24px !important;
  }
}
.chapter-card.is-empty{
  cursor:not-allowed;
  opacity:.82;
}
.chapter-card.is-empty .chapter-arrow{
  color:#94a3b8;
}
.chapter-card.is-empty:hover{
  transform:none;
  border-color:var(--xls-border);
}
.chapter-meta .empty-tip{
  color:#b45309;
  background:#fff7ed;
  border:1px solid #fed7aa;
  border-radius:999px;
  padding:3px 8px;
  font-weight:900;
}
.empty-practice-card{
  padding:24px;
  border-radius:24px;
  background:#fff;
  border:1px solid var(--xls-border);
  box-shadow:var(--xls-shadow);
}
.empty-practice-card h1{
  margin:0 0 10px;
  font-size:26px;
}
.empty-practice-card p{
  margin:0 0 16px;
  color:var(--xls-muted);
  line-height:1.7;
}
@media (max-width: 820px){
  body.zsb-grammar-page .grammar-app,
  body.zsb-grammar-live-page .grammar-app,
  body.zsb-grammar-practice-page .grammar-app{
    padding-top:8px !important;
  }
  .chapter-card{grid-template-columns:auto 1fr auto !important;}
}

/* V4.57 sentence component / word-class analysis question layout */
.segment-question-card{
  margin:12px 0 18px;
  padding:6px 0 2px;
}
.segment-sentence{
  font-size:28px;
  line-height:1.62;
  font-weight:850;
  color:#020617;
  letter-spacing:.01em;
  margin:0 0 24px;
}
.segment-no{
  margin-right:4px;
}
.segment-prompt{
  display:inline-block;
  margin-left:14px;
  font-size:24px;
  font-weight:700;
  color:#0f172a;
}
.segment-input-list{
  display:grid;
  gap:18px;
  max-width:760px;
}
.segment-row{
  display:grid;
  grid-template-columns:minmax(120px, auto) minmax(0,1fr);
  align-items:center;
  gap:10px;
  font-size:26px;
  color:#020617;
}
.segment-word{
  white-space:nowrap;
  font-weight:750;
}
.segment-row input{
  width:100%;
  min-height:52px;
  border:0;
  border-bottom:2px solid rgba(15,23,42,.28);
  background:transparent;
  outline:none;
  font-size:24px;
  padding:4px 0;
  color:#0f172a;
}
.segment-row input:focus{
  border-bottom-color:#2563eb;
}
.segment-answer-row{
  margin:10px 0;
  padding:12px 14px;
  border-radius:16px;
  background:#fff;
  border:1px solid var(--xls-border);
}
.segment-answer-row.ok{
  border-color:#86efac;
  background:#ecfdf5;
}
.segment-answer-row.bad{
  border-color:#fdba74;
  background:#fff7ed;
}
.segment-answer-row b{
  color:#0f172a;
}
.segment-answer-row p{
  margin:6px 0 0;
  color:#475569;
  line-height:1.65;
}
.ai-feedback-card{
  margin-top:14px;
  padding:14px 16px;
  border-radius:18px;
  background:#eff6ff;
  border:1px solid rgba(37,99,235,.18);
}
.ai-feedback-card b{
  display:block;
  margin-bottom:8px;
  color:#1d4ed8;
}
.ai-feedback-card p{
  margin:6px 0;
  color:#334155;
  line-height:1.7;
}
.ai-feedback-card ul{
  margin:8px 0 0 20px;
  padding:0;
  color:#1e3a8a;
  line-height:1.75;
}
.ai-warning{
  color:#b45309 !important;
}
@media (max-width: 820px){
  .segment-sentence{
    font-size:22px;
    line-height:1.62;
    margin-bottom:20px;
  }
  .segment-prompt{
    font-size:18px;
    margin-left:6px;
  }
  .segment-input-list{
    gap:14px;
  }
  .segment-row{
    grid-template-columns:1fr;
    gap:5px;
    font-size:20px;
  }
  .segment-row input{
    font-size:20px;
    min-height:44px;
  }
}

/* V4.59 grammar UI polish: keep grammar pages visually consistent with Xiaolanshu blue-white card system */
body.zsb-grammar-live-page .grammar-app,
body.zsb-grammar-practice-page .grammar-app,
body.zsb-grammar-page .grammar-app{
  width:min(1160px, calc(100% - 44px));
  padding-top:24px !important;
}
body.zsb-grammar-live-page .grammar-live-head{
  margin:0 0 18px;
  padding:24px 26px;
  border:1px solid rgba(148,163,184,.24);
  border-radius:28px;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(239,246,255,.86));
  box-shadow:0 18px 45px rgba(15,23,42,.08);
}
body.zsb-grammar-live-page .grammar-live-head h1{
  font-size:32px;
  line-height:1.2;
}
body.zsb-grammar-live-page .grammar-live-head p{
  max-width:760px;
}
body.zsb-grammar-live-page .chapter-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
body.zsb-grammar-live-page .chapter-card{
  min-height:116px;
  padding:18px 20px;
  border-radius:24px;
  box-shadow:0 16px 38px rgba(15,23,42,.075);
  grid-template-columns:auto minmax(0,1fr) 30px;
  gap:14px;
}
body.zsb-grammar-live-page .chapter-no{
  white-space:nowrap !important;
  min-width:76px !important;
  width:auto !important;
  padding:0 12px !important;
  height:44px;
  line-height:1;
  flex-shrink:0;
  background:linear-gradient(135deg,#eff6ff,#dbeafe);
  border:1px solid rgba(37,99,235,.12);
}
body.zsb-grammar-live-page .chapter-title{
  font-size:18px;
  line-height:1.35;
  margin-bottom:8px;
  white-space:normal;
}
body.zsb-grammar-live-page .chapter-meta{
  align-items:center;
  gap:6px;
  line-height:1.5;
}
body.zsb-grammar-live-page .chapter-arrow{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#eff6ff;
  font-size:22px;
}
body.zsb-grammar-practice-page .practice-layout{
  width:min(1100px,100%);
  margin:0 auto;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:18px;
}
body.zsb-grammar-practice-page .practice-card,
body.zsb-grammar-practice-page .side-card{
  border-radius:26px;
  box-shadow:0 18px 45px rgba(15,23,42,.08);
}
body.zsb-grammar-practice-page .practice-card{
  padding:26px;
}
body.zsb-grammar-practice-page .practice-top{
  padding-bottom:14px;
  border-bottom:1px solid rgba(148,163,184,.18);
}
body.zsb-grammar-practice-page .segment-sentence{
  font-size:27px;
  line-height:1.64;
}
body.zsb-grammar-practice-page .grammar-btn,
body.zsb-grammar-live-page .grammar-btn,
body.zsb-grammar-page .grammar-btn{
  appearance:none;
  -webkit-appearance:none;
  display:inline-grid;
  place-items:center;
  min-width:118px;
  height:48px;
  border-radius:16px;
  text-decoration:none !important;
  line-height:1;
}
body.zsb-grammar-practice-page .analysis-box{
  border-radius:22px;
  padding:18px;
  background:#f8fbff;
  border-color:#bfdbfe;
  box-shadow:0 12px 30px rgba(37,99,235,.06);
}
body.zsb-grammar-practice-page .analysis-box.correct,
body.zsb-grammar-practice-page .analysis-box.wrong{
  background:#f8fbff;
  border-color:#bfdbfe;
}
body.zsb-grammar-practice-page .analysis-box strong{
  color:#1d4ed8;
  font-size:18px;
}
body.zsb-grammar-practice-page .segment-answer-row{
  background:#fff;
  border-color:rgba(148,163,184,.30);
  box-shadow:0 8px 20px rgba(15,23,42,.04);
}
body.zsb-grammar-practice-page .segment-answer-row.ok{
  background:#f0fdf4;
  border-color:#bbf7d0;
}
body.zsb-grammar-practice-page .segment-answer-row.bad{
  background:#fffdf7;
  border-color:#fde68a;
}
body.zsb-grammar-practice-page .ai-feedback-card{
  background:linear-gradient(180deg,#eff6ff,#f8fbff);
  border-color:#bfdbfe;
  color:#1e3a8a;
}
body.zsb-grammar-practice-page .ai-feedback-card b{
  font-size:17px;
}
body.zsb-grammar-practice-page .ai-feedback-card ul{
  margin-left:18px;
}
@media (max-width: 820px){
  body.zsb-grammar-live-page .grammar-app,
  body.zsb-grammar-practice-page .grammar-app,
  body.zsb-grammar-page .grammar-app{
    width:min(100% - 24px, 720px);
    padding-top:12px !important;
  }
  body.zsb-grammar-live-page .grammar-live-head{
    padding:18px;
    border-radius:22px;
    margin-bottom:12px;
  }
  body.zsb-grammar-live-page .grammar-live-head h1{
    font-size:24px;
  }
  body.zsb-grammar-live-page .chapter-grid{
    grid-template-columns:1fr;
    gap:10px;
  }
  body.zsb-grammar-live-page .chapter-card{
    min-height:86px;
    padding:14px;
    border-radius:20px;
    grid-template-columns:auto minmax(0,1fr) 24px !important;
  }
  body.zsb-grammar-live-page .chapter-no{
    min-width:68px !important;
    height:40px;
    padding:0 10px !important;
  }
  body.zsb-grammar-live-page .chapter-title{
    font-size:16px;
    margin-bottom:4px;
  }
  body.zsb-grammar-practice-page .practice-layout{
    grid-template-columns:1fr;
    gap:12px;
  }
  body.zsb-grammar-practice-page .practice-card{
    padding:16px;
    border-radius:22px;
  }
  body.zsb-grammar-practice-page .practice-side{
    order:initial;
  }
  body.zsb-grammar-practice-page .segment-sentence{
    font-size:21px;
  }
  body.zsb-grammar-practice-page .practice-actions{
    gap:9px;
  }
  body.zsb-grammar-practice-page .grammar-btn{
    min-width:0;
    width:100%;
  }
}


/* V4.60 grammar practice: unify mobile buttons, fix next-question gating, and reduce PC text size */
body.zsb-grammar-practice-page .practice-card{
  max-width:980px;
  margin:0 auto;
}
body.zsb-grammar-practice-page .practice-layout{
  width:min(1040px,100%);
  grid-template-columns:minmax(0,1fr) 260px;
}
body.zsb-grammar-practice-page .practice-top{
  margin-bottom:14px;
}
body.zsb-grammar-practice-page .question-box{
  font-size:24px;
  line-height:1.6;
}
body.zsb-grammar-practice-page .segment-sentence{
  font-size:24px !important;
  line-height:1.6;
  margin-bottom:18px;
}
body.zsb-grammar-practice-page .segment-prompt{
  font-size:18px !important;
  font-weight:800;
}
body.zsb-grammar-practice-page .segment-input-list{
  gap:12px;
  max-width:720px;
}
body.zsb-grammar-practice-page .segment-row{
  font-size:20px !important;
  grid-template-columns:minmax(110px, auto) minmax(0,1fr);
  gap:10px;
}
body.zsb-grammar-practice-page .segment-row input,
body.zsb-grammar-practice-page .fill-answer{
  font-size:18px !important;
  min-height:42px;
  height:42px;
}
body.zsb-grammar-practice-page .segment-row input::placeholder,
body.zsb-grammar-practice-page .fill-answer::placeholder{
  font-size:16px;
}
body.zsb-grammar-practice-page .practice-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}
body.zsb-grammar-practice-page .practice-actions .grammar-btn{
  height:46px !important;
  min-width:122px;
  padding:0 16px;
  border-radius:16px !important;
  font-size:15px;
  font-weight:800;
  line-height:46px;
  box-sizing:border-box;
  display:inline-grid !important;
  place-items:center;
  text-align:center;
}
body.zsb-grammar-practice-page .practice-actions .grammar-btn.primary{
  background:linear-gradient(135deg,#2563eb,#38bdf8);
  color:#fff;
  border:1px solid transparent;
}
body.zsb-grammar-practice-page .practice-actions .grammar-btn.secondary{
  background:#fff;
  color:#2563eb;
  border:1px solid rgba(37,99,235,.24);
}
body.zsb-grammar-practice-page .practice-actions .grammar-btn:disabled{
  opacity:.45;
  filter:saturate(.8);
}
@media (max-width: 820px){
  body.zsb-grammar-practice-page .practice-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }
  body.zsb-grammar-practice-page .practice-actions .grammar-btn{
    width:100%;
    height:46px !important;
    min-width:0;
    padding:0 16px;
    border-radius:16px !important;
    font-size:15px;
    font-weight:800;
    line-height:46px;
  }
  body.zsb-grammar-practice-page .practice-actions .grammar-btn.secondary{
    background:#fff;
    color:#2563eb;
    border:1px solid rgba(37,99,235,.24);
  }
  body.zsb-grammar-practice-page .practice-actions .grammar-btn:disabled{
    opacity:.45;
  }
  body.zsb-grammar-practice-page .question-box{
    font-size:20px;
  }
  body.zsb-grammar-practice-page .segment-sentence{
    font-size:20px !important;
  }
  body.zsb-grammar-practice-page .segment-prompt{
    font-size:16px !important;
    margin-left:4px;
  }
  body.zsb-grammar-practice-page .segment-row{
    font-size:18px !important;
  }
  body.zsb-grammar-practice-page .segment-row input,
  body.zsb-grammar-practice-page .fill-answer{
    font-size:17px !important;
    min-height:42px;
    height:42px;
  }
}

/* V4.74：语法专项按空给分结果展示 */
.segment-summary-card{
  margin:10px 0 12px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(37,99,235,.08);
  color:#1d4ed8;
  font-weight:800;
}
.wrong-sub-list{display:grid;gap:10px;margin-top:10px;}
.wrong-sub-item{
  padding:10px 12px;
  border-radius:14px;
  background:rgba(239,68,68,.06);
  border:1px solid rgba(239,68,68,.14);
}
.wrong-sub-item b{display:block;margin-bottom:5px;color:#991b1b;}
