/* ============================================================
   英语模块 · 首页改版 / 薄弱语法 / 单词卡片 / AI 组卷
   ============================================================ */

/* ---------------- 首页：学习档案 ---------------- */
.eh-card{
  background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:20px 22px;margin-bottom:20px;
}
.eh-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.eh-row label{font-size:13px;color:var(--muted);font-weight:600;}
.eh-row select{
  appearance:none;-webkit-appearance:none;
  padding:10px 34px 10px 14px;border:1.5px solid #d7def5;border-radius:10px;
  font-size:15px;font-family:inherit;color:var(--text);background:#fff;cursor:pointer;
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%237a83a0' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;
}
.eh-row select:focus{outline:none;border-color:var(--primary);}
.eh-go{
  margin-left:auto;border:none;border-radius:10px;padding:10px 18px;cursor:pointer;
  background:linear-gradient(135deg,#4f6ef7,#6d8bff);color:#fff;font-size:14px;font-weight:700;
  font-family:inherit;box-shadow:0 6px 16px rgba(79,110,247,.28);
}
.eh-go:hover{filter:brightness(1.05);}
.eh-meta{font-size:12.5px;color:var(--muted);margin-top:12px;line-height:1.8;}
.eh-meta b{color:var(--primary);}

/* 数字概览 */
.eh-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:20px;}
.eh-stat{background:var(--card);border-radius:14px;padding:14px 8px;text-align:center;box-shadow:0 6px 18px rgba(79,110,247,.08);}
.eh-stat b{display:block;font-size:22px;color:var(--primary);line-height:1.2;}
.eh-stat span{font-size:11.5px;color:var(--muted);}
.eh-stat.warn b{color:var(--orange);}
.eh-stat.bad b{color:var(--red);}

/* 薄弱语法 */
.eh-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px;}
.eh-head h2{font-size:17px;letter-spacing:.3px;}
.eh-head span{font-size:12px;color:var(--muted);margin-left:auto;}
.eh-sub{font-size:12.5px;color:var(--muted);line-height:1.75;margin:6px 0 10px;}
.eh-label{font-size:13px;font-weight:800;color:#3c4560;margin:16px 0 9px;}
.eh-label .eh-lm{font-weight:400;color:var(--muted);font-size:12px;}

.eh-weak{display:flex;flex-direction:column;gap:10px;margin-top:12px;}
.eh-wrow{display:flex;align-items:center;gap:10px;}
.eh-rank{
  width:20px;height:20px;border-radius:6px;background:#eef1f8;color:#7a8399;
  font-size:11.5px;font-weight:800;display:flex;align-items:center;justify-content:center;flex:0 0 auto;
}
.eh-wrow:nth-child(1) .eh-rank{background:#ffe6e6;color:#d03838;}
.eh-wrow:nth-child(2) .eh-rank{background:#fff1dd;color:#c07a00;}
.eh-wrow:nth-child(3) .eh-rank{background:#fff8d9;color:#a88a00;}
.eh-wname{flex:1;font-size:13.5px;font-weight:700;min-width:0;}
.eh-wname small{display:block;font-weight:400;color:var(--muted);font-size:11.5px;margin-top:2px;}
.eh-track{display:block;height:6px;border-radius:999px;background:#eef1f8;margin-top:6px;overflow:hidden;}
.eh-bar{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#ff9090,#e35d5d);}
.eh-bar.mid{background:linear-gradient(90deg,#ffcb78,#f0a028);}
.eh-bar.low{background:linear-gradient(90deg,#8fd9b0,#2fb673);}
.eh-lv{font-size:11px;font-weight:700;padding:3px 8px;border-radius:999px;white-space:nowrap;}
.eh-lv.high{background:#fdeeee;color:#c93b3b;}
.eh-lv.mid{background:#fff4e2;color:#b97600;}
.eh-lv.low{background:#e9f9f1;color:#158a52;}
.eh-mini{
  border:1.5px solid #d7def5;background:#fff;border-radius:999px;padding:4px 12px;
  font-size:12px;font-family:inherit;color:var(--primary);cursor:pointer;white-space:nowrap;
}
.eh-mini:hover{background:var(--primary);border-color:var(--primary);color:#fff;}
.eh-tip{font-size:13px;color:var(--muted);line-height:1.8;padding:6px 0;}
.eh-chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px;}
.eh-chip{
  border:1.5px solid #d7def5;background:#fff;border-radius:999px;padding:8px 14px;
  font-size:13px;font-family:inherit;color:#4a5570;cursor:pointer;transition:.15s;
}
.eh-chip:hover{border-color:var(--green);color:var(--green);}

/* 状态 / 忙碌 */
.eh-status{
  display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:700;
  padding:4px 11px;border-radius:999px;white-space:nowrap;
}
.eh-status::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;}
.eh-status.is-ok{background:#e9f9f1;color:#158a52;}
.eh-status.is-off{background:#fdeeee;color:#c93b3b;}
.eh-busy{
  position:fixed;left:50%;bottom:26px;transform:translateX(-50%) translateY(14px);
  display:flex;align-items:center;gap:10px;background:#2b3350;color:#fff;
  padding:11px 20px;border-radius:999px;font-size:13.5px;box-shadow:0 10px 30px rgba(0,0,0,.25);
  opacity:0;pointer-events:none;transition:.22s;z-index:200;max-width:92vw;
}
.eh-busy.show{opacity:1;transform:translateX(-50%) translateY(0);}
.eh-spin{width:13px;height:13px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;animation:ehSpin .8s linear infinite;flex:0 0 auto;}
@keyframes ehSpin{to{transform:rotate(360deg);}}

/* ---------------- 通用弹层 ---------------- */
.eh-mask{
  position:fixed;inset:0;background:rgba(30,36,66,.45);z-index:150;
  display:none;align-items:center;justify-content:center;padding:18px;
}
.eh-mask.show{display:flex;}
.eh-modal{
  background:#fff;border-radius:18px;padding:24px;max-width:560px;width:100%;
  max-height:88vh;overflow:auto;position:relative;animation:ehPop .22s ease;
}
@keyframes ehPop{from{transform:scale(.95);opacity:0}to{transform:none;opacity:1}}
.eh-close{
  position:absolute;top:14px;right:14px;border:none;background:#f0f2f8;width:28px;height:28px;
  border-radius:8px;cursor:pointer;font-size:14px;color:#666;
}
.eh-modal h3{font-size:18px;margin-bottom:4px;padding-right:34px;}
.eh-msub{font-size:12.5px;color:var(--muted);margin-bottom:14px;line-height:1.7;}
.eh-modal-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px;}
.eh-btn{
  flex:1;min-width:110px;padding:11px 16px;border-radius:10px;border:1.5px solid #d7def5;
  background:#fff;color:#4a5570;font-size:14px;font-family:inherit;cursor:pointer;transition:.15s;
}
.eh-btn:hover{border-color:var(--primary);color:var(--primary);}
.eh-btn.primary{background:var(--primary);border-color:var(--primary);color:#fff;font-weight:700;}
.eh-btn.primary:hover{background:var(--primary-dark);color:#fff;}
.eh-btn:disabled{opacity:.6;cursor:not-allowed;}

.eh-plan{display:flex;flex-direction:column;gap:12px;}
.eh-plan-item{background:#f7f9ff;border-radius:12px;padding:13px 15px;}
.eh-plan-item b{font-size:13.5px;color:var(--primary);}
.eh-plan-item p{font-size:13px;color:#4a5570;line-height:1.8;margin-top:4px;}
.eh-reason{color:var(--muted)!important;font-size:12.5px!important;}

/* ---------------- 单词卡片 ---------------- */
.ec-stage{perspective:1200px;cursor:pointer;margin-bottom:14px;}
.ec-inner{position:relative;width:100%;height:270px;transform-style:preserve-3d;transition:transform .55s;}
.ec-inner.flip{transform:rotateY(180deg);}
.ec-face{
  position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;
  border-radius:18px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:22px;text-align:center;
}
.ec-front{background:linear-gradient(150deg,#f2f6ff,#f8f1ff);border:1.5px solid #e2e9fb;}
.ec-back{background:linear-gradient(150deg,#eefaf3,#f2f7ff);border:1.5px solid #d9ecdf;transform:rotateY(180deg);}
.ec-emoji{font-size:56px;line-height:1;}
.ec-zh{font-size:24px;font-weight:800;margin-top:12px;letter-spacing:.5px;}
.ec-en{font-size:30px;font-weight:800;color:#2f68c8;letter-spacing:.5px;}
.ec-sent{font-size:14px;color:#3c4560;margin-top:12px;line-height:1.8;max-width:92%;}
.ec-sentzh{font-size:12.5px;color:var(--muted);margin-top:4px;}
.ec-tip{font-size:11.5px;color:#9aa4c4;margin-top:16px;}
.ec-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.ec-bar .eh-btn{flex:0 0 auto;min-width:96px;}
.ec-count{font-size:13px;color:var(--muted);font-weight:700;}

/* ---------------- AI 组卷页 ---------------- */
.ep-head{display:flex;align-items:center;gap:10px;}
.ep-head h2{font-size:18px;flex:1;}
.ep-cats{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:9px;}
.ep-cat{
  border:1.5px solid #e0e6f5;background:#fff;border-radius:12px;padding:11px 12px;
  font-size:13px;font-family:inherit;color:#4a5570;cursor:pointer;text-align:left;transition:.15s;
}
.ep-cat:hover{border-color:var(--primary);}
.ep-cat.on{background:#eef3ff;border-color:var(--primary);color:var(--primary);font-weight:700;}
.ep-cat small{display:block;font-weight:400;font-size:11px;color:var(--muted);margin-top:4px;}
.ep-cat small.bad{color:var(--red);}
.ep-nums{display:flex;gap:8px;flex-wrap:wrap;}
.ep-num{
  border:1.5px solid #e0e6f5;background:#fff;border-radius:10px;padding:8px 16px;
  font-size:13px;font-family:inherit;color:#4a5570;cursor:pointer;
}
.ep-num.on{background:#eef3ff;border-color:var(--primary);color:var(--primary);font-weight:700;}
.ep-err{margin-top:12px;background:#fdeeee;border:1.5px solid #f5c9c9;border-radius:10px;padding:10px 14px;font-size:13px;color:#b53434;line-height:1.8;}
.ep-title{font-size:17px;font-weight:800;}
.ep-item{border:1.5px solid #e8ecf6;border-radius:13px;padding:15px 16px;margin-bottom:11px;}
.ep-q{font-size:14.5px;line-height:1.85;font-weight:600;}
.ep-cat-tag{
  display:inline-block;margin-left:8px;font-size:11px;font-weight:700;color:#7a4ad6;
  background:#f3ecff;border-radius:999px;padding:1px 9px;vertical-align:middle;
}
.ep-opts{margin-top:9px;font-size:13.5px;line-height:1.95;color:#4a5570;}
.ep-opt{padding-left:6px;}
.ep-opt.right{color:#158a52;font-weight:700;}
.ep-e{margin-top:9px;font-size:12.5px;color:#7a5a10;background:#fff8e8;border-radius:9px;padding:8px 12px;line-height:1.8;}

@media (max-width:560px){
  .eh-stats{grid-template-columns:repeat(2,1fr);}
  .eh-go{margin-left:0;width:100%;}
  .ec-inner{height:240px;}
  .ec-en{font-size:26px;}
}
