:root{
  --red:#F05454;
  --bg:#ffffff;
  --text:#222;
  --muted:#6a6a6a;
  --border:rgba(0,0,0,.08);
  --shadow:0 10px 28px rgba(0,0,0,.06);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:"Poppins", sans-serif;
  color:var(--text);
  background:var(--bg);
}

.wb-main{
  padding:28px 0 60px;
}

.wb-wrap{
  width:min(1240px, 94vw);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.wb-topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}

.wb-title{
  margin:0;
  font-size:28px;
  font-weight:700;
}

.wb-subtitle{
  margin:6px 0 0;
  color:var(--muted);
  font-size:14px;
}

.wb-top-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.wb-layout{
  display:grid;
  grid-template-columns:340px 1fr;
  gap:18px;
  align-items:start;
}

.wb-sidebar,
.wb-editor-card{
  background:#fff;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  border-radius:12px;
}

.wb-sidebar{
  padding:16px;
}

.wb-sidebar-head{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-bottom:14px;
}

.wb-sidebar-title{
  margin:0;
  font-size:18px;
  font-weight:700;
}

.wb-sidebar-subtitle{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

.wb-chapter-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.wb-chapter-card{
  width:100%;
  text-align:left;
  border:1px solid rgba(0,0,0,.08);
  border-radius:10px;
  background:#fff;
  padding:12px;
  cursor:pointer;
  transition:border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.wb-chapter-card:hover{
  transform:translateY(-1px);
  border-color:rgba(240,84,84,.35);
}

.wb-chapter-card.is-selected{
  border-color:var(--red);
  box-shadow:0 0 0 2px rgba(240,84,84,.08);
}

.wb-chapter-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.wb-chapter-title{
  margin:0;
  font-size:14px;
  font-weight:700;
  color:#222;
  line-height:1.35;
}

.wb-chapter-number{
  margin:0 0 6px;
  font-size:12px;
  color:#555;
  font-weight:600;
}

.wb-chapter-meta{
  margin-top:8px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.wb-chip{
  display:inline-flex;
  align-items:center;
  padding:6px 9px;
  border-radius:999px;
  background:#f6f0ee;
  border:1px solid rgba(0,0,0,.06);
  font-size:11px;
  font-weight:700;
  color:#444;
}

.wb-empty-side{
  padding:14px 4px 4px;
}

.wb-empty-side-title{
  margin:0;
  font-size:15px;
  font-weight:700;
}

.wb-empty-side-text{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
}

.wb-editor-card{
  padding:18px;
}

.wb-editor-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}

.wb-editor-title{
  margin:0;
  font-size:20px;
  font-weight:700;
}

.wb-editor-subtitle{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
}

.wb-divider{
  height:1px;
  background:rgba(0,0,0,.08);
  margin:16px 0;
}

.wb-form{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.wb-row{
  display:grid;
  grid-template-columns:180px minmax(0,1fr) 180px;
  gap:12px;
}

.wb-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.wb-label{
  font-size:13px;
  font-weight:600;
  color:#222;
}

.wb-input,
.wb-select,
.wb-textarea{
  width:100%;
  border:1px solid rgba(0,0,0,.10);
  border-radius:8px;
  padding:11px 12px;
  font-family:"Poppins", sans-serif;
  font-size:13px;
  background:#fff;
  outline:none;
}

.wb-textarea{
  min-height:520px;
  resize:vertical;
  line-height:1.6;
}

.wb-note{
  margin:0;
  color:var(--muted);
  font-size:12px;
}

.wb-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.wb-btn{
  border:none;
  cursor:pointer;
  font-family:"Poppins", sans-serif;
  font-size:13px;
  font-weight:700;
  border-radius:8px;
  padding:10px 14px;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.wb-btn-primary{
  background:var(--red);
  color:#fff;
}

.wb-btn-secondary{
  background:#f5f5f5;
  color:#333;
  border:1px solid rgba(0,0,0,.08);
}

.wb-btn-danger{
  background:#fff1f1;
  color:#b42318;
  border:1px solid #f3b3b3;
}

.wb-import-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#f5f5f5;
  color:#333;
  border:1px solid rgba(0,0,0,.08);
  border-radius:8px;
  padding:10px 14px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}

@media (max-width: 1100px){
  .wb-layout{
    grid-template-columns:1fr;
  }
}

@media (max-width: 760px){
  .wb-topbar,
  .wb-editor-head{
    flex-direction:column;
    align-items:stretch;
  }

  .wb-row{
    grid-template-columns:1fr;
  }

  .wb-textarea{
    min-height:420px;
  }
}