*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6fa;
  color: #222;
  min-height: 100vh;
}

a { color: #4f6ef7; text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.navbar .logo { font-size: 18px; font-weight: 700; color: #4f6ef7; flex: 1; }

.container { max-width: 960px; margin: 32px auto; padding: 0 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn-primary { background: #4f6ef7; color: #fff; }
.btn-danger  { background: #ff4d4f; color: #fff; }
.btn-ghost   { background: #fff; color: #555; border: 1px solid #ddd; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  padding: 24px;
  margin-bottom: 16px;
}

.tag-active   { display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; background:#e6f4ff; color:#1677ff; }
.tag-inactive { display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; background:#f5f5f5; color:#999; }

/* Edit page */
.editor-wrap { display:grid; grid-template-columns:1fr 360px; gap:24px; }
.question-list { display:flex; flex-direction:column; gap:12px; }
.q-card {
  background:#fff; border-radius:10px; border:2px solid transparent;
  box-shadow:0 1px 3px rgba(0,0,0,.08); padding:16px 20px; cursor:pointer;
  transition: border-color .15s;
}
.q-card:hover, .q-card.active { border-color:#4f6ef7; }
.q-card .q-header { display:flex; align-items:center; gap:8px; }
.q-card .q-num { width:24px; height:24px; border-radius:50%; background:#4f6ef7; color:#fff; font-size:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.q-card .q-label { flex:1; font-size:15px; font-weight:500; }
.q-card .q-type-tag { font-size:12px; color:#888; background:#f0f0f0; padding:2px 8px; border-radius:4px; }
.q-card .q-actions { display:flex; gap:6px; margin-top:8px; justify-content:flex-end; }

.panel {
  background:#fff; border-radius:12px;
  box-shadow:0 1px 4px rgba(0,0,0,.07);
  padding:24px; position:sticky; top:24px;
  max-height:calc(100vh - 80px); overflow-y:auto;
}
.panel h3 { font-size:15px; margin-bottom:16px; color:#444; }
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; color:#666; margin-bottom:6px; }
.form-group input, .form-group select, .form-group textarea {
  width:100%; padding:8px 10px; border:1px solid #ddd; border-radius:7px;
  font-size:14px; outline:none; transition:border .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color:#4f6ef7; }

.options-list { display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.option-row { display:flex; align-items:center; gap:6px; }
.option-row input { flex:1; }
.skip-row { display:flex; align-items:center; gap:6px; font-size:13px; margin-top:4px; }
.skip-row select { flex:1; padding:5px 8px; border:1px solid #ddd; border-radius:6px; font-size:13px; }

/* Fill page */
.survey-form { max-width:680px; margin:0 auto; }
.q-block {
  background:#fff; border-radius:10px; box-shadow:0 1px 3px rgba(0,0,0,.07);
  padding:24px; margin-bottom:16px;
}
.q-block .q-title { font-size:16px; font-weight:500; margin-bottom:6px; }
.q-block .q-required { color:#ff4d4f; }
.q-block .q-desc { font-size:13px; color:#888; margin-bottom:14px; }
.q-block label { display:flex; align-items:center; gap:10px; font-size:15px; padding:8px 10px; border-radius:7px; cursor:pointer; }
.q-block label:hover { background:#f5f6fa; }
.q-block input[type=text], .q-block textarea { width:100%; padding:10px 12px; border:1px solid #ddd; border-radius:7px; font-size:14px; outline:none; }
.q-block input[type=text]:focus, .q-block textarea:focus { border-color:#4f6ef7; }

/* Result page */
.stat-card { background:#fff; border-radius:10px; box-shadow:0 1px 3px rgba(0,0,0,.07); padding:20px; margin-bottom:16px; }
.stat-card h4 { font-size:15px; font-weight:500; margin-bottom:12px; }
.bar-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; font-size:14px; }
.bar-label { width:120px; flex-shrink:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#555; }
.bar-track { flex:1; background:#f0f0f0; border-radius:4px; height:18px; overflow:hidden; }
.bar-fill  { height:100%; background:#4f6ef7; border-radius:4px; transition:width .4s; }
.bar-count { width:40px; text-align:right; color:#888; font-size:13px; }

.summary-strip {
  display:flex; gap:24px; margin-bottom:24px; flex-wrap:wrap;
}
.kpi { background:#fff; border-radius:10px; box-shadow:0 1px 3px rgba(0,0,0,.07); padding:16px 24px; flex:1; min-width:140px; }
.kpi .num { font-size:28px; font-weight:700; color:#4f6ef7; }
.kpi .lbl { font-size:13px; color:#888; margin-top:2px; }

.empty { text-align:center; padding:60px 0; color:#aaa; font-size:15px; }
