/* ============================================================
   问卷系统 · 全局样式（浅色主题 · 精致化）
   ============================================================ */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --border: #e7ebf2;
  --border-strong: #d7dde8;
  --text: #17202f;
  --text-2: #3b495e;
  --muted: #6b7787;
  --primary: #3b6ef6;
  --primary-dark: #2f57cc;
  --primary-soft: #eaf0ff;
  --up: #e5484d;      /* 涨 = 红（中文习惯） */
  --down: #17a34a;    /* 跌 = 绿 */
  --warn: #f59e0b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 32, 64, 0.04), 0 4px 16px rgba(16, 32, 64, 0.05);
  --shadow-lg: 0 6px 16px rgba(16, 32, 64, 0.08), 0 16px 40px rgba(16, 32, 64, 0.09);
  --ring: 0 0 0 3px rgba(59, 110, 246, 0.12);
  --grad-primary: linear-gradient(135deg, #4d7cff 0%, #3b6ef6 52%, #2f57cc 100%);
  --grad-brand: linear-gradient(135deg, #3b6ef6 0%, #8b5cf6 100%);
  --grad-soft: linear-gradient(180deg, #fcfdff 0%, #f6f8fd 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ 布局 */
.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar .brand-logo {
  width: 22px;
  height: 22px;
  flex: none;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(59, 110, 246, 0.35));
}
.topbar .spacer { flex: 1; }
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 顶栏图标按钮（与文本按钮同高，无边框） */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: inherit;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn.btn-primary { background: var(--grad-primary); border-color: transparent; color: #fff; }
.icon-btn.btn-primary:hover { color: #fff; box-shadow: 0 4px 14px rgba(59, 110, 246, 0.35); transform: translateY(-1px); }
.icon-btn.btn-sm { height: 29px; padding: 0 11px; font-size: 12px; }

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}
.container.narrow { max-width: 880px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.card:hover { border-color: #dbe4fb; }
.card + .card { margin-top: 16px; }
.card-title {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 4px;
}
.card-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.card-title-row .card-sub { margin-bottom: 0; }

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 110, 246, 0.35);
  transform: translateY(-1px);
}
.btn-danger { color: var(--up); border-color: #f3c6c8; }
.btn-danger:hover { background: #fdf0f0; border-color: var(--up); color: var(--up); }
.btn-sm { height: 29px; padding: 0 11px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.btn-group .btn { border: none; border-radius: 0; border-right: 1px solid var(--border); }
.btn-group .btn:last-child { border-right: none; }
.btn-group .btn.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ------------------------------------------------------------ 表单 */
.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.select { cursor: pointer; }
label.field { display: block; margin-bottom: 16px; }
label.field > span {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-2);
  margin-bottom: 7px;
}
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------ 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th, table.data td {
  padding: 10px 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th {
  background: #f7f9fc;
  font-weight: 600;
  color: var(--text-2);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:nth-child(even) { background: #fafbfd; }
table.data tbody tr:hover { background: #f3f7ff; }
table.data td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }

/* ------------------------------------------------------------ 徽章 / 提示 */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 550;
  background: #eef1f6;
  color: var(--text-2);
}
.badge.published { background: #e6f7ee; color: #17803d; }
.badge.draft { background: #f2f4f7; color: #6b7785; }
.badge.closed { background: #fdf0f0; color: #c0392b; }

/* 顶栏当前登录用户 */
.auth-user { font-size: 13px; font-weight: 600; color: var(--text-2); }

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}
.empty h3 { margin: 0 0 8px; color: var(--text-2); font-size: 15px; }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  background: #fdf0f0;
  color: #a1272a;
  border: 1px solid #f5d4d5;
}
.alert.info { background: var(--primary-soft); color: var(--primary-dark); border-color: #c9d9ff; }

/* ------------------------------------------------------------ 概览卡 */
.stat {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-primary);
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #dbe4fb;
}
.stat .stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat .icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex: none;
}
.stat .icon .i { font-size: 16px; }
.stat .label {
  font-size: 12.5px;
  color: var(--muted);
}
.stat .value {
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -0.5px;
  margin-top: 8px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat .delta { font-size: 12px; margin-top: 4px; color: var(--muted); }
.stat .delta.up { color: var(--up); }
.stat .delta.down { color: var(--down); }

/* ------------------------------------------------------------ 筛选栏 */
.filterbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.filterbar .fitem { min-width: 140px; }
.filterbar .fitem > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.filterbar .factions { margin-left: auto; display: flex; gap: 8px; }

/* ------------------------------------------------------------ 题目卡 */
.qcard { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.qcard-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.qcard-head .idx {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  flex: none;
}
.qcard-head .t { font-weight: 600; font-size: 14px; }
.qcard-head .type { font-size: 12px; color: var(--muted); background: #f2f4f7; padding: 1px 7px; border-radius: 5px; flex: none; }
.qcard-head .qcard-actions { margin-left: auto; flex: none; }
.qcard-body { padding: 16px 18px; }
.chart { width: 100%; height: 300px; }
.chart.tall { height: 360px; }

.kv { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 12px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }

.nps-gauge { display: flex; align-items: baseline; gap: 8px; }
.nps-gauge .num { font-size: 34px; font-weight: 700; }

/* 文本样例 */
.sample-list { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; max-height: 220px; overflow-y: auto; }
.sample-list .s {
  padding: 7px 10px;
  background: #fafbfd;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.sample-list .s::before { content: "“"; color: var(--muted); }
.sample-list .s::after { content: "”"; color: var(--muted); }

/* ------------------------------------------------------------ 交叉表 */
.cross-table td.cell { text-align: center; font-variant-numeric: tabular-nums; }
.cross-table th.rowh { position: sticky; left: 0; background: #f7f9fc; z-index: 2; }
.cell-bar {
  position: relative;
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--primary);
  margin-top: 2px;
  opacity: 0.75;
}

/* ------------------------------------------------------------ 分页 */
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; justify-content: flex-end; }
.pager .info { color: var(--muted); font-size: 13px; margin-right: auto; }

/* ------------------------------------------------------------ 问卷列表 */
.survey-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.survey-row:hover { border-color: #c9d9ff; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.survey-row .main { flex: 1; min-width: 0; }
.survey-row .title { font-size: 15px; font-weight: 620; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.survey-row .desc { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.survey-row .meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.survey-row .actions { display: flex; gap: 8px; flex: none; }
.mode-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #8b5cf6;
  background: #f3efff;
  border: 1px solid #e2d9ff;
  border-radius: 5px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: 2px;
}

/* ------------------------------------------------------------ 设计器 */
.qitem {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--grad-soft);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.qitem:hover { border-color: #dbe4fb; box-shadow: var(--shadow); }
.qitem .row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.qitem .row:last-child { margin-bottom: 0; }
.qitem .handle {
  color: var(--muted);
  cursor: grab;
  user-select: none;
  padding: 0 6px;
  letter-spacing: -2px;
}
.qitem .handle:active { cursor: grabbing; }

/* 拖拽排序 */
.qitem.dragging { opacity: 0.4; border-color: var(--primary); background: var(--primary-soft); }
.qitem.drag-over { border-top: 2px solid var(--primary); }
.qitem.drag-over-below { border-top: 1px solid var(--border); border-bottom: 2px solid var(--primary); }
.qitem .row .grow { flex: 1; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.opt-row .dot {
  width: 14px; height: 14px; flex: none;
  border: 1.5px solid var(--border-strong);
  background: var(--card);
  border-radius: 50%;
  display: inline-block;
}
.opt-row .dot.multi { border-radius: 3px; }

/* ------------------------------------------------------------ 问卷模式选择 */
.mode-select { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 540px) { .mode-select { grid-template-columns: 1fr; } }
.mode-option { position: relative; cursor: pointer; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-option-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: all 0.15s;
}
.mode-option-body b { font-size: 14px; color: var(--text-2); }
.mode-option-body small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.mode-option:hover .mode-option-body { border-color: #b9cdfb; }
.mode-option input:checked + .mode-option-body {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--ring);
}
.mode-option input:checked + .mode-option-body b { color: var(--primary); }

/* ------------------------------------------------------------ 名单列表 */
.roster-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 320px;
  overflow-y: auto;
  background: var(--card);
}
.roster-list-head, .roster-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
}
.roster-list-head {
  font-size: 12px;
  color: var(--muted);
  background: #f7f9fc;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.roster-row { border-bottom: 1px solid var(--border); font-size: 13px; }
.roster-row:last-child { border-bottom: none; }
.roster-row .name { color: var(--text-2); font-weight: 500; }

/* ------------------------------------------------------------ 填写页 */
.survey-cover {
  background: var(--grad-primary);
  border: none;
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: 0 10px 28px rgba(59, 110, 246, 0.28);
  margin-bottom: 16px;
}
.survey-cover h1 { margin: 0 0 8px; font-size: 22px; color: #fff; }
.survey-cover p { margin: 0; color: rgba(255, 255, 255, 0.92); }

.question-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.question-block .qt { font-weight: 600; margin-bottom: 12px; font-size: 14.5px; }
.question-block .req { color: var(--up); margin-left: 3px; }
.name-block { border-color: #c9d9ff; background: var(--grad-soft); }
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.opt:hover { border-color: #b9cdfb; background: #fbfcff; }
.opt.checked { border-color: var(--primary); background: var(--primary-soft); }
.opt input { accent-color: var(--primary); margin: 0; }
.opt .box {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); flex: none;
}
.opt.checked .box { border-color: var(--primary); border-width: 5px; }

.stars { display: flex; gap: 6px; }
.star {
  font-size: 30px;
  line-height: 1;
  color: #dfe3ea;
  cursor: pointer;
  transition: transform 0.12s, color 0.12s;
  user-select: none;
}
.star:hover { transform: scale(1.14); }
.star.on { color: #f5a623; }

.nps-scale { display: flex; gap: 5px; flex-wrap: wrap; }
.nps-btn {
  width: 42px; height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  color: var(--text-2);
  transition: all 0.12s;
  font-family: inherit;
}
.nps-btn:hover { border-color: var(--primary); color: var(--primary); }
.nps-btn.on { background: var(--grad-primary); border-color: transparent; color: #fff; }
.nps-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; max-width: 470px; }

/* ------------------------------------------------------------ 其他 */
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.switch input { accent-color: var(--primary); }
.loading { text-align: center; padding: 40px; color: var(--muted); }
.share-link {
  display: flex; gap: 8px; align-items: center;
  background: #fafbfd; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px;
}
.share-link code { flex: 1; word-break: break-all; color: var(--text-2); }

/* ------------------------------------------------------------ 弹窗 (modal) */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.modal-mask.show { opacity: 1; }
.modal {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(16, 32, 64, 0.30), 0 4px 16px rgba(16, 32, 64, 0.12);
  padding: 22px 22px 18px;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.18s ease;
}
.modal-mask.show .modal { transform: translateY(0) scale(1); }
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.modal-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  flex: none;
}
.modal-icon.info { background: var(--primary-soft); }
.modal-icon.warn { background: #fff3e0; }
.modal-title {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.4;
}
.modal-body {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.7;
  margin: 0 0 20px;
  word-break: break-word;
}
.modal-body .input { margin-top: 12px; }
.modal-body .input.modal-invalid {
  border-color: var(--up);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   首页 Hero / 数据概览 / 搜索筛选
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 28px 30px 26px;
  margin-bottom: 18px;
  background:
    radial-gradient(900px 360px at 110% -20%, rgba(139, 92, 246, 0.45), transparent 60%),
    radial-gradient(700px 320px at -10% 120%, rgba(59, 110, 246, 0.45), transparent 60%),
    linear-gradient(135deg, #4d7cff 0%, #3b6ef6 52%, #2f57cc 100%);
  color: #fff;
  box-shadow: 0 14px 36px rgba(59, 110, 246, 0.28);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}
.hero .hero-greet {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.92;
  position: relative;
}
.hero .hero-greet .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #6cf2b6;
  box-shadow: 0 0 0 4px rgba(108, 242, 182, 0.18);
}
.hero h1 {
  margin: 8px 0 4px;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.3px;
  position: relative;
}
.hero .hero-sub {
  font-size: 13.5px;
  opacity: 0.85;
  margin: 0 0 18px;
  position: relative;
}
.hero .hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
}
@media (max-width: 760px) {
  .hero .hero-stats { grid-template-columns: 1fr; }
}
.hero-stat {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
}
.hero-stat .icon-bubble {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  display: grid; place-items: center;
  font-size: 18px;
  color: #fff;
  flex: none;
}
.hero-stat .k { font-size: 12px; opacity: 0.85; margin-bottom: 2px; }
.hero-stat .v { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.hero-stat .v small { font-size: 12px; font-weight: 500; opacity: 0.7; margin-left: 2px; }

.hero .hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.hero-btn.primary {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.hero-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24); }
.hero-btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-btn.ghost:hover { background: rgba(255, 255, 255, 0.2); }
.hero-btn .i { font-size: 16px; }

/* 列表筛选条 */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.list-toolbar .search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}
.list-toolbar .search-wrap .i-search {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.list-toolbar .search-wrap .input { padding-left: 34px; height: 34px; }
.list-toolbar .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.list-toolbar .sort-wrap { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.list-toolbar .sort-wrap .sort-label { font-size: 12px; color: var(--muted); }
.list-toolbar .sort-wrap .select { width: auto; min-width: 130px; height: 34px; font-size: 13px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.chip .count {
  font-size: 11.5px;
  background: rgba(59, 110, 246, 0.12);
  color: var(--primary);
  padding: 0 6px;
  border-radius: 9px;
  font-weight: 600;
}
.chip.active .count { background: var(--primary); color: #fff; }

/* 空状态美化 */
.empty-ill {
  text-align: center;
  padding: 64px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--grad-soft);
}
.empty-ill .empty-icon {
  width: 76px; height: 76px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: var(--primary-soft);
  display: grid; place-items: center;
  color: var(--primary);
  font-size: 32px;
  box-shadow: 0 4px 16px rgba(59, 110, 246, 0.18);
}
.empty-ill h3 { margin: 0 0 6px; color: var(--text-2); font-size: 16px; }
.empty-ill p  { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.empty-ill .empty-actions { display: inline-flex; gap: 8px; }

/* 仪表盘演示数据警告条（is_demo=1 时显示） */
.demo-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 12px 16px;
  background: linear-gradient(0deg, #fff7e6, #fff7e6);
  border: 1px solid #ffd591;
  border-left: 4px solid #fa8c16;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
  /* sticky 吸顶：dashboard 长页面滚动时 banner 一直跟随，
     避免 owner 看不到 region/device 等卡片时忘了"这是演示数据" */
  position: sticky;
  top: 12px;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.demo-banner .i {
  font-size: 20px;
  color: #fa8c16;
  flex: 0 0 auto;
  margin-top: 2px;
}
.demo-banner-title {
  font-weight: 600;
  color: #ad4e00;
  margin-bottom: 2px;
}
.demo-banner-text { color: var(--text-2); }
.demo-banner-text code {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  background: #fff;
  border: 1px solid #ffe7ba;
  padding: 0 5px;
  border-radius: 4px;
  color: #ad4e00;
}
.demo-banner-body { flex: 1; min-width: 0; }
.demo-banner .demo-toggle {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #ad4e00;
  background: #fff;
  border: 1px solid #fa8c16;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-start;
}
.demo-banner .demo-toggle:hover {
  background: #fa8c16;
  color: #fff;
}

/* ---------- 图表卡：全屏 + 嵌入链接 ---------- */
/* 这两个 icon-only 按钮由 dashboard.js 注入到 .card-head / .qcard-head */
.card-tools {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 4px;
}
.card-tools .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid #d5dbe5; border-radius: 6px;
  background: #fff; color: #6b7785;
  cursor: pointer; transition: all .12s;
  flex: none;
}
.card-tools .icon-btn:hover {
  border-color: #3b6ef6; color: #3b6ef6; background: #eef3ff;
}
.card-tools .icon-btn .i {
  display: inline-block; width: 14px; height: 14px; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
/* 全屏态：把整张卡片放大到全屏，chart 自适应 resize */
.card.is-fullscreen,
.qcard.is-fullscreen {
  background: #fff;
  border-radius: 0; box-shadow: none;
  position: fixed !important; inset: 0 !important;
  width: 100vw !important; height: 100vh !important;
  z-index: 9999; margin: 0 !important;
  display: flex; flex-direction: column;
  overflow: auto;
}
.card.is-fullscreen .card-head,
.qcard.is-fullscreen .qcard-head {
  position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid #eef1f6;
}
.card.is-fullscreen .chart,
.card.is-fullscreen [id$="Chart"],
.card.is-fullscreen [id^="ch"],
.card.is-fullscreen [id^="qc-"],
.qcard.is-fullscreen .qcard-body > [id^="qc-"] {
  flex: 1; min-height: 0;
  height: auto !important; min-height: 70vh;
}
.qcard.is-fullscreen .qcard-body { flex: 1; min-height: 0; padding: 18px; }
.qcard.is-fullscreen .qcard-body .sample-list { flex: 0 0 auto; max-height: 30vh; overflow: auto; }

/* 嵌入链接弹层：浮在卡片右上，复制按钮 + URL 输入框 */
.embed-popover {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  z-index: 50;
  background: #fff; border: 1px solid #e7ebf2; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
  padding: 12px; min-width: 340px; max-width: 92vw;
  font-size: 12px; color: #1f2a3a;
}
.embed-popover .embed-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.embed-popover .embed-row { display: flex; gap: 6px; align-items: center; }
.embed-popover input.embed-url {
  flex: 1; min-width: 0;
  font: 12px/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
  padding: 6px 8px; border: 1px solid #d5dbe5; border-radius: 6px;
  background: #f6f8fb; color: #1f2a3a;
}
.embed-popover .btn-copy {
  flex: none; padding: 6px 10px; border: 0; border-radius: 6px;
  background: #3b6ef6; color: #fff; cursor: pointer; font-size: 12px;
}
.embed-popover .btn-copy:hover { background: #2657d4; }
.embed-popover .embed-hint { margin-top: 6px; color: #6b7785; font-size: 11px; line-height: 1.5; }
.embed-popover code { background: #eef3ff; color: #3b6ef6; padding: 0 4px; border-radius: 3px; font-size: 11px; }

/* 嵌入链接弹层定位父容器：让 absolute 弹层有参照 */
.card-head, .qcard-head { position: relative; }
.qcard-head { position: relative; }

/* ============================================================
   响应式 / 移动端适配
   断点策略：1100 / 760 / 540
     - 1100px：网格从 3-4 列降为 2 列；大块按钮开始 wrap
     -  760px：顶栏折叠成汉堡；卡片、滤镜、模态全宽
     -  540px：padding 进一步压缩，触摸目标 ≥ 44px
   ============================================================ */

/* ---------- 顶栏 + 抽屉 ---------- */
/* 桌面端隐藏汉堡与抽屉 */
.topbar-hamburger, .topbar-drawer { display: none; }

/* 1100px：顶栏开始允许 wrap、按钮可换行，但仍保留全部按钮可见 */
@media (max-width: 1100px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar .btn { padding: 0 10px; }
  .topbar .switch { font-size: 12px; }
}

/* 760px：核心断点 — 顶栏折叠成汉堡 */
@media (max-width: 760px) {
  .topbar { height: 54px; padding: 0 10px; gap: 6px; }
  .topbar .brand span { font-size: 14px; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .brand-logo { width: 22px; height: 22px; }
  .topbar .badge { font-size: 10px; padding: 1px 6px; }
  .topbar .topbar-right { display: none !important; }
  .topbar .topbar-back { display: none; }
  .topbar-hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 0; background: transparent;
    color: var(--text-2); cursor: pointer; border-radius: 8px;
    margin-left: -4px;
  }
  .topbar-hamburger:hover { background: var(--surface-2, #f3f4f6); }
  .topbar-hamburger .i { width: 18px; height: 18px; display: inline-block; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
  .topbar-spacer { flex: 1; }
}

/* 抽屉：仅 < 760px 才显示（其它尺寸 display:none 已经搞定） */
@media (max-width: 760px) {
  .topbar-drawer {
    display: block;
    position: fixed; inset: 0; z-index: 100;
    pointer-events: none;
  }
  .topbar-drawer[hidden] { display: none; }
  .topbar-drawer-mask {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0; transition: opacity .2s;
    pointer-events: auto;
  }
  .topbar-drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(82vw, 340px);
    background: #fff;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    display: flex; flex-direction: column;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
  }
  .topbar-drawer.is-open { pointer-events: auto; }
  .topbar-drawer.is-open .topbar-drawer-mask { opacity: 1; }
  .topbar-drawer.is-open .topbar-drawer-panel { transform: translateX(0); }
  .topbar-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
  }
  .topbar-drawer-title { font-weight: 600; font-size: 14px; color: var(--text-1); }
  .topbar-drawer-close {
    width: 32px; height: 32px; border: 0; background: transparent;
    cursor: pointer; color: var(--text-2); border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .topbar-drawer-close:hover { background: #f3f4f6; }
  .topbar-drawer-close .i { width: 16px; height: 16px; display: inline-block; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
  .topbar-drawer-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow: auto; flex: 1; }
  .topbar-drawer-body .btn { width: 100%; justify-content: flex-start; height: 44px; }
  .topbar-drawer-body .btn .i { margin-right: 4px; }
  .topbar-drawer-body .switch { padding: 10px 4px; font-size: 14px; }
  .topbar-drawer-body .badge { align-self: flex-start; }
}

/* ---------- 容器 + 通用间距 ---------- */
@media (max-width: 760px) {
  .container { padding: 12px; }
  .container.narrow { max-width: 100%; }
  .card { border-radius: 10px; }
  .card + .card { margin-top: 12px; }
  .card-head { padding: 12px 14px; }
  .card-title { font-size: 14px; }
  .card-sub { font-size: 12px; }
  .qcard-head { padding: 12px 14px; }
  .qcard-head .t { font-size: 13px; }
  .qcard-body { padding: 12px 14px; }
  /* 图表高度收缩：heatmap / 题目卡 / 趋势 */
  #heatChart, #trendChart, #crossChart { height: 220px !important; }
  [id^="chChannel"], [id^="chDevice"], [id^="chRegion"] { height: 200px !important; }
  [id^="qc-"] { height: 220px !important; }
}

@media (max-width: 540px) {
  .container { padding: 8px; }
  .topbar { height: 50px; }
  .card { border-radius: 8px; }
  .card-head { padding: 10px 12px; }
  .qcard-head { padding: 10px 12px; }
  .qcard-body { padding: 10px 12px; }
  #heatChart, #trendChart, #crossChart { height: 180px !important; }
  [id^="chChannel"], [id^="chDevice"], [id^="chRegion"] { height: 170px !important; }
  [id^="qc-"] { height: 200px !important; }
  /* 按钮文字更紧凑：iPad/iPhone 屏幕只够显示 icon+1 字 */
  .btn .label-hide-sm { display: none; }
}

/* ---------- 表格横滚 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.table-wrap > table { min-width: 100%; }
/* 小屏表格压缩 */
@media (max-width: 760px) {
  .table-wrap > table { font-size: 12.5px; }
  .table-wrap > table th, .table-wrap > table td { padding: 8px 6px; }
  /* 答卷明细里多个答案列会撑爆表格，强制最小宽度让父容器出现横滚 */
  .answers-table th, .answers-table td { min-width: 90px; }
}

/* ---------- 模态弹层：移动端全宽 ---------- */
.modal, .alert-popup, [role="dialog"] {
  max-width: min(92vw, 560px);
}
@media (max-width: 540px) {
  .modal, .alert-popup, [role="dialog"] {
    max-width: 100vw; max-height: 100vh; height: 100%;
    border-radius: 0 !important;
  }
}

/* ---------- 触摸目标 ≥ 44px（iOS HIG） ---------- */
@media (max-width: 760px) {
  .btn { min-height: 38px; }
  .btn-sm { min-height: 36px; padding: 0 10px; font-size: 12.5px; }
  .icon-btn, .card-tools .icon-btn { width: 36px; height: 36px; }
  .input, .select, textarea { min-height: 40px; font-size: 16px; /* 防 iOS 缩放 */ }
  /* 单选 / 多选题的 dot 更大更易点 */
  .opt-row .dot { width: 18px; height: 18px; }
  .opt-row { padding: 10px 12px; }
}

/* ---------- 模态遮罩 / Toast 在小屏位置 ---------- */
@media (max-width: 540px) {
  .toast, #__toast { left: 12px !important; right: 12px; transform: none; top: 60px !important; text-align: center; }
  .embed-popover { left: 6px; right: 6px; min-width: 0; max-width: calc(100vw - 12px); }
}

/* ---------- Builder 移动端"请用电脑"提示条 ---------- */
.builder-mobile-notice {
  display: none; /* 默认桌面端隐藏 */
  position: sticky; top: 54px; z-index: 40;
  background: #fff7e6; color: #ad4e00;
  border-bottom: 1px solid #ffd591;
  padding: 10px 14px; font-size: 13px;
  align-items: center; gap: 10px;
}
.builder-mobile-notice .i { width: 16px; height: 16px; display: inline-block; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; flex: none; }
.builder-mobile-notice .text { flex: 1; line-height: 1.4; }
.builder-mobile-notice .text b { font-weight: 600; }
.builder-mobile-notice a { color: #ad4e00; font-weight: 600; text-decoration: underline; }
@media (max-width: 760px) {
  .builder-mobile-notice { display: flex; }
  /* 提示条出现时，body 顶距补出来，避免遮挡 */
  .builder-with-notice { padding-top: 4px; }
}

/* ---------- Hero (index.html) 在手机端更紧凑 ---------- */
@media (max-width: 760px) {
  .hero { padding: 18px 14px; border-radius: 12px; }
  .hero .hero-greeting { font-size: 13px; }
  .hero h1 { font-size: 22px; line-height: 1.3; }
  .hero .hero-stat { padding: 10px 12px; }
  .hero .hero-stat .v { font-size: 19px; }
  .hero .hero-stat .icon-bubble { width: 32px; height: 32px; }
  .hero .hero-actions { flex-direction: column; }
  .hero .hero-btn { width: 100%; justify-content: center; }
}

/* ---------- 列表 toolbar (index.html) ---------- */
@media (max-width: 760px) {
  .list-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .list-toolbar .search-box { width: 100%; }
  .list-toolbar .chip-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .list-toolbar .chip-row .chip { flex: none; }
  .list-toolbar .sort-select { width: 100%; }
}
@media (max-width: 540px) {
  .survey-row { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .survey-row .badge { align-self: flex-start; }
  .survey-row .main .meta { font-size: 12px; }
  .survey-row .actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .survey-row .actions .btn { flex: 1; min-width: 0; }
}

/* ---------- 滤镜栏 (dashboard.html) ---------- */
@media (max-width: 760px) {
  .filterbar { padding: 10px 12px; gap: 8px; }
  .filterbar .fitem { min-width: 0; flex: 1 1 calc(50% - 8px); }
  .filterbar .fitem > span { font-size: 11px; }
  .filterbar .factions { width: 100%; }
  .filterbar .factions .btn { flex: 1; }
}
@media (max-width: 540px) {
  .filterbar .fitem { flex: 1 1 100%; }
}

/* ---------- 交叉分析 (dashboard) ---------- */
@media (max-width: 760px) {
  .cross-controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .cross-controls > div { min-width: 0; width: 100%; }
  .cross-controls .muted { display: none; }
}

/* ---------- 嵌入链接弹层 (dashboard) 已在上面移动端全宽 ---------- */

/* ---------- 模态内表单在手机端 ---------- */
@media (max-width: 760px) {
  .modal-body { padding: 14px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row .form-label { min-width: 0; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}

/* ---------- 答卷明细搜索 + 分页 ---------- */
@media (max-width: 540px) {
  .pager { flex-wrap: wrap; }
}

/* ---------- 答卷填写页 (survey.html) ---------- */
@media (max-width: 760px) {
  .survey-cover { padding: 18px 18px; border-radius: 12px; margin-bottom: 12px; }
  .survey-cover h1 { font-size: 18px; }
  .survey-cover p { font-size: 13px; }
  .question-block { padding: 14px 14px; margin-bottom: 10px; border-radius: 10px; }
  .question-block .qt { font-size: 14px; margin-bottom: 10px; }
  .opt { padding: 11px 12px; min-height: 42px; }   /* 触摸目标 */
  .opt .box { width: 18px; height: 18px; }
  .stars { gap: 4px; flex-wrap: wrap; }
  .star { font-size: 26px; }
  .nps-scale { gap: 4px; }
  .nps-btn { width: calc((100vw - 80px) / 11 - 4px); min-width: 28px; height: 38px; font-size: 13px; padding: 0; }
  .nps-legend { font-size: 11px; }
}
@media (max-width: 540px) {
  .survey-cover { padding: 16px; }
  .survey-cover h1 { font-size: 17px; }
  .opt { padding: 10px 11px; min-height: 40px; }
  .star { font-size: 22px; }
}

/* ---------- 防 body 在抽屉打开时滚动 ---------- */
body.drawer-open { overflow: hidden; }

/* ---------- 安全区 (iPhone 刘海 / Home Indicator) ---------- */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 760px) {
    .topbar { padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); }
    .topbar-drawer-panel { padding-top: env(safe-area-inset-top); }
    .container { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  }
}

